rusefi-1/firmware/controllers/algo/accel_enrichment.h

61 lines
1.4 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file accel_enrichment.h
* @brief Acceleration enrichment calculator
*
* @date Apr 21, 2014
* @author Dmitry Sidin
* @author Andrey Belomutskiy, (c) 2012-2015
*/
#ifndef ACC_ENRICHMENT_H_
#define ACC_ENRICHMENT_H_
#include "engine_configuration.h"
#include "cyclic_buffer.h"
2015-08-21 12:01:36 -07:00
/**
* this object is used for MAP rate-of-change and TPS rate-of-change corrections
*/
2015-07-10 06:01:56 -07:00
class AccelEnrichmemnt {
public:
AccelEnrichmemnt();
2015-08-23 18:03:42 -07:00
/**
* @return Extra MAP value for Speed Density calculation
*/
2015-07-10 06:01:56 -07:00
float getMapEnrichment(DECLARE_ENGINE_PARAMETER_F);
2015-08-23 18:03:42 -07:00
/**
* @return Extra fuel squirt duration for TPS acceleration
*/
2015-07-10 06:01:56 -07:00
floatms_t getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F);
float getDelta();
void onEngineCycle(DECLARE_ENGINE_PARAMETER_F);
void onEngineCycleTps(DECLARE_ENGINE_PARAMETER_F);
void reset();
float delta;
cyclic_buffer<float> cb;
private:
float currentValue;
void onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S);
};
2015-08-21 12:01:36 -07:00
class WallFuel {
2015-08-23 18:03:42 -07:00
public:
2015-08-21 12:01:36 -07:00
WallFuel();
2015-08-23 20:02:37 -07:00
floatms_t adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PARAMETER_S);
floatms_t getWallFuel(int injectorIndex);
2015-08-21 12:01:36 -07:00
private:
/**
2015-08-23 20:02:37 -07:00
* Amount of fuel on the wall, in injector open time scale, for specific injector.
2015-08-21 12:01:36 -07:00
*/
2015-08-23 20:02:37 -07:00
floatms_t wallFuel[INJECTION_PIN_COUNT];
2015-08-21 12:01:36 -07:00
};
2015-07-10 06:01:56 -07:00
void initAccelEnrichment(Logging *sharedLogger);
float getAccelEnrichment(void);
#endif /* ACC_ENRICHMENT_H_ */