This article demonstrates how to integrate Sapog-based ESC into a UAV controlled by ArduPilot. The concepts explained here are applicable to any Sapog-based ESC design, such as Zubax Orel 20.
Documentation may be outdated
At the time of writing this, ArduPilot was undergoing a major redesign of its CAN bus subsystem. This means that the instructions provided here may have become outdated. Please check the ArduPilot documentation for updated instructions before reading this further.
Connecting
Connect all of the on-board CAN devices into a chain and make sure the bus is terminated at the end nodes. The order in which the ESC are chained does not matter. More information about proper bus connections can be gathered from the UAVCAN device interconnection page.
Configuring Sapog
Sapog can be configured either via CLI or via UAVCAN.
Via UAVCAN
This method requires that you have a CAN adapter connected to your computer.
Install the UAVCAN GUI Tool on your PC, then perform the following steps:
- Launch the application and connect to the correct CAN bus interface. Configure the bit rate at 1 Mbps, unless you have other specific requirements.
- Enable the dynamic node ID allocation server in the GUI Tool.
- Wait for the ESC nodes to become online.
- For each ESC node:
- Set the configuration parameter
uavcan_node_id
to a unique integer value for each ESC, except 1 (the node ID 1 is used by the autopilot). - Set the configuration parameter
esc_index
to a correct value according to the geometry of your airframe. - If necessary, change the direction of rotation of the ESC by setting the parameter
ctl_dir
. - Reboot the ESC by sending a reboot request from the GUI Tool.
- Set the configuration parameter
- Now you can verify the correct operation of each ESC by controlling them directly from the GUI Tool. If you chose to do so, ensure that the autpilot is not issuing any ESC commands.
Via the serial CLI
If you prefer CLI, you will need a Dronecode Probe to connect to the debug port of your ESC. Read the article about the serial command line interface (Serial CLI) for more information on how to use it.
Once connected, configure the same parameters as if you were using the GUI tool via the CLI.
Configuring the flight controller
Set the configuration parameter BRD_CAN_ENABLE
to the value of 3, then reboot the flight controller (at the time of writing this, the documentation of ArduPilot wrongly stated that the only valid values of BRD_CAN_ENABLE
are 0 and 1; this is not true).
Checking the configuration
This part is entirely optional. You may use the UAVCAN GUI Tool to check what ESC setpoints are being sent to the bus by the flight controller.
See also
- ArduPilot documentation portal: ardupilot.org.
- A somewhat related article on the ArduPilot website: http://ardupilot.org/copter/docs/common-uavcan-escs.html.
- If you have any questions, bring them to the support forum.