4-in-1 ESC mini with VOXL2 - Current is 0
-
We are testing the 4-in-1 esc (mini) with the VOXL2 (not mini). After connecting the J18 port to the ESC with the described pinouts we are able to spin our motors and interact with them through PX4. All metadata expected is available. The only problem is that the current measurement is always 0.
I have included some output of the
voxl-esc spin
commandFound voxl-esc tools bin version: 1.2 VOXL Platform: M0054 Detected VOXL2 M0054 or M0104! Found previous connection information in .voxl_esc_cache .. Prioritizing /dev/slpi-uart-2 @ 2000000 INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 2000000 Sending library name request: libslpi_uart_bridge_slpi.so Received standard error event 2 Sending initialization request INFO: ESC(s) detected on port: /dev/slpi-uart-2, baud rate: 2000000 INFO: Detected protocol: firmware INFO: Additional Information: INFO: --------------------- ID : 0 Board : version 40: ModalAi 4-in-1 ESC (M0129-3) UID : 0x2039333557555304003D001F Firmware : version 38, hash 83faccfa Bootloader : version 184, hash 10bf24c8 ID : 1 Board : version 40: ModalAi 4-in-1 ESC (M0129-3) UID : 0x2039333557555304003D001A Firmware : version 38, hash 83faccfa Bootloader : version 184, hash 10bf24c8 ID : 2 Board : version 40: ModalAi 4-in-1 ESC (M0129-3) UID : 0x2039333557555304003D001C Firmware : version 38, hash 83faccfa Bootloader : version 184, hash 10bf24c8 ID : 3 Board : version 40: ModalAi 4-in-1 ESC (M0129-3) UID : 0x2039333557555304003D0021 Firmware : version 38, hash 83faccfa Bootloader : version 184, hash 10bf24c8 --------------------- Detected Python version : 3.6.9 (default, Mar 10 2023, 16:46:00) [GCC 8.4.0] Found voxl-esc tools bin version: 1.2 VOXL Platform: M0054 Detected VOXL2 M0054 or M0104! Found previous connection information in .voxl_esc_cache .. Prioritizing /dev/slpi-uart-2 @ 2000000 INFO: Scanning for ESC firmware: /dev/slpi-uart-2, baud: 2000000 Sending library name request: libslpi_uart_bridge_slpi.so Received standard error event 2 Sending initialization request
Output when testing ESC 1 (which has a motor attached)
[2.665] (1) RPM: 2830, PWR: 5, VOLTAGE: 12.384V, TEMPERATURE: 37.71C, CURRENT: 0.000A [2.676] (1) RPM: 2830, PWR: 5, VOLTAGE: 12.384V, TEMPERATURE: 37.71C, CURRENT: 0.000A [2.684] (1) RPM: 2835, PWR: 5, VOLTAGE: 12.385V, TEMPERATURE: 37.72C, CURRENT: 0.000A [2.695] (1) RPM: 2836, PWR: 5, VOLTAGE: 12.381V, TEMPERATURE: 37.74C, CURRENT: 0.000A [2.707] (1) RPM: 2836, PWR: 5, VOLTAGE: 12.381V, TEMPERATURE: 37.74C, CURRENT: 0.000A [2.714] (1) RPM: 2866, PWR: 5, VOLTAGE: 12.391V, TEMPERATURE: 37.76C, CURRENT: 0.000A [2.725] (1) RPM: 2834, PWR: 5, VOLTAGE: 12.373V, TEMPERATURE: 37.76C, CURRENT: 0.000A [2.736] (1) RPM: 2834, PWR: 5, VOLTAGE: 12.373V, TEMPERATURE: 37.76C, CURRENT: 0.000A [2.744] (1) RPM: 2834, PWR: 5, VOLTAGE: 12.376V, TEMPERATURE: 37.75C, CURRENT: 0.000A [2.755] (1) RPM: 2831, PWR: 5, VOLTAGE: 12.378V, TEMPERATURE: 37.77C, CURRENT: 0.000A [2.767] (1) RPM: 2831, PWR: 5, VOLTAGE: 12.378V, TEMPERATURE: 37.77C, CURRENT: 0.000A [2.774] (1) RPM: 2826, PWR: 5, VOLTAGE: 12.369V, TEMPERATURE: 37.76C, CURRENT: 0.000A [2.786] (1) RPM: 2828, PWR: 5, VOLTAGE: 12.375V, TEMPERATURE: 37.76C, CURRENT: 0.000A [2.796] (1) RPM: 2828, PWR: 5, VOLTAGE: 12.375V, TEMPERATURE: 37.76C, CURRENT: 0.000A [2.804] (1) RPM: 2838, PWR: 5, VOLTAGE: 12.376V, TEMPERATURE: 37.76C, CURRENT: 0.000A [2.814] (1) RPM: 2832, PWR: 5, VOLTAGE: 12.377V, TEMPERATURE: 37.77C, CURRENT: 0.000A
We only have a motor connected to ESC 1, but I do see some logging for non-zero current on ESC 3. The RPM values are obviously bunk because there is nothing attached, but I do wonder if something went wrong in the hardware for logging current with ESCs 0-2.
Logging for the test of ESC 3 (with no motor attached):
[4.930] (3) RPM: 991, PWR: 0, VOLTAGE: 12.343V, TEMPERATURE: 44.29C, CURRENT: 0.000A, BOARD_VOLTAGE: 12.343V, BOARD_CURRENT: 0.024A [4.935] (3) RPM: 991, PWR: 0, VOLTAGE: 12.343V, TEMPERATURE: 44.29C, CURRENT: 0.000A, BOARD_VOLTAGE: 12.343V, BOARD_CURRENT: 0.024A [4.951] (3) RPM: 1021, PWR: 0, VOLTAGE: 12.350V, TEMPERATURE: 44.31C, CURRENT: 0.000A, BOARD_VOLTAGE: 12.350V, BOARD_CURRENT: 0.008A [4.955] (3) RPM: 1021, PWR: 0, VOLTAGE: 12.350V, TEMPERATURE: 44.31C, CURRENT: 0.000A, BOARD_VOLTAGE: 12.350V, BOARD_CURRENT: 0.008A [4.971] (3) RPM: 1051, PWR: 0, VOLTAGE: 12.341V, TEMPERATURE: 44.32C, CURRENT: 0.000A, BOARD_VOLTAGE: 12.341V, BOARD_CURRENT: -0.024A [4.975] (3) RPM: 1051, PWR: 0, VOLTAGE: 12.341V, TEMPERATURE: 44.32C, CURRENT: 0.000A, BOARD_VOLTAGE: 12.341V, BOARD_CURRENT: -0.024A [4.991] (3) RPM: 1081, PWR: 0, VOLTAGE: 12.350V, TEMPERATURE: 44.30C, CURRENT: 0.000A, BOARD_VOLTAGE: 12.350V, BOARD_CURRENT: -0.016A
Is there a most likely reason for us to be seeing this behavior?
-
The Mini ESC has one current measurement (total current going into the board) and it is measured by the ESC ID3.
I understand it is a little confusing, we can improve the test script.
Are you just trying to spin one motor (ESC 1) and see the total current?
Alex
-
Ah, thank you. That makes sense. We are currently using 2 of the ESCs and want to record the total current. I see how we could do that now through the testing script, but I am still running into trouble. We would like to be able to monitor our usage in flight through PX4, but looking through the message definitions I don't see anything that would supply the board current And all currents are reported as 0 as I would now expect.
Has the ability to get this total board current been implemented in ModalIO?
struct esc_status_s { uint64_t timestamp; uint16_t counter; uint8_t esc_count; uint8_t esc_connectiontype; uint8_t esc_online_flags; uint8_t esc_armed_flags; uint8_t _padding0[2]; // required for logger struct esc_report_s esc[8]; }
struct esc_report_s { uint64_t timestamp; uint32_t esc_errorcount; int32_t esc_rpm; float esc_voltage; float esc_current; float esc_temperature; uint16_t failures; uint8_t esc_address; uint8_t esc_cmdcount; uint8_t esc_state; uint8_t actuator_function; int8_t esc_power; uint8_t _padding0[5]; // required for logger }
-
Good question.
As you may already know, the 4 ESCs normally only send their feedback status packet when the host (flight controller) queries them. The feedback query bit is set for one ESC at a time when sending out the control packet to the 4 ESCs. The Flight controller requests the feedback from one ESC at a time in round robin fashion in order to avoid collisions on UART line. This is true for all ModalAI ESCs.
Now, the mini ESC M0129 has a special setup in terms of current sensing. IDs 0-2 do not have any current measurement, but ID3 measures the total current. In order to avoid confusion with individual current measurement, we have added a new Power Status message, which ID3 sends out in addition to the standard feedback. So when the Flight Controller asks ID3 to send feedback, the ID3 will send back the normal feedback packet and the power status packet. Here is a link in PX4 for your reference:
parsing of standard packet:
https://github.com/modalai/px4-firmware/blob/voxl-dev/src/drivers/actuators/modal_io/modal_io.cpp#L303parsing of power status and sending out battery status to PX4:
https://github.com/modalai/px4-firmware/blob/voxl-dev/src/drivers/actuators/modal_io/modal_io.cpp#L393It looks like the power status feature is only in
voxl-dev
branch of PX4 code at the moment.Hopefully that helps! Let me know if you have any other questions.
Alex