diff --git a/firmware/controllers/algo/defaults/default_fuel.cpp b/firmware/controllers/algo/defaults/default_fuel.cpp index d88ac97a9b..69ea67868b 100644 --- a/firmware/controllers/algo/defaults/default_fuel.cpp +++ b/firmware/controllers/algo/defaults/default_fuel.cpp @@ -129,7 +129,7 @@ static void setDefaultStftSettings() { cfg.deadband = 5; // Sensible region defaults - cfg.maxIdleRegionRpm = 1000 / RPM_1_BYTE_PACKING_MULT; + cfg.maxIdleRegionRpm = 1000; cfg.maxOverrunLoad = 35; cfg.minPowerLoad = 85; diff --git a/firmware/controllers/math/closed_loop_fuel.cpp b/firmware/controllers/math/closed_loop_fuel.cpp index 35832feb7b..f2cfd8c2b0 100644 --- a/firmware/controllers/math/closed_loop_fuel.cpp +++ b/firmware/controllers/math/closed_loop_fuel.cpp @@ -24,7 +24,7 @@ static SensorType getSensorForBankIndex(size_t index) { size_t computeStftBin(int rpm, float load, stft_s& cfg) { // Low RPM -> idle - if (idleDeadband.lt(rpm, cfg.maxIdleRegionRpm * RPM_1_BYTE_PACKING_MULT)) + if (idleDeadband.lt(rpm, cfg.maxIdleRegionRpm)) { return 0; } diff --git a/firmware/hw_layer/digital_input/trigger/trigger_input_comp.cpp b/firmware/hw_layer/digital_input/trigger/trigger_input_comp.cpp index c3361ec96c..b7e53a7fa3 100644 --- a/firmware/hw_layer/digital_input/trigger/trigger_input_comp.cpp +++ b/firmware/hw_layer/digital_input/trigger/trigger_input_comp.cpp @@ -114,7 +114,7 @@ void startTriggerInputPins(void) { dacHysteresisDelta = dacHysteresisMin; // 20 rpm (60_2) = 1000*60/((2*60)*20) = 25 ms for 1 tooth event - float satRpm = engineConfiguration->triggerCompSensorSatRpm * RPM_1_BYTE_PACKING_MULT; + float satRpm = engineConfiguration->triggerCompSensorSatRpm; hystUpdatePeriodNumEvents = engine->triggerCentral.triggerShape.getSize(); // = 116 for "60-2" trigger wheel float saturatedToothDurationUs = 60.0f * US_PER_SECOND_F / satRpm / hystUpdatePeriodNumEvents; saturatedVrFreqNt = 1.0f / US2NT(saturatedToothDurationUs); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 138c539b7e..8ef1f4ee75 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -260,7 +260,7 @@ struct stft_cell_cfg_s end_struct struct stft_s - uint8_t maxIdleRegionRpm;+Below this RPM, the idle region is active;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0, 12000, 0 + uint8_t autoscale maxIdleRegionRpm;+Below this RPM, the idle region is active;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0, 12000, 0 uint8_t maxOverrunLoad;+Below this engine load, the overrun region is active;"load", 1, 0, 0, 250, 0 uint8_t minPowerLoad;+Above this engine load, the power region is active;"load", 1, 0, 0, 250, 0 uint8_t deadband;+When close to correct AFR, pause correction. This can improve stability by not changing the adjustment if the error is extremely small, but is not required.;"%", 0.1, 0, 0, 3, 1 @@ -1443,7 +1443,7 @@ tChargeMode_e tChargeMode; uint8_t triggerCompCenterVolt;+Trigger comparator center point voltage;"V", @@VOLTAGE_1_BYTE_PACKING_DIV@@, 0, 0, 5.1, 2 uint8_t triggerCompHystMin;+Trigger comparator hysteresis voltage (Min);"V", @@VOLTAGE_1_BYTE_PACKING_DIV@@, 0, 0, 5.1, 2 uint8_t triggerCompHystMax;+Trigger comparator hysteresis voltage (Max);"V", @@VOLTAGE_1_BYTE_PACKING_DIV@@, 0, 0, 5.1, 2 - uint8_t triggerCompSensorSatRpm;+VR-sensor saturation RPM;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0, 12000, 0 + uint8_t autoscale triggerCompSensorSatRpm;+VR-sensor saturation RPM;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0, 12000, 0 pid_s idleRpmPid2 diff --git a/unit_tests/tests/test_stft.cpp b/unit_tests/tests/test_stft.cpp index 03eefbfc55..7368a04ecc 100644 --- a/unit_tests/tests/test_stft.cpp +++ b/unit_tests/tests/test_stft.cpp @@ -51,7 +51,7 @@ TEST(ClosedLoopFuel, CellSelection) { stft_s cfg; // Sensible region config - cfg.maxIdleRegionRpm = 1500 / RPM_1_BYTE_PACKING_MULT; + cfg.maxIdleRegionRpm = 1500; cfg.minPowerLoad = 80; cfg.maxOverrunLoad = 30;