mirror of https://github.com/rusefi/wideband.git
heater PID works
This commit is contained in:
parent
0e350c9f66
commit
0b7f591671
|
@ -50,7 +50,7 @@ static HeaterState GetNextState(HeaterState state, float sensorEsr)
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Pid heaterPid(0.1f, 0, HEATER_CONTROL_PERIOD);
|
static Pid heaterPid(0.1f, 0.1f, HEATER_CONTROL_PERIOD);
|
||||||
|
|
||||||
static float GetDutyForState(HeaterState state, float heaterEsr)
|
static float GetDutyForState(HeaterState state, float heaterEsr)
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,8 @@ static float GetDutyForState(HeaterState state, float heaterEsr)
|
||||||
|
|
||||||
return rampDuty;
|
return rampDuty;
|
||||||
case HeaterState::ClosedLoop:
|
case HeaterState::ClosedLoop:
|
||||||
return heaterPid.GetOutput(HEATER_TARGET_ESR, heaterEsr);
|
// Negated because lower resistance -> hotter
|
||||||
|
return heaterPid.GetOutput(-HEATER_TARGET_ESR, -heaterEsr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue