Thursday, July 23, 2009

Honda Mileage Device VID

This morning I finally implemented the changes required to fully make it possible to programmaticlly alter the fuel injection edge detection levels. I installed a divider resistor on the injector input line. I then wired the output of the CPU reference voltage circuit to pin 7 of the LM339 voltage comparator. Along the way, I had to make a small change in the program. In two places in the code, the program was blocking on [while] loops while waiting for the injector input line to go either high or low. Normally, when the injector comparator levels are set correctly, the resting voltage for the injector is 12 volts. However, if one or the other of the comparator reference voltages do not fall within the proper range, the interrupt line could get stuck in the wrong state--freezing up the program.I, therefore, added code to break out of the while loop after a 2 ms time delay. So, with that fixed, I was able to alter the comparator voltage level (using the setup program) until the the device started to work.


In this image, the scaled injector signal is shown in blue. The CPU voltage reference signal is in red. The voltage scale is 2 volts per unit. The time units is 500 microseconds. Notice, how the voltage reference signal moves to a low value ahead of the falling edge of the scaled injector signal. This shows how the device captures the leading edge of the injector signal.


This image shows the trailing edge of the injector signal. Notice how the voltage reference has assumed a value of around 2.75 volts before the injector signal begins to turn off--then goes low to wait for the next injector pulse. Note: the voltage reference level is capable of being programmed through the entire range of the injector signal swing. In this example, it was set for about 0 volts and 2.75.

Obliviously, this simulated injector signal is derived from a resistor and not an inductor. Had this been a real fuel injector, the (falling) leading edge would have taken almost a millisecond to reach full saturation-- meaning that the falling edge would have followed the characteristic exponent charging curve of an inductor. If this had been a peak-&-hold fuel injector type, it would have reached saturation sooner because it would have been of a lower impedance than saturated types. Once it reached full saturation, the ECU would have then reduced the current flow. The voltage reading at the injector would have responded by moving to a higher resting (2/3 point) level. It would have then remained at this higher plateau for the duration of the pulse, before being turned off completely and going to 12 volts. Obviously,the two step nature of the peak&hold injector presents certain challenges to any measurement circuit.

Therefore, for this particular measurement circuit to work, I decided that the the CPU controlled reference voltage would need to actually track the injector pulse by setting itself at a relatively low value during injector off time, and then moving to a point higher than the injector plateau level ahead of the injector current reduction commanded by the ECU.

Therefore by using the provisions of the 18F2520 programmable internal reference voltage, the user is now able to program the device to track these two levels with two injector comparator constants. For example, in a typical saturated type fuel injector system, the ECU pulls current through each injector by forward biasing an open collector power transistor. This collector is tied to one end of the fuel injector. The other end is ether tied directly to 12 volts, or, to a ballast resistor that is in turned tried to 12 volts. The measurement point for the VID is usually a point common to the open collector of the ECU transistor. If one puts a scope on this point, he would see that the transistor is pulling the line down from 12 volts zero volts each time it fires..
The VID injector input sees this same signal except that due to the input voltage divider it sees a scaled down version of it-i.e the signal now swings from 3.2 down to 0 volts.

The internal voltage reference has 16 possible programmable voltage levels. (0-15) The transfer function is therefore

Vout = ( (4 bit value) / 24) * 5;

low range = 5 * (0x00vref/24) = 0 volts

high range = 5 (0x0Fvref/24) = 3.15 volts

Example 1:

if the desired unscaled voltage threshold for this case is 6 volts and the scaling factor is 4.4 then
the actual scaled voltage is 1.36 volts. To make this happen with a VCC of 5 volts:

(4 bit value) = (1.36vref / 5vcc) * 24
= (6.52)
= (7)

We can program a value of 7 into both constants for the device and all will be well for this saturated type device. Reference_L(ow) and Reference_H(high) would be set to 7.


Example Two:

A peak and hold type injector with an open collector type ECU. For the falling edge, 6 volts might also be adequate so we already know that Reference_L would be set to 7.

The value of the rising edge should be somewhatlower than 12 volts but higher than the highest plateau voltage we could expect to see. For this example, lets use a value of 10 volts.

10 volts / 4.4 scaling factor = 2.27 volts

4 bit binary value = (5vcc/2.27) * 24
= 10.9
ReferenceH = 11



We have now talked about computing comparator levels. But how does the user program different comparator levels into the device? The answer: By using the Windows interface program, the user can now set the two reference levels at the same time he/she sets the Fuel and Distance Constant. In the lower left portion of this dialog box are two entry boxes labeled Reference_L and Reference_H. In this image, they are set for 1 and 10 respectively. The reader may notice that other two entry boxes labeled ECU_type and Timebase. For most vehicles, the ECU_Type will be set to 0. In some rare cases, this could be changed to 1. Setting ECU_type to 1 tells the VID that the vehicle's ECU is pulling the injectors to 12 volts from zero volts, instead of pulling them down to zero volts (from 12 volts) as in most vehicles.Timebase is set to a divider of 1.0. Since the basic time base of the VID is 1 second.. setting time base to 1 sets the VID time base to 1 second. A value of 2 here would set the VID time base to 500 milliseconds.

For information about Fuel and Distance Constants, please refer to an earlier blog entry.

The VID comes programmed with Reference_L and Reference_H programmed with values corresponding to 6 volts. That should satisfy most of the saturated type fuel injector vehicles. However, if it does not, then the user would experiment with these two constants until the VID readings (at idle) make sense.

No comments:

Post a Comment