Skip to content
Snippets Groups Projects
Commit d39a8b5a authored by Matthias Grob's avatar Matthias Grob Committed by Lorenz Meier
Browse files

Battery: Switch thrust based load compensation back to linear

To account for the parameter definition.
My tests if quadratic is actually better in practise were anyways not conclusive.
parent 5bb9babc
No related branches found
No related tags found
No related merge requests found
......@@ -167,8 +167,6 @@ Battery::sumDischarged(hrt_abstime timestamp, float current_a)
void
Battery::estimateRemaining(float voltage_v, float current_a, float throttle_normalized, bool armed)
{
// remaining battery capacity based on voltage
float cell_voltage = voltage_v / _n_cells.get();
......@@ -177,9 +175,8 @@ Battery::estimateRemaining(float voltage_v, float current_a, float throttle_norm
cell_voltage += _r_internal.get() * current_a;
} else {
// assume quadratic relation between throttle and current
// good assumption if throttle represents RPM
cell_voltage += throttle_normalized * throttle_normalized * _v_load_drop.get();
// assume linear relation between throttle and voltage drop
cell_voltage += throttle_normalized * _v_load_drop.get();
}
_remaining_voltage = math::gradual(cell_voltage, _v_empty.get(), _v_charged.get(), 0.f, 1.f);
......
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