Regia is the system description diagram
Saturday, September 22, 2012
Monday, September 3, 2012
Wednesday, August 15, 2012
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.
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:
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
Monday, November 30, 2009
Engine Management: Ignition Primary Circuits
Before starting the real Injection system, is important to understand what is key and important to know.
Let's start from the Aprilia Caponord ECU Injection system:

Therefore each injection coil is connected to +12V directly and grounded via the ECU circuit, the ECU Injector driver circuit looks like this:

The above picture represent a simple ECU circuit to drive the Fuel Injector. In essence, the ECU (the XE164 in the case of MaxPowerCMD) drives the first BJT transistor that acts as a voltage buffer to being able to drive the power MOS with higher voltages than the uC power supply (Aprilia RSV1000 Injector driver circuit is visible at Randomexploits).
Fuel Injectors
Let's copy some useful description of Fuel Injectors (or from Wiki).

Note that the solenoid voltage increases up to about 60V after the power MOS is turned off (as a result of the constant elettro-magnetic field).

Note that the injector solenoid current is quite low, about 0.6A (Mr. Jefferies MyECU declares 1 - 2 A per injector)
Wiki documentation claims that
The above voltage / current measurement scopes are showing a 4msec injection pulsewidth.
In my project MaxPowerCMD is not important to learn how to calculate the Fuel Injection pulsewidth since this is done by the motorbike ECU hardware. The motorbike ECU will feed the MaxPowerCMD with the desired Fuel Injection pulsewidth, but MaxPowerCMD will drive the Injector by changing the injection pulse, as for example:
- motorbike ECU pulsewidth = 5 msec
==> MaxPowerCMD [RPM, trottle, gear, ...] = 110%
==> MapowerCMD will drive a 5.5msec injection pulse
... and so on...
I think now is more clear what has to be done in software by using the powerful XE164 System on Chip.
Let's start from the Aprilia Caponord ECU Injection system:

Therefore each injection coil is connected to +12V directly and grounded via the ECU circuit, the ECU Injector driver circuit looks like this:

The above picture represent a simple ECU circuit to drive the Fuel Injector. In essence, the ECU (the XE164 in the case of MaxPowerCMD) drives the first BJT transistor that acts as a voltage buffer to being able to drive the power MOS with higher voltages than the uC power supply (Aprilia RSV1000 Injector driver circuit is visible at Randomexploits).
Fuel Injectors
Let's copy some useful description of Fuel Injectors (or from Wiki).
The injector is an electromechanical device, which is fed by a 12 volt supply from either the fuel injection relay or the ECM. The injector is supplied with fuel from a common fuel rail. The injector pulse width depends on the input signals seen by the ECM from its various engine sensors, and varies to compensate for cold engine starting and warm-up periods, the initial wide pulse getting narrower as the engine warms to operating temperature. The pulse width also expands under acceleration and contracts under light load conditions. The injector has constant voltage supply while the engine is running and the earth path is switched via the ECM. An example of a typical voltage waveform is shown below in:

Note that the solenoid voltage increases up to about 60V after the power MOS is turned off (as a result of the constant elettro-magnetic field).
Is then easy to understand that every time that ECU drives a current trough the injector solenoid, after an initial set-up time, a fuel injection will occur, as visible in: fuel injection animation.
An electromechanical injector of course takes a short time to react, as it requires a level of magnetism to build before the pintle is lifted off its seat. This time is called the ‘solenoid reaction time’. This delay is important to monitor and can sometimes occupy a third of the total pulse width. A good example of the delay in opening can be seen in the example waveform shown below:

Note that the injector solenoid current is quite low, about 0.6A (Mr. Jefferies MyECU declares 1 - 2 A per injector)
The waveform is ‘split’ into two clearly defined areas. The first part of the waveform is responsible for the electromagnetic force lifting the pintle, in this example taking approximately 0.6 ms. At this point the current can be seen to level off before rising again as the pintle is held open. With this level off ind it can be seen that the amount of time that the injector is held open is not necessarily the same as the time measured. It is not however possible to calculate the time taken for the injector’s spring to fully close the injector and cut off the fuel flow.
Wiki documentation claims that
Injector pulsewidth typically ranges from 4 ms/engine-cycle at idle, to 35 ms per engine-cycle at wide-open throttle. The pulsewidth accuracy is approximately 0.01 ms.
The above voltage / current measurement scopes are showing a 4msec injection pulsewidth.
In my project MaxPowerCMD is not important to learn how to calculate the Fuel Injection pulsewidth since this is done by the motorbike ECU hardware. The motorbike ECU will feed the MaxPowerCMD with the desired Fuel Injection pulsewidth, but MaxPowerCMD will drive the Injector by changing the injection pulse, as for example:
- motorbike ECU pulsewidth = 5 msec
==> MaxPowerCMD [RPM, trottle, gear, ...] = 110%
==> MapowerCMD will drive a 5.5msec injection pulse
... and so on...
I think now is more clear what has to be done in software by using the powerful XE164 System on Chip.
Saturday, November 28, 2009
MaxPowerCMD
Since my old Caponord need some "power injection" and that in any case the Traction Control need engine power adaptation, I thought is time to design my own Power Cmd.
The basic idea is to build up an electronic system to be connected at ECU inputs (trottle position, engine RPM, engine speed, ...) and outputs (injector driving signals, ...) so to change the injections maps during engine operation.
To clarify my initial ideas, I draw this:

