avatar motor commisioning - Uvic-Robotics-Club/uvic-rover-2027 GitHub Wiki

There are 2 different Avatar motors on the Arm: M5370 (base motor; 100:1) and M4210 (50:1).

These actuators use CANopen, not just an arbitrary CAN command protocol. Sending a CAN frame successfully does not necessarily mean the motor has accepted or executed the command.

Required Operating Mode

The known working approach for these motors is interpolated position mode (mode 7). Other modes tested during development did not produce comparably good results. Use interpolated position mode as the baseline for this arm rather than assuming another position-control mode will behave the same way.

Required Command Sequence

The controller must configure and enable the motor before sending motion targets. Follow this order:

  • Configure operating mode to interpolated position mode using CANopen SDO procedure.
  • Execute the tested controlword sequence in order to enable the motor: 0x0006, 0x0007, 0x000F, 0x001F.
  • Send position targets using PDOs using the configured RPDO1 mapping.
  • Send SYNC to advance the motion. Meaning that each target PDO sent must have a SYNC message afterward due to it being in interpolated mode.

Motion-Update Timing

It has been tested with a nominal 20ms update interval.

The test schedules updates against a monotonic clock to avoid accumulating the execution time of each loop iteration into the next interval. Python and Linux is not hard real-time, so the actual timing can still vary.

Keep the target-update and SYNC order consistent with the working implementation. Avoid adding unnecessary blocking operations, such as frequent feedback reads inside the motion update loop.

$ Position-Command Procedure The tested movement procedure uses explicit position targets:

  1. Read and save the initial position
  2. Calculate an absolute target position
  3. Generate intermediate targets between the initial position and destination
  4. Send the trajectory using the RPDO1/SYNC sequence
  5. Command the return trajectory to the saved initial position
  6. Read the final position and compare it with the expected position

Verify Successful Operation

If the motor does not move, first verify the configuration, enable sequence, PDO mapping, and SYNC procedure against the communication reference. Do NOT immediately assume that the motor is defective.