auto-sync

This commit is contained in:
rusEfi 2016-01-31 11:01:43 -05:00
parent 77f7ad454e
commit a09617c53e
3 changed files with 16 additions and 9 deletions

View File

@ -46,16 +46,19 @@ floatms_t WallFuel::adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PA
if (cisnan(target)) { if (cisnan(target)) {
return 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; float addedToWallsAmount = adjustedFuelPulse * addedToWallCoef;
wallFuel[injectorIndex] = wallFuel[injectorIndex] + addedToWallsAmount - suckedOffWallsAmount; wallFuel[injectorIndex] += addedToWallsAmount - suckedOffWallsAmount;
engine->wallFuelCorrection = result - target; engine->wallFuelCorrection = adjustedFuelPulse - target;
return result; return adjustedFuelPulse;
} }
floatms_t WallFuel::getWallFuel(int injectorIndex) { floatms_t WallFuel::getWallFuel(int injectorIndex) {

View File

@ -43,6 +43,10 @@ private:
class WallFuel { class WallFuel {
public: public:
WallFuel(); 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 adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PARAMETER_S);
floatms_t getWallFuel(int injectorIndex); floatms_t getWallFuel(int injectorIndex);
void reset(); void reset();

View File

@ -916,8 +916,8 @@ fileVersion = { 20160122 }
vssGauge = vehicleSpeedKph, "Speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1 vssGauge = vehicleSpeedKph, "Speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1
rpmAccelerationGa = rpmAcceleration, "rpm delta", "dRpm", 0, 3, 0, 1, 3, 4, 1, 1 rpmAccelerationGa = rpmAcceleration, "rpm delta", "dRpm", 0, 3, 0, 1, 3, 4, 1, 1
massAirFlowValueGa = massAirFlowValue,"Air Flow", "kg/hr", 0, 50, -999, -999, 999, 999, 1, 1 massAirFlowValueGa = massAirFlowValue,"Air Flow", "kg/hr", 0, 50, -999, -999, 999, 999, 1, 1
veValueGauge = veValue, "%", "", 0, 120, 10, 10, 100, 100, 1, 1 veValueGauge = veValue, "fuel: VE", "", 0, 120, 10, 10, 100, 100, 1, 1
deltaTpsGauge = deltaTps, "%", "", 0, 120, 10, 10, 100, 100, 1, 1 deltaTpsGauge = deltaTps, "fuel: tps delta", "", 0, 120, 10, 10, 100, 100, 1, 1
baroCorrectionGauge = baroCorrection,"BaroCorr", "%", 0, 120, 10, 10, 100, 100, 1, 1 baroCorrectionGauge = baroCorrection,"BaroCorr", "%", 0, 120, 10, 10, 100, 100, 1, 1
pedalPositionGauge = pedalPosition,"Pedal Position", "%", 0, 120, 10, 10, 100, 100, 1, 1 pedalPositionGauge = pedalPosition,"Pedal Position", "%", 0, 120, 10, 10, 100, 100, 1, 1
knockCountGauge = knockCount,"Knock count", "count", 0, 120, 10, 10, 100, 100, 1, 1 knockCountGauge = knockCount,"Knock count", "count", 0, 120, 10, 10, 100, 100, 1, 1