Creating a low voltage alert

Hi all,
We would like to create an alert (like an audible message or a colored flashing screen) that will alert the ROV pilot at a desired battery voltage level. Ideally this would include a time plot that shows the voltage history so that we can distinguish brief voltage dips from consistent levels. We are running a BlueROV2 with BlueOS/Navigator. For other telemetry data (e.g. DVL positioning) we have written scripts to extract log data and plot it graphically. We’d love to hear how others have solved the problem of end-of-dive pilot distraction and excessive battery drawdown (other than, of course, simply paying closer attention to the on-screen voltage readout in QGC!).

Hi @ScottM,

There are failsafes and corresponding parameters for this built into ArduSub already:

Parameter Description
BATT_LOW_VOLT Threshold for a “low voltage” event
BATT_FS_LOW_ACT Failsafe action in response to a low voltage event
BATT_LOW_TIMER Grace period before the event failsafe triggers (to avoid brief dips)
BATT_CRT_VOLT Threshold for a “critical voltage” event
BATT_CRT_FS_ACT Failsafe action in response to a critical voltage event

There’s definitely room for the ArduSub documentation and the control station user interface to be more clear about these options. I’ve recently suggested some battery indicator concepts (internally) to that effect, that I’m hopeful we can include in Cockpit to make it more intuitive and simple to understand and maintain a healthy battery state during operation.

Thanks Eliot. As far as I can see, the options for BATT_CRT_FS_ACT and BATT_FS_LOW_ACT include only “Disarm”, which I don’t want, and “Enter surface mode”, which I can’t find described anywhere, but am pretty sure I don’t want. A visual or auditory warning is what I’m after.

Ideally, I’d like to access real-time battery voltage and plot it in a separate topside application (which I don’t mind coding, but would love to see any hints from existing examples). Is this where the MAVLink REST API would come in handy? Or setting up a UDP endpoint for connecting to with Pymavlink from the surface?

Yeah, that’s poorly documented. I just tried it and leaving the failsafe action on “None” still gives you both a visual and auditory warning - the battery symbol and voltage turn orange (red for critical), the megaphone symbol turns into a warning symbol, and it speaks a message about the relevant battery level. Note that the low/critical status is apparently only determined while the vehicle is armed (so if the battery is low while disarmed it won’t warn you until you’ve armed it).

You could do this by popping out QGroundControl’s MAVLink Inspector window, selecting the BATTERY_STATUS message, and checking the plot box next to the voltage field.

If you’re not a fan of the plot style, or the messages being listed on the left side of the window, then making your own plot is also an option.

Either of these should work fine. I’m more familiar with establishing actual MAVLink communications via Pymavlink and filtering for the relevant message in the stream (using e.g. master.recv_match(type="BATTERY_STATUS")), but for the REST approach you’d just need to repeatedly fetch http://blueos.local:6040/mavlink/vehicles/1/components/1/messages/BATTERY_STATUS and extract the data you want to plot from the json response :slight_smile: