the making of a coil gun - Page 1
Forum section: electronics / projects

author: tuvtuv
author_rank: Contributor
timestamp: March 09, 2016, 12:54:30 am
content: Im working for quite a while now on a coil gun that shoots neodymium magnets. The main idea is having a barrel, and wrap coils around it to create magnetic field that will push on the magnets outward of the barrel. the force that acts on the magnets is dependent on the gradients of the magnetic field, so if we put a magnet inside a solenoid and create magnetic field in the opposite to the magnetic field that is inside the magnets, then the magnets will be shot out.To maximize the speed i though of building several acceleration stages, where several solenoids are laid across the barrel, and each solenoid has two sensor coils that sense the magnet's position:one sensor coil for sensing when the magnet is in the solenoidsecond sensor coil to sense when its out of the solenoid.when the system senses that the magnet is in a specific solenoid, it turns the solenoid on.when the system senses that the magnet is just out of a specific solenoid, it turns the solenoid off.Sensors:the sensor is just a small coil, as thin as possible, and has 5-10 turns.on the electronics side i have a comparator that does zero crossing of the induced voltage on the coil, where the zero voltage is crossed when the magnet's center is in the coil. when zero crossing is detected, a pulse is created by the comparator.solenoid:3mm enamled copper wire, at length of about the magnets size (a bit less), with many turns.i am still not sure how to determine the right amount of turns, ive done a lot of calculations and found that its best to have as little winding as possible, though its impossible to create infinite current, so extra winding creates more resistivity (im talking about real impedance) while paying a small price on the winding getting higher radius and adding smaller magnetic field than the internal windings. so i can just determine the highest current i wish to operate, and then make enough wire length to shunt the current to the wanted level.its worth mentioning that if the medium inside the solenoid is non paramagnetic (ive checked, and neodymium magnet have permeabillity of close to 1, like air... so this assumption holds true), then the time constant of the coil is relativly unchanging even though the inductance is groing since t=L/R, and for a relativly small number of winding rows this ratio is constant for the wire.power supply:i use 'low voltage' of 50V (so i wont die) with a capacitor bank of 2mF(can easily be increased), it can push about 300A (maybe more) for a short period.Control:atmega328p-au controls the switching of IGBT gates (not directly, but through a mosfet gate driver) that discharges the capacitors through the solenoids.the uC also gets the pulses of the zero crossing of the comparators, this way it knows where the magnet is, and when to turn on and off the solenoids.Barrel:my current design is using stainless steel which is non-magnetic, or so i thought, seems it 'only' has 1000 permeability constant, which is 1/5 of pure iron... ive made a slit all along the barrel to prevent induced currents which will only weaken the magnetic fields on the magnets inside.now im thinking of using carbon fiber rods i bought on aliexpress, i think they will be just fine, creating zero inductance compared to the stainless design.here are some photos and the schematics:https://www.dropbox.com/sc/baukwm1lfb4fmc1/AADEtrllIBfaUcXLICoiFroPa

author: tuvtuv
author_rank: Contributor
timestamp: March 09, 2016, 01:36:18 am
content: so far i was able to shoot only with the first stage, and i get bullet speeds of 13 m/s for a 10g neodymium bullet.the main problems im having is with the zero crossing detector circuit... before the last design, i tried using some low power op-amp i had, which did the detection just right, but couldnt reach logic level fast enough since the bandwidth was as low as 1MHz. the new design is using MAX9144 comparator, which is much a faster responder, though now i get noisy outputs, probably because it has a much lower offset voltage of 0.5 mV, and each small change makes the output go wild.does anyone have an idea of how i can highten the threshold of the comparator?also i'd like comments on the overall design, i feel quite stupid and inexperienced with all this

author: joeqsmith
author_rank: Super Contributor
timestamp: March 09, 2016, 04:37:12 am
content: A firecracker is about 30 Joules and you are talking 2.5? Maybe ask for a Red Ryder BB gun instead. Wiki says 73 m/s!https://en.wikipedia.org/wiki/Daisy_Outdoor_Products#Red_Ryder_BB_GunOf course, you may shoot your eye out.

author: Fungus
author_rank: Super Contributor
timestamp: March 09, 2016, 09:53:23 am
content: Quote from: joeqsmith on March 09, 2016, 04:37:12 amHey, it's only his first one...

author: tuvtuv
author_rank: Contributor
timestamp: March 09, 2016, 10:24:27 am
content: thats harshim building for the fun of it, im not the military or somthing...

author: tuvtuv
author_rank: Contributor
timestamp: March 09, 2016, 11:08:01 am
content: everything is in the link, the forum system dont leave me much uploading space, so i made a dropbox album

author: daqq
author_rank: Super Contributor
timestamp: March 09, 2016, 11:25:51 am
content: You should use a non conductive barrel - the currents caused by the fast moving magnets will slow them down somewhat:Also, you are using a fairly low voltage - there are several reasons for going for high voltages, mostly that the energy inside of a cap is the power of the voltage. Also, you get faster magnetic field rise times.By the way, be careful.

author: tuvtuv
author_rank: Contributor
timestamp: March 09, 2016, 11:45:38 am
content: Quote from: MK14 on March 09, 2016, 11:24:20 ami have attached the signal's profile, and want to add that the signal from side to side is about 10ms or so, i dont remember exactly...about the voltage level, you are totally right... damn... i need to bias the signal in the future... as for now, the signal is 100-200mV, which is a bit of a stretch, but still should work (expecially around the zero crossing). maybe im wrong, id like to hear what you think.thank you very much

author: tuvtuv
author_rank: Contributor
timestamp: March 09, 2016, 11:50:49 am
content: Quote from: daqq on March 09, 2016, 11:25:51 amyea i know about the currents, thats why i went to the length of making that slit in the middle, so currents cant loop around the magnetic field... im thinking of going carbon fiber, which unforunately is also conducting, though much less...somehow all the materials i can think about that can make a barrel as thin as possible yet strong (and smooth) are conductive.im using low voltages since is more safe, and still i get to experiment with the whole concept of shooting projectiles

author: MK14
author_rank: Super Contributor
timestamp: March 09, 2016, 11:53:45 am
content: You can do it on a single rail, no problem.But as it was drawn, originally, it would have needed dual rails, to stand even a small chance of working.Take the following as a rough guide.You need to make the reference voltage (currently ground), 2.5V or about half the supply rail.E.g. a pair of 10K resistors, as a voltage divider + 0.1 uF cap to keep it stable.The other pin (currently the incoming signal), make something around a pair of signal diodes, tied to the mid rail (2.5V ?), supply on the other pin.So it will be limited to the half supply rail, + or -, about 0.7 V.Or alternatively use some low voltage zeners.There are many ways of designing the input conditioning circuit.Then (ideally) you need to put in hysteresis.If you show the new circuit with the above, I can tell you how to add hysterysis (or someone else).Or you may already know ?

author: tuvtuv
author_rank: Contributor
timestamp: March 09, 2016, 12:00:12 pm
content: thanks alot!!!i will do it in the evening (israeli time), probably be done with it in 8 hours from now

author: MK14
author_rank: Super Contributor
timestamp: March 09, 2016, 12:00:33 pm
content: Quote from: tuvtuv on March 09, 2016, 11:45:38 amAS regards your 100-200mV.The problem is, if it is TOO LOW (negative) a voltage, it could just be clamped by circuitry (e.g. protection diodes or something else, as 200mV sounds a bit low to be diode clamped) in the IC. So it could be misbehaving as a result. Also it can damage the chip (datasheet violation).It IS just possible, that the signal is JUST within the limits.But that would be a very bad way of designing things.It should have proper circuitry, to keep the voltage (well ideally), within the limits of the chip.Also stability improving techniques, such as hysteresis, would be difficult to do as it is at the moment (as far as I can tell). But there might be ways.

author: tuvtuv
author_rank: Contributor
timestamp: March 09, 2016, 12:13:20 pm
content: like i said, its a stretch, i will bias it in the next design. this evening i will update it

