Need description of more Power Status flag numbers

Hello,

While investigating a mid flight power down of my pixhawk driven hexa, Im hooked up via APM planner’s graph view and plugging in and un-plugging power sources to try to find what’s causing my problem.

In the graph view, several Power_Status flag number appears that I can’t find in this list: pixhawk.ethz.ch/mavlink/
(link won’t work on Safari 6.1.6 by some reason)

Attaching screen dumps.

Major :question: is when flag values goes from 1 to 35, as appears to be without any obvious provocation in my attached picture. 34 is probably because I just then unplug the main power source and pixhawk jumps over to back up power via the servo rail.

Anyone know more about these numbers? Thanks!

And now another Power status flag: 3. Appears in the graph just after main and servo power’s been connected a few seconds apart starting with main

Sent using Tapatalk

The value you are looking at is defined as below,

typedef enum MAV_POWER_STATUS
{
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, /
| */
} MAV_POWER_STATUS;

The values are ORed together, which in this case means just added-up.

BRICK refers to the power module (more specifically, the pixhawk dedicated power input, whatever the source).

3 (1 OR 2) means,
MAV_POWER_STATUS_BRICK_VALID and MAV_POWER_STATUS_SERVO_VALID
In your case anything other than this indicates you are having a fault. Without the VSERVO connection you would expect only 1.

34 (2 OR 32) means,
MAV_POWER_STATUS_SERVO_VALID and MAV_POWER_STATUS_CHANGED
Only VSERVO is present, and there have been changes in power status

35 (1 OR 2 OR 32) means,
MAV_POWER_STATUS_BRICK_VALID and MAV_POWER_STATUS_SERVO_VALID and MAV_POWER_STATUS_CHANGED
BRICK and VSERVO are currently, but at some point one of them was missing.

If you plug/unplug the USB port during your testing, you will flag MAV_POWER_STATUS_CHANGED without it actually being a problem. This will also add 4 to your value while the USB is connected.

Thanks! But i dont follow here…“Added up”? Shall I combine number to get new values. Now I got 33 in the graph for example…

Sent using Tapatalk

The different parameters are binary bit-fields, as follows,

bit = 1 is ‘set’, bit = 0 is ‘clear’

These are the binary equivalents of the flag values,
76543210 = bit order
00000001 = 1 (bit 0 set); MAV_POWER_STATUS_BRICK_VALID
00000010 = 2 (bit 1 set); MAV_POWER_STATUS_SERVO_VALID
00000100 = 4 (bit 2 set); MAV_POWER_STATUS_USB_CONNECTED
00001000 = 8 (bit 3 set); MAV_POWER_STATUS_PERIPH_OVERCURRENT
00010000 = 16 (bit 4 set); MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT
00100000 = 32 (bit 5 set); MAV_POWER_STATUS_CHANGED

Now you can combine any of these together to indicate any or all of the flags being set at a particular time.

If you convert your number (33) to binary, you will get,
00100001

You see bit 0 and bit 5 are set, which correspond to MAV_POWER_STATUS_BRICK_VALID and MAV_POWER_STATUS_CHANGED. Which means your power module is active, and the power status has changed (something added /removed) since power on.

The key to understanding all of this is to realize there is only one possible way to add the values 1,2,4,8,16,32,64,128 to get any particular number between 0 and 255 (an 8 bit number); it might be helpful to read-up on binary numbers.

Aah! Rings a very very distant bell from uni. Think I got it, thanks a lot!!

:smiley:

Hi!) May by someone can help me)
During flight POWR Flags
During the flight, the POWR Flags had the value of 19. Just before the end of the minute, it had values of 49 and 51. Could you provide descriptions for all the bits, as I can see only up to the 5th bit discussed above? Immensely grateful.

19 = bit values 1 2 16

  • MAV_POWER_STATUS_BRICK_VALID
  • MAV_POWER_STATUS_SERVO_VALID
  • MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT

so you have a problem with accessories that should be run from a BEC

49 = bit values 1 16 32

  • MAV_POWER_STATUS_BRICK_VALID
  • MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT
  • MAV_POWER_STATUS_CHANGED

lost valid servo power

51 = bit values 1 2 16 32

  • MAV_POWER_STATUS_BRICK_VALID
  • MAV_POWER_STATUS_SERVO_VALID
  • MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT
  • MAV_POWER_STATUS_CHANGED

regained valid servo power
still over current on the accessories though!

1 Like

Thank you for your response. I didn’t specify the flight controller model.
Pixhawk 6C
Ardupilot Copter 4.3.2
We use main and reserve power and do not use servo
Are these bits decoded in the same way?

I still can’t understand what’s wrong. I connected the flight controller separately via Type-C (no external devices connected) and I’m getting the value POWR Flags 20. Should it be like this?

Could the MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT flag be raised, cause the entire system to shut down suddenly while in flight? Sometimes there is a sharp drop in voltage and shutdown with the drop of the copter, and sometimes all indicators are normal with a charged battery, but the copter simply falls without power.

20 = bit values 4 and 16
MAV_POWER_STATUS_USB_CONNECTED
MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT

The power flag bits are the same for all flight controllers.

You still have too much current draw from accessories.
So maybe a telemetry radio or rangefinder is too much for the flight controller to power.
Whichever accessory is drawing too much current will need its own separate BEC

Please tell me where the excess current can come from, if the controller is connected as like the photo (For an experiment)

I dont know - possibly some fault??
But the power status flags are the same over many versions of Ardupilot (and MAVLINK)

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

Ok. Thank you very much!

I am getting 5 flag initially and the suddenly it changes to 52 and then system rebooted. Could you please tell me the meaning of this 52 flags.

You add up the numbers, so 5 is 4+1=power brick valid + USB connected

52 = 32+16+4
Which is “something changed” and “Hi power over current” and “USB connected”