DEMO: UAVCAN node servo pwm control
How to send PWM signal using CAN bus
The idea is to control a servo motor or ESC via the CAN board using the UAVCAN protocol. This is useful to decentralize the processing from the FMU to multiple CAN boards in case of having multiple PWM units.
Next, we will show how to connect a CAN board to the Ubuntu 22.04 PC and send PWM commands.
(3) USB-TTL-3V3: the GND black wire should be mounted at the top when the serial debug connector is on the left.
(4) CAN to USB adapter board
(5) debug cable: to be able to communicate with the board via nutshell cmdline.
(6) CAN cable: mount the CAN cable at the top right connector.
(7) A resistor board: mount this board below the CAN cable connector
(8) Power supply: make sure to not exceed 5 Volts
(9) Servo motor for testing
Install drone_can_gui tool:
Open a terminal and type these two lines
Check whether can0 interface figures in network interfaces list:
Double check by dumping CAN bus traffic
In a nutshell, check the status of PWM in your board
Press ok
You should see your ucans32 device in the list of nodes:
Arm the vehicle (using QGC or RC transmitter depending on your setup):
External links:
[1]
[2]