Go Down

Topic: Arduino as an engine control module? (Read 3 times) previous topic - next topic

J-Ri350

I've been reading about experimental 6-stroke engines, and would like to try to convert my existing vehicle(s) to run using this method.  Essentially, at TDC on the exhaust stroke in a regular 4 stroke engine, both valves close as the piston approaches TDC.  High pressure water is then injected directly into the cylinder which turns to steam and forces the piston downward again.  Then there is an exhaust stroke for the steam, and we're back to the regular intake stroke.  This eliminates a large portion of the energy that is wasted in the form of unused heat.  These engines use roughly half the fuel of a conventional 4 stroke engine, and many don't even have a cooling system.

What I would like to build would be an 8-cycle engine (having a "regular" intake and compression stroke essentially wasted), as it would be impractical to rebuild the engine(s) to be true 6-cycle.  One problem with the 6-stroke is that until it warms up, it coasts through 2 strokes which makes them run rough.  I would have mine run in 4-stroke mode until warmed up, at which time it would switch to 8-stroke.  The first car I would try this on is an '01 Impala with the 3.4L V6.  Sequential fuel injection with one coil per pair of companion cylinders.  It has a maximum RPM of 5,600 RPM.  The 3 coils fire once per revolution, one spark ignites the air/fuel mixture and the other one fires in the companion cylinder which is on the exhaust stroke.  The fuel injectors fire every-other revolution, one on each cylinder.

What I would have to do is disable the fuel injector for the cylinder that is having water injected into it and run the water injector solenoid when the PCM commands spark for that coil.  Then the next time the fuel injector is commanded on, it would be allowed to do so, and water would not be injected with the spark.  Obviously the 16Mhz could handle this if the timing didn't need to be extremely accurate, but I'm not too sure how fast it would make it through the program, a couple milliseconds could let it run very lean or miss a power stroke altogether.  I don't have a lot of experience with the Arduino or programming in general, however I do have considerable experience with electronics.  I did build a methanol injector controller using a standalone Atmega328, but it read the throttle position, two adjustment pots, and varied the pulse width to the transistor that controlled the pump based on these 3 inputs.  I also built a sun tracker for a solar panel, and lots of little things just for fun.  But the timing needs to be pretty close here, where timing was of little to no concern on everything else I've done. 

I would also like to be able to measure how long each fuel injector is on, and inject a proportionate amount of water to make the engine run smooth.  The fuel injectors are commanded on to hundredths of milliseconds.  The on-time seems to be roughly  .12 mS resolution, which I assume the Arduino would miss completely.

Can any of the microprocessors available on an Arduino do this?  I will be building a module using a standalone microprocessor, so I can use a 20Mhz resonator if using the Atmega328 or another IC that can use an external timing device if 16Mhz would be a bit short.  It would be perfectly acceptable to me to have a maximum RPM of about 3,000 while running in 8-stroke mode, but any lower than 2,000 RPM wouldn't be worth my time to build this.  Any guesses as to how long it would take to execute the code required to do everything I need?


Thanks in advance,
Jason

PeterH

Interesting project.

I'm trying to get my head around the 8-stroke cycle. Are you going to leave the cam alone and actually pull in a fresh charge at the start of the 'steam' power stroke? In this case you'd be throwing away the hot exhaust charge that contains most of the energy you're trying to recover, and the only thing powering your 'steam' phase would be the hot metal. In this case I'm sure that skipping half the power strokes and running water through the cylinder would cool the engine a lot, but I'm sceptical that you'll gain enough power during the steam phase to offset the friction and pumping losses. I suspect you'll end up with a very rough engine with about half the power and a dead loss cooling system.

But it's interesting enough as a concept that I'd like to see how it works in practice.

I suppose that to do this properly you'd need to replace the cam drive system with one that ran at 1/3 crankshaft speed instead of half crankshaft speed, and you'd need to change the cam phase/durations. Getting a custom cam grind isn't technically difficult but needs money and engineering skills. Changing the chainwheel/pulley sizes to change the cam speed is something that is easy in theory but may not be possible in practice, depending on the design of your cam drive. It seems to me that this is the only approach that is likely to work well, though.

How are you implementing the water injection? Are you injecting into the cylinder? What sort of injectors and water supply system are you planning?

What sort of duty cycle are you envisaging for the water injectors? The petrol injectors are probably batch fired, but your water injectors would need to be sequential and accurately phased, so they'll need to be sized to use a much shorter pulse. This may mean you can't simply drive them from the petrol injector signal. You could use the ignition LT pulse to give you a crude engine phase sensor but you still need some logic to decide which part of the engine cycle you're in and switch the fuel and water injection systems on and off.

