T-Motor (AK-80-6)

The T-Motor double pendulum uses the AK80-6 Motors from T-Motor. Here the motors’ physical parameters, the initial setup as well as the usage with the python driver is documented. The AK80-6 manual can be found here .

Physical Parameters of the Actuator

The AK80-6 actuator from T-Motor is a quasi direct drive with a gear ratio of \(\small{6:1}\) and a peak torque of \(\small{12\,Nm}\) at the output shaft. The motor is equipped with an absolute \(\small{12}\) bit rotary encoder and an internal PD torque control loop. The motor controller is basically the same as the one used for MIT Mini-Cheetah, which is described in the documentation from Ben Katz. - Ben Katz: MIT Mini-Cheetah Documentation

_images/motor_ak80-6.jpg
  • Voltage = \(\small{24\,V}\)

  • Current = rated \(\small{12\,V}\), peak \(\small{24\,V}\)

  • Torque = rated \(\small{6\,Nm}\) , peak \(\small{12\,Nm}\) (after the transmission)

  • Transmission \(\small{N = 6 : 1}\)

  • Weight = \(\small{485\,g}\)

  • Dimensions = \(\small{⌀\,\,98\,mm\times\,38.5\,mm}\).

  • Max. torque to weight ratio = \(\small{24\,\frac{Nm}{Kg}}\) (after the transmission)

  • Max. velocity = \(\small{38.2\,\frac{rad}{s}}\) = \(\small{365\,rpm}\) (after the transmission)

  • Backlash (accuracy) = \(\small{0.15°(degrees)}\)

The T-Motor Ak-80-6 has the following motor constants (before the transmission):

  • Motor constant \(\small{k_m = 0.2206 \,\frac{Nm}{\sqrt{W}}}\)

  • Electric constant \(\small{k_e = 0.009524 \,\frac{V}{rpm}}\)

  • Torque constant \(\small{k_t = 0.091 \,\frac{Nm}{A}}\)

  • Torque = rated \(\small{1.092\,Nm}\), peak \(\small{2.184\,Nm}\)

  • Velocity / back-EMF constant \(\small{k_v = 100 \,\frac{rpm}{V}}\)

  • Max. velocity at \(\small{24\,V}\)= \(\small{251.2 \,\frac{rad}{s}}\) = \(\small{2400 \,\,rpm}\)

  • Motor wiring in \(\small{\nabla- configuration}\)

  • Number of pole pairs = \(\small{21}\)

  • Resistance phase to phase = \(\small{170\pm5\,m\Omega}\)

  • Inductance phase to phase = \(\small{57\pm10\,m\mu H}\)

  • Rotor inertia \(\small{Ir = 0.000060719\,Kg.m^2}\)

Initial Motor Setup

The R-LINK Configuration Tool is used to configure the AK80-6 from T-Motors. Before starting to use the R-Link device make sure you have downloaded the CP210x Universal Windows Driver from silabs. If this isn’t working properly follow the instructions at sparkfun on how to install ch340 drivers. You have to download the CH 341SER (EXE) file from the sparkfun webpage. Notice that you first have to select uninstall in the CH341 driver menu to uninstall old drivers before you are able to install the new driver. The configuration tool software for the R-LINK module can be downloaded on the T-Motors website.

Tutorials

Debugging

Error messages that showed up during the configuration procedure, such as UVLO (VM under voltage lockout) and OTW (Thermal warning and shutdown), could be interpreted with the help of the data sheet for the DRV8353M 100-V Three-Phase Smart Gate Driver from Texas Instruments:

Datasheet: DRV8353M (on the first Page under: 1. Features)

Communication

CAN Bus wiring

Along the CAN bus proper grounding and ideally, isolated ground is required for improvement of the signal quality. Therefore, the common shared ground for PC and motors is of great importance in CAN connection communication. When daisy-chaining multiple actuators, one can use the Ground form the R-Link connector of the motor, which is connected to the negative power pin. This can share the common ground from the PC side and power supply. At the very beginning and end of the CAN chain, there must be of the termination resistors of \(\small{120\,\Omega}\) between CAN-High and CAN-Low, which will be then connected to the corresponding pins between drivers. These resistors aim to absorb the signals and prevents the signals from being reflected at the wire ends. The CAN protocol is differential, hence no additional ground reference is needed. The diagram below displays the wiring of the CAN bus.

_images/can_bus.png

Fig. 2: main pc = CPU, CAN transceiver = CAN XCVR, actuator = AC

Setting up the CAN interface

During regular operation the motors are commanded via CAN interface. To setup the CAN connection follow these steps:

  • Run this command in the terminal to make sure that can0 (or any other can interface depending on the system) shows up as an interface after connecting the USB cable to your PC:

ip link show
  • Configure the can0 interface to have a 1 Mbaud communication frequency:

sudo ip link set can0 type can bitrate 1000000
  • To bring up the can0 interface, run:

sudo ip link set up can0

Note

Alternatively, one could run the shell script setup_caninterface.sh which will do the job for you.

Note

To change motor parameters such as CAN ID or to calibrate the encoder, a serial connection is used. The serial terminal GUI used on Linux for this purpose is cutecom

Testing Motor Connection

To test the connection to the motors, you can use the performance profiling script. The script will print the communication frequencies to the terminal.

Performance Profiler: Sends and received 1000 zero commands to measure the communication frequency with 1/2 motors.

Python Interface

The Python - Motor communication is done with the python driver. The basic python interface is the following:

Example Motor Initialization (for can interface can0 and motor_id =1):

motor = CanMotorController(can_socket='can0', motor_id=1, socket_timeout=0.5)

Available functions:

pos, vel, tau = motor.enable_motor()
pos, vel, tau = motor.disable_motor()
pos, vel, tau = motor.set_zero_position()
pos, vel, tau = motor.send_deg_command(position_in_degrees, velocity_in_degrees, Kp, Kd, tau_ff)
pos, vel, tau = motor.send_rad_command(position_in_radians, velocity_in_radians, Kp, Kd, tau_ff)

All functions return current position, velocity, torque in SI units except for send_deg_command, which returns degrees instead of radians.

Internal PD-Controller

A proportional-derivative controller, which is based on the MIT Mini-Cheetah Motor, is implemented on the motor controller board. The control block diagram of this closed loop controller is shown below. It can bee seen that the control method is flexible, as pure position, speed, feed forward torque control or any combination of those is possible.

_images/motor_ak80-6_pdcontroller.png

In the python driver , the:

send_rad_command(Pdes, Pvel, Kp, Kd, tff)

function lets you set desired position (Pdes), velocity (Pvel), Kp, Kd and feed forward torque (tff) values at every time step.