From a09617c53eb4351c624e7023ccd52e1491c1c774 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sun, 31 Jan 2016 11:01:43 -0500 Subject: [PATCH] auto-sync --- firmware/controllers/algo/accel_enrichment.cpp | 17 ++++++++++------- firmware/controllers/algo/accel_enrichment.h | 4 ++++ firmware/tunerstudio/rusefi.ini | 4 ++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index 47a4e18943..07c734e2c7 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -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) { diff --git a/firmware/controllers/algo/accel_enrichment.h b/firmware/controllers/algo/accel_enrichment.h index 66d7ef5fa4..82daa8118c 100644 --- a/firmware/controllers/algo/accel_enrichment.h +++ b/firmware/controllers/algo/accel_enrichment.h @@ -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(); diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index fc6eeb29df..d0a2750499 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -916,8 +916,8 @@ fileVersion = { 20160122 } 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 massAirFlowValueGa = massAirFlowValue,"Air Flow", "kg/hr", 0, 50, -999, -999, 999, 999, 1, 1 - veValueGauge = veValue, "%", "", 0, 120, 10, 10, 100, 100, 1, 1 - deltaTpsGauge = deltaTps, "%", "", 0, 120, 10, 10, 100, 100, 1, 1 + veValueGauge = veValue, "fuel: VE", "", 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 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