-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC 0018 - Improved Battery Status Reporting #19
base: master
Are you sure you want to change the base?
Conversation
6f9db10
to
f72ae85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for putting this together @hamishwillee
Co-authored-by: Jacob Dahl <[email protected]>
Co-authored-by: Jacob Dahl <[email protected]>
@hamishwillee I was thinking about fuel flow, and it depends how we map the units. An idle engine may have very low fuel flow. |
@tridge I'm not sure the argument is compelling unless you are expecting the GCS to integrate the received current? If that's a use case, this makes sense. Otherwise the power monitor can integrate whatever current it likes - if the vehicle happens to be sitting unused for 2 weeks and the monitor is calculating the usage accurately you'll still get the right The data size is the same so over the wire data doesn't matter. You could argue it is easier to calculate/send. I'm fine with it if @hendjoshsr71 @dakejahl all think it is worth doing. All, please confirm, or offer counter arguments. Note the only change would be
|
one thing we should seriously consider is adding float16 as a base type in mavlink. If we'd done the original mavlink battery msgs as float16 volts and amps then we probably wouldn't have been discussing these new msgs at all. |
having this:
that costs 8 bytes and gives the GCS what it really needs to sound an alarm about a bad cell |
Note that smart batteries should set the MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL bit to indicate that supplied capacity values are relative to a battery that is known to be full. | ||
Power monitors would not set this bit, indicating that capacity_consumed is relative to drone power-on, and that other values are estimated based on the assumption that the battery was full on power-on. | ||
</description> | ||
<field type="uint8_t" name="id" instance="true">Battery ID</field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<field type="uint8_t" name="id" instance="true">Battery ID</field> | |
<field type="uint16_t" name="id" instance="true">Battery ID</field> |
Is there a need to support more than 255 batteries? @AlexKlimaj thoughts? Would you ever go bigger than 255 in your box?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope not. That feels like excessive future proofing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean .. maybe ... is it? What if someone wanted to replace autopilot with ardupilot? 🤨
https://www.google.com/search?q=how+many+batteries+in+a+tesla
see what I did there I rhymed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dakejahl And you wonder why nobody likes you :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha ouch but you're wrong I am beloved. But no in DroneCAN I think it can make sense, probably not mavlink
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah yeah :-). I'm going to say no "right now". Yes this might come back and bite us, but it feels like a waste.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thought about that one before too.....
But i guess one could create their own message at that point. :)
For mavlink no reason to waste space.
yeah this actually makes a lot of sense because the SMART_BATTERY_INFO message doesn't indicate anything about cells being bad. I don't think streaming the cell voltages all the time is a good idea either and the GCS shouldn't be forced to do that. You guys know more about message design than I do, is 10 more bytes breaking the bank? We're at 217 right now with v2 frame overhead. So that's a 4.6% increase in size... seems worth it to me edit: there are the status flags for sounding an alarm in general, but knowing if a cell is going bad before it actually does could be useful |
@dakejahl SO current proposal is that this is in its own message. Its a low rate message so ideally not on Battery_status_v2 message. It could go on the SMART_BATTERY_INFO maybe, but I'd prefer not to. |
oh wait I also think I counted wrong we're only at 49 bytes
Frame overhead is 25 bytes, for a 10 byte message? Does it make more sense to stuff it somewhere else where it's already getting polled or low rate streamed? Is the overhead less of a worry with low rate messages? |
for the max/min cell proposal, we also need cell count so we can calculate avg to get deviation from avg for the warning trigger |
@tridge @hendjoshsr71 @dakejahl @auturgy
|
@tridge @dakejahl @hendjoshsr71 I have merged the BATTERY_STATUS_V2 into development.xml, unchanged since my last comment above #19 (comment). A couple of issues came up that we decided did not warrant changes - see at bottom Let's get some testing. Is anyone "in particular" committing to implementing these, and in what timeframes? I ask because we're trying to make sure that things don't live in development.xml forever. if no one else, I will start the process of doing this for PX4. @WickedShell @tridge - the voltage cell message has not gone in, as that is still waiting on a precise definition from "someone". The changes discussed for BATTERY_STATUS_V2 that did not change anything:
|
Is this still relevant? I'm just looking at mavlink/MAVSDK#1792... |
<entry value="262144" name="MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL"> | ||
<description> | ||
Battery capacity_consumed and capacity_remaining values are relative to a full battery (they sum to the total capacity of the battery). | ||
This flag would be set for a smart battery that can accurately determine its remaining charge across vehicle reboots and discharge/recharge cycles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag would be set for a smart battery that can accurately determine its remaining charge across vehicle reboots and discharge/recharge cycles. | |
This flag would be set for a battery that can accurately determine its remaining charge across vehicle reboots and discharge/recharge cycles. |
The BATTERY_STATUS has two arrays that can be used to report individual cell voltages (up to 14), or a single cumulative voltage, and which cannot be truncated.
The vast majority of consumers are only interested in the total battery voltage, and either sum the battery cells or get the cumulative voltage.
This RFC proposes two new messages, separating out the individual voltage for cells as cell fault information. The result is a simpler message to understand and use. We've also liased with UAVCAN in order to ensure that the messages are compatible with what UAVCAN is doing.