Skip to content

Commit

Permalink
ETB overheats due to constant isTpsError true/false/true/false jitter…
Browse files Browse the repository at this point in the history
…: this seems obvious enough to disable ETB at least on non running engine #4832
  • Loading branch information
rusefillc committed Dec 1, 2022
1 parent 0edf719 commit 405b23d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions unit_tests/tests/actuators/test_etb_integrated.cpp
Expand Up @@ -17,7 +17,10 @@ static EtbController * initEtbIntegratedTest() {

initTps();
doInitElectronicThrottle();
return (EtbController*)engine->etbControllers[0];

EtbController *etb = (EtbController*)engine->etbControllers[0];
etb->etbInputErrorCounter = 0; // ETB controlles are global shared instances :(
return etb;
}

TEST(etb, integrated) {
Expand All @@ -44,7 +47,6 @@ TEST(etb, integrated) {
ASSERT_NEAR(destination, 130.2554, EPS3D);
}


TEST(etb, integratedTpsJitter) {
EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method
EtbController *etb = initEtbIntegratedTest();
Expand All @@ -66,3 +68,19 @@ TEST(etb, integratedTpsJitter) {

ASSERT_EQ(2, etb->etbInputErrorCounter);
}

TEST(etb, intermittentPps) {
EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method
EtbController *etb = initEtbIntegratedTest();
Sensor::setMockValue(SensorType::AcceleratorPedal, 25.0f, true);

ASSERT_FALSE(isTps1Error());
ASSERT_FALSE(isTps2Error());
ASSERT_FALSE(isPedalError());
etb->update();
ASSERT_EQ(1, etb->etbInputErrorCounter);

Sensor::setInvalidMockValue(SensorType::AcceleratorPedal);
etb->update();
ASSERT_EQ(2, etb->etbInputErrorCounter);
}

0 comments on commit 405b23d

Please sign in to comment.