auto-sync

This commit is contained in:
rusEfi 2015-08-21 15:01:36 -04:00
parent 3961124d9f
commit 8b7397c340
2 changed files with 44 additions and 2 deletions

View File

@ -2,6 +2,19 @@
* @file accel_enrichment.cpp
* @brief Acceleration enrichment calculator
*
* In this file we have three strategies for acceleration/deceleration fuel correction
*
* 1) MAP rate-of-change correction
* 2) TPS rate-of-change correction
* 3) fuel film/wal wetting correction
* AWC Added to Wall Coefficient, %
* AWA Added to Wall Amount
* SOC Sucked Off wall Coefficient, %
* SOA Sucked Off wall amount
* WF current on-Wall Fuel amount
*
*
* http://rusefi.com/wiki/index.php?title=Manual:Software:Fuel_Control
* @date Apr 21, 2014
* @author Dmitry Sidin
* @author Andrey Belomutskiy, (c) 2012-2015
@ -19,6 +32,23 @@ EXTERN_ENGINE
static Logging *logger;
WallFuel::WallFuel() {
wallFuel = 0;
}
floatms_t WallFuel::adjust(floatms_t target DECLARE_ENGINE_PARAMETER_S) {
float suckedOffCoef = 0;
float addedToWallCoef = 0;
floatms_t suckedOffWallsAmount = wallFuel * suckedOffCoef;
floatms_t result = (target - suckedOffWallsAmount) / (1 - addedToWallCoef);
float addedToWallsAmount = result * addedToWallCoef;
wallFuel = wallFuel + addedToWallsAmount - suckedOffWallsAmount;
return result;
}
float AccelEnrichmemnt::getDelta() {
return cb.maxValue(cb.getSize());
}

View File

@ -13,8 +13,9 @@
#include "engine_configuration.h"
#include "cyclic_buffer.h"
//#define MAX_ACCEL_ARRAY_SIZE 64
/**
* this object is used for MAP rate-of-change and TPS rate-of-change corrections
*/
class AccelEnrichmemnt {
public:
AccelEnrichmemnt();
@ -33,6 +34,17 @@ private:
void onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S);
};
class WallFuel {
WallFuel();
floatms_t adjust(floatms_t target DECLARE_ENGINE_PARAMETER_S);
private:
/**
* Amount of fuel on the wall, in injector open time scale
*/
floatms_t wallFuel;
};
void initAccelEnrichment(Logging *sharedLogger);
float getAccelEnrichment(void);