Whatever we call it, no matter how we do it - we need live data / remote view into rusEFI actual state #3353

dead code
This commit is contained in:
rusefillc 2021-10-14 15:17:09 -04:00
parent eb6db5e5a4
commit ea87d9c9be
6 changed files with 28 additions and 184 deletions

View File

@ -564,47 +564,6 @@ void EtbController::update() {
&& m_function == ETB_Throttle1; && m_function == ETB_Throttle1;
ClosedLoopController::update(); ClosedLoopController::update();
DISPLAY_STATE(Engine)
DISPLAY(DISPLAY_IF(1))
DISPLAY_TEXT(Electronic_Throttle);
DISPLAY_SENSOR(TPS)
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Pedal);
DISPLAY_SENSOR(PPS);
DISPLAY(DISPLAY_CONFIG(throttlePedalPositionAdcChannel));
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Feed_forward);
DISPLAY(DISPLAY_FIELD(etbFeedForward));
DISPLAY_TEXT(eol);
DISPLAY_STATE(ETB_pid)
DISPLAY_TEXT(input);
DISPLAY(DISPLAY_FIELD(input));
DISPLAY_TEXT(Output);
DISPLAY(DISPLAY_FIELD(output));
DISPLAY_TEXT(iTerm);
DISPLAY(DISPLAY_FIELD(iTerm));
DISPLAY_TEXT(eol);
DISPLAY(DISPLAY_FIELD(errorAmplificationCoef));
DISPLAY(DISPLAY_FIELD(previousError));
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Settings);
DISPLAY(DISPLAY_CONFIG(ETB_PFACTOR));
DISPLAY(DISPLAY_CONFIG(ETB_IFACTOR));
DISPLAY(DISPLAY_CONFIG(ETB_DFACTOR));
DISPLAY_TEXT(eol);
DISPLAY(DISPLAY_CONFIG(ETB_OFFSET));
DISPLAY(DISPLAY_CONFIG(ETB_PERIODMS));
DISPLAY_TEXT(eol);
DISPLAY(DISPLAY_CONFIG(ETB_MINVALUE));
DISPLAY(DISPLAY_CONFIG(ETB_MAXVALUE));
/* DISPLAY_ELSE */
DISPLAY_TEXT(No_Pedal_Sensor);
/* DISPLAY_ENDIF */
} }
void EtbController::autoCalibrateTps() { void EtbController::autoCalibrateTps() {

View File

@ -598,46 +598,9 @@ void startIdleThread(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
initIdleHardware(PASS_ENGINE_PARAMETER_SIGNATURE); initIdleHardware(PASS_ENGINE_PARAMETER_SIGNATURE);
#endif /* EFI_UNIT_TEST */ #endif /* EFI_UNIT_TEST */
DISPLAY_STATE(Engine) engine->engineState.idle.idleState = INIT;
DISPLAY_TEXT(Idle_State); engine->engineState.idle.baseIdlePosition = -100.0f;
engine->engineState.idle.DISPLAY_FIELD(idleState) = INIT; engine->engineState.idle.currentIdlePosition = -100.0f;
DISPLAY_TEXT(EOL);
DISPLAY_TEXT(Base_Position);
engine->engineState.idle.DISPLAY_FIELD(baseIdlePosition) = -100.0f;
DISPLAY_TEXT(Position_with_Adjustments);
engine->engineState.idle.DISPLAY_FIELD(currentIdlePosition) = -100.0f;
DISPLAY_TEXT(EOL);
DISPLAY_TEXT(EOL);
DISPLAY_SENSOR(TPS);
DISPLAY_TEXT(EOL);
DISPLAY_TEXT(Throttle_Up_State);
DISPLAY(DISPLAY_FIELD(throttlePedalUpState));
DISPLAY(DISPLAY_CONFIG(throttlePedalUpPin));
DISPLAY_TEXT(eol);
DISPLAY(DISPLAY_IF(isAutomaticIdle))
DISPLAY_STATE(idle_pid)
DISPLAY_TEXT(Output);
DISPLAY(DISPLAY_FIELD(output));
DISPLAY_TEXT(iTerm);
DISPLAY(DISPLAY_FIELD(iTerm));
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Settings);
DISPLAY(DISPLAY_CONFIG(IDLERPMPID_PFACTOR));
DISPLAY(DISPLAY_CONFIG(IDLERPMPID_IFACTOR));
DISPLAY(DISPLAY_CONFIG(IDLERPMPID_DFACTOR));
DISPLAY(DISPLAY_CONFIG(IDLERPMPID_OFFSET));
DISPLAY_TEXT(eol);
DISPLAY_TEXT(ETB_Idle);
DISPLAY_STATE(Engine)
DISPLAY(DISPLAY_FIELD(etbIdleAddition));
/* DISPLAY_ELSE */
DISPLAY_TEXT(Manual_idle_control);
/* DISPLAY_ENDIF */
#if ! EFI_UNIT_TEST #if ! EFI_UNIT_TEST

View File

@ -80,8 +80,7 @@ floatms_t WallFuel::adjust(floatms_t desiredFuel DECLARE_ENGINE_PARAMETER_SUFFIX
// if tau is really small, we get div/0. // if tau is really small, we get div/0.
// you probably meant to disable wwae. // you probably meant to disable wwae.
DISPLAY_STATE(wall_fuel) float tau = CONFIG(wwaeTau);
float tau = CONFIG(DISPLAY_CONFIG(wwaeTau));
if (tau < 0.01f) { if (tau < 0.01f) {
return desiredFuel; return desiredFuel;
} }
@ -93,7 +92,7 @@ floatms_t WallFuel::adjust(floatms_t desiredFuel DECLARE_ENGINE_PARAMETER_SUFFIX
} }
float alpha = expf_taylor(-120 / (rpm * tau)); float alpha = expf_taylor(-120 / (rpm * tau));
float beta = CONFIG(DISPLAY_CONFIG(wwaeBeta)); float beta = CONFIG(wwaeBeta);
#if EFI_TUNER_STUDIO #if EFI_TUNER_STUDIO
if (engineConfiguration->debugMode == DBG_KNOCK) { if (engineConfiguration->debugMode == DBG_KNOCK) {
@ -136,11 +135,8 @@ floatms_t WallFuel::adjust(floatms_t desiredFuel DECLARE_ENGINE_PARAMETER_SUFFIX
} }
#endif // EFI_TUNER_STUDIO #endif // EFI_TUNER_STUDIO
DISPLAY_TEXT(Current_Wall_Fuel_Film); wallFuel = fuelFilmMassNext;
DISPLAY_FIELD(wallFuel) = fuelFilmMassNext; wallFuelCorrection = M_cmd - desiredFuel;
DISPLAY_TEXT(Fuel correction);
DISPLAY_FIELD(wallFuelCorrection) = M_cmd - desiredFuel;
DISPLAY_TEXT(ms);
return M_cmd; return M_cmd;
} }

View File

@ -42,14 +42,7 @@ static mapEstimate_Map3D_t mapEstimationTable;
#if EFI_ENGINE_CONTROL #if EFI_ENGINE_CONTROL
DISPLAY_STATE(Engine) float getCrankingFuel3(
DISPLAY(DISPLAY_FIELD(sparkDwell))
DISPLAY(DISPLAY_FIELD(dwellAngle))
DISPLAY(DISPLAY_FIELD(cltTimingCorrection))
DISPLAY_TEXT(eol);
DISPLAY(DISPLAY_IF(isCrankingState)) float getCrankingFuel3(
float baseFuel, float baseFuel,
uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_SUFFIX) { uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_SUFFIX) {
// these magic constants are in Celsius // these magic constants are in Celsius
@ -63,44 +56,35 @@ DISPLAY(DISPLAY_IF(isCrankingState)) float getCrankingFuel3(
/** /**
* Cranking fuel changes over time * Cranking fuel changes over time
*/ */
DISPLAY_TEXT(Duration_coef); engine->engineState.cranking.durationCoefficient = interpolate2d(revolutionCounterSinceStart, config->crankingCycleBins,
engine->engineState.DISPLAY_PREFIX(cranking).DISPLAY_FIELD(durationCoefficient) = interpolate2d(revolutionCounterSinceStart, config->crankingCycleBins,
config->crankingCycleCoef); config->crankingCycleCoef);
DISPLAY_TEXT(eol);
/** /**
* Cranking fuel is different depending on engine coolant temperature * Cranking fuel is different depending on engine coolant temperature
* If the sensor is failed, use 20 deg C * If the sensor is failed, use 20 deg C
*/ */
auto clt = Sensor::get(SensorType::Clt); auto clt = Sensor::get(SensorType::Clt);
DISPLAY_TEXT(Coolant_coef); engine->engineState.cranking.coolantTemperatureCoefficient =
engine->engineState.DISPLAY_PREFIX(cranking).DISPLAY_FIELD(coolantTemperatureCoefficient) =
interpolate2d(clt.value_or(20), config->crankingFuelBins, config->crankingFuelCoef); interpolate2d(clt.value_or(20), config->crankingFuelBins, config->crankingFuelCoef);
DISPLAY_SENSOR(CLT);
DISPLAY_TEXT(eol);
auto tps = Sensor::get(SensorType::DriverThrottleIntent); auto tps = Sensor::get(SensorType::DriverThrottleIntent);
DISPLAY_TEXT(TPS_coef); engine->engineState.cranking.tpsCoefficient = tps.Valid ? 1 : interpolate2d(tps.Value, engineConfiguration->crankingTpsBins,
engine->engineState.DISPLAY_PREFIX(cranking).DISPLAY_FIELD(tpsCoefficient) = tps.Valid ? 1 : interpolate2d(tps.Value, engineConfiguration->crankingTpsBins,
engineConfiguration->crankingTpsCoef); engineConfiguration->crankingTpsCoef);
/* /*
engine->engineState.DISPLAY_PREFIX(cranking).DISPLAY_FIELD(tpsCoefficient) = engine->engineState.cranking.tpsCoefficient =
tps.Valid tps.Valid
? interpolate2d(tps.Value, engineConfiguration->crankingTpsBins, engineConfiguration->crankingTpsCoef) ? interpolate2d(tps.Value, engineConfiguration->crankingTpsBins, engineConfiguration->crankingTpsCoef)
: 1; // in case of failed TPS, don't correct.*/ : 1; // in case of failed TPS, don't correct.*/
DISPLAY_SENSOR(TPS);
DISPLAY_TEXT(eol);
floatms_t crankingFuel = baseCrankingFuel floatms_t crankingFuel = baseCrankingFuel
* engine->engineState.cranking.durationCoefficient * engine->engineState.cranking.durationCoefficient
* engine->engineState.cranking.coolantTemperatureCoefficient * engine->engineState.cranking.coolantTemperatureCoefficient
* engine->engineState.cranking.tpsCoefficient; * engine->engineState.cranking.tpsCoefficient;
DISPLAY_TEXT(Cranking_fuel); engine->engineState.cranking.fuel = crankingFuel * 1000;
engine->engineState.DISPLAY_PREFIX(cranking).DISPLAY_FIELD(fuel) = crankingFuel * 1000;
if (crankingFuel <= 0) { if (crankingFuel <= 0) {
warning(CUSTOM_ERR_ZERO_CRANKING_FUEL, "Cranking fuel value %f", crankingFuel); warning(CUSTOM_ERR_ZERO_CRANKING_FUEL, "Cranking fuel value %f", crankingFuel);
@ -108,29 +92,16 @@ DISPLAY(DISPLAY_IF(isCrankingState)) float getCrankingFuel3(
return crankingFuel; return crankingFuel;
} }
/* DISPLAY_ELSE */
floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) { floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) {
ScopePerf perf(PE::GetRunningFuel); ScopePerf perf(PE::GetRunningFuel);
DISPLAY_TEXT(Base_fuel); ENGINE(engineState.running.baseFuel) = baseFuel;
ENGINE(engineState.DISPLAY_PREFIX(running).DISPLAY_FIELD(baseFuel)) = baseFuel;
DISPLAY_TEXT(eol);
float iatCorrection = ENGINE(engineState.running.intakeTemperatureCoefficient);
DISPLAY_TEXT(Intake_coef); float cltCorrection = ENGINE(engineState.running.coolantTemperatureCoefficient);
float iatCorrection = ENGINE(engineState.DISPLAY_PREFIX(running).DISPLAY_FIELD(intakeTemperatureCoefficient));
DISPLAY_SENSOR(IAT);
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Coolant_coef); float postCrankingFuelCorrection = ENGINE(engineState.running.postCrankingFuelCorrection);
float cltCorrection = ENGINE(engineState.DISPLAY_PREFIX(running).DISPLAY_FIELD(coolantTemperatureCoefficient));
DISPLAY_SENSOR(CLT);
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Post_cranking_coef);
float postCrankingFuelCorrection = ENGINE(engineState.DISPLAY_PREFIX(running).DISPLAY_FIELD(postCrankingFuelCorrection));
DISPLAY_TEXT(eol);
float baroCorrection = ENGINE(engineState.baroCorrection); float baroCorrection = ENGINE(engineState.baroCorrection);
@ -140,15 +111,9 @@ floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) {
floatms_t runningFuel = baseFuel * baroCorrection * iatCorrection * cltCorrection * postCrankingFuelCorrection; floatms_t runningFuel = baseFuel * baroCorrection * iatCorrection * cltCorrection * postCrankingFuelCorrection;
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(runningFuel), "NaN runningFuel", 0); efiAssert(CUSTOM_ERR_ASSERT, !cisnan(runningFuel), "NaN runningFuel", 0);
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Running_fuel); ENGINE(engineState.running.fuel) = runningFuel * 1000;
ENGINE(engineState.DISPLAY_PREFIX(running).DISPLAY_FIELD(fuel)) = runningFuel * 1000;
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Injector_lag);
DISPLAY(DISPLAY_PREFIX(running).DISPLAY_FIELD(injectorLag));
DISPLAY_SENSOR(VBATT);
return runningFuel; return runningFuel;
} }

