2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file fuel_math.h
|
|
|
|
*
|
|
|
|
* @date May 27, 2013
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2019-10-07 22:49:42 -07:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#include "engine.h"
|
2020-06-06 04:25:19 -07:00
|
|
|
#include "airmass.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-01-10 20:48:05 -08:00
|
|
|
void initFuelMap(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return total injection time into all cylinders, before CLT & IAT corrections
|
|
|
|
*/
|
2017-05-15 20:33:22 -07:00
|
|
|
floatms_t getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return baseFuel with CLT and IAT corrections
|
|
|
|
*/
|
2017-05-15 20:33:22 -07:00
|
|
|
floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-05-15 20:33:22 -07:00
|
|
|
float getBaroCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|
|
|
int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2020-07-20 23:11:48 -07:00
|
|
|
angle_t getInjectionOffset(float rpm, float load DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2020-04-18 15:45:30 -07:00
|
|
|
float getIatFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2017-05-15 20:33:22 -07:00
|
|
|
floatms_t getInjectorLag(float vBatt DECLARE_ENGINE_PARAMETER_SUFFIX);
|
|
|
|
float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2018-03-22 10:37:34 -07:00
|
|
|
float getFuelCutOffCorrection(efitick_t nowNt, int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2017-05-15 20:33:22 -07:00
|
|
|
angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2020-06-17 14:15:04 -07:00
|
|
|
floatms_t getCrankingFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2020-06-18 05:54:02 -07:00
|
|
|
floatms_t getCrankingFuel3(floatms_t baseFuel, uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2017-05-15 20:33:22 -07:00
|
|
|
floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
|
|
|
|
percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2017-12-31 16:25:59 -08:00
|
|
|
|
2020-05-05 05:01:40 -07:00
|
|
|
float getStandardAirCharge(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|
|
|
|
2017-12-31 16:25:59 -08:00
|
|
|
// convert injection duration (Ms/Nt) to fuel rate (L/h)
|
|
|
|
float getFuelRate(floatms_t totalInjDuration, efitick_t timePeriod DECLARE_ENGINE_PARAMETER_SUFFIX);
|