- Mon Jun 15, 2020 9:03 pm
#43693
Hi,
For our race car it would be nice to have the total seconds of injector open time since the last ECU boot.
Knowing how much fuel we've burned is essential so we don't run out on track. The in-tank fuel gauge is useless on track due to fuel slosh.
Knowing the total injector open time to the second is fine, that's plenty of precision for a fuel burn gauge.
I was planning to add a microsecond accumulator in the injectorNOpen() functions to add the PW - inj_open time, and in the main loop check to see if it's over a million and increment the seconds counter, then subtract a million from the us counter.
It'll be up to the user to convert injector open time to units of their choice.
Does anyone have any comments or requests before I implement this?
Also, there's some latent bugs in the main loop regarding the pulsewidth calcs.
Inside the PW() function there are clamps to limit pulse length for the hardware, then in the main loop it then adjusts them with no overflow checks before clamping it to the duty cycle limit. This could lead to some lean conditions at very low RPMs.
For our race car it would be nice to have the total seconds of injector open time since the last ECU boot.
Knowing how much fuel we've burned is essential so we don't run out on track. The in-tank fuel gauge is useless on track due to fuel slosh.
Knowing the total injector open time to the second is fine, that's plenty of precision for a fuel burn gauge.
I was planning to add a microsecond accumulator in the injectorNOpen() functions to add the PW - inj_open time, and in the main loop check to see if it's over a million and increment the seconds counter, then subtract a million from the us counter.
It'll be up to the user to convert injector open time to units of their choice.
Does anyone have any comments or requests before I implement this?
Also, there's some latent bugs in the main loop regarding the pulsewidth calcs.
Inside the PW() function there are clamps to limit pulse length for the hardware, then in the main loop it then adjusts them with no overflow checks before clamping it to the duty cycle limit. This could lead to some lean conditions at very low RPMs.