Selecting Correct Variable for Voltage Sensing on Two Batteries

Hello,

We are using our BlueROV Heavy with two batteries, and two Blue Robotics voltage/current sense modules. We have this working in QGroundControl, but haven’t been able to get the voltage readouts from both batteries in Cockpit. The hardware setup is as described in an earlier post I made about this, where we initially got it sorted out in QGroundControl (this post: Connecting Second Battery and Power Sense Module ).

Right now, we have two generic input widgets, set to read variables 'BATTERY_STATUS_/id=0/voltages/0 (for the first battery) and 'BATTERY_STATUS_/id=1/voltages/0 (for the second battery). The screenshot below shows how we have it set up for Battery 2.

Battery 1 is the same, except for ‘id=0’ instead of ‘id=1’. As I understand it, ‘voltages/0’ is the correct voltage to read, as ‘voltages/1’',3, etc. are voltages of individual cells, and this is not something we can read (or want to) with the hardware we have got.

I should also mention we have tried the variable ‘/mavlink/1/1/Battery Status/id=1/voltages/0’, but that does not seem to give us the voltage readings we are after…I am not sure what the specific difference is between this varialble and ‘BATTERY_STATUS/…’ variables?

Anyway, when we implement these two widgets in cockpit, both batteries show the same voltage…we have measure the voltages on the H6 Pro charger, and we know they are not identical (we unbalanced them a bit, for testing purposes). As mentioned, the voltages of the two batteries do show up as expected and match the voltages shown on the charge in QGroundControl. In Cockpit we get something like this:

Based on the QGround Control, we are expecting Battery 1 to show 14.3 and Battery 2 to show 14.9 (or vice versa, depending on which variable maps to which battery).

Is this a case of just selecting the wrong variable, and if so, can you tell me which variable we should select for our generic input widget?

Thanks very much,

Ben

It is the correct value, but the reasoning isn’t fully correct. Per the BATTERY_STATUS spec:

The original variables had no prefix, but we’ve duplicated them to support future multi-source applications (e.g. with multiple vehicles sending data to Cockpit), and specified which communication protocol it’s coming from (as part of a broader data-lake cleanup). The variables with and without the prefix should have the same value.

Can you check the Tools / Data Lake page and see whether any of the BATTERY_STATUS variables have the value you’re looking for? That’s likely easier and faster than trying them one by one in the indicator.

If the id=0 and id=1 variables are fully matching then there might be a bug in the instance splitting logic. And if the ones with the prefixes are not matching the un-prefixed ones then that’s also likely a bug. Please share screenshots if either of those is the case.

Hi @EliotBR,

I had a look at all the variables associated with Battery in the Data Lake. Note that I did this test with one battery fully disconnected (I believe ‘Battery 1’ was disconnected) to see what would show up in the Data Lake. Here at the variables associated with Battery_0 (you can also see the two battery indicator generic input widgets on the top bar, showing the same values).

Here are the variables associated with Battery_1.

To me they, look identical. I can’t get them both on the same page of the Data Lake view at the same time, but I think the difference in the last 3 digits of the voltage reading is just a manifestation of changes when I’m flipping through the Data Lake variable - I do believe they are reporting identical voltages.

Please let me know if there is something else we should try, or if it is indeed a bug.

Thanks,

Ben

Try tipping “voltages/0”. Both should show up at the same time. This way we can confirm the problem.

I investigated the code around the value splitting for same messages with different IDs and couldn’t find any problem.

@bsnow if you confirm that the two values are indeed equal in /menu/tools/data-lake, there’s another possibility I would like to investigate: Cockpit receiving equal (wrong) values.

For that I’ve built this temporary release that you can download and test. Go to /menu/settings/dev and click the “Start” button to generate a MAVLink dump. 10 seconds are enough. Download the file and send here so we can check it.

Hi @rafael.lehmkuhl, thanks for those suggestions.

I had a look again at the output from the Data Lake, with the variable selection of ‘voltages/0’, as requested. Here is a screenshot of what I see:

Here is a short video clip, where you can see that the mV values for the two variable are close, but not exactly the same:

So that voltages are slightly different, on a mV scale, between the two batteries. That being said, I’m a bit confused because we only had one battery connected when we did this test. The other battery was physically disconnected, and thus I would expect one of the channels to read 0 or perhaps 65k or something like that. Not sure if that is the expected behaviour or not? There are two BlueRobotics power sense modules connected - can you tell me what the expected value for parameter /BATTERY_STATUS/id=X/voltages/0 would be with no battery connected?

I can also say, the voltage values seem correct - when we take our battery off the H6 Pro Charger after it has completed a charger cycle, it reads 16.81 V. Cockpit also shows 16.8k volts in the battery indicator.

I will try the temporary release, and send the a MAVLink dump. Any other troubleshooting steps we should try in the interim, please let us know.

Thanks,

Ben

Hi @bsnow -

Can you detail how you’re wiring both batteries to the system? If you have both battery harnesses connected to the bus bars at the back of the BlueROV2 enclosure, you’re effectively wiring the batteries together in parallel. Are you separating their output so that half the ESCs are connected to one battery? It sounds like both of your power sense modules are connected to this, and potentially sensing the voltage on their output? How do the messages compare for measured current?

The small difference you’re seeing to me indicates that two analog inputs are reading effectively the same voltage…

I’m a bit stumped on your goal for monitoring the voltage of two batteries - it seems simpler to intentionally wire them in parallel, and monitor one voltage and current output from them, and set the correct parameter to a capacity that reflects the total capacity of the batteries. The only “gotcha” is that batteries always need to be charged to an equal level before being connected in parallel - but this isn’t a problem for the BlueBoat! Are you using the second battery for some separate payload perhaps, and don’t want to risk losing control if you use up that power source?

@bsnow any updates on this?