Wednesday, April 27, 2011

I tell ya, it's better this way


Testing from a good friend of mine with better equipment already showed that 1A was about the right level for these lasers. I was about to just build my own when I saw someone was already selling decent size current sources on the cheap. I only used 4 wires. I hook it up, I get 1A. Just that easy. Next I just plug it into the diodes and I should be up and running.

Soldering like a pro



It turns out I can't use the existing leads at all. I had to solder on my own. In this case, using high-heat-tolerance wire to make the soldering easier and to assure that it doesn't melt when the machine it running.

Also, you can see the step-mirror used to bring the laster beams closer together. Hopefully those lenses at the end will even re-column-ate the beam.

Next step is to try running with one of the power supplies.

Saturday, April 23, 2011

Parts and preperation

Next project on the docket: Building a laser gun

First things first: lasers are not particularly effective for destroying things. They deliver heat. A large burning and cutting laser with a price tag in the tens of thousands might be a 50W laser. That means it's delivering 50 J/s. So if you hold it on target for 1 second, that target will receive 50J of energy. By contrast, an AK-47 bullet will deliver about 2000J to the target. Those can be had for about $300, weigh a lot less and don't need to plug into the wall. Thats why we don't use lasers for war: They're overpriced, weak, hard to port about, and generally a waste of money that could be spent on real guns.

So why build one? For starters, they're bad ass. Also, they're quiet, more socially acceptable to carry, and actually useful at times. I probably wouldn't start a camp fire with an AK. I would with a laser pistol.

That begs the question, what about all those costs? Well, the internet has already solved that. The goal of a laser is just to have a single wavelength of light. With one wavelength, it's possible to control and direct the beam in a way that multi-spectrum light can't. Multi-spectrum lite through lenses will disperse and it becomes difficult to control (this is what prisms do, except on purpose). By contrast, if you can make light of all the same wavelength going in some well known and regular direction, you can focus it to go just exactly where you want. For instance in a single straight column.

I gather there are really two ways to handle this. One way is to have a separate lasing material which you shine initiating light into and then pump. This is the shitty, expensive way. But it get you to higher power. The other way is to have a laser diode produce that light. It is difficult to get such diodes to high power (probably due to heat, but I'll admit I don't know).


I do know that Casio, the electronics company, developed a way to get them up to about 1W. And then they put 24 of em in a projector (a rather nice project, actually). These are the lasers that the Wicked Lasers people are harvesting. Except that Wicked Lasers is charging $300 for a single laser while the projectors are only $800. So I bought a projector.

It turns out the projectors even comes with a bunch of really convenient columnizing optics (though I've yet to run it independently, that's what it appears to be).

I only started ripping it apart, however, when my laser protection arrived.



Let me tell you, Thor Labs is a funky company. You buy $150, fuckin class-a laser goggles... and they send you some complimentary snacks. I can only assume these are meant for the starving grad students spending university money and eating out of vending machines.

To Thor Lab's credit, the snacks were both tasty and healthy.

Sunday, April 17, 2011

Laser protection: Cheap is totally fine because if you needed the expensive ones you're screwed anyways.


Laser goggles are rated by optical density: http://en.wikipedia.org/wiki/Optical_density

Turns out this is a base-10 exponential rating. And when it comes to the goggles you do get what you pay for in terms of OD. The two pairs I've decided to try are the dragon-lasers UV to Green goggles and the Thor LG3 goggles.

The Thor goggles are OD 7+ (and $145) while the dragon-laser ones are 4+ (and $25). Of course, if we're dealing with 1W lasers, the cheaper goggles will cut it down to 0.1mW. If a normal laser pointer is 5mW then we've clearly implemented enough protection.

Now the question is, would you ever need such goggles?

If we assume that 5mW is about what the human eye can be expected to tolerate, for someone to need more than 4 OD of protection, the laser must be at least a 5mW * 10,000 = 50W laser. Of course, when the glasses are protecting you they must absorb the energy of the laser. And they're plastic. Which melts, burns, and vaporizes.

