ETB overheats due to constant isTpsError true/false/true/false jitter #4832

This commit is contained in:
Andrey 2022-11-29 11:42:09 -05:00
parent fee886b310
commit 607a5677d4
4 changed files with 35 additions and 2 deletions

View File

@ -259,7 +259,7 @@ expected<percent_t> EtbController::getSetpoint() {
expected<percent_t> EtbController::getSetpointIdleValve() 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 EFI_TUNER_STUDIO && (EFI_PROD_CODE || EFI_SIMULATOR)
#if EFI_TUNER_STUDIO
engine->outputChannels.etbTarget = m_idlePosition;
#endif // EFI_TUNER_STUDIO
return clampF(0, m_idlePosition, 100);

View File

@ -71,6 +71,8 @@ public:
void setLuaAdjustment(percent_t adjustment) override;
float getLuaAdjustment() const;
float prevOutput = 0;
protected:
// This is set if an automatic TPS calibration should be run
bool m_isAutocal = false;
@ -90,7 +92,6 @@ private:
ExpAverage m_dutyRocAverage;
ExpAverage m_dutyAverage;
float prevOutput = 0;
// Pedal -> target map
const ValueProvider3D* m_pedalMap = nullptr;

View File

@ -0,0 +1,31 @@
#include "pch.h"
#include "init.h"
#include "electronic_throttle_impl.h"
TEST(etb, integrated) {
EngineTestHelper eth(TEST_ENGINE);
engineConfiguration->tps1_1AdcChannel = EFI_ADC_3;
engineConfiguration->tps1_2AdcChannel = EFI_ADC_3;
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_3;
engineConfiguration->throttlePedalPositionSecondAdcChannel = EFI_ADC_3;
Sensor::setMockValue(SensorType::AcceleratorPedalPrimary, 40);
Sensor::setMockValue(SensorType::AcceleratorPedalSecondary, 40);
Sensor::setMockValue(SensorType::Tps1, 25.0f, true);
initTps();
doInitElectronicThrottle();
EtbController *etb = (EtbController*)engine->etbControllers[0];
etb->update();
ASSERT_EQ(engine->outputChannels.etbTarget, 40);
ASSERT_EQ(etb->prevOutput, 100);
}

View File

@ -107,6 +107,7 @@ TESTS_SRC_CPP = \
tests/actuators/test_boost.cpp \
tests/actuators/test_dc_motor.cpp \
tests/actuators/test_etb.cpp \
tests/actuators/test_etb_integrated.cpp \
tests/actuators/test_fan_control.cpp \
tests/actuators/test_fuel_pump.cpp \
tests/actuators/test_gppwm.cpp \