M0138: VOXL FPV ESC - No Current Readings When Calibrating
-
Hello @Alex-Kushleyev I was hoping you could help me figure out why I am not seeing current readings when calibrating the ESC.
SW Setup:
FW Build - m0138_1_v0_39_RC11HW Setup: Connected directly to J1 on the M0138 ESC with a UART adapter to a PC running Ubuntu 22.04. ESC externally powered by batteries.
Issue Summary:
No calibration data is being displayed when running voxl-esc-calibrate.pySteps to Reproduce:
- Connect M0138 to motors, battery and via J1 to a PC with a UART to USB adapter
- Run:
./voxl-esc-calibrate.py --id 0 --pwm-min 10 --pwm-max 95
Actual Results:
Expected Results:
- My expectation for voxl-esc-calibrate.py would be to output the current data after the calibration test.
Questions / Comments:
- I saw some discussion within the forum that for some of the ESCs current sensing is setup for all 4 channels and the output of the current is a total current measurement for all 4 channels. Does the M0138 measure current individually on each channel or as a combined measurement of all 4 channels?
- As a follow up to the last question, I tried to run calibration on each channel individually and did not see any current readings. Is there a way to run the calibration for all motors at once such as the spin test with running id
255
? I attempted to pass this argument and it failed:./voxl-esc-calibrate.py --id 255 --pwm-min 10 --pwm-max 95
- Do I need to configure anything in FW to read current?
Any help would be greatly appreciated!
-
Hey @Alex-Kushleyev please disregard this. I just read through a post here that mentions the current measurement on the calibration script is not currently working. It also states that M0138 only has current monitoring on
id 2
I will run spin test command below for now to capture current via
id 2
:./voxl-esc-spin.py --id 2 --power 40 --ramp-time 2.0 --timeout 2.5 --enable-plot 1 --cmd-rate 250
-
@Alex-Kushleyev all good to go! Great work on this plotting feature, it is excellent
-
@blue , i just fixed (a few days ago) the calibration script (on
voxl-esc
dev branch) to plot the total current for M0138 in the calibration procedure, however, yes you still need to run the calibration test using ID2. This is because ID2 measures the total current and it only sends back the data if the feedback is requested from it. If you are running a test on a single ESC which is not ID2, then ID2 is not asked to send any data back, this allows for 4x the feedback rate for that single ESC that is being tested.So on M0138 if you want to see the current output, you should use ID2 for testing:
./voxl-esc-calibrate.py --id 2 --pwm-min 10 --pwm-max 95
Currently, the current ( ) is not used for anything in the calibration procedure, but it is good to look at it to make sure it follows a smooth curve as the power ramps up.
Thanks, I try to add as much data to plot as possible because it is often easier to spot issues by looking at the plots. By the way, it seems your data time scale is kind of coarse (seems like 14-15hz). Sometimes this can happen if your USB-to-serial adapter buffers too much data.. are you using a PC or VOXL for this test? if you are using FTDI, this may be helpful to test out : https://granitedevices.com/wiki/FTDI_Linux_USB_latency
You should be able to get really nice plots when using 2Mbit baud rate and
--cmd-rate 1000
or even2000
helps catch any small spikes or anomalies.In your calibration test that you originally posted (where the current was reported zero), it looks like towards the end, the top left curve (commanded motor voltage vs rpm) starts curving up a bit more, that can suggest that the motor is not operating optimally at that point. I am not sure which motor / propeller you are testing, but sometimes it helps to adjust the ESC commutation advance from 0 to 20 or so (esc param
<param name="timing_advance" value="20"/>
). You could try that and see if the high end shape of the curve does not curve up as much.Alex