Battery monitor not working on Control Zero

I am trying to get PX4 working on an mRo Control Zero and am not able to get the battery monitoring to work in QGroundControl. In the MavLink console, I see the correct brick voltage but brick_valid = 0. I am running v1.11.2. Any help would be greatly appreciated!


Hmm, it looks like brick_valid = 0 is actually the true state, and changes to 1 if the brick is disconnected. I am wondering if the issue has something to do with this line in analog_battery.cpp:

bool connected = voltage_v > BOARD_ADC_OPEN_CIRCUIT_V &&
(BOARD_ADC_OPEN_CIRCUIT_V <= BOARD_VALID_UV || is_valid());

BOARD_ADC_OPEN_CIRCUIT_V is set to 5.6 in board_config.h for the Control Zero and BOARD_VALID_UV is set to 3.7 in board_common.h

I compiled v1.11.3 after changing BOARD_ADC_OPEN_CIRCUIT to 1.0f in the Control Zero board_config.h and now I see the correct battery voltage at the top of QGroundControl and see “Connected: True” under battery_status in the MavLink Console. I’m not going to mark this as resolved, since I am not familiar enough with the code to convince myself that this is the right solution.