From d5739815b4e1d1002f38e511106e676ff6a971a2 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 26 Jul 2020 10:54:51 -0400 Subject: [PATCH] Weird VAG: DC motor idle valve not ETB #1637 --- .../controllers/actuators/electronic_throttle.cpp | 12 ++++++------ firmware/integration/rusefi_config.txt | 2 +- unit_tests/tests/test_etb.cpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index ef32b12da9..6ec1ec9ec7 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -99,8 +99,8 @@ static bool startupPositionError = false; #define STARTUP_NEUTRAL_POSITION_ERROR_THRESHOLD 5 -static SensorType indexToTpsSensor(size_t index, bool volkswagenEtbIdle) { - if (volkswagenEtbIdle) { +static SensorType indexToTpsSensor(size_t index, bool dcMotorIdleValve) { + if (dcMotorIdleValve) { return SensorType::Tps2; } @@ -169,7 +169,7 @@ expected EtbController::getSetpoint() const { // VW ETB idle mode uses an ETB only for idle (a mini-ETB sets the lower stop, and a normal cable // can pull the throttle up off the stop.), so we directly control the throttle with the idle position. - if (CONFIG(volkswagenEtbIdle)) { + if (CONFIG(dcMotorIdleValve)) { return clampF(0, m_idlePosition, 100); } @@ -748,13 +748,13 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif /* EFI_PROD_CODE */ // If you don't have a pedal (or VW idle valve mode), we have no business here. - if (!CONFIG(volkswagenEtbIdle) && !Sensor::hasSensor(SensorType::AcceleratorPedalPrimary)) { + if (!CONFIG(dcMotorIdleValve) && !Sensor::hasSensor(SensorType::AcceleratorPedalPrimary)) { return; } pedal2tpsMap.init(config->pedalToTpsTable, config->pedalToTpsPedalBins, config->pedalToTpsRpmBins); - if (CONFIG(volkswagenEtbIdle)) { + if (CONFIG(dcMotorIdleValve)) { engine->etbActualCount = 1; } else { engine->etbActualCount = Sensor::hasSensor(SensorType::Tps2) ? 2 : 1; @@ -766,7 +766,7 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // If this motor is actually set up, init the etb if (motor) { - auto positionSensor = indexToTpsSensor(i, CONFIG(volkswagenEtbIdle)); + auto positionSensor = indexToTpsSensor(i, CONFIG(dcMotorIdleValve)); engine->etbControllers[i]->init(positionSensor, motor, i, &engineConfiguration->etb, &pedal2tpsMap); INJECT_ENGINE_REFERENCE(engine->etbControllers[i]); } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index e3bde63fa7..813fd55734 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -826,7 +826,7 @@ custom maf_sensor_type_e 4 bits, S32, @OFFSET@, [0:1], @@maf_sensor_type_e_enum@ bit enableInnovateLC2 bit showHumanReadableWarning bit stftIgnoreErrorMagnitude;+If enabled, adjust at a constant rate instead of a rate proportional to the current lambda error. This mode may be easier to tune, and more tolerant of sensor noise. Use of this mode is required if you have a narrowband O2 sensor.; - bit volkswagenEtbIdle + bit dcMotorIdleValve;+Used on some German vehicles around late 90s: cable-operated throttle and DC motor idle air valve.\nSet the primary TPS to the cable-operated throttle's sensor\nSet the secondary TPS to the mini ETB's position sensor(s). bit unusedBit_251_12 bit unusedBit_251_13 bit unusedBit_251_14 diff --git a/unit_tests/tests/test_etb.cpp b/unit_tests/tests/test_etb.cpp index 70a94c977c..9f48a11887 100644 --- a/unit_tests/tests/test_etb.cpp +++ b/unit_tests/tests/test_etb.cpp @@ -83,13 +83,13 @@ TEST(etb, initializationDualThrottle) { doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE); } -TEST(etb, initializationVolkswagenEtbIdleMode) { +TEST(etb, initializationDcMotorIdleValveMode) { StrictMock mocks[ETB_COUNT]; WITH_ENGINE_TEST_HELPER(TEST_ENGINE); // Enable VW idle mode - engineConfiguration->volkswagenEtbIdle = true; + engineConfiguration->dcMotorIdleValve = true; for (int i = 0; i < ETB_COUNT; i++) { engine->etbControllers[i] = &mocks[i]; @@ -231,7 +231,7 @@ TEST(etb, idleVolkswagenMode) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); // In this mode the idle position should be passed thru as the setpoint directly - engineConfiguration->volkswagenEtbIdle = true; + engineConfiguration->dcMotorIdleValve = true; EtbController etb; INJECT_ENGINE_REFERENCE(&etb);