it compiles

This commit is contained in:
alrijleh 2024-09-05 00:30:27 -04:00
parent 6d9ec67194
commit 9a4b637aa9
3 changed files with 22 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#include "engine_configuration.h"
#include "sensor.h"
#include "rusefi/interpolation.h"
#include "dfco.h"
@ -26,7 +27,11 @@ bool DfcoController::getState() const {
float rpm = Sensor::getOrZero(SensorType::Rpm);
float vss = Sensor::getOrZero(SensorType::VehicleSpeed);
bool mapActivate = map.value_or(0) < engineConfiguration->coastingFuelCutMap;
float mapThreshold = engineConfiguration->useTableForDfcoMap ?
interpolate2d(rpm, engineConfiguration->dfcoMapRpmValuesBins, engineConfiguration->dfcoMapRpmValues) :
engineConfiguration->coastingFuelCutMap;
bool mapActivate = map.value_or(0) < mapThreshold;
bool tpsActivate = tps.Value < engineConfiguration->coastingFuelCutTps;
bool cltActivate = clt.Value > engineConfiguration->coastingFuelCutClt;
// True if throttle, MAP, and CLT are all acceptable for DFCO to occur

View File

@ -216,6 +216,8 @@ struct_no_prefix engine_configuration_s
#define ADC_CHANNEL_NONE 0
#define TPS_TPS_ACCEL_CLT_CORR_TABLE 4
#define DFCO_RPM_MAP_TABLE 4
#define BARO_CORR_SIZE 4
#define MAF_DECODING_COUNT 64
@ -1247,6 +1249,9 @@ tChargeMode_e tChargeMode;
int16_t coastingFuelCutClt;Fuel cutoff is disabled when the engine is cold.;"C", 1, 0, -100, 100, 0
int16_t pidExtraForLowRpm;Increases PID reaction for RPM<target by adding extra percent to PID-error;"%", 1, 0, 0, 100, 0
bit useTableForDfcoMap,"Table","Fixed";Use a fixed MAP value as DFCO threshold, or vary the threshold with RPM. This allows a softer cut at high RPMs where greater vaccuum is generated.
uint8_t[DFCO_RPM_MAP_TABLE] autoscale dfcoMapRpmValuesBins;;"RPM", 100, 0, 0, 17500, 0
uint8_t[DFCO_RPM_MAP_TABLE] autoscale dfcoMapRpmValues;;"MAP", 1, 0, 0, 50, 0
int16_t coastingFuelCutMap;MAP value above which fuel injection is re-enabled.;"kPa", 1, 0, 0, 250, 0

View File

@ -376,6 +376,14 @@ enable2ndByteCanID = false
yBins = dwellVoltageCorrValues
gauge = VBattGauge
curve = dfcoMapRpmCorrection, "DFCO RPM MAP Correction"
columnLabel = "Engine Speed", "DFCO Threshold"
xAxis = 0, 8000, 9
yAxis = 0, 60, 6
xBins = dfcoMapRpmValuesBins, RPMValue
yBins = dfcoMapRpmValues
gauge = RPMGauge
curve = tpsTspRpmCorrection, "TPS/TPS AE RPM Correction"
columnLabel = "RPM", "Multiplier"
xAxis = 0, 8000, 9
@ -1745,6 +1753,7 @@ menuDialog = main
subMenu = iatFuelCorrCurve, "IAT multiplier", 0, {isInjectionEnabled == 1}
subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1}
subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1}
subMenu = dfcoMapRpmCorrection, "DFCO MAP to RPM threshold", 0, {isInjectionEnabled && useTableForDfcoMap }
subMenu = std_separator
# Injector model
@ -4454,7 +4463,8 @@ dialog = tcuControls, "Transmission Settings"
field = "Vehicle speed cut above", coastingFuelCutVssHigh, {coastingFuelCutEnabled == 1}
field = "Vehicle speed restore below", coastingFuelCutVssLow, {coastingFuelCutEnabled == 1}
field = "Cut fuel below TPS", coastingFuelCutTps, {coastingFuelCutEnabled == 1}
field = "Cut fuel below MAP", coastingFuelCutMap, {coastingFuelCutEnabled == 1}
field = "Cut fuel below MAP mode", useTableForDfcoMap, {coastingFuelCutEnabled == 1}
field = "MAP threshold", coastingFuelCutMap, {coastingFuelCutEnabled && !useTableForDfcoMap}
field = "Fuel cut delay", dfcoDelay, {coastingFuelCutEnabled == 1}
field = "Inhibit closed loop fuel after cut", noFuelTrimAfterDfcoTime, {coastingFuelCutEnabled == 1}