Skip to content
Snippets Groups Projects
Commit 6de02c46 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Battery estimation: Widen thresholds and filter more

parent 4c61f522
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment