Computed Torque Method(CTM)
In this example, the computed torque control method (described below) is implemented using IndySDK and it will be executed through the simulation (please note that this example has been verified only in simulations, not real robots)
Summary of Controller
To begin with, the CTM-based position control is briefly summarized. The robot dynamics is given as follows: \begin{align} \tau + J^{T}F_{ext} = M(q)\ddot{q} + C(q,\dot{q})\dot{q} + g(q), \end{align} Here, M(q), C(q,\dot{q}), and g(q) are respectively the inertia matrix, Coriolis matrix, and gravity vector. F_{ext} denotes the external force and \tau is a control input.
As shown in below, the control input is calculated based on the robot model so as to cope with the nonlinear and coupled characteristics of the robot dynamics. This enables to configure the high performance position controller.
Consequently, this make the robot behave as the following linear system.
Defining the reference acceleration \ddot{q}_{ref} given as
here e = q_{des} - q, eventually, the robot is controlled to satisfy the following second order ordinary differential equation:
It is clear that this satisfies the exponential stability, and consequently the error converges to the equilibrium point (i.e., q_{des} \rightarrow q).
Example Code
To begin with, let's generate the joint control component. Then, include "DynamicAnalysis6D.h" and define the type "DynamicAnalysis" to use the robot dynamic models like follows:
1 2 3 4 |
|
Next, fill in the computeControlTorq() function like follows. Here, JointDynamics function returns inertia matrix, Coriolis matrix, and gravity vector to M, C, g arguments respectively.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|