ETB duty cycle jitter #4833

a step back to safety
This commit is contained in:
Andrey 2022-11-27 19:26:19 -05:00
parent 9b595e72df
commit b00a7e506b
2 changed files with 7 additions and 1 deletions

View File

@ -208,7 +208,7 @@ bool EtbController::init(etb_function_e function, DcMotor *motor, pid_s *pidPara
// Ignore 3% position error before complaining
m_errorAccumulator.init(3.0f, etbPeriodSeconds);
m_dutyIntegrator.init(engineConfiguration->etbDutyThreshold, etbPeriodSeconds);
// m_dutyIntegrator.init(engineConfiguration->etbDutyThreshold, etbPeriodSeconds);
reset();

View File

@ -198,6 +198,7 @@ TEST(etb, initializationNoPrimarySensor) {
Sensor::resetAllMocks();
EtbController dut;
EngineTestHelper eth(TEST_ENGINE);
// Needs pedal for init
Sensor::setMockValue(SensorType::AcceleratorPedal, 0.0f, true);
@ -469,6 +470,7 @@ TEST(etb, setpointNoPedalMap) {
}
TEST(etb, setpointIdleValveController) {
EngineTestHelper eth(TEST_ENGINE);
EtbController etb;
etb.init(ETB_IdleValve, nullptr, nullptr, nullptr, false);
@ -488,6 +490,7 @@ TEST(etb, setpointIdleValveController) {
}
TEST(etb, setpointWastegateController) {
EngineTestHelper eth(TEST_ENGINE);
EtbController etb;
etb.init(ETB_Wastegate, nullptr, nullptr, nullptr, false);
@ -583,6 +586,7 @@ TEST(etb, etbTpsSensor) {
// Test wastegate control
{
// EngineTestHelper eth(TEST_ENGINE);
EtbController etb;
etb.init(ETB_Wastegate, nullptr, nullptr, nullptr, true);
EXPECT_EQ(etb.observePlant().Value, 33.0f);
@ -590,6 +594,7 @@ TEST(etb, etbTpsSensor) {
// Test idle valve control
{
// EngineTestHelper eth(TEST_ENGINE);
EtbController etb;
etb.init(ETB_IdleValve, nullptr, nullptr, nullptr, true);
EXPECT_EQ(etb.observePlant().Value, 66.0f);
@ -738,6 +743,7 @@ TEST(etb, setOutputLimpHome) {
}
TEST(etb, closedLoopPid) {
// huh? how is this breaking the test? EngineTestHelper eth(TEST_ENGINE);
pid_s pid = {};
pid.pFactor = 5;
pid.maxValue = 75;