Monitoring/checking all power inputs

I am trying to see if its possible to monitor the health of the two 5v power inputs. All I can see is one hwvoltage which I presume is the internal 5v rail. I would like a warning if the backup power fails.
I guess its possible to put the 2nd 5v in on the volt monitoring pin of the power port but its not a neat solution.
Also, will the cube run off the servo rail if the 2 main inputs fail? I see it lights up but does not play the buzzer self check if supplied from just the servo rail.

Any link to more detailed documentation and circuit diagrams please?

Each power rail has a power good signal. This will let you know which ones are ok

Sorry Philip, I dont really understand what you mean. It seems I can disconnect power 2 without getting any warnings. I dont want the situation where Im thinking I have a backup power but it has actually failed at some point without generating a warning.

Are you monitoring it? How are you trying to see this?
Power 1
And power 2

I have a power brick on power1 (of course this is monitoring batt volt but it wont tell me if the 5v side has failed if power2 is good). I have 5v UBEC driving power2. But what I want is a warning, or at least some way of checking occasionally if one of the 5v has failed (without using a voltmeter) It seems hwvolt or boardvolt will not change (much) if one of the inputs fails.
The only way I can see to check and generate warning is to use the analog sense pin on power2 to check the UBEC 5v. I’m sure there’s a neater way, also this wont inform me if the 5v from the power brick has failed and the UBEC is good.

There is a power bitmask that checks this.

@Michael_Oborne

The bitmask is POWR.Flags in the logs, and appears in Mavlink status as POWER_STATUS {Vcc : 5249, Vservo : 5322, flags : 3}

The bitmask is enumerated as follows:

MAV_POWER_STATUS_BRICK_VALID=1, /* main brick power supply valid | /
MAV_POWER_STATUS_SERVO_VALID=2, / main servo power supply valid for FMU | /
MAV_POWER_STATUS_USB_CONNECTED=4, / USB power is connected | /
MAV_POWER_STATUS_PERIPH_OVERCURRENT=8, / peripheral supply is in over-current state | /
MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT=16, / hi-power peripheral supply is in over-current state | /
MAV_POWER_STATUS_CHANGED=32, / Power status has changed since boot | /
MAV_POWER_STATUS_ENUM_END=33

So, with both power inputs normal, your flag will be 3. If, for example, the power brick fails, the flag should change to 34 (2 + 32), to indicate that input 1 is bad, input 2 is good, and the status has changed since last boot.

Thanks for trying to help but I must be missing a huge gap in my arduknowlage.
I assume I have to get into the code to make use of the above info. Should I manage to do that, will MP give a warning if one supply drops out?
Please steer me in the right direction. I have done a few C and arduino projects but never tried to fiddle with the Ardupilot code. (actually I did reverse the motors way back before H frame was an option)
Sorry to be dumb about this.

I don’t think Mission Planner generates a message based on the power flags (maybe it should). However, they do show up in your dataflash logs under POWR.Flags, but I realize that doesn’t exactly help you in flight.

I mentioned the MAVLink message because I didn’t know what kind of communication you had with your drone. The “correct” way would be to generate a warning based on this message, but I don’t know if any of the off-the-shelf GCSes do that.