So, let's try to explayin (and clarify myself also):
- on the left there is the original Motorbyke ECU, one Injector channel is drawn only. The Aprilia Caponord ECU drives the 4 Injectors exactly in such way: each Injector is connectd to +12V and the low side is switched by ECU (most likely using a power N-MOS), this is what I found from original Aprilia manual:

- between the fuel Injector (drawn on top right) a "fake injector" is inserted: this is needed to scope the Injector signal and to make sure that the ECU sense something and believes that Injector is still connected and working as expected:

- some logic gates must be inserted so to be able to replicate the original ECU signal as it is or to modify it:

- the last blocks is the MaxPowerCMD CPU itself, so the XE164:
.
How it works?
The basic idea is the following:
1- MaxPowerCMD has to sense the time when the motorbyke ECU would like to start an Injection sequence
2- MaxPowerCMD has to sense the Injector ON time at every revolution
==> with all information from 1 and 2, MaxPowerCMD would be able to reproduce the same Injection pulse as the motorbyke ECU would do
3- MaxPowerCMD has to measure the engine RPM
4- MaxPowerCMD has to measure the trottle position
==> with all information from 3 and 4, MaxPowerCMD would be able to access to a new Injection MAP as:

==> the Injection MAP will have to be designed in % way, so 100% would indicate that the MaxPowerCMD will not change the motorbyke Injector pulse width. 50% would indicate a 50% shorter pulse and 150% an 1+1/2 pulse lenght. From this last requirement is now easy to understand why I have designed the logic gate block
to èermit to create an output signal that is shorter or longer then the ECU's imposed. The logic gate implementation also simplify the need to sincronize the MaxPowerCMD with the ECU signals since the MaxPowerCMD will simply impose the BYPASS mode just before any new injection sequence.
Before proceeding with the MaxPowerCMD I think is better to acquire more information about the Aprilia Caponord electronic injection system.
Injectors Test:
Aprilia indicated that a working Injector should have a resistence of about: 11,5 - 13 Ω at 20 °C (68 °F):
The basic idea is to build up an electronic system to be connected at ECU inputs (trottle position, engine RPM, engine speed, ...) and outputs (injector driving signals, ...) so to change the injections maps during engine operation.
To clarify my initial ideas, I draw this:
So, let's try to explayin (and clarify myself also):
- on the left there is the original Motorbyke ECU, one Injector channel is drawn only. The Aprilia Caponord ECU drives the 4 Injectors exactly in such way: each Injector is connectd to +12V and the low side is switched by ECU (most likely using a power N-MOS), this is what I found from original Aprilia manual:

- between the fuel Injector (drawn on top right) a "fake injector" is inserted: this is needed to scope the Injector signal and to make sure that the ECU sense something and believes that Injector is still connected and working as expected:

- some logic gates must be inserted so to be able to replicate the original ECU signal as it is or to modify it:
- the last blocks is the MaxPowerCMD CPU itself, so the XE164:
How it works?
The basic idea is the following:
1- MaxPowerCMD has to sense the time when the motorbyke ECU would like to start an Injection sequence
2- MaxPowerCMD has to sense the Injector ON time at every revolution
==> with all information from 1 and 2, MaxPowerCMD would be able to reproduce the same Injection pulse as the motorbyke ECU would do
3- MaxPowerCMD has to measure the engine RPM
4- MaxPowerCMD has to measure the trottle position
==> with all information from 3 and 4, MaxPowerCMD would be able to access to a new Injection MAP as:

(rows: trottle position; columns: engine RPM speed)
==> the Injection MAP will have to be designed in % way, so 100% would indicate that the MaxPowerCMD will not change the motorbyke Injector pulse width. 50% would indicate a 50% shorter pulse and 150% an 1+1/2 pulse lenght. From this last requirement is now easy to understand why I have designed the logic gate block
to èermit to create an output signal that is shorter or longer then the ECU's imposed. The logic gate implementation also simplify the need to sincronize the MaxPowerCMD with the ECU signals since the MaxPowerCMD will simply impose the BYPASS mode just before any new injection sequence.
Before proceeding with the MaxPowerCMD I think is better to acquire more information about the Aprilia Caponord electronic injection system.
Injectors Test:
Aprilia indicated that a working Injector should have a resistence of about: 11,5 - 13 Ω at 20 °C (68 °F):

Subscribe to:
Posts (Atom)