Impl. useSeparateVeForIdle/useSeparateAdvanceForIdle (#522)
This commit is contained in:
parent
3f6eaec812
commit
58cff1697e
|
@ -23,6 +23,7 @@
|
|||
#include "interpolation.h"
|
||||
#include "efilib2.h"
|
||||
#include "engine_math.h"
|
||||
#include "tps.h"
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
|
@ -102,6 +103,15 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
|
|||
+ engine->engineState.cltTimingCorrection
|
||||
// todo: uncomment once we get useable knock - engine->knockCount
|
||||
;
|
||||
|
||||
// get advance from the separate table for Idle
|
||||
if (CONFIG(useSeparateAdvanceForIdle)) {
|
||||
float idleAdvance = interpolate2d("idleAdvance", rpm, config->idleAdvanceBins, config->idleAdvance, IDLE_ADVANCE_CURVE_SIZE);
|
||||
// interpolate between idle table and normal (running) table using TPS threshold
|
||||
float tps = getTPS(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
result = interpolateClamped(0.0f, idleAdvance, boardConfiguration->idlePidDeactivationTpsThreshold, result, tps);
|
||||
}
|
||||
|
||||
engine->m.advanceLookupTime = GET_TIMESTAMP() - engine->m.beforeAdvance;
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -262,7 +262,14 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
/**
|
||||
* *0.01 because of https://sourceforge.net/p/rusefi/tickets/153/
|
||||
*/
|
||||
currentVE = baroCorrection * veMap.getValue(rpm, map) * 0.01;
|
||||
float rawVe = veMap.getValue(rpm, map);
|
||||
// get VE from the separate table for Idle
|
||||
if (CONFIG(useSeparateVeForIdle)) {
|
||||
float idleVe = interpolate2d("idleVe", rpm, config->idleVeBins, config->idleVe, IDLE_VE_CURVE_SIZE);
|
||||
// interpolate between idle table and normal (running) table using TPS threshold
|
||||
rawVe = interpolateClamped(0.0f, idleVe, boardConfiguration->idlePidDeactivationTpsThreshold, rawVe, tps);
|
||||
}
|
||||
currentVE = baroCorrection * rawVe * 0.01;
|
||||
targetAFR = afrMap.getValue(rpm, map);
|
||||
} else {
|
||||
baseTableFuel = getBaseTableFuel(rpm, engineLoad);
|
||||
|
|
Loading…
Reference in New Issue