Difference between revisions of "Inverse Dynamic Model"

From SoftMC-Wiki
Jump to: navigation, search
(Torque Units)
(Torque Units)
Line 17: Line 17:
  
 
=Torque Units=
 
=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 [[MC-Basic:element.TORQUEFEEDBACK| TorqueFeedback]].
 +
 
==CDHD Drive setup==
 
==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: <br>
 +
<center> <math> TFb = \frac{Current Actual Value}{Tfac}\ </math> </center>
 +
 +
Therefore, the TorqueFactor property should be set appropriately in order to convert the TorqueFeedback value to units of [Nm]: <br>
 +
<center> <math> TFac = \frac{1000000}{MKT*MICONT}\ </math> </center>
 +
 +
 +
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)==
 
==EtherCAT and CANopen standart (DS402)==
 +
The EtherCAT standard defines the following parameters which are equivalent to the above parameters:
 +
 +
{|class="wikitable" style="text-align: center"
 +
!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==
 
==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. <br>
 +
For example, setting the TorqueThreshold to a value that matches MICONT: <br>
 +
<center> <math> <axis>.TorqueThreshold = \frac{1000}{TFac}\ </math> </center>
 +
 +
Setting the TorqueThreshold to a value that matches '''MIPEAK''':
 +
<center> <math> TorqueThreshold=\frac{1000*MIPEAK}{TFac*MICONT}\ </math> </center>
 +
 
==How to include gear ratio==
 
==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).
 +
<center> <math> TFac = \frac{1000000}{MKT*MICONT*GR}\ </math></center>
 +
 +
where GR stands for Gear Ratio. Figure 3 shows an example of a gear ratio.
 +
 +
[[file:DM 2.png|80px|frame|left|<big><center> ''figure 2 - Setting the torque factor(TFac) property for all axes in MC-Basic for WtherCAT drive''</center></big>]]
 +
 +
 +
[[file:DM 3.png|150px|frame|left|<big><center> ''figure 3 - An example of a gear mechanism with a ratio of 1:2''</center></big>]]
 
==Linear Axes==
 
==Linear Axes==
 
===Rotary motors with lead screws / pulleys / or different type of mechanism used to translate turning motion into linear motion===
 
===Rotary motors with lead screws / pulleys / or different type of mechanism used to translate turning motion into linear motion===

Revision as of 10:53, 9 November 2017

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

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

Linear Motors

Operation Mode and PDOs

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