Nick wonders if DC wastegate is still FUBAR #5075

This commit is contained in:
Andrey 2023-02-17 22:17:09 -05:00
parent 496c588120
commit abab788d20
3 changed files with 3 additions and 14 deletions

View File

@ -257,8 +257,7 @@ expected<percent_t> EtbController::getSetpoint() {
case ETB_IdleValve:
return getSetpointIdleValve();
case ETB_Wastegate:
firmwareError(OBD_PCM_Processor_Fault, "Wastegate should not run closed loop controller");
return unexpected;
return getSetpointWastegate();
default:
return unexpected;
}
@ -273,7 +272,7 @@ expected<percent_t> EtbController::getSetpointIdleValve() const {
return clampF(0, m_idlePosition, 100);
}
percent_t EtbController::getWastegateOutput() const {
expected<percent_t> EtbController::getSetpointWastegate() const {
return clampF(0, m_wastegatePosition, 100);
}
@ -630,13 +629,6 @@ void EtbController::update() {
return;
}
if (getFunction() == ETB_Wastegate) {
// boost controller runs it's own PID we just take the result
m_motor->enable();
m_motor->set(getWastegateOutput() / PERCENT_MULT);
return;
}
bool isOk = checkStatus();
if (!isOk) {

View File

@ -47,7 +47,7 @@ public:
expected<percent_t> getSetpoint() override;
expected<percent_t> getSetpointEtb();
percent_t getWastegateOutput() const;
expected<percent_t> getSetpointWastegate() const;
expected<percent_t> getSetpointIdleValve() const;
expected<percent_t> getOpenLoop(percent_t target) override;

View File

@ -475,8 +475,6 @@ TEST(etb, setpointWastegateController) {
EtbController etb;
etb.init(ETB_Wastegate, nullptr, nullptr, nullptr, false);
/*
* we need some unit test but this unit test seems pretty wrong
etb.setWastegatePosition(0);
EXPECT_FLOAT_EQ(0, etb.getSetpoint().value_or(-1));
@ -490,7 +488,6 @@ TEST(etb, setpointWastegateController) {
EXPECT_FLOAT_EQ(0, etb.getSetpoint().value_or(-1));
etb.setWastegatePosition(110);
EXPECT_FLOAT_EQ(100, etb.getSetpoint().value_or(-1));
*/
}
TEST(etb, setpointLuaAdder) {