Arduino automated spudgun fuel injector

Boom! The classic potato gun harnesses the combustion of flammable vapor. Show us your combustion spud gun and discuss fuels, ratios, safety, ignition systems, tools, and more.
GalFisk
Specialist
Specialist
Sweden
Posts: 113
Joined: Mon Feb 28, 2005 4:06 am
Been thanked: 4 times

Tue Aug 04, 2020 4:52 pm

Hi all, I've been away from the forum since forever, but I'm still firing my old cannons now and then. They all reside at the airfield where I skydive, since it's there I have the most space and the best audience. My carrot combustion cannon (showcased here) has been my go-to since it's not tied to a compressor, but hand-metering butane means inconsistent shots and disappointed audiences. I had another chamber to which I had fitted a ball valve many years ago, and I've decided to finally make use of it.


Photos will be forthcoming, but here's a description of the planned fueling system (edit - photos now added):
  1. The fuel comes from a propane cylinder, with a propane regulator set to minimum pressure (it says 1 bar, but I haven't checked).
  2. The propane enters a 3-way 12V solenoid valve, built for pneumatic automation projects. It's a non-piloted valve, which requires more power but works better at low pressures.
  3. When the solenoid is activated, the propane port is opened, and connected to the metering port. This port is plugged, which creates a small dead volume inside the valve. This is my metering chamber.
  4. When the solenoid is deactivated, the propane port is closed, and the (now propane-filled) metering chamber gets connected to the outlet port. The result is a small, precisely metered puff of propane. I can send a new pulse to the solenoid for another puff.
  5. A tiny Arduino clone (Pro Micro form SparkFun) controls power to the valve, in order to create the desired number and length of pulses.
I've just started this project today, when I bought the valve and scrounged up all the other parts from my old spudding supplies, electronics hobby supplies, and earlier abandoned projects.

Each puff from the valve gives 3 ml of gas, which I found out by capturing 10 puffs in an inverted medicine measuring cup underwater. An open and close time of 100 ms each is sufficient for metering accuracy, giving me 5 puffs per second. 50 ms was too short, and 500ms didn't improve metering accuracy visibly over 100ms.

I need 60 ml or 20 puffs for my chamber, which will take 4 seconds to meter. I could reduce the number of puffs by increasing the regulator pressure or meter dead volume, but for now I think the tweaking accuracy afforded by lots of puffs will be the most useful. Also, having the regulator set at the end stop means I don't have to worry about adjusting it carefully.

The fueling tube is 4mm (ID 2.5mm) pneumatic tubing, which I will stick through the inside of the open ball valve and into the chamber, in order to inject the gas in the center of the chamber. I'll also plug the end of the fueling tube, and add transverse holes that will spray the gas turbulently in all directions. When fueling is complete, I'll retract the tubing, close the ball valve, and let 'er rip.

There will be more parts to the injector before I consider it done. The most important part is adding a 12V mattress inflator, also controlled by the Arduino, so that I can replace the air through the same port before injecting new fuel. I plan on using a larger hose for this, and placing the gas hose loosely inside the air hose, so they they both can be connected at once and the rest done by the push of a button.

Planned functionality and tests:
  • I haven't actually injected and fired the cannon itself yet. I'll have to do that to see if my math is on point.
    I'll have to see if the concentric tube idea works, and how fast the inflator can replace the air in the chamber. I normally do this by filling the chamber with smoke, and seeing how fast it clears. The inflator is at the airfield, so I won't get it until the weekend.
  • The circuit is breadboarded right now, and wires and tubing are dangling about on my desk. It's also a bit over-engineered, with optocouplers for the motor transistors. Good freewheeling diodes and design shoud keep any transients well away from the micro, and I'll need the optos for another project (A mains-powered, Arduino-controlled stroboscope).
  • The final circuit will be mounted in a box and/or on a board. The slender propane cylinder also needs a way to stay upright, or liquid will mess up the regulation. I could possibly strap the other parts to the cylinder, but I want the option of using other size cylinders in the future. I may mount everything in a small briefcase or something.
  • The circuit is powered by 4S 18650 lithium cells (16V fully charged, 12V empty). I'll get (or 3D print) a better battery holder, and probably have the Arduino keep an eye on the cell voltages. Charging will be done by a separate charger that monitors individual cells.
  • I think the mattress inflator will draw too much current, especially at 16V, so I may need to put more cells in, or control it through PWM if it delivers enough air at lower RPM. A soft start is probably a good idea in any case.
  • I may want to use the batteries for cannon ignition as well. Right now it has a 9V battery assisted by a capacitor. I don't want to be tethered during firing though. If the system works consistently every time, I'll probably just charge a cap from the batteries, enough for one ignition attempt.
I'll program the Arduino with the functions I want. The main one will be a sequence of venting and fueling, but there are others too:
  • Priming the fuel line by injecting enough propane to expel any air (2 puffs shoud suffice)
  • Emptying the fuel line between the propane bottle and valve, after closing the bottle (testing showed that this took 30 puffs - these will have decreasing pressure, which won't give accurate fueling, so this gas will just be vented)
  • Monitor circuit functionality: solenoid, fan motor, battery voltage, program halt with error indications of something's wrong.
  • Maybe in the future, settings for different chamber volumes.
I do have a copper pipe piston hybrid which I gave up on many, many years ago (maybe 13?) when I couldn't get the metering system to function reliably because of pressure regulation issues. When it did fire hybridically, which it did just once, it was a beast. I used it for many years as a pneumatic, but I found recently that the piston had corroded and needs replacing.

Edit: now with photos!
Attachments
The breadboarded first prototype circuit and the three-way pneumatic valve with plugged port.
The breadboarded first prototype circuit and the three-way pneumatic valve with plugged port.
The new combustion chamber with ball valve and ignition circuit attached. Also my big toe.
The new combustion chamber with ball valve and ignition circuit attached. Also my big toe.
Propane tank and regulator (mounted upside down for space reasons)
Propane tank and regulator (mounted upside down for space reasons)
User avatar
mark.f
Sergeant Major 3
Sergeant Major 3
Eritrea
Posts: 3570
Joined: Sat May 06, 2006 11:18 am
Location: The Big Steezy
Has thanked: 15 times
Been thanked: 10 times
Contact:

Donating Members

Wed Aug 05, 2020 7:48 am

Nice!

I had dreamed up something similar in the shower, but using a fuel injector and alcohol since it would be easier to measure the amount of fuel injected vs. pulse width. Your idea of placing the outlet underwater under an inverted graduated cylinder was a good idea, maybe I could look into doing something similar since all the denatured alcohol available now smells like potatoes. :p

But I wonder if it's the best metering system for a hybrid, especially a small one? Spudblaster15's "air-through-meter" fueling concept is miles better in terms of accuracy than a "conventional" meter and air connector, and manometric is best of all (if you don't mind the cost).
GalFisk
Specialist
Specialist
Sweden
Posts: 113
Joined: Mon Feb 28, 2005 4:06 am
Been thanked: 4 times

Wed Aug 05, 2020 2:41 pm

Thanks for your thoughts, Mark.

There are no pulse width issues with my design (apart from too short pulses leading to inaccuracies). When the solenoid is on, gas is being led to a small metering chamber (equivalent to having the first ball valve open on a traditional meter), and when it's off, the metering chamber is being exhausted (equivalent to closing the first and opening the second ball valve). At no point is there direct flow from the regulator to the combustion chamber.

In a traditional, manually operated meter, all the gas needed is injected into the meter at once, and one must adjust the pressure to the correct setting in order to get the desired amount of gas. That is not necessary with this automated meter, because it only meters a small fraction of the gas needed, and I can simply work out and automate the number of gas puffs required.

The principle only works for gases; for alcohol injection I'd have a look at car fuel injectors.


For hybrid fueling, there are two ways my design could be used:

One would be to fuel the hybrid at atmospheric pressure, by injecting the propane at the rear of the chamber with the valve open. If I had a hybrid with the same chamber volume as my combustion cannon, I could inject 20 puffs for 1x, 40 for 2x and so on, then close the valve, and finally add the appropriate amount of air. Here I'd want the injection to be gentle and non-turbulent, so the injected propane stays near the rear of the chamber and doesn't escape.

The other would be to inject the fuel into a closed but non-pressurized chamber. This would gradually pressurize the chamber, so subsequent puffs would add less gas than with atmospheric fueling, but the math for calculating the number of extra puffs needed in order to compensate would be reasonably straightforward. I could easily add a hybrid setting to the software that automatically compensates for this. The advantage would be that no propane could leak out though the main valve, which would increase accuracy. The disadvantage would be that once the chamber pressure reaches the regulator pressure, no more fuel can be injected (and it will become slower and slower when approaching this pressure). 1 bar is 50% propane, enough for a 12x shot (if my quick calculations are correct). I can adjust my regulator up to 4 bar if needed.

When having a large traditional meter, I see the advantage of Spudblaster15's design (You're referring to the TBMA-230 V2.0, right?), because emptying the meter of gas residue means back pressure during fueling is not an issue, and no special calculations are needed. I also like how it pressurizes the pilot automatically, in order to close the valve before fueling.

---

I have now test fired one injected load with good success, and rebuilt the circuit on veroboard. It will handle the exhaust fan (yellow LED), fuel metering (red LED) and charge the firing capacitor (the green LED will turn off momentarily during charging). This capacitor will replace the battery powering the high voltage circuit.

I've tested the low voltage part of my veroboard build (essentially the 7-segment bit), but I haven't connected the battery yet. I need to triple check everything and start out with a lower voltage, because if there is a short anywhere that gives 16V to the Arduino, it's toast.

The 7-segment display will show status and diagnostics with a single number or letter. The colored LEDs are connected to voltage outputs in order to show what they're doing. I may also decide to connect them to analog inputs through voltage dividers, so the software can check what the hardware is doing.

I haven't decided how to enclose the circuit yet, and I may replace the buttons with something else also. It should be fairly rugged, and easy to use, but I don't need it to be operable by others.
Attachments
Fuel injector (drilled tubing)
Fuel injector (drilled tubing)
Electronic schemtic of stuff attached to the Arduino. The firing capacitor charger is just attached to the battery, and is essentially a resistor.
Electronic schemtic of stuff attached to the Arduino. The firing capacitor charger is just attached to the battery, and is essentially a resistor.
The circuit on veroboard. I haven't decided what the small buttons will do, but the big one is for injection. Maybe the small ones wil select different functions for the big one.
The circuit on veroboard. I haven't decided what the small buttons will do, but the big one is for injection. Maybe the small ones wil select different functions for the big one.
User avatar
mark.f
Sergeant Major 3
Sergeant Major 3
Eritrea
Posts: 3570
Joined: Sat May 06, 2006 11:18 am
Location: The Big Steezy
Has thanked: 15 times
Been thanked: 10 times
Contact:

Donating Members

Wed Aug 05, 2020 8:02 pm

Nice job on the circuit. I'm a man that can appreciate the work required to compact something onto perfboard. If you're interested (probably not given the work put into the current iteration) an ATTiny takes up even less space but that's not always a priority.
The TMBA's meter is pretty much it. You can see the design on his earlier launchers as welI, it eliminates the pesky residual propane in the meter pipe which becomes a problem at higher mixtures. I did a writeup here which is a little jumbled but has worked fine.
GalFisk
Specialist
Specialist
Sweden
Posts: 113
Joined: Mon Feb 28, 2005 4:06 am
Been thanked: 4 times

Thu Aug 06, 2020 5:19 pm

That's a good writeup covering many fueling scenarios. If you wanted to expand on it, you could add liquid metering and my method (let's call it puff metering). I'm halfway through writing the formulas, but I've been coding all day (the software is done, two hardware bugs were found and fixed, smoke test tomorrow), so my brain is a bit mushy. I'll work on it more tomorrow.

I love perfboard and use it for all my permanent projects. I enjoy the puzzle-like nature of laying out the circuit in a compact manner on paper, trying it out to see how it fits, and modifying as necessary. The transistor cluster (actually two transistors and a 7805 voltage regulator) was a result of this process, and it kept the heat sinks from touching (which they nearly did in my original plan) as they all carry different voltages. I don't expect either to actually need heat sinking. I've left some space for hooking up the analog lines of the Arduino if I want to, and the 7-segment was added more for fun than necessity. About 20% of the code is for that one alone.

I have a bunch of Pro Micros I bought for cheap in order to do projects such as this, and I don't need the board any smaller, but thanks for the tip about ATTiny. It may come in handy for more space constrained projects.

Functionality:
Top button: fuel enable/disable
Bottom button: fan enable/disable
Middle button: execute

If neither fuel or fan is enabled, but action is pressed: prime gas lines. If priming or fueling has been done at least once, purge gas lines

Fan has a PWMed spin-up of to seconds, run time of 5 seconds, and spin down delay of three seconds - all guesstimates.
Fuel priming is three slow puffs (slower speed mainly to give feedback on what's happening)
Fuel injection is 20 100ms puffs
Fuel purge is 30 50ms puffs (prioritizing speed rather than accuracy)

The 7-segment will flash text about what is going to happen when action is pushed, count fan runtime (I'll probably change it to a countdown), or count down gas puffs.

I'll record a video when it's all used in action, which may take some weeks.
GalFisk
Specialist
Specialist
Sweden
Posts: 113
Joined: Mon Feb 28, 2005 4:06 am
Been thanked: 4 times

Mon Aug 10, 2020 7:14 am

Let's do the math for puff metering a hybrid with a closed chamber. We'll use numbers a bit different from mine, to make the example clearer. I've sanity checked the result and double checked some of the math, but if someone wants to check and verify (both thinking and actual math) it's appreciated.


Meter pressure: 3 barg
Puff volume into atmosphere, assume 1 bara: 6 ml
Chamber volume: 1700 ml
Mix ratios: 1x - 10x
Gas: propane, C3H8

We'll make a few simplifications: we’ll assume that injected air and gas hold the same temperature, we'll assume that a stoichiometric fuel/air ratio is desirable, and we'll assume negligible dead volume between the meter and chamber (easily done by using a thin tube, or injecting gas into the air line, and then the air). We assume 21 vol% oxygen in air. Let's use up to 2 decimal places unless something else is called for.

First, let's calculate the stoichiometric ratio.
C3H8+O2 -> H2O+CO2: C3 will need 3O2, H8 will need 2O2: C3H8+5O2 -> 3CO2+4H2O. That's a fuel:oxygen ratio of 1:5, which becomes a fuel:air ratio of 1:(5/21*100) = 1:23.81.

For a 1x mix, we'll need 1700/23.81 = 71,4 ml propane/6 ml per puff = 11,9 puffs, so let's go with 12. Puffing this into a closed chamber will raise the pressure to (1700+71,4)/1700 = 1.042 bar. That won't affect things much.

Let's instead consider a 10x mix. Now we want to inject 714 ml propane into the chamber, which will raise the chamber pressure to (1700+714)/1700 = 1.42 bara. This will obviously affect the injected volume of gas.

In order to see how much, we need first to calculate the meter volume:
3 bar(g) = 4 bara. The propane expands 4 times, from 4 bara to 1 bara. This results in 6 ml of gas being injected into the chamber, which is ¾ of all the gas in the meter. The meter volume is therefore (6/3*4)-6 = 2 ml.

So our first puff will expand into 1 bara, and our last will expand into 1.42 bara, but we only need to calculate what happens against the average back pressure, which will be (1+1.42)/2 = 1.21 bara. We can assume all our puffs will expand into that, and get the correct result. Note that this math only works as long as the final pressure is lower than the meter pressure.

So 2 ml of 4 bar gas will expand into 2*4/1.21 = 6.61 ml of gas, of which 6.61-2 = 4.61 ml will be injected.

However, those 4.61 ml will have a pressure of 1.21 bara, so they’ll be denser than what would’ve been injected at 1 bara. Since we know that we want 714 ml of 1 bara propane, we can calculate what this represents: 4.61*1.21 = 5.58 ml of 1 bara propane.
That’s pretty good, actually - only 0.02 ml per puff on average is lost due to back pressure. A lower meter pressure or a bigger meter volume would lead to bigger losses.

Now we can calculate the actual number of puffs we need: 714/5.58 = 127,95, so 128 puffs for a 10x mix. We originally has 12 puffs, and now we got 12*10+8, so that’s 8 puffs extra to compensate for 10x back pressure. We can easily interpolate, and see that a 5x mix needs 4 extra puffs, a 20x needs 16 extra puffs, and so on.
User avatar
mark.f
Sergeant Major 3
Sergeant Major 3
Eritrea
Posts: 3570
Joined: Sat May 06, 2006 11:18 am
Location: The Big Steezy
Has thanked: 15 times
Been thanked: 10 times
Contact:

Donating Members

Sun Aug 16, 2020 6:09 am

GalFisk wrote:
Mon Aug 10, 2020 7:14 am
Let's do the math for puff metering a hybrid with a closed chamber. We'll use numbers a bit different from mine, to make the example clearer. I've sanity checked the result and double checked some of the math, but if someone wants to check and verify (both thinking and actual math) it's appreciated.
Meter pressure: 3 barg
Puff volume into atmosphere, assume 1 bara: 6 ml
Chamber volume: 1700 ml
Mix ratios: 1x - 10x
Gas: propane, C3H8
We'll make a few simplifications: we’ll assume that injected air and gas hold the same temperature, we'll assume that a stoichiometric fuel/air ratio is desirable, and we'll assume negligible dead volume between the meter and chamber (easily done by using a thin tube, or injecting gas into the air line, and then the air). We assume 21 vol% oxygen in air. Let's use up to 2 decimal places unless something else is called for.
First, let's calculate the stoichiometric ratio.
C3H8+O2 -> H2O+CO2: C3 will need 3O2, H8 will need 2O2: C3H8+5O2 -> 3CO2+4H2O. That's a fuel:oxygen ratio of 1:5, which becomes a fuel:air ratio of 1:(5/21*100) = 1:23.81.
For a 1x mix, we'll need 1700/23.81 = 71,4 ml propane/6 ml per puff = 11,9 puffs, so let's go with 12. Puffing this into a closed chamber will raise the pressure to (1700+71,4)/1700 = 1.042 bar. That won't affect things much.
Let's instead consider a 10x mix. Now we want to inject 714 ml propane into the chamber, which will raise the chamber pressure to (1700+714)/1700 = 1.42 bara. This will obviously affect the injected volume of gas.
In order to see how much, we need first to calculate the meter volume:
3 bar(g) = 4 bara. The propane expands 4 times, from 4 bara to 1 bara. This results in 6 ml of gas being injected into the chamber, which is ¾ of all the gas in the meter. The meter volume is therefore (6/3*4)-6 = 2 ml.
So our first puff will expand into 1 bara, and our last will expand into 1.42 bara, but we only need to calculate what happens against the average back pressure, which will be (1+1.42)/2 = 1.21 bara. We can assume all our puffs will expand into that, and get the correct result. Note that this math only works as long as the final pressure is lower than the meter pressure.
So 2 ml of 4 bar gas will expand into 2*4/1.21 = 6.61 ml of gas, of which 6.61-2 = 4.61 ml will be injected.
However, those 4.61 ml will have a pressure of 1.21 bara, so they’ll be denser than what would’ve been injected at 1 bara. Since we know that we want 714 ml of 1 bara propane, we can calculate what this represents: 4.61*1.21 = 5.58 ml of 1 bara propane.
That’s pretty good, actually - only 0.02 ml per puff on average is lost due to back pressure. A lower meter pressure or a bigger meter volume would lead to bigger losses.
Now we can calculate the actual number of puffs we need: 714/5.58 = 127,95, so 128 puffs for a 10x mix. We originally has 12 puffs, and now we got 12*10+8, so that’s 8 puffs extra to compensate for 10x back pressure. We can easily interpolate, and see that a 5x mix needs 4 extra puffs, a 20x needs 16 extra puffs, and so on.
Looks good on a surface level but I gotta fire up excel whenever I get the chance to "get it" a little better.
GalFisk
Specialist
Specialist
Sweden
Posts: 113
Joined: Mon Feb 28, 2005 4:06 am
Been thanked: 4 times

Thu Sep 24, 2020 2:28 am

Now I wonder why I didn't use a spreadsheet to do the calculations. That'd've (is that a word?) been a lot easier.

Having used this device now on several occasions, I'm very happy with its accuracy and speed. The only misfire was when the propane tank tipped over, and liquid got into the regulator.

Some points:
The valve seals seem to react with the propane, causing the valve to stick after sitting unused for a week or two. So far, it has always started working again after a few cycles. Maybe I'll make an "unstick" function.
The 7-segment is needlessly complex, which I already knew. Status LEDs would suffice.
It's easy to forget turning off the thing. I'll write a sleep function.
4 used 18650 cells have plenty of power and last hundreds of shots. The venting draws the most power by far, but it only runs for a couple of seconds.
User avatar
jackssmirkingrevenge
Five Star General
Five Star General
Posts: 25782
Joined: Thu Mar 15, 2007 11:28 pm
Has thanked: 104 times
Been thanked: 61 times

Donating Members

Wed Oct 07, 2020 3:46 pm

Also my big toe.
Some things never change :)

Interesting project!
hectmarr wrote:You have to make many weapons, because this field is long and short life
GalFisk
Specialist
Specialist
Sweden
Posts: 113
Joined: Mon Feb 28, 2005 4:06 am
Been thanked: 4 times

Wed Oct 07, 2020 4:08 pm

Thanks. The transistor for the solenoid actually burned out last weekend, so I put another MOSFET there, same kind that I used for the blower. Now it works again. I also took the opportunity to fix a bug, simplify the display, and add a 5 minute idle timer to lower power consumption when (not if) I forget to turn the thing off.
I haven't made a video yet, but maybe I'll ask someone to film this weekend, or to send me films from previous occasions. This meter has made my cannon very powerful and consistant. It is just as good as I hoped for when I started this project.

Hopefully I can get my old hybrid up and running next spring, using the same meter or a clone of it. I gave up on it (at least the hybrid part - it was a great pneumatic still) because of fueling precision issues. The piston has corroded during years of storage, but I learned today that I can get new ones lathed at work, both for the hybrid and my pneumatic ones.
Post Reply