• If you like antique engines, vintage tractors or old iron machinery, register and join us. When you register on Smokstak, please give complete answers and fill in all blanks. IF YOU ARE ON WIRELESS OR SATELLITE, GIVE YOUR CITY AND STATE! NO ZIPCODES! All registrations are manually approved.

Arduino COP Ignition to adjust engine timing for alternate fuels

Pete Spaco

Registered
From time to time I see people over on the Onan Generator forum trying to upgrade the ignition system on the older Onans.

I have been working on an Arduino microcontroller based Coil On Plug ignition system on and off and, although I am not done yet, here's a short progress report:

https://www.youtube.com/watch?v=JUpwmo8bFrc

"Stock" timing is probably okay for most folks, but when running spark ignition engines on alternative fuels like woodgas or producer gas, some useful power gains can be made with timing adjustments. So this system can easily allow for quick or even automatic timing changes over a wide range of conditions.

Also, you eliminate high tension wiring completely, or at least, to a large degree if you take the "Coil Near Plug" route. And most COP packs these days need only a tiny trigger current from the Arduino to fire, so you don't even need to be switching primary coil current externally to the COP pack.

And, the Arduino Uno microcontroller now sells for as low as $3.98 on Ebay. Used COP packs can be found in many places. It appears that many mechanics replace the whole set of them if one goes bad.

Pete Stanaitis
 
L

Lead Head

Guest
Excellent work! Now to combine that with my Arduino EFI project :O
 

Odin

Subscriber
Last Subscription Date
07/13/2019
Bit of a revival, but did you run into trouble with the arduino not liking the EMF kicked up by the coil when it fires?

I made an electronic breaker point of sorts that lets me use a common 12v ignition coil for an experimental engine. When trying to test it using an arduino as a pulse generator to simulate the hall sensor input, the arduino kept freezing and rebooting on me.

My circuit uses an attiny85 instead of an arduino since the features of the larger chip aren't really needed.
 
L

Lead Head

Guest
I had a similar issue when I had an experimental arduino EFI system going on a motorcycle engine. With both ignition coils hooked up, the arduino just continually reset, with only one of them hooked up, it was fine. It was driving me crazy until I realized one of the ignition coils had a resistor-type spark plug boot on it, while the other one didn't. Put a resistor boot on it, and the problem went away instantly.

You absolutely must use resistor-type spark plug wires or a resistor spark plug boot. It might also be a good idea to put a noise suppression capacitor across the coil primary.

How are you triggering your coil? Are you doing it through an opto-isolator?
 

Odin

Subscriber
Last Subscription Date
07/13/2019
Its got an entire MCU between the arduino and the coil. The plug wire being used has a metallic core and is meant for a 1980s continential 4 cylinder. Usually I test it with a Champion J8C plug, though I'll sometimes hook it to other plugs to test them and the prototype engine has a really long plug in it.

Schematics
Assembled coil + controller

The program in the attiny85 microcontroller is programmed to turn the mosfet on when triggered. It then measures the voltage across the mosfet, and when it senses the voltage there has stopped rising it turns the mosfet off again to fire the spark.

Like so it self-tunes to deal with variations in the coil properties, with the 1kv rectifier protecting the mosfet from the coil ring-down and the different attiny pins having their own overvoltage protections.

I was trying to use an arduino on the input of the attiny to simulate a hall sensor being triggered at ~1khz, in the hopes of getting a buzzcoil effect. Instead the coil made so much EMF that just having the arduino anywhere near it made the arduino hang and restart.
 
L

Lead Head

Guest
Before I found a resistor plug boot, just using a piece of automotive carbon resistor wire solved the issue. You also obviously might try distancing the spark plug itself from the arduino.

If possible isolate the arduino from the attiny using opto-isolators and put it on a separate power supply. My setup used an opto-isolator between the arduino and the injector driver, just to eliminate any possible connection to the ignition system.
 

