auto-sync

This commit is contained in:
rusEfi 2016-01-31 11:01:43 -05:00
parent 7c00d9f5f1
commit 7fc6885fd6
2 changed files with 14 additions and 7 deletions

View File

@ -46,16 +46,19 @@ floatms_t WallFuel::adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PA
if (cisnan(target)) {
return target;
}
float addedToWallCoef = engineConfiguration->addedToWallCoef;
float addedToWallCoef = CONFIG(addedToWallCoef);
floatms_t suckedOffWallsAmount = wallFuel[injectorIndex] * engineConfiguration->suckedOffCoef;
/**
* What amount of fuel is sucked of the walls, based on current amount of fuel on the wall.
*/
floatms_t suckedOffWallsAmount = wallFuel[injectorIndex] * CONFIG(suckedOffCoef);
floatms_t result = (target - suckedOffWallsAmount) / (1 - addedToWallCoef);
floatms_t adjustedFuelPulse = (target - suckedOffWallsAmount) / (1 - addedToWallCoef);
float addedToWallsAmount = result * addedToWallCoef;
wallFuel[injectorIndex] = wallFuel[injectorIndex] + addedToWallsAmount - suckedOffWallsAmount;
engine->wallFuelCorrection = result - target;
return result;
float addedToWallsAmount = adjustedFuelPulse * addedToWallCoef;
wallFuel[injectorIndex] += addedToWallsAmount - suckedOffWallsAmount;
engine->wallFuelCorrection = adjustedFuelPulse - target;
return adjustedFuelPulse;
}
floatms_t WallFuel::getWallFuel(int injectorIndex) {

View File

@ -43,6 +43,10 @@ private:
class WallFuel {
public:
WallFuel();
/**
* @param target desired squirt duration
* @return total adjusted fuel squirt duration once wall wetting is taken into effect
*/
floatms_t adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PARAMETER_S);
floatms_t getWallFuel(int injectorIndex);
void reset();