I'm thinking a simple class d bjt amp powered by the ECM's coil trigger output for each coil. Or FETs if you want to get fancy (possibly higher parts count)? There are also some widely available stepper motor driver DIP ICs that may fit the bill.
My thinking is the uC employs a watchdog timer that triggers relearn. So we haven't seen an input change in a while, watchdog timer fires and says assume the engine isn't running anymore so set a bit in memory and go to sleep (power consumption can be an issue with the arduinos).
Let's assume that the stopping position is 20-30 degrees shy of tdc of a compression stroke. We're either going to be near 1, 4, 6, 7, or 8, 3, 5, 2. Let's also make a huge leap that this is not in a light gap in the wheel (logic low to the uC).
So the user cranks the engine.
The user engages the starter, and the uC picks up a rising edge interrupt that wakes it. We look at the "is it running" bit to see if we need to re-learn the position. We do, so we start counting microseconds until the next falling edge.
The falling edge signal happens and we store the microseconds in variable a.
Now we wait for the next rising edge signal. <thumbs twiddling>
Rising edge signal clicks. Now we count microseconds again until the next falling edge signal.
Falling edge signal happens. Store microseconds in variable b. Compare a to b.
Code:
if ( a > b ) {
c = a / b;
[ some code I haven't thought through completely]
x = (next firing cylinder);
} else {
c = b / a;
[ some code I haven't thought through completely]
x = (next firing cylinder);
}
Once the running bit is set the uC sequences ignition from memory based on the rising edge.
So you say what if the engine is parked in a light gap, and the first signal we see is a falling edge. Simple - set another bit that inverts the sequence detection logic [that I haven't thought out completely].
Easy peezy. I'll think about fleshing out the code on my drive to work tomorrow. There will need to be some fuzzy math allowing for variance in angular velocity during cranking. That's why they made the big gaps larger by multiples of 5.
Bookmarks