PX4/Firmware — pull request #739 by DrTon (2014-03-15 08:19:17+00:00)
Title: Add default battery parameters to autostart scripts, battery sensor tuning

To fix https://github.com/PX4/Firmware/issues/737

I've added default batt parameters for F330 as example (tuned on my 2600mAh 3S battery, I think it's close to average setup).

- pink: current version estimate, min(V, Discharged), V_EMPTY=3.4, V_FULL=3.7
- blue: proposed in this PR
- yellow: resistance-compensated, with 0.2Hz filter

![batt_f330](https://f.cloud.github.com/assets/4341525/2427919/e26f64b8-ac18-11e3-8cd0-65e79fbb63ef.png)

Yellow looks perfect, right? ;) But this result is post-tuned! I had 3 batts of the same model and age, and error between voltage-based remaining charge estimates was 30%! I.e. you will never know which voltage will have unknown battery (or even known, but under unknown conditions) when it will have 30% of charge.

Laptops and cell phones has well known, calibrated batteryes, and remaining charge estimators, moreover they can learn their batteries, but try to use it at low temp (0 C) and you will see that it fails, phone/laptop can die at 50% of charge... So, I have no idea how to solve this problem perfectly. Looks like all we can do: report 60% charge during 90% of flight and say "battery is dead" on last 10-20 seconds - this will work on all setups :)