{"action":"created","issue":{"url":"https://api.github.com/repos/diydrones/ardupilot/issues/1434","labels_url":"https://api.github.com/repos/diydrones/ardupilot/issues/1434/labels{/name}","comments_url":"https://api.github.com/repos/diydrones/ardupilot/issues/1434/comments","events_url":"https://api.github.com/repos/diydrones/ardupilot/issues/1434/events","html_url":"https://github.com/diydrones/ardupilot/issues/1434","id":44853214,"number":1434,"title":"Better estimate of battery capacity when arming","user":{"login":"lvale","id":3130363,"avatar_url":"https://avatars.githubusercontent.com/u/3130363?v=3","gravatar_id":"","url":"https://api.github.com/users/lvale","html_url":"https://github.com/lvale","followers_url":"https://api.github.com/users/lvale/followers","following_url":"https://api.github.com/users/lvale/following{/other_user}","gists_url":"https://api.github.com/users/lvale/gists{/gist_id}","starred_url":"https://api.github.com/users/lvale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvale/subscriptions","organizations_url":"https://api.github.com/users/lvale/orgs","repos_url":"https://api.github.com/users/lvale/repos","events_url":"https://api.github.com/users/lvale/events{/privacy}","received_events_url":"https://api.github.com/users/lvale/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/diydrones/ardupilot/labels/ArduCopter","name":"ArduCopter","color":"02e10c"},{"url":"https://api.github.com/repos/diydrones/ardupilot/labels/ArduPlane","name":"ArduPlane","color":"d7e102"},{"url":"https://api.github.com/repos/diydrones/ardupilot/labels/ArduRover","name":"ArduRover","color":"02d7e1"},{"url":"https://api.github.com/repos/diydrones/ardupilot/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2014-10-03T21:57:03Z","updated_at":"2015-06-25T10:19:30Z","closed_at":null,"body":"Considering that a large percentage of users use LiPo batteries and that this parameter\r\n\r\nsys_status->battery_remaining = mavlink_msg_sys_status_get_battery_remaining(msg);\r\n\r\n is reset to 100% when the vehicle is armed, and that the energy consumption when armed might be considered negligible, I would like to propose that a simple method to estimate battery capacity when the vehicle is armed, to be used. \r\nAlthough not perfect but way better than simple setting the value to 100%,  this method would get the voltage as it does now, and when armed estimates a number of cells \r\n\r\nNrCells (returning the smallest integer larger than or equal to (Voltage divided by 4.2v->LiPo nominal fully charged tension-<-)) \r\nand the voltage per cell (Voltage/NrCells)\r\n\r\nWith the value of Voltage per cell an empirical rule like below can be used to report the much more real value of capacity remaining with very low (->zero) current consumption.\r\n\r\n4.2v--100%\r\n4.00--84%\r\n3.96---77%\r\n3.93---70%\r\n3.90---63%\r\n3.86---56%\r\n3.83---48%\r\n3.80---43%\r\n3.76---35%\r\n3.73---27%\r\n3.70---21%\r\n3.67---14%\r\n\r\nThis will only change the initial value for battery remaining, and the current method to calculate it's value while in use remains.\r\n\r\nI don't believe it requires a large change of the code and has no dependencies."},"comment":{"url":"https://api.github.com/repos/diydrones/ardupilot/issues/comments/115200447","html_url":"https://github.com/diydrones/ardupilot/issues/1434#issuecomment-115200447","issue_url":"https://api.github.com/repos/diydrones/ardupilot/issues/1434","id":115200447,"user":{"login":"pepevalbe","id":12985864,"avatar_url":"https://avatars.githubusercontent.com/u/12985864?v=3","gravatar_id":"","url":"https://api.github.com/users/pepevalbe","html_url":"https://github.com/pepevalbe","followers_url":"https://api.github.com/users/pepevalbe/followers","following_url":"https://api.github.com/users/pepevalbe/following{/other_user}","gists_url":"https://api.github.com/users/pepevalbe/gists{/gist_id}","starred_url":"https://api.github.com/users/pepevalbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pepevalbe/subscriptions","organizations_url":"https://api.github.com/users/pepevalbe/orgs","repos_url":"https://api.github.com/users/pepevalbe/repos","events_url":"https://api.github.com/users/pepevalbe/events{/privacy}","received_events_url":"https://api.github.com/users/pepevalbe/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T10:19:30Z","updated_at":"2015-06-25T10:19:30Z","body":"My idea is to estimate the initial capacity at startup (just one time). After this calculation, capacity percentage will only get lower depending on your current consumption. There is no posibilty of changing up/down this way."}}