Failsafe / Warning for 5V Flight Controller power loss

Does anyone know if it it possible to setup a warning (ideally a MAVlink message) that would let the operator know if power is lost on one of the two main power inputs? Is it possible to monitor the voltages on the inputs (I am using a Pixhawk Orange Cube)?

We lost a very expensive aircraft last year because we lost power on both our inputs due to regulators failing from heat. The primary likely failed weeks if not months prior, so this situation could have been avoided if we knew the primary had failed.

Does anyone else agree this is an important safety feature?


Have you got a .bin log of a flight with good power supplies, and the flight where the remaining power supply failed?

The signals are there in the Cube for each of the 5vdc inputs

There is POWR:Flags in logging.

And in MissionPlanner there is “voltageflag” which can be added to the HUD (or the Tuning window of the Map). This may be the most useful so far.

The Ardupilot code also includes something labelled
for notifying when the status changes while armed.
I’m trying to work out more about which flag values mean what and where the MAV_POWER_STATUS_CHANGED would be apparent.

Someone may already know and can inform us, or I will keep looking through the code and logs

This is the mavlink message

In MAV_POWER_STATUS the second power brick of the Cube (or any other fight controller with two power connectors) is the “SERVO_VALID” line, according to what I can see in the AP code. I assume this is because the servo power rail is not used as source of power for the flight controller anymore, but was used in earlier flight controllers. The naming has stayed the same.

So if both power bricks are good, you should have a flag value of 3.
Brick 1 valid: 1
Brick 2 valid: 2
Both valid: 3
USB connected (but nothing else) : 4
2 valid power bricks and USB connected = 7

So if flight started with 2 valid power bricks (flag 3) and one died during flight, you would also get the MAV_POWER_STATUS_CHANGED flag and drop a power brick flag, so will go from:
1+2 = 3
1 + 0 +32 = 33
So any flag greater than 32 and you will know something just changed.

With the limited testing I can do here at the moment, these values seem to translate to the MissionPlanner “voltageflag” which can be added to the HUD (right-click, User Items)
This should also be in POWR:Flags in dataflash logs.

Unfortunately the SD card got destroyed in the crash.

Thanks so much for looking into this. I will definitely look into adding the power flag to the HUD.

The only unfortunate part is we rarely have our ground station on or near us for our type of operations. Really the only time it’s on is for RTK (and it’s not near us). It would be really helpful to be able to have a:
a) MAVmessage so we could see the fault on our FPV feed.
b) Flight controller LED warning light
c) Pre-arm check

Either way the a quick check on the HUD for the power flag is a good start.

You can also write a simple lua script to send the information to your ground station. Including defining an automatic failsafe in case one of the feeders fails.