My electromagnetic BB gun project, 130 m/s velocity, 20 rpm rate of fire - Page 1
Forum section: electronics / projects

author: rpopeye
author_rank: Newbie
timestamp: January 16, 2018, 11:50:09 am
content: So, this is my baby - an electromagnetic BB gun (coil gun), that shoots standard size 4.5mm steel BBs with a velocity of up to 130 m/s and a rate of fire of 20 rpm. It's basically as good as an average CO2 BB airgun and, as far as I am aware, is the first practically usable electromagnetic BB gun. I know that the height of the coil gun hype is long past, but I think we are now entering the next stage where the concept may actually become practically usable, at least in the recreational shooting area.It's basically a standard coil gun design - a series of coils along the barrel are switched on and off in rapid succession creating a running electromagnetic field from the back of the barrel towards the front which attracts and accelerates the steel BB. To achieve these high velocities the coils are powered from a high voltage capacitor bank, which in turn is charged up from a 2.5 Ah 25C 3s LiPo battery by means of a boost DC-DC converter. A single charge of the battery is sufficient for more than 300 shots. The whole thing is controlled by two PIC micro-controllers - one master and one for generating the pulses. The coils are switched by mosfet transistors and the schematics is pretty standard (attached).Took me about a year to design, 3D print and build, but it was worth itCheck out my demo video where I shatter glass bottles with it.https://youtu.be/jhtAsYy7dgM

author: boatanchorguy
author_rank: Newbie
timestamp: January 16, 2018, 01:04:53 pm
content: Very cool.. do you have some pictures of the interior showing the coils and other construction?

author: daqq
author_rank: Super Contributor
timestamp: January 16, 2018, 01:58:09 pm
content: Nice build!If you need the field in the coils to decay faster once the MOSFET has been turned of you might want to add a series resistor (or a different dissipative snubber) to the flyback diode.I know that I gained a bit of lower efficiency in my old (very simple) coilgun because the field in the inductor was still present after the ball passed through it, creating a drag.

author: rpopeye
author_rank: Newbie
timestamp: January 16, 2018, 03:29:19 pm
content: thanks daqq, that's a good idea, have to be careful however not to over-voltage the mosfet with the drop on the resistor that will add on top of the remaining voltage in the capacitor

author: rpopeye
author_rank: Newbie
timestamp: January 16, 2018, 03:32:31 pm
content: Here is a picture of the interior, the rest of the volume is pretty much filled with capacitors

author: moonquasar
author_rank: Contributor
timestamp: January 17, 2018, 04:12:29 am
content: Very nice build. Are there sensors to track the bb or is it open loop?

author: tpowell1830
author_rank: Frequent Contributor
timestamp: January 17, 2018, 05:19:55 am
content: Quote from: rpopeye on January 16, 2018, 03:32:31 pmIt is difficult to see, but it looks similar to a linear motor. Is that the mode of operation?

author: tautech
author_rank: Super Contributor
timestamp: January 17, 2018, 06:18:20 am
content: What degree of accuracy has been achieved ? Say a 25m group ?

author: rpopeye
author_rank: Newbie
timestamp: January 17, 2018, 06:24:56 am
content: Yes, it is basically a linear motorWhat is visible in the interior picture are the mosfet transistors sitting on top of the coilsIt doesn't have sensors to track the BB and indeed works in an open loop configurationCurrently the accuracy is pretty bad (10cm spread at 6m) due to the lack of precision instruments when making the barrel - there is a considerable gap (0.5mm) between the barrel internal diameter and the diameter of the BBs, and also the barrel is most likely not exactly straight

author: tautech
author_rank: Super Contributor
timestamp: January 17, 2018, 06:38:20 am
content: Quote from: rpopeye on January 17, 2018, 06:24:56 amCould the barrel be precision bored to the correct size after manufacture ?What length is the barrel ?Is it possible the field is not even and effects the path of the BB near exit ?Could a plain tube extension be added to improve accuracy ?

author: rpopeye
author_rank: Newbie
timestamp: January 17, 2018, 08:28:26 am
content: The barrel is 50cm long and can be precision manufactured to tightly fit the BB's diameter, I just don't have the tools, so I used an off-the-shelf acrylic glass tube instead. Unfortunately, the required internal diameter wasn't available so I had to go with slightly larger and also acrylic glass is flexible, so exact straightness couldn't be ensured either.The field is radially uniform, so in theory shouldn't affect the path of the BB.There is a conical tube extension at the end of the barrel if that's what you meant. Without it the accuracy might have been even worse.I think the main problem is the large internal diameter and straightness of the barrel - the BB most likely bounces off the walls inside the barrel and when exiting its path deviates from the straight axis.

