mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
Battery estimation: Widen thresholds and filter more
This commit is contained in:
@@ -102,7 +102,7 @@ Battery::updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float curre
|
||||
void
|
||||
Battery::filterVoltage(float voltage_v)
|
||||
{
|
||||
if (_voltage_filtered_v < 0) {
|
||||
if (_voltage_filtered_v < 0.0f) {
|
||||
_voltage_filtered_v = voltage_v;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ Battery::estimateRemaining(float voltage_v, float throttle_normalized)
|
||||
// remaining battery capacity based on voltage
|
||||
const float rvoltage = (voltage_v - (_param_n_cells.get() * bat_v_empty_dynamic))
|
||||
/ (_param_n_cells.get() * voltage_range);
|
||||
const float rvoltage_filt = rvoltage * 0.99f + _remaining_voltage * 0.01f;
|
||||
const float rvoltage_filt = rvoltage * 0.997f + _remaining_voltage * 0.003f;
|
||||
|
||||
if (PX4_ISFINITE(rvoltage_filt)) {
|
||||
_remaining_voltage = rvoltage_filt;
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
* @decimal 2
|
||||
* @increment 0.01
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(BAT_V_EMPTY, 3.5f);
|
||||
PARAM_DEFINE_FLOAT(BAT_V_EMPTY, 3.4f);
|
||||
|
||||
/**
|
||||
* Full cell voltage (5C load)
|
||||
@@ -68,7 +68,7 @@ PARAM_DEFINE_FLOAT(BAT_V_EMPTY, 3.5f);
|
||||
* @decimal 2
|
||||
* @increment 0.01
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(BAT_V_CHARGED, 4.1f);
|
||||
PARAM_DEFINE_FLOAT(BAT_V_CHARGED, 4.05f);
|
||||
|
||||
/**
|
||||
* Low threshold
|
||||
@@ -116,7 +116,7 @@ PARAM_DEFINE_FLOAT(BAT_CRIT_THR, 0.07f);
|
||||
* @decimal 2
|
||||
* @increment 0.01
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(BAT_V_LOAD_DROP, 0.25f);
|
||||
PARAM_DEFINE_FLOAT(BAT_V_LOAD_DROP, 0.3f);
|
||||
|
||||
/**
|
||||
* Number of cells.
|
||||
|
||||
Reference in New Issue
Block a user