Inverse Dynamic Model

From SoftMC-Wiki
Revision as of 11:44, 9 November 2017 by Itay (talk | contribs) (Operation Mode and PDOs)
Jump to: navigation, search

Introduction - what is it good for and how does it work

The inverse dynamic model (IDM) feature is used to compensate friction and dynamic effects for motion elements, otherwise leading to positioning errors and suboptimal settling and tracking behavior.


The motivation of the IDM feature is to use additional knowledge about the motion than just the position – i.e. velocity and torque – to offset the command values of the torque controller in order to make them react faster and thereby reduce the final positioning error and improve the settling behavior.


The term inverse dynamic model (often named computed torque control) means that the softMC takes a cartesian motion of a motion element and not only computes the joint position for the next Cartesian setpoint, but also the joint torque required for the motion. In order to be able to do that, it needs a dynamic model – i.e., a model of the masses and inertias – of the motion element. The joint velocity and torque are then sent to the drives as additional torque command data (see Figure 1).


In most cases, the user doesn’t have the parameters of the dynamic model. In such cases, those parameters can be estimated using the softMC identification process. The softMC allows to perform measurements and estimate the dynamic model parameters of some common robot models. The identification process is performed as follows: while the robot is commanded to perform a certain movement, the movement parameters and internal motors torques are recorded. Then, the dynamic model parameters of the robot are extracted based on the robot model and the measurements.


Figure 1 - A schematic drawing of the control system and the feedforward part of the Taddcmd

Torque Units

The MKS system of units defines the torque unit as [Nm] (Newton*meter). When dealing with motors, the torque is usually modeled as proportional to the current in the motors. Therefore, the torque can be defined with different units in each system. This section describes the torque units for each system and how they relate to each other.


The softMC reads the motor's torque through the drives, but not in [Nm] units. Therefore, the softMC contains an axis property called TorqueFactor (TFac) which divides the motor's torque parameter in order to convert it to desirable units. The result of this operation is stored in an axis property called TorqueFeedback.

CDHD Drive setup

The CDHD drives have the following parameters to define the motor's current properties:

  • MICONT – in units of Ampere [A], but being read in units of milli-Ampere [mA], defines the motor continuous current. This is the maximum allowed value for long operation cycles.
  • MIPEAK – in units of Ampere [A], but being read in units of milli-Ampere [mA], defines the motor peak current. This is the maximum allowed value for very short operation cycles.
  • MKT – for rotary motors, being read in units of [Nm/A], defines the torque constant, i.e. how much torque the motor gives per Ampere unit.
  • MKF – for linear motors, being read in units of [N/A], defines the force constant, i.e. how much force the motor gives per Ampere unit.
  • I – being read in units of milli-MICONT [0.001*MICONT]. It indicates the actual value of the current. It corresponds to the current in the motor.


The TorqueFeedback property is calculated as follows:

Therefore, the TorqueFactor property should be set appropriately in order to convert the TorqueFeedback value to units of [Nm]:


The 1 million is in order to compensate for the MICONT being in units of [mA] and the Current Actual Value being in units of [0.001*MICONT]. Defining the TorqueFactor this way will convert the Current Actual Value to unit of [Nm] (and the value is assigned to TorqueFeedback). After setting Tfac, all values of torque (Tfb,TCmd,Tmax, TorqueThreshold, Te) will always be in units of [Nm] ([N] for linear axes). An example for this calculation in MC-Basic is presented in Figure 2.

EtherCAT and CANopen standart (DS402)

The EtherCAT standard defines the following parameters which are equivalent to the above parameters:

CDHD parameter EtherCAT parameter EtherCat index
MICONT Motor Rated Current 0x6075
MIPEAK Motor Peak Current 0x2036
MKT Torque Constant 0x2039
MKF Torque Constant for Linear Motors 0x2038
I Current Actual Value 0x6078

softMC torque related properties

The softMC has the following torque related properties:

  • <axis>.TorqueThreshold - The axis torque threshold value is used to define the limit of the TADDCOMMAND value. If this value is exceeded, the softMC raises an error. One can set this value to some user desired value, or to a value matching the drive MICONT or MIPEAK values.

For example, setting the TorqueThreshold to a value that matches MICONT:

Setting the TorqueThreshold to a value that matches MIPEAK:

How to include gear ratio

Usually, the motors are connected to the joints through a gear system. The gear system affects the torque loads the motors carry and therefore the torque factors should be compensated appropriately. After this compensation, the TorqueFactor parameter transforms the Current Actual Value parameter from current inside the motors ([mMICONT] units) to the torques the joints are carrying (in [Nm] units).

where GR stands for Gear Ratio. Figure 3 shows an example of a gear ratio.

figure 2 - Setting the torque factor(TFac) property for all axes in MC-Basic for WtherCAT drive


figure 3 - An example of a gear mechanism with a ratio of 1:2

Linear Axes

All of the above refers to rotary axes. Linear axes, in contrast to rotary axes, carry force and not torque. These forces are measured in units of Newton [N]. Therefore, some modifications should be made when dealing with Linear axes. Basically, there are two types of linear axes - Rotary motors with lead screws/pulleys/others, and Linear Motors.

Rotary motors with lead screws / pulleys / or different type of mechanism used to translate turning motion into linear motion

This type is treated the same as the regular rotary axes with a single modification. The mechanism used to translate turning motion into linear motion transforms the torque load, carried by the motor, to a force load on the linear axis. Therefore, the TorqueFactor should be multiplied by another factor. This parameter should contain the ratio between the amount of linear motion made per one rotation of the rotary motor (after the gear). For a lead screw, it would be the Screw Lead [mm/rev]. For a pulley, it would be the radius of the pulley multiplied by 2π [mm/rev]. The TorqueFactor would be:

When SL stands for Screw Lead or an equivalent parameter. figure 4 shows an example of a lead-screw lead.


figure 4 - An example of a lead-screw (top) and a lead-screw lead (bottom)


Linear Motors

This type is treated the same as the regular rotary axes, but the MKT is switched with the MKF property, which is in units of [N/A] and there is no gear, therefore the TorqueFactor would be:


Operation Mode and PDOs

The operation mode of the drives while using the dynamic model should be cyclic synchronous position. The dynamic model is used to compute the required torque (or current) for each motor, however the results are never precise. The additive torque command is used only as a feed forward signal as mentioned in section 3.
Here is the list of additional PDOs (additional to the ‘cyclic synchronous position’ PDOs) that are necessary to use the dynamic model:

PDO index Description
RX: 0x60B2 Torque Offset – the additive torque signal
TX 0x6078 Current Actual Value – the torque feedback signal

How to perform the dynamic model parameters identification

Explanation of the identification output file

Explanation of the identification process recording file

Demonstration of tracking improvements (settling , position error)

Collision detection

Review of the possible reasons for an identification failure

How to assess what is the failure reason based on the output files

Test specifications