Battery: Declare fault on overtemperature

If the measured temperature exceeds the fixed threshold of 100 degC, a
fault is declared, causing batteryCheck to show a failsafe warning to
the user.
This commit is contained in:
Balduin 2026-02-09 11:59:36 +01:00 committed by Matthias Grob
parent 3fb1459c33
commit ecf8191aad
2 changed files with 10 additions and 0 deletions

View File

@ -330,6 +330,10 @@ uint16_t Battery::determineFaults()
faults |= (1 << battery_status_s::FAULT_SPIKES);
}
if (PX4_ISFINITE(_temperature_c) && _temperature_c > BAT_TEMP_MAX) {
faults |= (1 << battery_status_s::FAULT_OVER_TEMPERATURE);
}
return faults;
}

View File

@ -217,4 +217,10 @@ private:
static constexpr float OCV_DEFAULT = 4.2f; // [V] Initial per cell estimate of the open circuit voltage
static constexpr float R_COVARIANCE = 0.1f; // Initial per cell covariance of the internal resistance
static constexpr float OCV_COVARIANCE = 1.5f; // Initial per cell covariance of the open circuit voltage
// Temperature [degC] above which an overtemperature fault is declared,
// leading to a failsafe warning recommending immediate landing. Note
// that depending on the setup this may be measured in/close to the
// battery (smart battery) or from a separate power monitor module.
static constexpr float BAT_TEMP_MAX = 100.0f;
};