diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2013-11-08 21:30:10 +0400 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2013-11-08 21:30:10 +0400 |
commit | 6b085e8ced81d946307074f2ae44d6d62c63f170 (patch) | |
tree | 83a2448ea72ecc1d9b20653b04841d42bac00f89 /src/modules/commander/commander_helper.h | |
parent | 1a318ee2a60d95f7d64fe7ed13db8e5377b8c98c (diff) | |
download | px4-firmware-6b085e8ced81d946307074f2ae44d6d62c63f170.tar.gz px4-firmware-6b085e8ced81d946307074f2ae44d6d62c63f170.tar.bz2 px4-firmware-6b085e8ced81d946307074f2ae44d6d62c63f170.zip |
Use discharged current to estimate remaining battery charge if capacity is known
Diffstat (limited to 'src/modules/commander/commander_helper.h')
-rw-r--r-- | src/modules/commander/commander_helper.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/commander/commander_helper.h b/src/modules/commander/commander_helper.h index e9514446c..d0393f45a 100644 --- a/src/modules/commander/commander_helper.h +++ b/src/modules/commander/commander_helper.h @@ -75,12 +75,13 @@ void rgbled_set_mode(rgbled_mode_t mode); void rgbled_set_pattern(rgbled_pattern_t *pattern); /** - * Provides a coarse estimate of remaining battery power. + * Estimate remaining battery charge. * - * The estimate is very basic and based on decharging voltage curves. + * Use integral of current if battery capacity known (BAT_CAPACITY parameter set), + * else use simple estimate based on voltage. * * @return the estimated remaining capacity in 0..1 */ -float battery_remaining_estimate_voltage(float voltage); +float battery_remaining_estimate_voltage(float voltage, float discharged); #endif /* COMMANDER_HELPER_H_ */ |