ESC Current Readings
-
I get motor current readings of zero through both the voxl-esc-spin python script and through the px4 ESC mavlink messages. Do I need to set a calibration parameter? Thanks in advance!
px4 1.14-rc1
voxl-esc modalai_esc_firmware_m0129_3_v0_39_RC5_fb6fd95c -
FYI, I am running the voxl-esc mini. I put a screen shot below from the spin command showing the 0.000A current reading.
BTW, is the current output supposed to be phase current or DC current? If it's DC is there just one shunt on the board or do we current to each controller? Thanks in advance.
-
Ping.
I am similarly seeing that data the current is not being reported in the PX4 SD log, under esc_status.
-
@hanzichi , I am really sorry for the delay, I must have missed the original message.
The mini ESC only has one current sensor and it is attached to ESC ID 3. If you either spin all 4 motors at the same time (using
--id 255
invoxl-esc-spin.py
command), then the total board current will be reported and printed to screen. Or you just need to spin one motor, please perform your test on ESC ID 3 and you will see the current.Also, just a tip, if you want to see a plot of the data, you can use the following options to make a plot at the end of the test:
./voxl-esc-spin.py <your desired arguments> --timeout 10 --enable-plot 1
this will stop the test after 10 second and plot the data (including current draw) in the browser using plotly.
In terms of PX4 integration, yes esc_status will report zero individual currents, but the mini ESC does send out the battery status message with voltage and total current (instead of the APM power module driver, that is typically used)
I hope this helps!
Alex
-
OK, thanks, I'll try that out, but I recall all currents reading zero when I tried before.
I was actually hoping to get more information about the individual motors during their operation. I would love to see phase current, but that doesn't sound like what you're reporting. Do you by chance report or can it be set up to report phase pwm/driving voltage? I want to use this as a safety measure for when the motors are approaching their limits. My guess is no, but I thought I'd ask.
-
Here is an example that should help.
- using latest firmware from
dev
branch ofvoxl-esc
(also same firmware as onmaster
branch) : https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/tree/dev/voxl-esc-tools/firmware - i connected directly to mini ESC using USB adapter, but you can run the same command on VOXL2 (stop / disable px4 first)
- unloaded 1306 motors just for a quick test
- test command:
./voxl-esc-spin.py --power 30 --ramp-time 5.0 --timeout 6.0 --cmd-rate 500 --enable-plot 1 --id 255
- terminal output ( note board current )
... [5.999] (0) RPM: 13516, PWR: 30, VOLTAGE: 14.972V, TEMPERATURE: 34.84C, CURRENT: 0.000A, BOARD_VOLTAGE: 14.950V, BOARD_CURRENT: 0.848A [5.999] (1) RPM: 13749, PWR: 30, VOLTAGE: 14.979V, TEMPERATURE: 34.51C, CURRENT: 0.000A, BOARD_VOLTAGE: 14.950V, BOARD_CURRENT: 0.848A [5.999] (2) RPM: 13535, PWR: 30, VOLTAGE: 14.967V, TEMPERATURE: 35.47C, CURRENT: 0.000A, BOARD_VOLTAGE: 14.950V, BOARD_CURRENT: 0.848A [5.999] (3) RPM: 13576, PWR: 30, VOLTAGE: 14.950V, TEMPERATURE: 35.81C, CURRENT: 0.000A, BOARD_VOLTAGE: 14.950V, BOARD_CURRENT: 0.848A
plot:
- individual phase current is normally not available (if you are talking about each of the 3 phases of the motor).
- the mini ESC only measures total current
- if you need individual motor current, then you need to choose another ESC (such as M0134) with individual current sensing
- the applied power is reported in ESC feedback and it is a value of 0-100 (in %), also plotted on the plot. This is actual duty cycle of the motor control voltage. When ESC uses RPM control, this value is calculated by ESC and applied internally. Otherwise, you can also control the ESC power % directly, just like i did in this example script (using
--power
option in thevoxl-esc-spin.py
test script
- using latest firmware from
-
@Alex-Kushleyev
Thanks Alex, that helps. With voxl-esc-spin We were able to recreate the board current with id = 255, but had mixed results getting just current on id = 3. More importantly, we don't see current getting populated in esc_status on px4. I now see 'power' in the px4 esc_status log which is great and a better metric for what I'm doing anyway. -
esc_status in px4 would contain individual current for each ESC and since this is not possible to measure on the mini ESC, the esc_status message does not contain any current measurements. So the total current goes into the Battery Status message.
Please make sure you enable publishing of battery status in the voxl-esc driver here :
param_get(param_find("VOXL_ESC_PUB_BST"), ¶ms->publish_battery_status);
and the status is published here