So if you take a shot of that 50W laser to the face, how long till it burns through the goggles?

If the laser has a 1mm diameter (pretty normal for a large laser), it's beam will have a surface area of 3.14E-6 m^2 on your glasses. If acrylic of the glasses are about 2mm thick we're illuminating 6.28E-9 m^3 worth of material. If that material has a density of acrylic (118kg/m^3) then we're talking about 7.414E-3 g worth of material. If that material has the specific heat of most plastics (~1.25 J/(g*degC)) then our material will warm at the rate of 9.27E-3 J/degC. Well our laser is 50W or 50 J/s. So our material will be heating at a rate of 5,395 degC per second. If the Acrylic melts at 150 degC or vaporizes at 200 degC...

We'll have about 30ms before such a laser melts right through your glasses and burns your eyes out anyways. So either you've got a laser exposure that's weak enough that the cheap classes can handle it or you've got a laser exposure so strong any of the glasses would just burn away almost instantly.

I guess I really shouldn't have paid for the nice ones before writing this post...

(Also, I have no education in this so I'm mostly piecing this together from internet research. If you're going to put your life or eyes on the line and/or like to sue people instead of thinking for yourself, don't trust anything I've said here.)

Saturday, April 16, 2011

How it's done volume 6: When and how to fire the coils


Earlier we talked about the need for SCRs. We also talked about having an infrared see-through barrel. Hopefully you did both. Because if you did, it's easy to pick up cut-beam sensors and big beefy SCRs from digikey. I'll assume that you've done so. I'll also assume that you're using shielded wire. That's critical to cut down on the EM noise made by the charger and the coils firing.

Some coil guns will place sensors right before every coil and fire that coil when the round is about to enter it. Other guns will simply use a series of pre-determined delays from when the round first fires. Those times are often determined experimentally.

Don't do either of these, do both. If you have the sensor right before every coil, when the coils are firing slow compared to the projectile velocity, you'll be firing those coils too late. If you're always getting stuck around 40 or 50m/s this is almost certainty your problem. If you take the other track and have timers from the beginning, you'll have issues with timer drift as you add more and more coils. For instance, if the second coil doesn't give as much power as expected, the round will be too late for the 3rd coil and then even later for the 4th coil and so on till you're essentially using the other coils only some of the times and become the victim of chaos.

The alternative is to have many sensors and fire coils in advance based on times. If you look at the code that I have, sometimes I'm waiting for a sensor to fire and firing one coil but then waiting and firing the next coil without waiting for a sensor. By the end, the computer is actually firing coils a few sensors in advance. So the projectile may hit sensor 5 and the computer will wait a small time then fire coil 8.

The values here must be determined experimentally. Far too much chaos to apply math to this one. That said, it's very reliable. Each round is within 5% of the previous round. I have some confidence that I could even use the same basic construction and not have to change these constants or at least not have to change them much.

A long as you're doing this experimentally, use a computer. Don't try building this into circuits. A cheap PIC chip will have enough power to handle it. And get a simple one. The Arduino is a nice piece of equipment, but if it's actually running Java that means you're got a garbage handler. It could kick in any time and mess up the timing. Get a simple computer with no operating system, write in C.

I use the almost-disposable DM164120-2 demo board which comes with a PIC16F887 MCU. It takes an hour or two to setup the environment for it. There are some IO pins that don't-work/I-can't-get-to-work. However, I've used even the more complex things like interrupts with no difficulty.

This board comes with a bunch of LEDs on PORTD so I made that the output port. I arbitrarily made port C the input port and took one of the pins from PORTB as the input for the charge signal. You'll notice some code to prevent the system from firing while charging. This happens when either there's a user error or more commonly the EM noise from the charger gives the computer bad readings about the sensors and it thinks the time has come to fire.

