Hi there, I am trying to get total power mAh consumed during a flight using CurrTot. I have a graph in Mission Planner but what are the units being used? Thanks.
milliAmpHour
and not in Mission Planner but in the log.
Thanks. Think I need some calibration!
indeed
…
When I look at BAT.CurrTot in my logs, I see units “unknown”. Is there a way to get them to show up when reviewing a log? Initially I thought they were Coulombs until I found your comment.
Related, is there a way to change the units that appear on these graphs? Perhaps to use kWh instead of Watt-seconds when viewing BAT.EnrgTot, for example.
No way to change the units in the MP graphs.
you could doubleclick the parameter before displaying it on the right side of the MP log viewer. There you can do any calculation you want. After that you choose that value to display et voilà The downside is that you would have to do this every time…
So MP may allow you to change the units if it had an inkling of what the units were.
Sadly, the metadata in the ArduPilot codebase isn’t complete in this case - probably me being lazy.
https://github.com/ardupilot/ardupilot/blob/pr%2Flog-download-tests/libraries/AP_Logger/LogStructure.h#L2340 <- those ?
mean, “I’m too lazy to work out what the unit of this field is”.
I would imagine it’s Amps * seconds
- perhaps with some sort of multiplier involved. Perhaps @WickedShell knows?
It looks like AP_BattMonitor records the total consumed current in mAh, which jives with what @Eosbandi says above. The default units for charge in AP_Logger are Ampere seconds, so I think it would be pretty straightforward to tweak the code to reflect that.
Would it make more sense to report the total consumed current in Ah or mAh? I noticed in AP_Logger there were a few places where units weren’t entirely SI for readability reasons. Users might be used to seeing mAh in the logs even though the units aren’t shown. Switching to Ampere seconds might be confusing. As far as I can tell (correct me if I’m mistaken), the CurrTot message is the only place in AP_Logger where the units for electric charge are used.
I tried to tweak the code and make a pull request but honestly, I have no clue what I’m doing. Those two changes need to be separate pull requests, I’m not sure how they both ended up on the same one.
Blockquote[quote=“MisterMower, post:9, topic:52316”]
I tried to tweak the code and make a pull request but honestly, I have no clue what I’m doing. Those two changes need to be separate pull requests, I’m not sure how they both ended up on the same one.
[/quote]
Those logger changes looks to be correct.
I don’t see a problem. I’ve been using mAh for YEARS. I have my battery monitors calibrated to within ± 50mAh between current used and current charged.