mirror of https://github.com/rusefi/rusefi.git
lock injection timing at high duty cycle to avoid skipped injections
This commit is contained in:
parent
6a7700ccfb
commit
c872239f51
|
@ -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;
|
||||
|
||||
|
|
|
@ -81,6 +81,7 @@ public:
|
|||
|
||||
multispark_state multispark;
|
||||
|
||||
bool shouldUpdateInjectionTiming = true;
|
||||
};
|
||||
|
||||
EngineState * getEngineState();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue