Remove warmup afr pid (#879)

* config changes

* actually remove from config

* rip out implementation
This commit is contained in:
Matthew Kennedy 2019-07-18 15:26:18 -07:00 committed by rusefi
parent 7800585cf6
commit 21d1b25c5e
12 changed files with 8 additions and 93 deletions

View File

@ -256,12 +256,6 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setFrankenso_01_LCD(boardConfiguration);
setFrankenso0_1_joystick(engineConfiguration);
// boardConfiguration->useWarmupPidAfr = true;
engineConfiguration->warmupAfrPid.pFactor = -0.2;
engineConfiguration->warmupAfrPid.iFactor = -0.0005;
// engineConfiguration->warmupAfrPid.dFactor = -0.02;
engineConfiguration->debugMode = DBG_WARMUP_ENRICH;
// set global_trigger_offset_angle 38
engineConfiguration->globalTriggerAngleOffset = 38;
// set injection_offset 0

View File

@ -274,13 +274,6 @@ void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
copyTimingTable(racingFestivaIgnitionTable, config->ignitionTable);
#endif
// boardConfiguration->useWarmupPidAfr = true;
engineConfiguration->warmupAfrPid.pFactor = -0.2;
engineConfiguration->warmupAfrPid.iFactor = -0.0005;
// engineConfiguration->warmupAfrPid.dFactor = -0.02;
engineConfiguration->debugMode = DBG_WARMUP_ENRICH;
engineConfiguration->tpsAccelEnrichmentThreshold = 40;
engineConfiguration->engineLoadAccelEnrichmentThreshold = 5.0;

View File

@ -607,8 +607,8 @@ case DBG_VEHICLE_SPEED_SENSOR:
return "DBG_VEHICLE_SPEED_SENSOR";
case DBG_VVT:
return "DBG_VVT";
case DBG_WARMUP_ENRICH:
return "DBG_WARMUP_ENRICH";
case DBG_2:
return "DBG_2";
case Force_4_bytes_size_debug_mode_e:
return "Force_4_bytes_size_debug_mode_e";
}

View File

@ -198,7 +198,6 @@ void Engine::setConfig(persistent_config_s *config) {
this->config = config;
engineConfigurationPtr = &config->engineConfiguration;
memset(config, 0, sizeof(persistent_config_s));
engineState.warmupAfrPid.initPidClass(&config->engineConfiguration.warmupAfrPid);
}
void Engine::printKnockState(void) {

View File

@ -132,11 +132,6 @@ void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
}
#endif
engine->sensors.oilPressure = getOilPressure(PASS_ENGINE_PARAMETER_SIGNATURE);
// todo: should this feature get removed?
// it does the same thing as the warmup CLT multiplier
warmupTargetAfr = interpolate2d("warm", engine->sensors.clt, engineConfiguration->warmupTargetAfrBins,
engineConfiguration->warmupTargetAfr);
}
void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
@ -163,22 +158,7 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
// todo: move this into slow callback, no reason for IAT corr to be here
iatFuelCorrection = getIatFuelCorrection(engine->sensors.iat PASS_ENGINE_PARAMETER_SUFFIX);
// todo: move this into slow callback, no reason for CLT corr to be here
if (CONFIGB(useWarmupPidAfr) && engine->sensors.clt < engineConfiguration->warmupAfrThreshold) {
if (rpm < 200) {
cltFuelCorrection = 1;
warmupAfrPid.reset();
} else {
cltFuelCorrection = warmupAfrPid.getOutput(warmupTargetAfr, engine->sensors.currentAfr, MS2SEC(FAST_CALLBACK_PERIOD_MS));
}
if (engineConfiguration->debugMode == DBG_WARMUP_ENRICH) {
#if EFI_TUNER_STUDIO
tsOutputChannels.debugFloatField1 = warmupTargetAfr;
warmupAfrPid.postState(&tsOutputChannels);
#endif /* EFI_TUNER_STUDIO */
}
} else {
cltFuelCorrection = getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
}
cltFuelCorrection = getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
// update fuel consumption states
fuelConsumption.update(nowNt PASS_ENGINE_PARAMETER_SUFFIX);

