FPV ESC PWM Signal Control
-
Currently using the VOXL IO board for PWM control on the VOXL 2 using SDK 1.3.5, I am beginning to integrate the FPV ESC and noticed that it has listed PWM output capabilities. If I can remove the VOXL IO board from the loop that would be ideal from a SWaP perspective. However, there is little documentation on how to get the PWM control to work through PX4 outside of what is listed in the test script. Has PWM output on the ESCs been fully integrated, separate from the ESC control which we would prefer to keep over the UART. Or, is the VOXL IO board still the only way to integrate PWM control out of the box with the Modal AI ecosystem? PWM control will be used for Payload control specifically.
-
@Jeremy-Frederick , the FPV ESC currently supports two pwm outputs, it can be tested using the following test script:
- https://docs.modalai.com/voxl-fpv-esc-datasheet/#pwm-inputs--outputs (docs)
- https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-esc/-/blob/dev/voxl-esc-tools/voxl-esc-pwm.py (test script)
- make sure ESC firmware is
39.18
or later, as specified in documentation
The python script tells you which ESC boards support pwm output:
# PWM support on ModalAi ESCs: # M0049, M0117, M0134, M0129 : IDs 0, 1, 2, 3 # M0138: IDs 0, 3 only # All boards use pin A2 for PWM output
by changing the
--id
argument between0
and3
you should be able to use this test script to control PWM outputs of the two test points of M0138 ESC . Please be careful soldering to the test points as they are small and avoid pulling on the wires (use strain relief).We are also working on enabling a 3rd pwm output on the output that is currently used for the Neopixel LED (this output is also pwm capable).
In terms of integration, standalone testing can be done using this python script, but sending pwm commands have to go through PX4, and we are working on integration.
You can use the following tool which will send a message to PX4, which will get forwarded to the ESC:
https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-tools/-/blob/sdk-1.3.4/tools/voxl-send-esc-pwm-cmd.c . Note that this tool has been moved to another repo after sdk 1.3.4 , but you should be able to use this tool to control pwm from voxl2 command line while the px4 is running and talking to the ESC.The new repo for the tools is here : https://gitlab.com/voxl-public/voxl-sdk/services/voxl-io-server/-/tree/dev/tools and I believe it should be doing the same thing, although i have not personally confirmed it yet.
Try it out!
Long term, we do plan to provide the support for this (this is not a temporary feature), so we are working on cleaning up the tools for that.
Alex