View File

@ -48,9 +48,7 @@ temperature_t getTCharge(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX) {
float coolantTemp = clt.Value; float coolantTemp = clt.Value;
DISPLAY_STATE(Engine) if ((engine->engineState.sd.isTChargeAirModel = (CONFIG(tChargeMode) == TCHARGE_MODE_AIR_INTERP))) {
if ((engine->engineState.sd.DISPLAY_IF(isTChargeAirModel) = (CONFIG(tChargeMode) == TCHARGE_MODE_AIR_INTERP))) {
const floatms_t gramsPerMsToKgPerHour = (3600.0f * 1000.0f) / 1000.0f; const floatms_t gramsPerMsToKgPerHour = (3600.0f * 1000.0f) / 1000.0f;
// We're actually using an 'old' airMass calculated for the previous cycle, but it's ok, we're not having any self-excitaton issues // We're actually using an 'old' airMass calculated for the previous cycle, but it's ok, we're not having any self-excitaton issues
floatms_t airMassForEngine = engine->engineState.sd./***display*/airMassInOneCylinder * CONFIG(specs.cylindersCount); floatms_t airMassForEngine = engine->engineState.sd./***display*/airMassInOneCylinder * CONFIG(specs.cylindersCount);
@ -58,32 +56,21 @@ temperature_t getTCharge(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX) {
// And if the engine is stopped (0 rpm), then airFlow is also zero (avoiding NaN division) // And if the engine is stopped (0 rpm), then airFlow is also zero (avoiding NaN division)
floatms_t airFlow = (rpm == 0) ? 0 : airMassForEngine * gramsPerMsToKgPerHour / getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX); floatms_t airFlow = (rpm == 0) ? 0 : airMassForEngine * gramsPerMsToKgPerHour / getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
// just interpolate between user-specified min and max coefs, based on the max airFlow value // just interpolate between user-specified min and max coefs, based on the max airFlow value
DISPLAY_TEXT(interpolate_Air_Flow) engine->engineState.airFlow = airFlow;
engine->engineState.DISPLAY_FIELD(airFlow) = airFlow;
DISPLAY_TEXT(Between)
engine->engineState.sd.Tcharge_coff = interpolateClamped(0.0, engine->engineState.sd.Tcharge_coff = interpolateClamped(0.0,
CONFIG(DISPLAY_CONFIG(tChargeAirCoefMin)), CONFIG(tChargeAirCoefMin),
CONFIG(DISPLAY_CONFIG(tChargeAirFlowMax)), CONFIG(tChargeAirFlowMax),
CONFIG(DISPLAY_CONFIG(tChargeAirCoefMax)), airFlow); CONFIG(tChargeAirCoefMax), airFlow);
// save it for console output (instead of MAF massAirFlow) // save it for console output (instead of MAF massAirFlow)
} else/* DISPLAY_ELSE */ { } else {
// TCHARGE_MODE_RPM_TPS
DISPLAY_TEXT(interpolate_3D)
DISPLAY_SENSOR(RPM)
DISPLAY_TEXT(and)
DISPLAY_SENSOR(TPS)
DISPLAY_TEXT(EOL)
DISPLAY_TEXT(Between)
float minRpmKcurrentTPS = interpolateMsg("minRpm", tpMin, float minRpmKcurrentTPS = interpolateMsg("minRpm", tpMin,
CONFIG(DISPLAY_CONFIG(tChargeMinRpmMinTps)), tpMax, CONFIG(tChargeMinRpmMinTps), tpMax,
CONFIG(DISPLAY_CONFIG(tChargeMinRpmMaxTps)), tps); CONFIG(tChargeMinRpmMaxTps), tps);
DISPLAY_TEXT(EOL)
float maxRpmKcurrentTPS = interpolateMsg("maxRpm", tpMin, float maxRpmKcurrentTPS = interpolateMsg("maxRpm", tpMin,
CONFIG(DISPLAY_CONFIG(tChargeMaxRpmMinTps)), tpMax, CONFIG(tChargeMaxRpmMinTps), tpMax,
CONFIG(DISPLAY_CONFIG(tChargeMaxRpmMaxTps)), tps); CONFIG(tChargeMaxRpmMaxTps), tps);
engine->engineState.sd.Tcharge_coff = interpolateMsg("Kcurr", rpmMin, minRpmKcurrentTPS, rpmMax, maxRpmKcurrentTPS, rpm); engine->engineState.sd.Tcharge_coff = interpolateMsg("Kcurr", rpmMin, minRpmKcurrentTPS, rpmMax, maxRpmKcurrentTPS, rpm);
/* DISPLAY_ENDIF */
} }
if (cisnan(engine->engineState.sd.Tcharge_coff)) { if (cisnan(engine->engineState.sd.Tcharge_coff)) {

View File

@ -527,32 +527,6 @@ void TriggerState::decodeTriggerEvent(
bool isSynchronizationPoint; bool isSynchronizationPoint;
bool wasSynchronized = getShaftSynchronized(); bool wasSynchronized = getShaftSynchronized();
DISPLAY_STATE(Trigger_State)
DISPLAY_TEXT(Current_Gap);
DISPLAY(DISPLAY_FIELD(currentGap));
DISPLAY_TEXT(EOL);
DISPLAY_STATE(Trigger_Central)
DISPLAY(DISPLAY_CONFIG(TRIGGERINPUTPINS1));
DISPLAY_TEXT("Trigger 1: Fall");
DISPLAY(DISPLAY_FIELD(HWEVENTCOUNTERS1));
DISPLAY_TEXT(", Rise");
DISPLAY(DISPLAY_FIELD(HWEVENTCOUNTERS2));
DISPLAY_TEXT(EOL);
DISPLAY(DISPLAY_CONFIG(TRIGGERINPUTPINS2));
DISPLAY_TEXT("Trigger 2: Fall");
DISPLAY(DISPLAY_FIELD(HWEVENTCOUNTERS3));
DISPLAY_TEXT(", Rise");
DISPLAY(DISPLAY_FIELD(HWEVENTCOUNTERS4));
DISPLAY_TEXT(EOL);
DISPLAY_TEXT(VVT_1);
DISPLAY(DISPLAY_CONFIG(CAMINPUTS1));
DISPLAY(DISPLAY_FIELD(vvtEventRiseCounter));
DISPLAY(DISPLAY_FIELD(vvtEventFallCounter));
DISPLAY(DISPLAY_FIELD(vvtCamCounter));
if (triggerShape.isSynchronizationNeeded) { if (triggerShape.isSynchronizationNeeded) {
currentGap = 1.0 * toothDurations[0] / toothDurations[1]; currentGap = 1.0 * toothDurations[0] / toothDurations[1];