Needing sequential injection also makes it harder to choose the ECU. There are several aftermarket systems that support sequential injection up to 6 cylinders, but it rules out the experimental systems such as Megasquirt/VSMS. It would be worth doing some research though to find what state MS is up to now - last time I was involved with this they were developing a SMD controller that was planned to support lots of drivers and probably do what you need here.

If you're running this setup in economy mode I guess you'll be around 3000 rpm which corresponds to 20 ms per crank revolution. If you wanted to complete the water injection within say a 45 degree period, that gives you 2.5 ms water injection duration. I wouldn't expect any difficulty achieving that with an Arduino. The pulse wouldn't need to be calibrated accurately as long as you have some scope to dial it up and down a bit to find the best compromise between water consumption and power. You'd also need outputs to disable the corresponding injector, and inputs for crank position (crank trigger wheel?), cam position (#1 spark LT?) and throttle (MAP?) so you could decide when to enable water injection and phase it correctly.
I only provide help via the forum - please do not contact me for private consultancy.

dc42

It sounds doable to me. You've quite a long time to do the calculations between injection events, and having calculated when you need to do an injection, you can just wait until that time comes around, which will give you accuracy to within a few microseconds if you design the software with no interrupts. Similarly, you can hold the injector open for a precise time before you close it. Then start on the next calculation. You'll probably want to avoid using floating point maths to avoid the calculations taking too long.

You could use timer 1 as your system clock and use its capture facility to time-stamp your synchronisation event, which I presume is a spark to any cylinder. You'll need some additional way of telling whether the spark is for a particular cylinder, perhaps a flip-flop readable by the Arduino that is set by a spark to a particular cylinder and cleared by a spark to the next cylinder.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

J-Ri350

Thanks for the replies!


Interesting project.

I'm trying to get my head around the 8-stroke cycle. Are you going to leave the cam alone and actually pull in a fresh charge at the start of the 'steam' power stroke? In this case you'd be throwing away the hot exhaust charge that contains most of the energy you're trying to recover, and the only thing powering your 'steam' phase would be the hot metal. In this case I'm sure that skipping half the power strokes and running water through the cylinder would cool the engine a lot, but I'm sceptical that you'll gain enough power during the steam phase to offset the friction and pumping losses. I suspect you'll end up with a very rough engine with about half the power and a dead loss cooling system.

But it's interesting enough as a concept that I'd like to see how it works in practice.

I suppose that to do this properly you'd need to replace the cam drive system with one that ran at 1/3 crankshaft speed instead of half crankshaft speed, and you'd need to change the cam phase/durations. Getting a custom cam grind isn't technically difficult but needs money and engineering skills. Changing the chainwheel/pulley sizes to change the cam speed is something that is easy in theory but may not be possible in practice, depending on the design of your cam drive. It seems to me that this is the only approach that is likely to work well, though.

How are you implementing the water injection? Are you injecting into the cylinder? What sort of injectors and water supply system are you planning?

What sort of duty cycle are you envisaging for the water injectors? The petrol injectors are probably batch fired, but your water injectors would need to be sequential and accurately phased, so they'll need to be sized to use a much shorter pulse. This may mean you can't simply drive them from the petrol injector signal. You could use the ignition LT pulse to give you a crude engine phase sensor but you still need some logic to decide which part of the engine cycle you're in and switch the fuel and water injection systems on and off.

Needing sequential injection also makes it harder to choose the ECU. There are several aftermarket systems that support sequential injection up to 6 cylinders, but it rules out the experimental systems such as Megasquirt/VSMS. It would be worth doing some research though to find what state MS is up to now - last time I was involved with this they were developing a SMD controller that was planned to support lots of drivers and probably do what you need here.

If you're running this setup in economy mode I guess you'll be around 3000 rpm which corresponds to 20 ms per crank revolution. If you wanted to complete the water injection within say a 45 degree period, that gives you 2.5 ms water injection duration. I wouldn't expect any difficulty achieving that with an Arduino. The pulse wouldn't need to be calibrated accurately as long as you have some scope to dial it up and down a bit to find the best compromise between water consumption and power. You'd also need outputs to disable the corresponding injector, and inputs for crank position (crank trigger wheel?), cam position (#1 spark LT?) and throttle (MAP?) so you could decide when to enable water injection and phase it correctly.