You'll also notice I don't use interrupts. Interrupts on this device are too slow from the work that we're doing. At 70m/s it takes just 1.4uS for our projectile to travel a millimeter and a couple of millimeters can make a difference as to how much power you get from a coil.


#include
__CONFIG(INTCLK & WDTDIS & PWRTDIS & MCLRDIS & UNPROTECT & DUNPROTECT & BORDIS & IESODIS & FCMDIS & LVPDIS);
__CONFIG(BORV40); // 2nd config word

#define FIRE_TIMEOUT 0xFF0


void wait(int a, int b)
{
int i,j;
for(i = 0; i < a; i++)
for(j = 0; j < b; j++);
}

void test_count()
{
int time;
time = 0;
TRISD = 0x00;
while(1==1)
{
time = time+1;
PORTD = time;
wait(0x01,0xFF);
}
}

void showC()
{
int tmrOff = 0b00110100;
T1CON = tmrOff;
ADCON0 = 0xFF;
ANSELH = 0; //Turn off PortB AtoD
TRISC = 0xFF;
TRISD = 0x00;
TRISB = 0xFF;
while(1==1)
{
PORTD = PORTC;
}

}

void delayFire()
{
int time;
int i;
int tmrOff = 0b00110100;
int holdFire;
T1CON = tmrOff;
ADCON0 = 0xFF;
ANSELH = 0; //Turn off PortB AtoD
TRISC = 0xFF;
TRISD = 0x00;
TRISB = 0xFF;
time = 0;
while( 1==1)
{
//If the 'charge signal' is on, it should not be easy to disable
if( (PORTB & 0x04) > 0x00)
{
PORTD = 0x00000000;//Don't fire
wait(0x01,0x0A);
i = 0;
if( (PORTB & 0x04) > 0x00)
{
//It better be cleared consistantly and for a long time before we'll consider firing
while(i<0x3F) { wait(0x01,0x2F); if((PORTB & 0x02) > 0x00)
i = 0;
else
i = i+1;
}
}
}
else //Consider firing
{
//Gate 1
if( (PORTC & 0x01) == 0x00)
{
//wait(0x01,0x01);
PORTD = 0b00000001;


//Gate 2
wait(0x01,0x60);
PORTD = 0b00000011;

//Gate 3
//I is the timeout. It's used only when not firing (not fast enough for firing)
//Only really used for clearing issues on startup or power cycle.
i = 0;
while( ((PORTC & 0x02) != 0x00) && i < FIRE_TIMEOUT)
i = i + 1;
if( i < FIRE_TIMEOUT )
{
wait(0x01,0x37);
PORTD = 0b00000110;
}

//Gate 4
i = 0;
while( ((PORTC & 0x04) != 0x00) && i < FIRE_TIMEOUT)
i = i + 1;
if( i < FIRE_TIMEOUT )
{
wait(0x01,0x2A); //tested 3/30
PORTD = 0b00001100;
}

//Gate 5
i = 0;
while( ((PORTC & 0x08) != 0x00) && i < FIRE_TIMEOUT)
i = i + 1;
if( i < FIRE_TIMEOUT )
{
wait(0x01,0x13);
PORTD = 0b00011000;
}

//Gate 6
wait(0x01,0x30);
PORTD = 0b00110000;

//Gate 7
i = 0;
while( ((PORTC & 0x10) != 0x00) && i < FIRE_TIMEOUT)
i = i + 1;
if( i < FIRE_TIMEOUT )
{
i = 0;
while(i < 0x20)
i++;
PORTD = 0b01100000;
}
wait(0x01,0xF0);
}
else
PORTD = 0b10000000;
}
}
}

void main()
{
//test_count();
//test_a();
//showC();
delayFire();
}

Overview of the MA11 - world's fastest DIY coil gun overview in HD

Wednesday, April 13, 2011

How it's done volume 5: Charging that cap


Of course, you'll have to charge those shiny bad-ass capacitors. This is pretty easy if you're going to be plugging it into the wall: Buy an old microwave and strip out the transformer. Those guys can give like a thousand volts last I checked.

But what if you're using a DC battery? I've personally found that all the DC-DC products out on the market are pretty much shit. So I chose to build my own. There are a lot of DC-DC transformer designs out there on the market. They also seemed pretty shitty. So I designed my own. It's a pump charger that runs at variable frequency. I've seen this kind of charger setup to run at constant frequency but I found that to be pretty inefficient.

Essentially this circuit pulls current through the inductor to ground till it senses that it's got a certain amount, then it kills the connection to ground and lets the inductor force the current through the capacitor. It makes a lot of EM noise but it can also get a 12V source up to 1000V without a lot of hassle. I did a test of pumping it out of one capacitor and into another maybe 2 years ago and remember getting a number like 80% efficient or so. If anyone can find a place to buy such equipment let me know. Otherwise, this is definitely an area that I feel the market is letting us down.

Of course, the schematic I have is a vague recollection. I'd have to go back and actually map it... or dig the exact design out of my file drawer. It also doesn't show a current limiting circuit which you'll also want. At this point, I leave both of those to the reader. If you can figure out how to finish the circuit, you're allowed to use it for your projects :) And if you find a way to sell it, I want a cut!

How it's done volume 4: Getting a decent cap


Any decent sized accelerator relies on it's capacitors. The most important part of a good cap is it's voltage. The because the coils are highly inductive. The change in current through an inductor rises linearly with the voltage across that inductor. So we need high voltage to raise the current going through them as quickly as possible. If it was cheap/easy to power those coils at 10,000V I absolutely would. It would save a lot of hassle of firing coils in advance and getting timing just right. Of course, 10kV is hard to manage from an arcing standpoint and generally capacitors rated to that voltage have terrible power density.

As it happens, the type of cap with the highest power density and lowest cost per Joule is the electrolytic. It is not the fastest firing capacitor, but we're using it on an inductive load anyways so there's not a lot of point in going for hyper-fast firing. If you do any research at all you'll find that electrolytics go up to about 400 or 500V. That's about where I draw the line at vaguely save voltages anyways! How convenient.

If you hit a place like digikey you'll be able to buy these things in bulk for a few hundred dollars per dozen. I got mine for 9.88 $/Joule brand new. You can also usually find them on ebay but they'll be of more questionable construction and history.

As long as we're here, let's get serious for a second. Here's something I did once: Take a couple hundred kJ cap with a few hundred volts on it. Get a wire, bend it into a U shape, and the jam it across the leads of that cap. I wasn't wearing a shirt at the time so I could feel the pressure wave across my chest as part of the wire vaporized. If you're a litigious person, don't do this because it really is dangerous and you'll find a way to hurt yourself. If you've got balls of steel, a serious expert understanding of how not to die doing it, and are willing to risk your life if you're wrong, do try it. It will give your animal instincts a better understanding of the risks: Take a misstep and it'll nerf your heart in a millisecond. That shit is lighting in a can. But you need it to run your machine.

Tuesday, April 12, 2011

Request: Things you'd like to see me shoot

I've been looking around the house for scrap metal and shooting that. People seem pretty unimpressed. So I'm looking for something more interesting. Give me suggestions. And be reasonable here, it's still got less power than a 22.

Sunday, April 10, 2011

How it's done volume 3: Physically constructing a coil


Making the coils is probably the most time consuming part of building an accelerator. It's also the most formulaic: follow the process and it'll turn out just fine.

Step one: Figure out what material to make the accelerator barrel out of. It should not be ferromagnetic, otherwise it'll direct the magnetic fields away from the projectile (ex: don't use steel). It should be non-conductive, otherwise there will be eddy currents from the coils firing and you'll waste energy (ex: don't use aluminum, brass, or carbon fiber). You'll need to put sensors on it. Reflective sensors are a pain, I recommend cut-beam sensors. If you don't want to drill a bunch of little holes and then spend a lot of time aligning them, try to find a material that's infrared see-through. I've found that semi-rigid nylon tube fits these bills. You can buy it from smallparts.com. If you do, I also recommend getting a steel rod to put through it and keep it straight till you mount it.

