No battery charge reported when using VOXL ESC FPV 4-in-1 (M0138) with FlightCoreV2
-
In QGroundControl, the battery drop down shows that current discharged is always 0 and when monitoring the battery_status mavlink message, the battery discharged and current readings are always 0 (this is the case when BAT1_SOURCE param is either ESC or POWER MODULE).
Looking into the code on github (https://github.com/PX4/PX4-Autopilot tag 1.15.0), in src/drivers/actuators/voxl_esc/voxl_esc.cpp on line 568, we get the current from the ESC's onboard current monitor (the M0138 doesnt monitor every ESC but has one single monitor on ID2 ESC. The normal esc_status message will not show the current on any ESC but a power status packet will be sent from the ESC when requested by the voxl_esc driver). This current appears to always be negative. Negating the value on this line along with changing BAT1_SOURCE param to POWER MODULE causes everything to 'work'. This doesn't seem right, any insight would be greatly appreciated!
Thanks!
-
@Dracad , have you tried spinning up the motors and checking if current is showing correctly?
M0138 can measured current up to 200Amps and therefore is not very accurate around very low currents ~100mA, it could report slightly negative current due to its ability to measure negative currents and the zero point not being exactly 0Amps.
Please try a brief test to spin the motors and see if the current measurement reports a positive value.
Alex
-
Hi Alex, I had and I still had the issue.
But once I built from https://github.com/modalai/px4-firmware/tree/voxl-fpv-dev and changed BAT1_SOURCE to power module (I originally had it set to ESC), when spinning the motors the current appeared correct and power draw updated correctly! Appreciate the help!
One interesting thing, with BAT1_SOURCE set to the ESC, when monitoring the battery_status mavlink message the current consumed and current battery values were invalid (both set to 0), I would've figured that mavlink message would still be valid irrespective of the source as its only coming from place?
Thanks