diff --git a/firmware/console/binary/tunerstudio_outputs.h b/firmware/console/binary/tunerstudio_outputs.h index 723f297df0..bdb56cc07c 100644 --- a/firmware/console/binary/tunerstudio_outputs.h +++ b/firmware/console/binary/tunerstudio_outputs.h @@ -141,9 +141,9 @@ struct TunerStudioOutputChannels { scaled_channel wallFuelCorrection; // 74 // TPS/load AE - scaled_percent engineLoadDelta; // 76 + scaled_percent unused76; // 76 scaled_percent deltaTps; // 78 - scaled_percent engineLoadAccelExtra; // 80 + scaled_percent unused80; // 80 scaled_ms tpsAccelFuel; // 82 // Ignition diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 1e5a6bca11..632d998004 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -752,10 +752,6 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->tpsAccelFuel = engine->engineState.tpsAccelEnrich; - tsOutputChannels->engineLoadAccelExtra = engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE) * 100 / Sensor::getOrZero(SensorType::Map); - - tsOutputChannels->engineLoadDelta = engine->engineLoadAccelEnrichment.getMaxDelta(); - tsOutputChannels->checkEngine = hasErrorCodes(); #if EFI_MAX_31855 diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index 4d8b85b616..abf41e100e 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -115,37 +115,6 @@ floatms_t TpsAccelEnrichment::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATUR return extraFuel; } -float LoadAccelEnrichment::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_SIGNATURE); - - float d = (cb.get(index) - (cb.get(index - 1))) * CONFIG(specs.cylindersCount); - - float result = 0; - int distance = 0; - float taper = 0; - if (d > engineConfiguration->engineLoadAccelEnrichmentThreshold) { - - distance = cb.currentIndex - index; - if (distance <= 0) // checking if indexes are out of order due to circular buffer nature - distance += minI(cb.getCount(), cb.getSize()); - - taper = interpolate2d(distance, engineConfiguration->mapAccelTaperBins, engineConfiguration->mapAccelTaperMult); - - result = taper * d * engineConfiguration->engineLoadAccelEnrichmentMultiplier; - } else if (d < -engineConfiguration->engineLoadDecelEnleanmentThreshold) { - result = d * engineConfiguration->engineLoadAccelEnrichmentMultiplier; - } - - if (engineConfiguration->debugMode == DBG_EL_ACCEL) { -#if EFI_TUNER_STUDIO - tsOutputChannels.debugIntField1 = distance; - tsOutputChannels.debugFloatField1 = result; - tsOutputChannels.debugFloatField2 = taper; -#endif /* EFI_TUNER_STUDIO */ - } - return result; -} - void AccelEnrichment::resetAE() { cb.clear(); } @@ -201,10 +170,6 @@ void TpsAccelEnrichment::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } } -void LoadAccelEnrichment::onEngineCycle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - onNewValue(getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX); -} - AccelEnrichment::AccelEnrichment() { resetAE(); cb.setSize(4); @@ -213,26 +178,12 @@ AccelEnrichment::AccelEnrichment() { #if ! EFI_UNIT_TEST static void accelInfo() { -// efiPrintf("EL accel length=%d", mapInstance.cb.getSize()); - efiPrintf("EL accel th=%.2f/mult=%.2f", engineConfiguration->engineLoadAccelEnrichmentThreshold, engineConfiguration->engineLoadAccelEnrichmentMultiplier); - efiPrintf("EL decel th=%.2f/mult=%.2f", engineConfiguration->engineLoadDecelEnleanmentThreshold, engineConfiguration->engineLoadDecelEnleanmentMultiplier); - // efiPrintf("TPS accel length=%d", tpsInstance.cb.getSize()); efiPrintf("TPS accel th=%.2f/mult=%.2f", engineConfiguration->tpsAccelEnrichmentThreshold, -1); efiPrintf("beta=%.2f/tau=%.2f", engineConfiguration->wwaeBeta, engineConfiguration->wwaeTau); } -void setEngineLoadAccelThr(float value) { - engineConfiguration->engineLoadAccelEnrichmentThreshold = value; - accelInfo(); -} - -void setEngineLoadAccelMult(float value) { - engineConfiguration->engineLoadAccelEnrichmentMultiplier = value; - accelInfo(); -} - void setTpsAccelThr(float value) { engineConfiguration->tpsAccelEnrichmentThreshold = value; accelInfo(); @@ -267,17 +218,7 @@ void setTpsAccelLen(int length) { accelInfo(); } -void setEngineLoadAccelLen(int length) { - if (length < 1) { - efiPrintf("Length should be positive"); - return; - } - engine->engineLoadAccelEnrichment.setLength(length); - accelInfo(); -} - void updateAccelParameters() { - setEngineLoadAccelLen(engineConfiguration->engineLoadAccelLength); setTpsAccelLen(engineConfiguration->tpsAccelLength); } diff --git a/firmware/controllers/algo/accel_enrichment.h b/firmware/controllers/algo/accel_enrichment.h index 55f97425ba..e7b2bbc338 100644 --- a/firmware/controllers/algo/accel_enrichment.h +++ b/firmware/controllers/algo/accel_enrichment.h @@ -31,15 +31,6 @@ public: int onUpdateInvocationCounter = 0; }; -class LoadAccelEnrichment : public AccelEnrichment { -public: - /** - * @return Extra engine load value for fuel logic calculation - */ - float getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void onEngineCycle(DECLARE_ENGINE_PARAMETER_SIGNATURE); -}; - class TpsAccelEnrichment : public AccelEnrichment { public: /** @@ -62,10 +53,6 @@ private: void initAccelEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void setEngineLoadAccelLen(int len); -void setEngineLoadAccelThr(float value); -void setEngineLoadAccelMult(float value); - void setTpsAccelThr(float value); void setTpsDecelThr(float value); void setTpsDecelMult(float value); diff --git a/firmware/controllers/algo/airmass/maf_airmass.cpp b/firmware/controllers/algo/airmass/maf_airmass.cpp index 7d5815c15a..0ca1abeb83 100644 --- a/firmware/controllers/algo/airmass/maf_airmass.cpp +++ b/firmware/controllers/algo/airmass/maf_airmass.cpp @@ -3,7 +3,7 @@ #include "maf.h" AirmassResult MafAirmass::getAirmass(int rpm) { - float maf = Sensor::getOrZero(SensorType::Maf) + engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE); + float maf = Sensor::getOrZero(SensorType::Maf); return getAirmassImpl(maf, rpm); } diff --git a/firmware/controllers/algo/airmass/speed_density_airmass.cpp b/firmware/controllers/algo/airmass/speed_density_airmass.cpp index e9de444934..10050c9eb0 100644 --- a/firmware/controllers/algo/airmass/speed_density_airmass.cpp +++ b/firmware/controllers/algo/airmass/speed_density_airmass.cpp @@ -15,9 +15,7 @@ AirmassResult SpeedDensityAirmass::getAirmass(int rpm) { auto map = getMap(rpm); - engine->engineState.sd.manifoldAirPressureAccelerationAdjustment = engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE); - - float adjustedMap = engine->engineState.sd.adjustedManifoldAirPressure = map + engine->engineState.sd.manifoldAirPressureAccelerationAdjustment; + float adjustedMap = engine->engineState.sd.adjustedManifoldAirPressure = map; efiAssert(CUSTOM_ERR_ASSERT, !cisnan(adjustedMap), "NaN adjustedMap", {}); float ve = getVe(rpm, adjustedMap); diff --git a/firmware/controllers/algo/defaults/default_fuel.cpp b/firmware/controllers/algo/defaults/default_fuel.cpp index f23878434b..9e3b4035ea 100644 --- a/firmware/controllers/algo/defaults/default_fuel.cpp +++ b/firmware/controllers/algo/defaults/default_fuel.cpp @@ -231,11 +231,6 @@ void setDefaultFuel(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // Decel fuel cut setDefaultFuelCutParameters(PASS_CONFIG_PARAMETER_SIGNATURE); - // Accel Enrich - engineConfiguration->engineLoadAccelLength = 6; - engineConfiguration->engineLoadAccelEnrichmentThreshold = 5; // kPa - engineConfiguration->engineLoadAccelEnrichmentMultiplier = 0; // todo: improve implementation and re-enable by default - engineConfiguration->tpsAccelLength = 12; engineConfiguration->tpsAccelEnrichmentThreshold = 40; // TPS % change, per engine cycle @@ -251,4 +246,4 @@ void setDefaultFuel(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // AE load taper setLinearCurve(engineConfiguration->mapAccelTaperBins, 0, 32, 4); setArrayValues(engineConfiguration->mapAccelTaperMult, 1.0f); -} \ No newline at end of file +} diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 0360262851..0ac81c7bb6 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -249,7 +249,6 @@ public: */ angle_t engineCycle; - LoadAccelEnrichment engineLoadAccelEnrichment; TpsAccelEnrichment tpsAccelEnrichment; TriggerCentral triggerCentral; diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 82a0033034..58dd819e81 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -183,7 +183,6 @@ efitimesec_t getTimeNowSeconds(void) { } static void resetAccel(void) { - engine->engineLoadAccelEnrichment.resetAE(); engine->tpsAccelEnrichment.resetAE(); for (size_t i = 0; i < efi::size(engine->injectionEvents.elements); i++) diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index 1554d775c1..5316b3d25a 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -314,7 +314,6 @@ static void handleFuel(const bool limitedFuel, uint32_t trgEventIndex, int rpm, ENGINE(tpsAccelEnrichment.onNewValue(Sensor::getOrZero(SensorType::Tps1) PASS_ENGINE_PARAMETER_SUFFIX)); if (trgEventIndex == 0) { ENGINE(tpsAccelEnrichment.onEngineCycleTps(PASS_ENGINE_PARAMETER_SIGNATURE)); - ENGINE(engineLoadAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_SIGNATURE)); } if (limitedFuel) { diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index a41d643256..90ee181e3e 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -915,7 +915,6 @@ const plain_get_integer_s getI_plain[] = { {"trigger_type", (int*)&engineConfiguration->trigger.type}, // {"idle_solenoid_freq", setIdleSolenoidFrequency}, // {"tps_accel_len", setTpsAccelLen}, -// {"engine_load_accel_len", setEngineLoadAccelLen}, // {"bor", setBor}, // {"can_mode", setCanType}, // {"idle_rpm", setTargetIdleRpm}, @@ -1039,8 +1038,6 @@ const command_f_s commandsF[] = { {"tps_decel_threshold", setTpsDecelThr}, {"tps_decel_multiplier", setTpsDecelMult}, {"cranking_priming_pulse", setCrankingPrimingPulse}, - {"engine_load_accel_threshold", setEngineLoadAccelThr}, - {"engine_load_accel_multiplier", setEngineLoadAccelMult}, {"engine_decel_threshold", setDecelThr}, {"engine_decel_multiplier", setDecelMult}, {"flat_injector_lag", setFlatInjectorLag}, @@ -1104,7 +1101,6 @@ const command_i_s commandsI[] = {{"ignition_mode", setIgnitionMode}, {"trigger_type", setTriggerType}, {"idle_solenoid_freq", setIdleSolenoidFrequency}, {"tps_accel_len", setTpsAccelLen}, - {"engine_load_accel_len", setEngineLoadAccelLen}, #endif // EFI_ENGINE_CONTROL #if EFI_PROD_CODE {"bor", setBor}, diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 87704fa0f6..b233f36f5c 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1322,10 +1322,10 @@ int16_t tps2Max;Full throttle#2. tpsMax value as 10 bit ADC value. Not Voltage!\ int engineLoadAccelLength;;"cycles", 1, 0, 1, 200, 0 - float engineLoadDecelEnleanmentThreshold;;"roc", 1, 0, 0, 200, 3 - float engineLoadDecelEnleanmentMultiplier;;"coeff", 1, 0, 0, 200, 3 - float engineLoadAccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3 - float engineLoadAccelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3 + float unusedEL1;;"roc", 1, 0, 0, 200, 3 + float unusedEL1;;"coeff", 1, 0, 0, 200, 3 + float unusedEL1;;"roc", 1, 0, 0, 200, 3 + float unusedEL1;;"coeff", 1, 0, 0, 200, 3 uint32_t uartConsoleSerialSpeed;Band rate for primary TTL;"BPs", 1, 0, 0, 1000000, 0