mirror of https://github.com/rusefi/wideband.git
detect underheat fault
This commit is contained in:
parent
b32d6bf80f
commit
5c9acd4c66
|
@ -7,6 +7,7 @@ enum class Fault
|
|||
// First fault code at 3 so it's easier to see
|
||||
SensorDidntHeat = 3,
|
||||
SensorOverheat = 4,
|
||||
SensorUnderheat = 5,
|
||||
};
|
||||
|
||||
void setFault(Fault fault);
|
||||
|
|
|
@ -59,12 +59,16 @@ static HeaterState GetNextState(HeaterState state, float sensorEsr)
|
|||
|
||||
break;
|
||||
case HeaterState::ClosedLoop:
|
||||
// TODO: handle departure from closed loop
|
||||
if (sensorEsr < HEATER_FAULT_ESR)
|
||||
if (sensorEsr < HEATER_OVERHEAT_ESR)
|
||||
{
|
||||
setFault(Fault::SensorOverheat);
|
||||
return HeaterState::Stopped;
|
||||
}
|
||||
else if (sensorEsr > HEATER_UNDERHEAT_ESR)
|
||||
{
|
||||
setFault(Fault::SensorUnderheat);
|
||||
return HeaterState::Stopped;
|
||||
}
|
||||
|
||||
break;
|
||||
case HeaterState::Stopped: break;
|
||||
|
|
|
@ -38,4 +38,5 @@
|
|||
|
||||
#define HEATER_CLOSED_LOOP_THRESHOLD_ESR 2000
|
||||
#define HEATER_TARGET_ESR 300
|
||||
#define HEATER_FAULT_ESR 200
|
||||
#define HEATER_OVERHEAT_ESR 200
|
||||
#define HEATER_UNDERHEAT_ESR 3000
|
||||
|
|
Loading…
Reference in New Issue