Step two: Setup a place to actually wind the coils. Get two blocks, drill two holes in them and use this to hold the coil up. If you mount the block of wire somehow, you can then just turn the barrel to make the windings.

Step three: Winding them. You'll probably have to make several levels of coils. If you do this all at once, they'll slide all over, look like shit, and generally not be of the right shape. Instead, do one level at at time and use gorilla-glue to hold each layer in place before putting on the next layer.

Step four: Adding the shielding around them. The best shielding possible is ferrite torroids used for transformers. In general, if you can design your coils to fit within such torrioids you'll get the best focusing. As for the sides, I just use iron filled epoxy (such as quick steel) but I'm not sure if that's the best material.

Girl totally breaks the turret coil gun

Shooting the coil gun at a 1mm steel plate

Girl shooting the coil gun

Saturday, April 9, 2011

How it's done volume 2: Using force calculations to design coils



Building accelerator coils is a pain. For starters, they take forever to build. Most importantly though if you build the firing tube and it's coils too small you won't get the power you need to accelerate but if you build them too large the coils won't fire quickly enough.

Why is that? Most serious coil guns use SCRs. You'll have a capacitor, you want to discharge it into the coil. If you just use a switch, the amperage involved is probably more than the 20A most switches are rated for so the switch will be destroyed (in many cases these machines work at thousands or tens of thousands of amps). In fact, this current is generally too strong to use even normal power mosfets. But never fear, there is a product called an SCR. It's essentially a diode that doesn't conduct in either direction till you turn it on. And it happens to be able to survive extremely amperages compared to other devices. The way it does this is that it only turns on.

The amperage limits of other electrical components often comes from heating. The wattage dissipated by a transistor is the voltage across it times the amperage through it. If either is small, there is no heat dissipation. If both are significant, that's when the heat is on. And predictably, if a transistor is partially conducting, it will be taking on a lot of heat. Now SCRs only turn on. Thus, they go very quickly from zero amperage and high voltage to high amperage and zero voltage. This keeps them from building up much heat and thus you can get megawatt switches for double digit prices.

So now you've got a coil that can fire. However, if it fires too long, the projectile will be leaving out the other side and get pulled back in. Thus, you'll have to design the coils to fire for just long enough to pull the projectile in but to have been expended after that. That is why the coils must be neither too large or too small.

How many times should I wind the wire around the firing tube to make the coils? 10? 10,000? How to know? Should I be using 10 gauge wire? 30 gauge wire? Here's where some seriously shoddy math comes in. Essentially, doing some calculations about the expected inductance, discharge time, etc. I don't want to go into the math because it's complex and most people don't give a damn. So I'll just link you to the spreadsheet that you can plug numbers in to calculate. That said, the spreadsheet won't save you. It's not ballistics where you'll find out within 1% where the projectile will land. This will get you within 2x or 4x in either direction. Plug in numbers and then look at the timings to make sure they're not telling you the rise and fall times are too far off. Then do the same thing with the next coil and so on for ever coil you'll be making. For me, that boiled down to about the settings in the spreadsheet.

When you decide on a set of parameters, build a coil or two and fire it. Get a triggering scope to check if the timing you had is what you expected.

Remember those other firing tubes at the top? Well they're not being used for a reason. Countless hours making parts that can't get up to and surpass the very difficult to beat 60m/s marker.

How it's done volume 1: Getting and optimizing for force



Check out wikipedia for the basics... You read it? Good. Now that you understand that, let's talk about engineering this gun. Our objective is to get it to fire a fast moving projectile. Chemical guns get a good velocity. It should work like that. But with magnetics. And not being so damn loud.

