Firmware and setup
Claw runs AM32 2.20 with DroneCAN. On the bus it reports itself as
com.bearmetal.claw#M<n>, where <n> is ESC_INDEX plus one.
Start-up and arming
After power-up the ESC runs its bootloader for a few seconds, then starts the application and plays the start-up tune through the motor. The bootloader answers no ESC command.
The ESC arms itself on a continuous zero throttle command and plays a second tune. It ignores every other command until then.
Choosing the input
INPUT_SIGNAL_TYPE sets which commands the ESC follows:
| Value | Input |
|---|---|
| 0 | DroneCAN, and DShot or PWM on INPUT, detected at start-up. The factory setting. |
| 1 | DroneCAN and DShot |
| 2 | DroneCAN and PWM |
| 5 | DroneCAN only. The ESC ignores INPUT. |
Connect one input only. On a DroneCAN airframe set 5, so that noise on an unconnected INPUT pin cannot reach the motor.
Setting up PX4 over DroneCAN
- Set
UAVCAN_ENABLEto 3 and reboot. PX4 then assigns each ESC a node ID, broadcasts the arming state, and sends the motor outputs over DroneCAN at 1 Mbit/s. - In QGroundControl open Vehicle Setup, then Actuators, and assign a motor to each UAVCAN ESC output. The motor order depends on the airframe, see the PX4 airframe reference .
- On each ESC set
ESC_INDEXto its output number minus one: the ESC on output 1 takesESC_INDEX0.
With REQUIRE_ARMING at 1, the default, the ESC runs the motor only while the autopilot
broadcasts that the vehicle is fully armed, and stops it when the vehicle disarms. With
REQUIRE_ZERO_THROTTLE at 1, the default, an ESC that restarts while the vehicle is armed
waits for zero throttle before it runs the motor again. At 0 it follows the throttle at once.
Setting up PX4 over DShot
- Wire INPUT and GND to a motor output, see Throttle input . On Karu, outputs 1 to 8 of FMU PWM OUT support DShot.
- In QGroundControl open Vehicle Setup, then Actuators. Set the output group to a DShot rate and assign a motor to each output.
- For telemetry, wire TELEMETRY to the RX pin of a free serial port and set
DSHOT_TEL_CFGto that port. Reboot.
Parameters
DroneCAN Web Tools reads and writes the parameters through a USB-CAN adapter on CAN_A or CAN_B. It connects through Web Serial, so open it in Chrome or Edge. This is also the way to set the parameters of an ESC that flies on DShot.
- Connect the adapter and set the local node ID.
- If no autopilot is on the bus, start the Dynamic Node ID Allocation Server. Without a server the ESC gets no node ID and does not appear. With an autopilot on the bus, leave the server off: the autopilot allocates the IDs.
- Open the ESC Panel: choose Panels, then ESC. Keep it open until the values are stored. While the panel is closed the ESC runs its bootloader, which has no parameters.
- Select the ESC under Online Nodes. Node Properties lists its parameters.
- Change the values, then store them. The ESC keeps a stored value across power cycles.
The ESC refuses to store parameters while the motor runs.
Motor parameters
| Parameter | Default | Set to |
|---|---|---|
MOTOR_POLES |
14 | the number of magnet poles in the motor |
MOTOR_KV |
2000 | the motor’s rpm per volt |
DIR_REVERSED |
0 | 1 to reverse the direction of rotation |
Updating firmware
The ESC receives new firmware over DroneCAN.
- Open the ESC’s Node Properties in DroneCAN Web Tools, as in Parameters .
- Choose Update Firmware and select the
.binimage. - The ESC restarts into its bootloader, receives the image, and starts the new application.