diff --git a/firmware/heater_control.cpp b/firmware/heater_control.cpp index 7594814..a0b5244 100644 --- a/firmware/heater_control.cpp +++ b/firmware/heater_control.cpp @@ -178,7 +178,7 @@ void HeaterControllerBase::Update(const ISampler& sampler, HeaterAllow heaterAll } // duty = (V_eff / V_batt) ^ 2 - float voltageRatio = heaterVoltage / batteryVoltage; + float voltageRatio = (batteryVoltage < 1.0f) ? 0 : heaterVoltage / batteryVoltage; float duty = voltageRatio * voltageRatio; #ifdef HEATER_MAX_DUTY