author: MK14
author_rank: Super Contributor
timestamp: March 09, 2016, 12:29:21 pm
content: Quote from: tuvtuv on March 09, 2016, 12:13:20 pmHere is a design guide (or reference example), on how to do the hysteresis.http://www.ti.com/lit/ug/tidu020a/tidu020a.pdfIf you don't need it, then please ignore this post.

author: daqq
author_rank: Super Contributor
timestamp: March 09, 2016, 02:33:05 pm
content: QuoteActually some amount of induced currents (and as a result slowed projectile) WILL be present even with the slit. While it will not affect the electromagnets, the moving magnet will carry its own field with it, moving it and inducing current in the sides regardless of the slit.I also built a coilgun, though much simpler... aaah... good times - I used normal turned nylon as the barrel - the bulk of the kinetic energy has to be in the forward momentum - if you are damaging your sides of the barrel you have a different problem. With the energies you are dealing with you would be better off with a plastic tube.

author: tuvtuv
author_rank: Contributor
timestamp: March 09, 2016, 03:23:43 pm
content: 1) do you have any suggestion for a nylon tube? i need something in the order of 8mm internal diameter, and as small as possible external diameter.2) did the nylon tube not warp from the heat of the coils?

author: woodchips
author_rank: Frequent Contributor
timestamp: March 09, 2016, 07:40:10 pm
content: Look at the books written by Eric Laithwaite, he worked on linear electric motors for years.

author: tuvtuv
author_rank: Contributor
timestamp: March 10, 2016, 02:04:12 am
content: so i tested with a scope the attached circuit:designed it so it would have 50 mV hysteresis.the coil is biased by a cap of 1u and two resistors, and filtered by a 330n cap (just tried some untill the signal was clean enough).the output signal is clean, though its a bit off phase from where i would like it to be... i think its something to do with both biases being a bit offset from each other...which bring me to the question: is it possible to bias the inverting input to the low threshold of the comparator without using shitty trimmers?

author: joeqsmith
author_rank: Super Contributor
timestamp: March 10, 2016, 02:32:29 am
content: Quote from: tuvtuv on March 09, 2016, 10:24:27 amNot sure why you consider adding some perspective as being harsh. I could pretty much guess it was not for the military.

author: MK14
author_rank: Super Contributor
timestamp: March 10, 2016, 02:56:26 am
content: You seem to have AC coupled the comparator input. Which would be fine for AC signals.But it (presumably), is a very rare, almost one-off signal (technically speaking it is still AC, but in practice, DC may well be a better way of detecting it). This gives any capacitor little/no time to settle or work very well.I'd prefer to DC couple it. Make the other side of the coil, a SOLID half-rail voltage. Then bring the other side of the coil into the comparator, with other circuitry (e.g. resistors), as necessary. It may still need some capacitors.When working with coil sensors, which are in close proximity to solenoids and other voltages and magnets/magnetic fields, the coil and/or wires can pick up transients, which at best will cause false triggering of the comparator, or worst destroy it.That's why I tried to persuade you to protect it with a pair of back to back diodes (between the coil output, maybe after a resistor, diode back to back pair connected to SOLID mid rail supply).If possible false triggering or possible damage do not bother you, then leave them out. They are really cheap at about 1p each, and rather small.I don't know where in the waveform, you originally showed, you want the ideal trigger point to be. Knowing that, may help other forum readers, to help you, by knowing this.Also, if the signal is TOO SMALL, to need the diodes. I would suggest that the original signal may be too weak, to reliably get to your controller. I.e. it will be potentially sensitive to noise.200mV is not too bad. But more may be better.Comparators DON'T work that well (i.e. tend to be slow), if the signal is fairly small.I've NEVER made a coil gun. So I may be too inexperienced with them, to give you the best of advice. The above is the way I might go about solving it, but there are many different ways, and lots of opinions.

author: daqq
author_rank: Super Contributor
timestamp: March 10, 2016, 12:15:43 pm
content: Quote1. Nope - I turned my own. Used the schools lathe.2. There wasn't enough heat to do any reasonable damage/bending.I used about 20 turns of reasonably thick wire. You are using a lot of smaller wire - this gives you a large inductance, which just increases your speed problem.