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!