-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c61b67
commit bbd2b76
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,15 +146,15 @@ 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.997f + _remaining_voltage * 0.003f; | ||
const float rvoltage_filt = _remaining_voltage * 0.99f + rvoltage * 0.01f; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
LorenzMeier
Author
Member
|
||
|
||
if (PX4_ISFINITE(rvoltage_filt)) { | ||
_remaining_voltage = rvoltage_filt; | ||
} | ||
|
||
// remaining battery capacity based on used current integrated time | ||
const float rcap = 1.0f - _discharged_mah / _param_capacity.get(); | ||
const float rcap_filt = rcap * 0.99f + _remaining_capacity * 0.01f; | ||
const float rcap_filt = _remaining_capacity * 0.99f + rcap * 0.01f; | ||
|
||
if (PX4_ISFINITE(rcap_filt)) { | ||
_remaining_capacity = rcap_filt; | ||
|
@LorenzMeier is it correct that the two variables are swapped now?