From 6b83ec8c08c769ea0aa69702ed1654f9dba74a76 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 27 Jul 2022 23:45:16 -0700 Subject: [PATCH] boost control thresholds (#4392) --- firmware/controllers/actuators/boost_control.cpp | 11 ++++++++++- firmware/integration/rusefi_config.txt | 8 ++++++-- firmware/tunerstudio/rusefi.input | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/firmware/controllers/actuators/boost_control.cpp b/firmware/controllers/actuators/boost_control.cpp index 003da05b70..b8f237c359 100644 --- a/firmware/controllers/actuators/boost_control.cpp +++ b/firmware/controllers/actuators/boost_control.cpp @@ -158,7 +158,16 @@ void BoostController::update() { m_pid.iTermMin = -50; m_pid.iTermMax = 50; - ClosedLoopController::update(); + bool rpmTooLow = Sensor::getOrZero(SensorType::Rpm) < engineConfiguration->boostControlMinRpm; + bool tpsTooLow = Sensor::getOrZero(SensorType::Tps1) < engineConfiguration->boostControlMinTps; + bool mapTooLow = Sensor::getOrZero(SensorType::Map) < engineConfiguration->boostControlMinMap; + + if (rpmTooLow || tpsTooLow || mapTooLow) { + // Passing unexpected will use the safe duty cycle configured by the user + setOutput(unexpected); + } else { + ClosedLoopController::update(); + } } static bool hasInitBoost = false; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index e9b3085628..5febe2c3df 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -529,7 +529,11 @@ custom injection_mode_e 1 bits, U08, @OFFSET@, [0:1], "Simultaneous", "Sequentia injection_mode_e crankingInjectionMode;+This is the injection strategy during engine start. See Fuel/Injection settings for more detail. It is suggested to use "Simultaneous". injection_mode_e injectionMode;+This is where the fuel injection type is defined: "Simultaneous" means all injectors will fire together at once. "Sequential" fires the injectors on a per cylinder basis, which requires individually wired injectors. "Batched" will fire the injectors in groups. If your injectors are individually wired you will also need to enable "Two wire batch emulation". \nset injection_mode X\nSee also twoWireBatchInjection -angle_t unusedHere1341234 + +uint16_t boostControlMinRpm; Minimum RPM to enable boost control. Use this to avoid solenoid noise at idle, and help spool in some cases.;"", 1, 0, 0, 25000, 0 +uint8_t boostControlMinTps; Minimum TPS to enable boost control. Use this to avoid solenoid noise at idle, and help spool in some cases.;"", 1, 0, 0, 100, 0 +uint8_t boostControlMinMap; Minimum MAP to enable boost control. Use this to avoid solenoid noise at idle, and help spool in some cases.;"", 1, 0, 0, 250, 0 + angle_t crankingTimingAngle;+Ignition advance angle used during engine cranking, 5-10 degrees will work as a base setting for most engines.\nThere is tapering towards running timing advance\nset cranking_timing_angle X;"deg", 1, 0, -30, 30, 0 custom ignition_mode_e 1 bits, U08, @OFFSET@, [0:1], "Single Coil", "Individual Coils", "Wasted Spark", "Two Distributors" @@ -595,7 +599,7 @@ int unused460 custom spi_device_e 1 bits, U08, @OFFSET@, [0:2], "Off", "SPI1", "SPI2", "SPI3", "SPI4" spi_device_e hip9011SpiDevice; uint8_t failedMapFallback;Single value to be used in event of a failed MAP sensor \nThis value is only used for speed density fueling calculations.;"kPa", 1, 0, 0, 100, 0 - uint8_t boostControlSafeDutyCycle;+Duty cycle to use in case of a sensor failure. This duty cycle should produce the minimum possible amount of boost.;"%", 1, 0, 0, 100, 0 + uint8_t boostControlSafeDutyCycle;+Duty cycle to use in case of a sensor failure. This duty cycle should produce the minimum possible amount of boost. This duty is also used in case any of the minimum RPM/TPS/MAP conditions are not met.;"%", 1, 0, 0, 100, 0 adc_channel_e mafAdcChannel float globalFuelCorrection;set global_fuel_correction X;"coef", 1, 0, 0, 1000, 2 diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 3880a3f113..ef3ca185c9 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -3547,6 +3547,9 @@ dialog = tcuControls, "Transmission Settings" field = "Output Mode", boostControlPinMode, { isBoostControlEnabled } field = "Frequency", boostPwmFrequency, { isBoostControlEnabled } field = "Safe duty cycle", boostControlSafeDutyCycle, { isBoostControlEnabled } + field = "No boost control below RPM", boostControlMinRpm, { isBoostControlEnabled } + field = "No boost control below TPS", boostControlMinTps, { isBoostControlEnabled } + field = "No boost control below MAP", boostControlMinMap, { isBoostControlEnabled } dialog = boostOpenLoopDialog, "", border panel = boostTableTbl, Center