Skip to content

Commit

Permalink
Common: AM32 DroneCan gets firmware update instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Feb 12, 2025
1 parent 4d61612 commit e6c2c79
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
44 changes: 39 additions & 5 deletions common/source/docs/common-am32-escs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ More ESCs may be found from the `AM32 targets.h <https://github.com/am32-firmwar
ArduPilot Configuration
=======================

To enable communication with the AM32 ESCs using DroneCAN, set the following parameters
To enable communication with the AM32 ESCs using DroneCAN, set the following parameters:

- Set :ref:`CAN_P1_DRIVER <CAN_P1_DRIVER>` = 1 (First driver) to specify that the ESCs are connected to the CAN1 port
- Set :ref:`CAN_D1_PROTOCOL <CAN_D1_PROTOCOL>` = 1 (DroneCAN)
Expand All @@ -33,16 +33,50 @@ To enable communication with the AM32 ESCs using DroneCAN, set the following par
- Set ``SERVOx_MIN`` = 1000 and ``SERVOx_MAX`` = 2000 for each ESC connected (``x`` corresponds to the ESC number) so ArduPilot uses an output range that matches the ESCs input range
[/site]
- Set ``SERVOx_FUNCTION`` to each motor channel (e.g. 33 - 40 for motors 1 - 8). This is automatically configured when setting frame class/type. If a motor channel isn't assigned to a servo output, commands won't be sent to the associated ESC.
- :ref:`CAN_D1_UC_ESC_BM <CAN_D1_PC_ESC_BM>` is a bitmask that determines which servo output channels are transmitted over CAN. For quadcopters this is normally "15"
- :ref:`CAN_D1_UC_ESC_OF <CAN_D1_UC_ESC_OF>` allows for more efficient packing of ESC command messages when ESCs are connected to higher servo outputs (e.g. 5 to 8). For most vehicles this can be left at zero
- :ref:`CAN_D1_UC_ESC_RV <CAN_D1_UC_ESC_RV>` allows specifying which ESCs support spinning in reverse

By default, all configured motor channels are used to send control commands to the ESCs. These control messages are transmitted by the autopilot at a default rate of 50Hz. These parameters can be modified using:
ESC Firmware Updates
====================

- :ref:`CAN_D1_PC_ESC_BM <CAN_D1_PC_ESC_BM>` is a bitmask that determines which ESC (motor) channels are transmitted over CAN
- :ref:`CAN_D1_PC_ESC_RT <CAN_D1_PC_ESC_RT>` determines the rate (Hz) at which commands are sent out to the ESCs
The latest firmwares can be found on the `am32.ca downloads page <https://am32.ca/downloads>`__

To update the ESCs firmware using Mission Planner:

.. image:: ../../../images/am32-dronecan-escs-firmwareupdate-with-MP.png
:width: 450px

- Download the firmware from the `am32.ca downloads page <https://am32.ca/downloads>`__
- Power on the autopilot and ESCs
- Connect to the autopilot using Mission Planner
- Open Mission Planner's Setup, Optional Hardware, DroneCAN/UAVCAN page
- Select "MAVLinkCAN1" from the drop-down (assuming the ESCs are connected to the autopilot's CAN1 port) and press Connect
- The ESCs should appear in the list of connected devices
- For each ESC listed, push the "Menu" button on the right and select "Update"
- When asked, "Do you want to search the internet for an update?", push "No" and select the firmware downloaded above
- After the firmware is uploaded, check the "SW Version" column shows the expected version

ESC Configuration
=================

The AM32 ESCs can be setup using the :ref:`DroneCAN GUI Tool <common-uavcan-gui>` with the ESC connected to the autopilot, or alternatively, the `AM32 configurator <https://am32.ca/configurator>`__ can be used by directly connecting to the ESC's PWM connection
If the ESCs are already connected to the autopilot (via DroneCAN), they can be configured using Mission Planner's DroneCAN/UAVCAN page or the :ref:`DroneCAN GUI Tool <common-uavcan-gui>`. Alternatively, the `AM32 configurator <https://am32.ca/configurator>`__ can be used by directly connecting to the ESC's PWM connection.

In most cases at least some of the following parameters will need to be changed:

- ESC_INDEX: The motor number - 1. For multicopters the motor number and position are shown on the :ref:`ESCs and Motors wiki page <copter:connect-escs-and-motors>`
- DIR_REVERSED: the motor direction. Use Mission Planner's motor test page to check the direction and change this parameter if necessary
- MOTOR_POLES: the number of poles in the motor
- MOTOR_KV: the motor's KV rating

To change the above parameters using Mission Planner:

- Power on the autopilot and ESCs
- Connect to the autopilot using Mission Planner
- Open Mission Planner's Setup, Optional Hardware, DroneCAN/UAVCAN page
- Select "MAVLinkCAN1" from the drop-down (assuming the ESCs are connected to the autopilot's CAN1 port) and press Connect
- For each ESC listed, push the "Menu" button on the right and select "Parameters"
- Change the parameters as required and press, "Write Params"

Logging and Reporting
---------------------
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e6c2c79

Please sign in to comment.