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.
This commit is contained in:
Matthias Grob
2018-02-22 10:22:37 +01:00
committed by Lorenz Meier
parent 5bb9babc20
commit d39a8b5a48
+2 -5
View File
@@ -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);