View File

@ -879,15 +879,6 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
setDefaultCrankingSettings(PASS_ENGINE_PARAMETER_SIGNATURE);
engineConfiguration->warmupTargetAfrBins[0] = -12;
engineConfiguration->warmupTargetAfr[0] = 12.3;
engineConfiguration->warmupTargetAfrBins[1] = 0;
engineConfiguration->warmupTargetAfr[1] = 13;
engineConfiguration->warmupTargetAfrBins[2] = 30;
engineConfiguration->warmupTargetAfr[2] = 13.8;
engineConfiguration->warmupTargetAfrBins[3] = 60;
engineConfiguration->warmupTargetAfr[3] = 14.5;
engineConfiguration->fuelClosedLoopCorrectionEnabled = false;
engineConfiguration->fuelClosedLoopCltThreshold = 70;
engineConfiguration->fuelClosedLoopRpmThreshold = 900;
@ -1069,9 +1060,6 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
boardConfiguration->isVerboseAlternator = false;
engineConfiguration->warmupAfrPid.offset = 1;
engineConfiguration->warmupAfrThreshold = 60;
engineConfiguration->engineLoadAccelLength = 6;
engineConfiguration->engineLoadAccelEnrichmentThreshold = 5; // kPa
engineConfiguration->engineLoadAccelEnrichmentMultiplier = 0; // todo: improve implementation and re-enable by default

View File

@ -85,12 +85,6 @@ public:
*/
floatms_t injectorLag = 0;
/**
* See useWarmupPidAfr
*/
Pid warmupAfrPid;
float warmupTargetAfr = 0;
float baroCorrection = 0;
efitick_t timeSinceLastTChargeK;

View File

@ -604,7 +604,7 @@ typedef brain_pin_e output_pin_e;
typedef enum {
DBG_ALTERNATOR_PID = 0,
DBG_TPS_ACCEL = 1,
DBG_WARMUP_ENRICH = 2,
DBG_2 = 2,
DBG_IDLE_CONTROL = 3,
DBG_EL_ACCEL = 4,
DBG_TRIGGER_INPUT = 5,

View File

@ -330,7 +330,6 @@ static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
if (engine->versionForConfigurationListeners.isOld(engine->getGlobalConfigurationVersion())) {
updateAccelParameters();
engine->engineState.warmupAfrPid.reset();
}
engine->periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE);

View File

@ -442,9 +442,6 @@ static void printTemperatureInfo(void) {
scheduleMsg(&logger, "A/C relay=%s @ %s", boolToString(enginePins.acRelay.getLogicValue()),
hwPortname(boardConfiguration->acRelayPin));
scheduleMsg(&logger, "warmupPID=%d corr=%.2f", boardConfiguration->useWarmupPidAfr,
engine->engineState.cltFuelCorrection);
#endif /* EFI_ANALOG_SENSORS */
}

View File

