mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
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:
@@ -330,6 +330,10 @@ uint16_t Battery::determineFaults()
|
|||||||
faults |= (1 << battery_status_s::FAULT_SPIKES);
|
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;
|
return faults;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 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 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
|
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;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user