Yes, I'll be leaving the cam alone.  The 6 stroke engines do have a regular exhaust stroke, so they lose much of the heat in the exhaust as well.  Having the second intake/compression strokes will pull in fresh air and compress it, leaving it pretty warm.  I know this isn't as ideal as a specially built engine, but I have a feeling it should work, at least a little bit.  At highway speed, a dead miss on one cylinder isn't typically even noticeable on these engines, so hopefully having a little bit of a power stroke from the water will help.  I have also considered the possibility of disabling the system on idle and acceleration, but I'll figure that out if I come to it.

Another thought I had was to convert it to electronically controlled hydraulic valves, Fiat is working on those for the purpose of varying the lift and duration of the valves.  That would be expensive and complicated, but may be feasible in the near future. 

I'm thinking about the same water injector pulse width as the fuel injectors.  Most of the 6 cycles I read about used about the same quantity of fuel and water, but as the water injectors will probably flow more, the pulse could be shorter.  I will probably use fuel injectors for a direct injection engine as they are designed for high temperature and pressure.  They are becoming more and more common in newer production cars.  I won't be doing this for a while (but I'll probably start on the code), I just bought this car to have something to drive while I build up the engine in my street/track car and it is a cheap one to experiment on once my new engine is built.  I might need to find an additive for lubrication and corrosion protection, I was thinking maybe methanol and the lubricant they add in the engines that burn it.  I would need something for freeze protection in colder months (Iowa, USA) anyway, and that should probably work. I would machine a port for the water injectors into the top of the head.  I'm an automotive technician and have worked on and modified lots of engines, and I know I can do the mechanical and electrical parts, but I will likely need a great deal of help with the programming part.  I will detail the entire process if I end up doing this.  This engine is sequentially injected, so I won't have to do anything with the stock ECU.  I also have HP Tuners, a PCM tuning system that lets me control almost everything about how the engine runs.  I can even set it to not turn on the check engine light for the fuel injector circuit trouble codes that would probably set from opening the power supply to disable the injectors.

I don't think I should need a way to directly measure the crank position.  The stock PCM does this already, and fires a coil at "x" degrees before TDC.  At higher RPMs they have more advance because the fuel takes time to burn and build pressure, I think the water would take time to vaporize as well.  I'm hoping for the water to be injected as soon as the spark occurs for that cylinder.  For disabling the injectors, I'll be using a depletion mode MOSFET for each fuel injector.  Currently the fuel injectors have one power wire from a relay with a splice under the upper intake manifold that has 6 wires coming out of it, so all I have to do is run individual power to each injector.  For enable and disable RPM, I can just measure the time between  coil firings.  On this engine, 3 coils are used that fire on two companion cylinders at the same time.  Companion cylinders reach TDC at the same time, one on exhuast and one on compression, so coil pulses on one coil per minute equals RPM. I don't think I should have to measure the throttle or MAP, because the time the fuel injectors are commanded on is already calculated by the PCM based on these inputs.  I'm hoping to just multiply that by a number to get how long to fire the water injector (after measuring the flow rate), and it's possible it could even be the same time.


You'll need some additional way of telling whether the spark is for a particular cylinder, perhaps a flip-flop readable by the Arduino that is set by a spark to a particular cylinder and cleared by a spark to the next cylinder.


I think I should be able to tell what cylinder the spark is for by looking at which fuel injector fired most recently.

mdkoskenmaki

#4
Feb 06, 2012, 07:47 am Last Edit: Feb 06, 2012, 07:52 am by mdkoskenmaki Reason: 1
Your idea is interesting, but let me make some points.    

1.  Does the engine have individual valve lockout?    If not, this idea (6 stroke) is impossible.  

2.  If you do not let the exhaust out after the combustion cycle, all ( and more) energy will be lost recompressing the now hot and expanded products of combustion.   This means leaving the valve open well past TDC, or you have a severe backpressure issue.  

3.  Cooling the combustion chamber after the exhaust stroke, by injecting water on the next compression stroke will cause your engine to be extremely inefficient with very large heat loss to the pistons, cylinder walls, and combustion chamber in the head at the next cumbustion cycle.   Additionally, the cold ( cooled ) cylinders will cause the actual combustion to be much less efficient.  

4.  If your goal is just to improve efficiency of the motor,  re-write your advance and fuel curves and re-write them for maximum economy ( timing for peak pressures that don't detonate or just aren't too far advanced, never richer than the stoichiometric ratio for your fuel.  

Number 4 is worth anywhere from 5 to 30% fuel economy gain on modern emission controlled engines, current emissions calibrations rob your economy quite a bit compared to best economy calibration - and best economy calibration will generally only exceed Oxides of Nitrogen above limits occaisionally.  

+++++++++++++++++++++++++++++

5 of every 4 people have math issues.

Go Up