@ -70,8 +70,6 @@ struct_no_prefix engine_configuration_s
! this is here so that rusEfi console can access it, too
#define TS_OUTPUT_SIZE 356
#define WARMUP_TARGET_AFR_SIZE 4
#define MAP_ANGLE_SIZE 8
#define MAP_WINDOW_SIZE 8
@ -164,7 +162,7 @@ float baseFuel;+Base duration of the fuel injection during cranking, this is mod
int16_t rpm;+This sets the RPM limit below which the ECU will use cranking fuel and ignition logic, typically this is around 350-450rpm. \nset cranking_rpm X;"RPM", 1, 0, 0, 3000, 0
end_struct
#define debug_mode_e_enum "Alternator PID", "TPS acceleration enrichment", "Warmup PID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "Aux Temperature", "ETB Logic"
#define debug_mode_e_enum "Alternator PID", "TPS acceleration enrichment", "INVALID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "Aux Temperature", "ETB Logic"
custom debug_mode_e 4 bits, U32, @OFFSET@, [0:5], @@debug_mode_e_enum@@
#define vvt_mode_e_enum "First half", "Second half", "2GZ", "Miata NB2", "mode4", "mode5", "mode6", "mode7"
@ -601,7 +599,7 @@ bit is_enabled_spi_2
bit useTpicAdvancedMode;
bit useLcdScreen;
bit unusedAnotherOne;
bit useWarmupPidAfr;
bit unusedOldWarmupAfr;
bit onOffAlternatorLogic; +This will cause the alternator to be operated in a basic on or off mode, this is the simplest alternator control.
bit isCJ125Enabled
bit vvtCamSensorUseRise;+Use rise or fall signal front
@ -821,7 +819,7 @@ custom pin_mode_e 1 bits, U08, @OFFSET@, [0:6], @@pin_mode_e_enum@@
float wwaeTau;+Length of time the deposited wall fuel takes to dissipate after the start of acceleration. ;"Seconds", 1, 0, 0.0, 3.0, 2
pid_s alternatorControl;
pid_s etb;
pid_s warmupAfrPid;
uint8_t[20] unusedFormerWarmupAfrPid;
! todo: mapErrorDetectionIdleTooLow? 30kPa is usually lowest on idle
float mapErrorDetectionTooLow;kPa value which is too low to be true;"kPa", 1, 0, -100.0, 100.0, 2
@ -885,9 +883,7 @@ custom pin_mode_e 1 bits, U08, @OFFSET@, [0:6], @@pin_mode_e_enum@@
float slowAdcAlpha;+ExpAverage alpha coefficient;"coeff", 1, 0, 0, 200, 3
debug_mode_e debugMode;+See http://rusefi.com/s/debugmode\n\nset debug_mode X
float[WARMUP_TARGET_AFR_SIZE] warmupTargetAfrBins;CLT-based target AFR for PID-based control;"C", 1, 0, -100.0, 250.0, 2
float[WARMUP_TARGET_AFR_SIZE] warmupTargetAfr;;"AFR", 1, 0, 0.0, 20.0, 2
float warmupAfrThreshold;;"temperature", 1, 0, 0, 200, 3
uint32_t[9] unused_former_warmup_target_afr;
float boostCutPressure;kPa value at which we need to cut fuel and spark, 0 if not enabled;"kPa", 1, 0, 0, 500, 0

View File

@ -558,18 +558,6 @@ fileVersion = { 20190701 }
yBins = crankingAdvance
gauge = RPMGauge
curve = warmupTargetAfrCurve, "CLT-based target AFR"
columnLabel = "Coolant", "Correction"
#if CELSIUS
xAxis = -40, 120, 10
#else
xAxis = -40, 250, 10
#endif
yAxis = 0, 50, 10
xBins = warmupTargetAfrBins, coolant
yBins = warmupTargetAfr
gauge = CLTGauge
curve = wueAfrTargetOffsetCurve, "AFR Target Temperature Adjustment"
columnLabel = "Coolant", "AFR Offset"
#if CELSIUS
@ -1247,7 +1235,6 @@ menuDialog = main
# EXPERIMENTAL FEATURES
subMenu = parkingLot, "Experimental/Broken"
subMenu = warmupTargetAfrCurve, "Warmup fuel auto correction AFR target"
subMenu = smLaunchControl, "Launch control"
subMenu = std_separator
@ -2111,16 +2098,6 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "#% duty = Pterm + Iterm + Dterm + offset%"
dialog = warmupFuelDialog, "Warmup fuel closed-loop", yAxis
field = "use automatic Pid Afr control", useWarmupPidAfr
field = "warmup temperature Threshold", warmupAfrThreshold
field = "wa offset", warmupAfrPid_offset
field = "wa P factor", warmupAfrPid_pFactor
field = "wa I factor", warmupAfrPid_iFactor
field = "wa D factor", warmupAfrPid_dFactor
field = "#correction = Pterm + Iterm + Dterm + offset"
dialog = energySystems, "Battery and Alternator Settings", yAxis
panel = batteryDialog
panel = alternator
@ -2585,8 +2562,6 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "MAP Averaging Logic @", mapAveragingSchedulingAtIndex
field = "Target temperature", postCrankingTargetClt
panel = warmupFuelDialog
[Tools]
;addTool = toolName, PanelName