lock injection timing at high duty cycle to avoid skipped injections

This commit is contained in:
Matthew Kennedy 2023-10-11 23:43:31 -07:00 committed by rusefi
parent 6a7700ccfb
commit c872239f51
4 changed files with 9 additions and 5 deletions

View File

@ -175,6 +175,8 @@ void EngineState::periodicFastCallback() {
timingAdvance[i] = correctedIgnitionAdvance + getCombinedCylinderIgnitionTrim(i, rpm, ignitionLoad);
}
shouldUpdateInjectionTiming = getInjectorDutyCycle(rpm) < 90;
// TODO: calculate me from a table!
trailingSparkAngle = engineConfiguration->trailingSparkAngle;

View File

@ -81,6 +81,7 @@ public:
multispark_state multispark;
bool shouldUpdateInjectionTiming = true;
};
EngineState * getEngineState();

View File

@ -276,10 +276,6 @@ float getInjectionModeDurationMultiplier() {
}
}
/**
* This is more like MOSFET duty cycle since durations include injector lag
* @see getCoilDutyCycle
*/
percent_t getInjectorDutyCycle(int rpm) {
floatms_t totalInjectiorAmountPerCycle = engine->engineState.injectionDuration * getNumberOfInjections(engineConfiguration->injectionMode);
floatms_t engineCycleDuration = getEngineCycleDuration(rpm);

View File

@ -105,7 +105,12 @@ bool InjectionEvent::updateInjectionAngle(int cylinderIndex) {
auto result = computeInjectionAngle(cylinderIndex);
if (result) {
injectionStartAngle = result.Value;
// If injector duty cycle is high, lock injection SOI so that we
// don't miss injections at or above 100% duty
if (getEngineState()->shouldUpdateInjectionTiming) {
injectionStartAngle = result.Value;
}
return true;
} else {
return false;