author: tpowell1830
author_rank: Frequent Contributor
timestamp: January 17, 2018, 03:38:59 pm
content: Quote from: rpopeye on January 17, 2018, 08:28:26 amIs there a method to allow air to enter the back of the barrel, behind the BB? If this is not allowed, you could perhaps be pulling a vacuum in the accel chamber, behind the BB, slowing the process. There is a considerable fluid dynamic occurring here.Also, the precision of the barrel is a consideration, once the fluid dynamic is handled. This is a wonderful device that you have built, but I believe many improvements can make it, not only accurate at a distance, but considerably faster. The speed of sound is one of the factors.Have you considered going to the 6mm BB? It is unfortunate that we are not close in proximity and I could look at the problem more closely. What a fun project! And you have done a beautiful job of the entire system. I am certain you can overcome these issues.

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: January 17, 2018, 03:45:51 pm
content: Just wanted to congratulate you on an awesome and fun project! Such a nice build too!

author: langwadt
author_rank: Super Contributor
timestamp: January 17, 2018, 04:07:42 pm
content: Quote from: rpopeye on January 16, 2018, 03:29:19 pmwhen you exceed the D-S voltage on a mosfet it start acting like a zener diode, so the limit os how much power it can handle not voltage. Look for avalanche rated mosfets, they specify how much energy they can handleif it is within the limits of how much is stored in the inductor you can skip the flyback diode

author: rpopeye
author_rank: Newbie
timestamp: January 17, 2018, 04:57:21 pm
content: Quote from: tpowell1830 on January 17, 2018, 03:38:59 pmYes, there is an opening at the back of the barrel from where air can enter when the BB is being accelerated, otherwise it indeed creates vacuum behind itself which considerably slows it down and also creates a funny sound when exiting the barrelI've already started working on the next version, which should see many improvements, at least I've found a tube with the right diameter, so accuracy should get a boost. I am also expecting the velocity to reach 160m/s, but for now the speed of sound looks like a very far away goalUsing 6mm BBs would certainly give it more kinetic energy and at some point in the future I would like to try them, but first I want to make the 4.5mm ones work sufficiently well. I might also try 4.5mm steel pellets though as they would require only software modifications and probably only minor changes to the loading mechanism.

author: rpopeye
author_rank: Newbie
timestamp: January 17, 2018, 05:06:46 pm
content: Quote from: langwadt on January 17, 2018, 04:07:42 pmYes, the mosfets are avalanche rated. I haven't calculated how much energy the coil would dump on the mosfet, but I did an experiment without the flyback diode and sadly the mosfet died. I even had to use fast diodes, it seems the general purpose ones did not switch on fast enough to prevent the avalanche in the mosfet.

author: dexters_lab
author_rank: Unknown
timestamp: January 17, 2018, 07:17:01 pm
content: great project, it's really nice to see a home brew project finished so completely!what is the voltage/capacitance dumped into each coil?

author: daqq
author_rank: Super Contributor
timestamp: January 17, 2018, 09:49:18 pm
content: QuoteThe maximum voltage produced by an inductor should be the current that was flowing thought it at the time of the disconnection times the resistance in series with the flyback diode (plus the diode voltage). Try simulating it in LTSpice.