Pete Spaco

Registered
It has been a while since I looked in on this thread.
But you guys have been discussing noise getting into the arduino.

Here are a couple of my thoughts/observations:

I am using a 4-wire coil on plug pak to drive my test spark plug. So, there's NO spark plug wire at all and the whole upper part of the plug is covered by the metallic sheath of the COP pak. During most of my testing to date, I had no resetting or noise issues with the arduino.
But, one day I decided to try a simple inductiively coupled tachometer that my son had given me, just to confirm that my own code was really working accurately. To accomplish this, I had put a 6" piece of spark plug wire up into the COP pak and thence to the (well grounded) plug.
Well, then I had all sorts of noise problems. On my test setup, I had to construct a sizable grounded metal shield to get things back into control.

Pete Stanaitis
----------------
 

OTTO-Sawyer

Subscriber
Age
57
Last Subscription Date
07/15/2019
Just found this thread and what you're doing.

Figured I'd give you a thread bump and link your latest video.

Looks like you're getting close.



I just subscribed to your YouTube channel too while I was there.

:salute:
 

DustyBar

Subscriber
Last Subscription Date
01/14/2020
Yes, it would be nice to see some code. I've been interested in something like this but really don't know where to begin. Are there similarities doing this with an Arduino or Raspberry PI? I've been interested in the Ras PI for several years but haven't bought one yet.
 
L

Lead Head

Guest
RasPi could probably be used to do something like that, but the RasPi is more like a general purpose mini-computer, that runs a full operating system.

The arduino is a micro-controller, which you program to do a specific task.
 

Vanman

Subscriber
Last Subscription Date
07/10/2019
It would be interesting to see how much the part load fuel consumption could be improved by incorporating vacuum advance into this setup...
 

Pete Spaco

Registered
Here's the latest video:
https://www.youtube.com/watch?v=sYHnmFgdZqs

I have done some shielding, twisted some Hall sensor wiring and added a switch to disconnect the Onan's coil primary when using the Arduino setup since then. These changes have improved run-ability quite a bit but there's still a ways to go. Today I went out and bought some metal boxes and I think I have found some shielded wire. I will add those things soon.

I would be glad to share my code, but it is still kinda messy.

Pete Stanaitis
----------------
 

Pete Spaco

Registered
re: adding vacuum advance:
Once I get the engine running smoothly on the Arduino, the next step is to add the ability to change timing on the fly. I will probably code in the range of TDC to about 60 degrees advance.

Pete Stanaitis
---------------
 
L

Lead Head

Guest
Re: Vacuum advance.

Since the engine runs at a fixed speed, you wouldn't even need vacuum advance. The only thing you'd need would be throttle/governor position via. potentiometer. A simple 1-dimensional look-up table could provide could relate spark advance to a specific throttle position (load).

An easy way to create that look up table, would be to have a potentiometer monitoring the governor/throttle position, and another pot hooked up to control the timing. You'll need a variety of loads for the generator to test. But basically you'd adjust the timing manually until you achieve the lowest throttle opening at a given load without knocking, then write down the particular throttle opening % and degrees of advance. Then build a look up table with the values you recorded. Then you just set the micro-controller to set the timing based on the reported throttle opening.
 

Pete Spaco

Registered
Lead Head: Yup.
But there's more to it than that. I have to be able to anticipate changes in the quality of the fuel, hopefully before I lose engine power. So there are other variables to deal with. Reactor temperature and below-grate suction, for example. Once those variables have been characterized, we need to do something to the fuel production system to correct for those changes. Shaking the grate and adding fuel (wood chips in my case) are two of several options.
Others have made much more progress than have I, but they have gasifiers that are very different from mine.
I probably should start all over, but I guess I'm a glutton for punishment.

Pete Stanaitis
---------------
 
L

Lead Head

Guest
That link is to your own user video control panel. Not your channel. So if I click that link, I just see my own videos.
 
Top