When considering a dynamic system (aka: shit moving), it's often helpful to consider the static case (nothing is moving). In our static case, we have a projectile near an electromagnet. During this moment, the electromagnet is exerting a force on the projectile. If the force is allowed to move the projectile some small distance, the projectile will pick up Energy = Force * Distance from it. (You may ask where the energy comes from in this case. If we observed the coil during this time, the current through it would have decreased. As the now magnetized projectile moves closer it causes current in the opposite direction of the existing current.)



So how do we build this machine to get the maximum force? After all, it looks like getting the most force is what we need to get the most energy in our projectile. If this where a chemical gun, that force could be computed as the pressure on the back of the bullet. The pressure * the area of the back of the bullet * the length of the barrel will give you the expected energy of the bullet. In that case, we could just have to add more powder to increase the pressure. We could also increase the area of the back of the bullet. This is common in many very high speed guns.

Shittily, knowing the force we're imparting is ridiculously complex with a magnetic weapon. For starters, the magnetic field strength is based on the current in the coils which is both dynamic and changes with the movement of the projectile. Secondly, the force is difficult (impossible?) to compute just from the construction of the coils and especially hard as the projectile is moving through them.

So if don't know how to find the force, we should at least be able to aim for getting more of it. I recommend downloading this Finite Element Method Magnetics (FEMM) magnetic simulator to get a sense of how the magnetic fields will work. once you get the hang of it, it'll also tell you what sort of magnetic field strength to expect given your setup. In particular, you should notice that it's hard to increase the magnetic field strength beyond 2T (or rather it doesn't increase as fast after that). This is called magnetic saturation. From what I understand, that's essentially when all the iron dipoles are already pointing in the same direction (and thus there are no more to give a boost to the field being applied to them).



If you don't download that and use it, I'll give you a hint: There's a stronger field when there's iron around the coil as well. So the first thing we now know is that to make the strongest accelerator, we need to have magnetic shielding around our coils.

And that is the point of what we've learned with this post: If you want to get more power, put magnetic shielding around your coils.

Thursday, April 7, 2011

Overview of the MA11 - General explanation of it's construction

Firing an electromagnetic rifle at a piece of plexiglas


Not as impressive as the plate firing but this was actually my first demo of the accelerator outside the basic test setup I had.

How that plate is doing




The plate is actually mostly bent. At the time of firing it was actually just taped on both sides to the target and then had a larger steel plate about 4" behind it. Based on the shape of the impact, I'd guess that it actually bent till the first place touched the back on and then the projectile pinched them. I wonder if we could have gotten penetration if it had been better mounted.

Firing an electromagnetic rifle at a random metal plate

Monday, April 4, 2011

It's done. Final speed is 70m/s




First off, you can see that the wave is showing 2.5ms. That's how long it took the projectile to pass 18cm. This puts the final speed at right around 70m/s. With a projectile weight of 9.5g that means we've got a destroy energy of 23.5J.

The machine is only running with 8 of it's total of 13 accelerator gates but frankly I'm just so done with it and all it's bullshit. I'll post a video to explain more, but just to give a few examples:

The lower digital display is supposed to measure the voltage on the capacitors. After several small explosions and major circuit shorts in the rest of the system, it flickers on and off. It can no longer take accurate readings near the machine's top voltage of 410V. Instead, I listen for the tone of the whine on the charger to change. If the voltage limit circuit in the charger ever goes out, the caps will over change, self-short and probably explode.

Every few weeks while working on it, the firing system will find a way to break. Maybe the EM noise will confuse the computer and it'll try firing while charging. The charger can handle extremely high amperage and it'll just overwhelm the firing circuit, heat fracturing the leads and blowing 4 of the gates all at the same time. Maybe the firing coil will find a way to short to the case, bringing the whole gun up to a deadly 400V with tens of thousands of amps behind it. It's always something. And not just some random thing. It's some dangerous shit.


I'll come back and narrate these pics more, post details, and make a video once I'm done with work (like for money work).