author: rpopeye
author_rank: Newbie
timestamp: January 18, 2018, 06:25:31 am
content: The capacitor bank is charged up to 95 V, but the mosfets switch off the coils at the right times to achieve maximum velocity, so not all of the capacitance is dumped on the coils. The energy dumped on the first coil is about 7 joules (calculated, I don't have the means to actually measure it), it gets progressively smaller for the other coils as the length of the switched on time decreases with increasing velocity of the projectile. The efficiency of the whole thing is about 2%, pretty bad, but sufficient for this version.In the next version I am planning to do more simulations and testing to optimize the circuit and hopefully achieve better efficiency.Speaking of efficiency, does anybody know the main reason for why coil guns are so notoriously inefficient?I can thing of two - active losses in the coil wire and poor magnetic coupling between the coil and the projectile, but I don't know how strong these effects are.Apparently DARPA has achieved 22% efficiency in their design of a coilgun mortar according to Wikipedia, but of course the design I suppose is classified and not publicly available.

author: Rerouter
author_rank: Super Contributor
timestamp: January 18, 2018, 10:38:28 am
content: The darpa coil guns used many smaller bifilar wound pairs to reduce the inductance between the capacitor bank and the coil, they also likely used many parrellel turns instead of a true coil, to increase the amperage while keeping the voltage lower,due to insulation gap, they likely would have tried to keep the voltages lower as that way you can get more joules closer to the barrel if you can maximize for joules/cubic meter.They also would have segmented and closed the magnetic path outside of the barrel to focus the magnetic field lines and prevent influence from adjacent coils, like the iron washers many designs seem to use, I assume they would have gone a step furthur and made a 2 part shell to encase the outside of each coil.Square magnet wire is also likely on the cards, gets a bit lower resistance for the same number of turns however this costs much more for hobbies.The other trick they likely would have used is different diameters of wire or lengths along the barrel, as the switching period of the coils gets shorter and shorter towards the end of the barrel, meaning you need a lower inductance to peak and dissipate faster.And maybe the last though i can come up with would be a full cycle push pull as the projectile passes through, as it approaches the opening of the field shell,turn on and begin building up the field, to draw it in faster, it cruises in, then when its approaching the end of the coil you apply a reverse polarity pulse to kick it out while the next coil is drawing it in.

author: CopperCone
author_rank: Super Contributor
timestamp: January 18, 2018, 06:00:52 pm
content: An interesting note on the darpa mortar is that it uses a 94ghz radar to track the position of the mortar in the barrel. I thought it would be a ldvt.Do you just put a horn on the bottom of the barrel and measure reflection? Really interesting.

author: ahbushnell
author_rank: Frequent Contributor
timestamp: January 19, 2018, 04:48:46 am
content: Quote from: rpopeye on January 18, 2018, 06:25:31 amThere is a public paperwww.dtic.mil/get-tr-doc/pdf?AD=ADA610358

author: Richard Head
author_rank: Frequent Contributor
timestamp: January 19, 2018, 01:25:18 pm
content: I wonder if you could use an energy recovery winding for every turn on the barrel. This way you may be able to recover the energy that isn't transfered to the projectile.

author: jbb
author_rank: Super Contributor
timestamp: January 19, 2018, 08:40:38 pm
content: Quote from: Richard Head on January 19, 2018, 01:25:18 pmAn energy recovery winding might work, but I suspect that copper volume in the coils is critical. Instead, you could try a two-switch circuit (see below).To fire, close M1 and M2. The DC rail is applied to the inductor and current rises.To hold current, open M2. Current flows through M1 and D2, 0V applied to inductor, current holds steady.To release, open M1 and M2. Current flows through D1 and D2, energy is transferred from inductor back to the DC rail.

author: Vgkid
author_rank: Super Contributor
timestamp: January 20, 2018, 07:40:38 am
content: This is very cool.

author: BravoV
author_rank: Super Contributor
timestamp: January 20, 2018, 07:56:25 am
content: Quote from: jbb on January 19, 2018, 08:40:38 pmFyi, this topology is proven and worked at the inductor saturation tester circuit designed and built by our forum member Jay_Diddy_B, it was started as an idea to recycle the energy used in the inductor when biased with current to find it's saturation limit.Details here ->Inductor saturation tester

author: LaserSteve
author_rank: Super Contributor
timestamp: January 20, 2018, 01:19:17 pm
content: As a target shooter, I think you should be very proud....Steve

author: rpopeye
author_rank: Newbie
timestamp: January 20, 2018, 02:08:29 pm
content: An energy recovery winding would not only take copper volume, which indeed is critical, but might also mess up the pulse in the main coil.The two-switch circuit is a much better choice, it has also an additional benefit besides energy recovery, the electromagnetic field in the coil would decay much faster because of the much higher voltage potential between the coil terminals.

author: ez24
author_rank: Super Contributor
timestamp: January 20, 2018, 06:51:52 pm
content: Very interesting

author: max_torque
author_rank: Super Contributor
timestamp: January 20, 2018, 07:43:12 pm
content: Considering that a magnetic coil acts on a iron object in such a fashion as to always try to maximise its inductance, then there must be a load of design optimisations for the coil geometry that depend upon the velocity of the projectile? Ie you want to be be able to build the maximum coil current before the projectile reaches the max inductance location, and then ideally, immediately reduce the magnetic flux to zero to avoid creating a drag force on the projectile as it exits the coil. Hence, so sort of iron magnetic flux steering might make an improvement?The problem with recovering some of the firing energy, using an H bridge type driver is that the voltage available to reduce the magnetic flux is limited to that of the storage medium. Using a simple on/off switch (of a suitably high voltage rating) means the flux can be destroyed by a much higher voltage that that used to generate that flux (there is no penalty (in terms of barrel velocity) with turning on coils early, compared to a significant one with turning them off late!In all cases, you need to maximise the amp turns for any given inductance value

author: jbb
author_rank: Super Contributor
timestamp: January 21, 2018, 07:01:12 am
content: Hmm, if it’s really important to discharge the inductor quickly, there might be some interesting (I.e. complicated) resonant snubber tricks which could still ring the energy back into the main rail.Or maybe just adding a (non inductive!!!) discharge resistor in series with one of the diodes (and increase the voltage rating of the opposing switch) would do the trick. Lossy but easy :-).