bytor
Well-Known Member
The next thing I was curious about functionality wise was the ignition timing operation. Starting with the HEI module, I wanted to understand a bit deeper what was going on especially around how the timing advance was controlled. Here’s the basic 7-pin HEI module block diagram.
I’ll focus on the R, E, and B pins on the HEI module,
The R pin is the reference pulse sent to the ECM. If the engine is turning, the HEI module continually sends this reference pulse to the ECM. The ECM uses the signal for ignition functions but also RPM, fuel injector timing and other functions. It’s a key signal the ECM needs to function. The important thing to remember about this signal is it’s always being sent to the ECM and the frequency changes with RPM.
The B pin is the EST bypass control. The bypass signal is zero volts during cranking (less than 400 rpm or 5 to 15 seconds), then there is 5 volts on this pin after the engine starts to signal the 7-pin module that it should use the signal on the R pin to control timing. When 5v is ‘not’ applied to this pin the HEI module is In bypass mode. Basically meaning the module is operating autonomously and not under the control of the ECM. The pick-up coil signal is the trigger signal for the ignition coil. When the engine is cranking below a predetermined threshold (400 rpm), the computer has no control over the timing. Only when RPM reaches the threshold speed, does the computer take over timing and 5v is applied to the B pin. At this point, the ECM is in full control of the timing advance.
In starting (By-Pass) mode
In run mode (ECM providing timing control)
Pulses and other neat stuff:
The following is info from the Megasquirt site that goes in-depth describing the HEI and interfacing it to their ECM. I modified the section below some to be a bit more generic as I assume the GM ECM works in a similar manor.
http://www.megamanual.com/ms2/GM_7pinHEI.htm
More related info and ECM advance & dwell calculation details. http://www.megasquirt.info/HEIgn.htm
Another detailed HEI write up http://chevythunder.com/ignition_systems_hei_operation.htm
The 4-pin HEI uses a negative-to-positive transition, while the 7/8-pin uses a positive-to-negative transition (though this *might* have changed in some applications). Thus polarity of the reluctor signal is critical to proper function.
In the GM 7/8-pin HEI, the module converts the AC signal from the variable reluctor pick-up {on pins P & N} in the distributor to a 'square wave' tach signal {on pin R} suitable ECM.
HEI does not use the reluctor for dwell control, this is accomplished in the module. Dwell needs to be independent of RPM. Variable reluctor output is RPM dependent with regard to both its width and amplitude of its output. The only thing constant with a variable reluctor output is the location of the zero crossing point with respect to the passing tooth.
Be sure to get the variable reluctor pick-up wires connected properly. Reversing the variable reluctor sensor wires and thus the polarity of the sensor causes the leading voltage to go negative first and the electronics ignores the positive going transition. Thus trigger signal, if ever recognized, is the falling edge of the voltage as the end of the tooth passes.
The only way to get proper triggering at the center of the tooth is to have the positive ½ cycle first (tooth approaching) and the negative ½ cycle last.
The 7/8-pin HEI uses a "next cylinder" advance calculation method. That is, you get the square wave out of the module at (say) 10° BTDC which is used for cranking and limp home mode. To advance the timing ECM waits until the NEXT cylinder to fire to provide an altered signal to the coil.
Reference (tach) pulses come into ECM from pin R at 10° BTDC. At each reference pulse, the period between it and the previous reference pulse is calculated. The difference is used (with a time interpolation technique) to set up the timing pulse for the next ignition event. Specifically, the reference period is added to the time of the current pulse, a calculated amount subtracted for the advance, another amount subtracted for the dwell to determine the rise time.
When the signal is 'high', current flows. When the signal is pulled low, current stops, the magnetic field in the coil collapses, and a spark is produced. Thus, the HEI module fires on the 'trailing edge' of the advance signal. The advance signal is generated by ECM from the tach signal by modifying its duty cycle (pulse width). Larger duty cycles mean less advance, as the spark is delayed by a larger amount. The timing of the trailing edge determines the amount of advance: a longer pulse width means a more delayed, 'retarded' spark, while a shorter pulse width means an earlier 'advanced' spark.
The paragraph above is the key part I was trying to figureout. There is not much out there on this. I figure if this is how the Megasquirt interfaces to the 7-pin module and controls the ignition advance, the GM ECM must send the same modified pulse width signal to the module as well.
Timing Advance Calculations for GM HEI Modules:
This info again is from the Megasquirt site and I assume the GM ECM timing is determined in a similar manor. I’m digging into that now.
In order to fire the coil, the coil must have a dwell period that ends when the advance timing for a spark is correct. The dwell itself must fall within certain limits, or the coil will overheat if dwell is too long, and produce a weak spark if the dwell is too short. So the spark is controlled by the start and stopping of current to the coil. In the MegaSquirtII code:
adv_deg = ign_table(rpm, kpa) + adv_offset + cold_adv_deg
Note that the adv_deg is relative to the trigger, not to TDC. However, MegaTune's ignition table corrects for this, and you fill the table with values relative to TDC. Futhermore, the advance reported by MegaTune is with respect to TDC.
In any ignition system, all of the required events must take place within the time available:
time available = latency time + dwell time + advance
In the MegaSquirtII code, this is calculated as:
dtpred = charge_time + coil_dur + adv_us
It is important to note that we need to estimate dtpred in order to have the correct amount of igntiuon timing advance. The better we estimate dtpred, the more accurately our actual timing will reflect the table and other parameters.
The process of determining the timing events (coil charging and coil spark) is performed as follows:
first, MegaSquirtII predicts the amount of time until the next TDC reference pulse (dtpred). This is done using the time between the last two pulses, the amount by which that time has changed since the pulse before that (the first derivative - dtn), and the amount that the 'change' has changed (second derivative - ddtn).
The equations are:
dtn = tn - tn-1
ddtn = (dtn - dtn-1) / ((dtn + dtn-1)/2)
ddtn-1 = (dtn-1 - dtn-2) / ((dtn-1 + dtn-2)/2)
dddtn = (ddtn - ddtn-1)/((((dtn + dtn-1)/2) + ((dtn-1 + dtn-2)/2))/2)
ddtpred = ddtn + dddtn * dtn
dtpred = dtn + ddtpred * dtn = dtn + (ddtn * dtn) + (dddtn * dtn * dtn)
MegaSquirtII also uses a Kalman filter random error correction algorithm to filter out noises in the ignition signal. The Kalman filter correction is proportional to the difference between current dt2 and last predicted dt2.
Next, the desired amount of ignition advance, in engine degrees, is determined from the appropriate cell of the spark advance table, and converted to µsec based on the current speed of the engine. This value is adv_us.
Finally, the time required for ignition coil dwell (coil_dur) is calculated. In order to optimize both the spark energy and the coil life, MegaSquirtII controls both the firing point (ex. the trailing edge) as well as the charging point (the leading edge) of the signal to the coil. The pulse width of the square wave is the dwell, and it is held within specific limits by MegaSquirtII. Typically, dwell time is between 2.0 milliseconds and 4.0 milliseconds for most ignitions systems.
For the OEM HEI coils set the dwell to
3.5 milliseconds for an in-cap coil (7-pin module),
2.5 milliseconds for a small cap distributor with an external coil (7-pin module).
If the amount of desired dwell is longer than the remaining amount of time available (i.e. coil_dur + adv_us > dtpred, and charge_time = 0), the coil_dur time is shortened and the amount of time available is used (otherwise the timing would be increasingly delayed).
The coil is supplied with 12 volts when the charge_time has passed after the TDC signal from the distributor/crank sensor. It begins to charge. When a further time equal to coil_dur has passed, the current to the coil is shut off, and a spark is produced. Both charge_time and coil_dur vary based on engine rpm (dtpred), desired spark advance (adv_us + adv_offset), and dwell parameters.
I’ll focus on the R, E, and B pins on the HEI module,
The R pin is the reference pulse sent to the ECM. If the engine is turning, the HEI module continually sends this reference pulse to the ECM. The ECM uses the signal for ignition functions but also RPM, fuel injector timing and other functions. It’s a key signal the ECM needs to function. The important thing to remember about this signal is it’s always being sent to the ECM and the frequency changes with RPM.
The B pin is the EST bypass control. The bypass signal is zero volts during cranking (less than 400 rpm or 5 to 15 seconds), then there is 5 volts on this pin after the engine starts to signal the 7-pin module that it should use the signal on the R pin to control timing. When 5v is ‘not’ applied to this pin the HEI module is In bypass mode. Basically meaning the module is operating autonomously and not under the control of the ECM. The pick-up coil signal is the trigger signal for the ignition coil. When the engine is cranking below a predetermined threshold (400 rpm), the computer has no control over the timing. Only when RPM reaches the threshold speed, does the computer take over timing and 5v is applied to the B pin. At this point, the ECM is in full control of the timing advance.
In starting (By-Pass) mode
In run mode (ECM providing timing control)
Pulses and other neat stuff:
The following is info from the Megasquirt site that goes in-depth describing the HEI and interfacing it to their ECM. I modified the section below some to be a bit more generic as I assume the GM ECM works in a similar manor.
http://www.megamanual.com/ms2/GM_7pinHEI.htm
More related info and ECM advance & dwell calculation details. http://www.megasquirt.info/HEIgn.htm
Another detailed HEI write up http://chevythunder.com/ignition_systems_hei_operation.htm
The 4-pin HEI uses a negative-to-positive transition, while the 7/8-pin uses a positive-to-negative transition (though this *might* have changed in some applications). Thus polarity of the reluctor signal is critical to proper function.
In the GM 7/8-pin HEI, the module converts the AC signal from the variable reluctor pick-up {on pins P & N} in the distributor to a 'square wave' tach signal {on pin R} suitable ECM.
HEI does not use the reluctor for dwell control, this is accomplished in the module. Dwell needs to be independent of RPM. Variable reluctor output is RPM dependent with regard to both its width and amplitude of its output. The only thing constant with a variable reluctor output is the location of the zero crossing point with respect to the passing tooth.
Be sure to get the variable reluctor pick-up wires connected properly. Reversing the variable reluctor sensor wires and thus the polarity of the sensor causes the leading voltage to go negative first and the electronics ignores the positive going transition. Thus trigger signal, if ever recognized, is the falling edge of the voltage as the end of the tooth passes.
The only way to get proper triggering at the center of the tooth is to have the positive ½ cycle first (tooth approaching) and the negative ½ cycle last.
The 7/8-pin HEI uses a "next cylinder" advance calculation method. That is, you get the square wave out of the module at (say) 10° BTDC which is used for cranking and limp home mode. To advance the timing ECM waits until the NEXT cylinder to fire to provide an altered signal to the coil.
Reference (tach) pulses come into ECM from pin R at 10° BTDC. At each reference pulse, the period between it and the previous reference pulse is calculated. The difference is used (with a time interpolation technique) to set up the timing pulse for the next ignition event. Specifically, the reference period is added to the time of the current pulse, a calculated amount subtracted for the advance, another amount subtracted for the dwell to determine the rise time.
When the signal is 'high', current flows. When the signal is pulled low, current stops, the magnetic field in the coil collapses, and a spark is produced. Thus, the HEI module fires on the 'trailing edge' of the advance signal. The advance signal is generated by ECM from the tach signal by modifying its duty cycle (pulse width). Larger duty cycles mean less advance, as the spark is delayed by a larger amount. The timing of the trailing edge determines the amount of advance: a longer pulse width means a more delayed, 'retarded' spark, while a shorter pulse width means an earlier 'advanced' spark.
The paragraph above is the key part I was trying to figureout. There is not much out there on this. I figure if this is how the Megasquirt interfaces to the 7-pin module and controls the ignition advance, the GM ECM must send the same modified pulse width signal to the module as well.
Timing Advance Calculations for GM HEI Modules:
This info again is from the Megasquirt site and I assume the GM ECM timing is determined in a similar manor. I’m digging into that now.
In order to fire the coil, the coil must have a dwell period that ends when the advance timing for a spark is correct. The dwell itself must fall within certain limits, or the coil will overheat if dwell is too long, and produce a weak spark if the dwell is too short. So the spark is controlled by the start and stopping of current to the coil. In the MegaSquirtII code:
adv_deg = ign_table(rpm, kpa) + adv_offset + cold_adv_deg
Note that the adv_deg is relative to the trigger, not to TDC. However, MegaTune's ignition table corrects for this, and you fill the table with values relative to TDC. Futhermore, the advance reported by MegaTune is with respect to TDC.
In any ignition system, all of the required events must take place within the time available:
time available = latency time + dwell time + advance
In the MegaSquirtII code, this is calculated as:
dtpred = charge_time + coil_dur + adv_us
It is important to note that we need to estimate dtpred in order to have the correct amount of igntiuon timing advance. The better we estimate dtpred, the more accurately our actual timing will reflect the table and other parameters.
The process of determining the timing events (coil charging and coil spark) is performed as follows:
first, MegaSquirtII predicts the amount of time until the next TDC reference pulse (dtpred). This is done using the time between the last two pulses, the amount by which that time has changed since the pulse before that (the first derivative - dtn), and the amount that the 'change' has changed (second derivative - ddtn).
The equations are:
dtn = tn - tn-1
ddtn = (dtn - dtn-1) / ((dtn + dtn-1)/2)
ddtn-1 = (dtn-1 - dtn-2) / ((dtn-1 + dtn-2)/2)
dddtn = (ddtn - ddtn-1)/((((dtn + dtn-1)/2) + ((dtn-1 + dtn-2)/2))/2)
ddtpred = ddtn + dddtn * dtn
dtpred = dtn + ddtpred * dtn = dtn + (ddtn * dtn) + (dddtn * dtn * dtn)
MegaSquirtII also uses a Kalman filter random error correction algorithm to filter out noises in the ignition signal. The Kalman filter correction is proportional to the difference between current dt2 and last predicted dt2.
Next, the desired amount of ignition advance, in engine degrees, is determined from the appropriate cell of the spark advance table, and converted to µsec based on the current speed of the engine. This value is adv_us.
Finally, the time required for ignition coil dwell (coil_dur) is calculated. In order to optimize both the spark energy and the coil life, MegaSquirtII controls both the firing point (ex. the trailing edge) as well as the charging point (the leading edge) of the signal to the coil. The pulse width of the square wave is the dwell, and it is held within specific limits by MegaSquirtII. Typically, dwell time is between 2.0 milliseconds and 4.0 milliseconds for most ignitions systems.
For the OEM HEI coils set the dwell to
3.5 milliseconds for an in-cap coil (7-pin module),
2.5 milliseconds for a small cap distributor with an external coil (7-pin module).
If the amount of desired dwell is longer than the remaining amount of time available (i.e. coil_dur + adv_us > dtpred, and charge_time = 0), the coil_dur time is shortened and the amount of time available is used (otherwise the timing would be increasingly delayed).
The coil is supplied with 12 volts when the charge_time has passed after the TDC signal from the distributor/crank sensor. It begins to charge. When a further time equal to coil_dur has passed, the current to the coil is shut off, and a spark is produced. Both charge_time and coil_dur vary based on engine rpm (dtpred), desired spark advance (adv_us + adv_offset), and dwell parameters.
Last edited: