heater tweaks

This commit is contained in:
Matthew Kennedy 2021-07-12 23:45:35 -07:00
parent 21a3ae4939
commit 1119d79856
2 changed files with 6 additions and 6 deletions

View File

@ -92,7 +92,7 @@ static float GetVoltageForState(HeaterState state, float heaterEsr)
{
case HeaterState::Preheat: return 0.04f;
case HeaterState::WarmupRamp:
if (rampVoltage < 12)
if (rampVoltage < 10)
{
// 0.3 volt per second, divided by battery voltage and update rate
constexpr float rampRateVoltPerSecond = 0.3f;
@ -135,9 +135,9 @@ static void HeaterThread(void*)
state = GetNextState(state, heaterEsr);
float heaterVoltage = GetVoltageForState(state, heaterEsr);
// Limit to 13 volts
if (heaterVoltage > 13) {
heaterVoltage = 13;
// Limit to 11 volts
if (heaterVoltage > 11) {
heaterVoltage = 11;
}
// duty = (V_eff / V_batt) ^ 2

View File

@ -44,7 +44,7 @@
#define HEATER_PREHEAT_TIME 5000
#define HEATER_WARMUP_TIMEOUT 30000
#define HEATER_CLOSED_LOOP_THRESHOLD_ESR 800
#define HEATER_CLOSED_LOOP_THRESHOLD_ESR 400
#define HEATER_TARGET_ESR 300
#define HEATER_OVERHEAT_ESR 150
#define HEATER_UNDERHEAT_ESR 1200
#define HEATER_UNDERHEAT_ESR 600