Sunday, December 13, 2009

XE164 Injector pulse measurement

XE164 has to acquire, measure and sincronize to the INJ-in signals (one for each motorbike injectors).
The best way is to use a dedicated XE164 peripheral: the CAPCOM2 unit.

The CAPCOM unit is designed for capturing, measuring various signals in respect to a base timer. The idea is the following:
- a timer is resetted and started once necessary (TIMER7)
- various I/O port signals can be used to capture the timer value at the signal trigger.
Since the same I/O port signal can be used on various capturing units, MaxPowerCMD will:
- INJ-in rising edge is used to capture the delay between the 0 degree and the injection firing time (let's call t1)
- INJ-in falling edge is used to capture the time when the motorbike ECU likes to stop the injection pulse (let's call t2)
Therefore it will be possible to calculate the injection pulsewidth by subtracting t2 from t1, D=t2-t1.

Once the pulsewidth has been calculated, the CAPCOM timer can be reset, so to be ready for the incoming capturing phase.

To configure properly the XE164's CAPCOM is only necessary to estimate correctly the timing scale that the injector events require.
Supposing that the motorbike engine runs at 10000 RPM as max speed, so each injector will fire every 10000/60 Hz, so about 166Hz.
The second parameter to be considered is the measurement accurancy: each injection pulse could be around 2msec, so at least a precision of 0.1msec is required.
0.1 msec x 65535 = 6553.5msec is far enough.

Tuesday, December 1, 2009

MaxPowerCMD: the logic gates

As anticipated, the logic gates have been added between the motorbike ECU Injector signal to the replicated Injector driver.


I have defined it by defining the transfer function table, as:

Once the transfer function have been fully defined, it is now possible to give some examples.

Example 1: Injection Pulsewidth enlargement
In this case, the XE164 will set EN='1' just before that the real motorbike Injection signal will come (called INJ-in in the above table). In this way, the logic gates will act as a pass gate transferring the INJ-in signal to the output (OUT signal). The MaxPowerCMD power MOS will then drive the injector solenoid to lift the pintle. So, exactly following the motorbike ECU imposed sequene without any delay.
Now XE164 can recognize and sincronize the motorbike intention by acquiring the status of INJ-in signal (INJ-in='1' at Time=1). The XE164 knowns the pulsewith from the previous injection cycle and then it will access the Alpha-N table and retrieve the percentage to enlarge or decrease the current injection pulsewidth. XE164 sets the EN='1' so to be sure that even if the motorbike pulse disappear, the OUT will stay high. At this point the XE164 set-up the related timer designed to drive low the EN signal at the righ time (Time = 5).
All the above is depicted in the following plot, from Time = 0 to Time = 6:


Example 2: Injection Pulsewidth shortening
Similar to the above example 1, whenever XE164 needs to shorten the Injector pulsewidth, it can act as depicted from Time = 7 to 12.

Example 3: Injection Pulsewidth anticipation
Similar to the above example 1, whenever XE164 needs to anticipate the Injector pulsewidth, it can act as depicted from Time = 13 to 18. Please note that this operation can be really dangerous for the engine functionality since it could lead to wrong detonation or other bad sideeffcts.

So, to summarize, the logic gates is needed to change the Injection Pulsewidth:

  • EN is used to shortening or postpone it
  • ON is used to enlarge or anticipate it