mirror of https://github.com/rusefi/wideband.git
heater_control: do not preheat on low voltages (#286)
Co-authored-by: Andrey Gusakov <dron0gus@gmail.com>
This commit is contained in:
parent
2469315a35
commit
982cd32ee7
|
@ -42,6 +42,7 @@ HeaterState HeaterControllerBase::GetNextState(HeaterState currentState, HeaterA
|
|||
if (batteryVoltage < HEATER_BATTETY_OFF_VOLTAGE)
|
||||
{
|
||||
batteryStabTime = batteryStabTimeCounter;
|
||||
return HeaterState::NoHeaterSupply;
|
||||
}
|
||||
// measured voltage is high enougth to auto-start heating, wait some time to stabilize
|
||||
if ((batteryVoltage > HEATER_BATTERY_ON_VOLTAGE) && (batteryStabTime > 0))
|
||||
|
@ -143,9 +144,11 @@ float HeaterControllerBase::GetVoltageForState(HeaterState state, float sensorEs
|
|||
// TODO: heater PID should operate on temperature, not ESR
|
||||
return 7.5f - heaterPid.GetOutput(m_targetEsr, sensorEsr);
|
||||
case HeaterState::Stopped:
|
||||
case HeaterState::NoHeaterSupply:
|
||||
// Something has gone wrong, turn off the heater.
|
||||
return 0;
|
||||
case HeaterState::NoHeaterSupply:
|
||||
// No/too low heater supply - disable output
|
||||
return 0;
|
||||
}
|
||||
|
||||
// should be unreachable
|
||||
|
|
Loading…
Reference in New Issue