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 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.
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.
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.
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.
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
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
I’ve just upgraded from a pixhawk4 to pixhawk6C, i’m having the same bit MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 1 in “voltageflag” byte
looks like that message does not refer a real charge issue on the power.
Since las discussions here, have anybody conclude to a bug or any clear reason to get that value ?
Well is works but QGC displays a red flag…
Not easy to measure current, then i tried to remove every single peripheral, one by one, FMU,IO, I2C GPS’s UARTS, at last even both power supplies.
=> Then i had only the USB connected to MP.
voltageflag = 20 : 4 for USB + 16 for HIPOWER_OVERCURRENT
32 never turned on during any tests, so i think it detects overcurrent at boot.