## 4 Analysis of Inner Motion Loops  
The inner loops are implemented inside robot controllers. In most commercial robots, the details, such as dynamics parameters, gains, and algorithms of the inner controller, are not available for users. However, today, most of the robot controllers compensate for the nonlinear dynamics or, at least, the effect of gravity. The force control tasks are usually performed at very low velocities and accelerations. Thus, the inertia, centrifugal, and Coriolis forces have less influence than gravity force. As stated previously, the inner control may be a position loop or a velocity loop. Several authors have used different forms of inner loops. All of them had to use Cartesian commands. Some used absolute position commands [21; 34]. [PERSON] and [PERSON] [35] used position increments instead of absolute positions, and in the works of [PERSON], [PERSON] et al. [9] and [PERSON], [PERSON] et al. [30], the authors used inner velocity loops. It should be emphasized that some robot controllers do not have cartesian velocity commands, so this option is not always available. An essential feature for the force control in a robot is the cartesian stiffness matrix. This matrix determines the deviation of the robot from the nominal trajectory, under the effect of external forces. \begin{table}
\begin{tabular}{c l} \hline \hline
**Algorithm** & \multicolumn{1}{c}{**Control Action**} \\ \hline Proportional Derivative—PD & \(u=K_{\text{\emph{ref}}}\big{(}f_{d}-\hat{f}\big{)}+K_{\text{\emph{ref}}} \big{(}\hat{f}_{d}-\hat{f}\big{)}\), & (6) \\ Proportional with Velocity feed—PV & \(u=K_{\text{\emph{ref}}}\big{(}f_{d}-\hat{f}\big{)}-K_{\text{\emph{ref}}} \big{(}\hat{x}\), & (7) \\ Proportion—Integ—Derivat—PID & \(u=K_{\text{\emph{ref}}}\big{(}f_{d}-\hat{f}\big{)}+K_{\text{\emph{ref}}} \big{(}\hat{f}_{d}-\hat{f}\big{)}+K_{\text{\emph{ref}}}\int\big{(}f_{d}-\hat{f} \big{)}dt\), & (8) \\ Proportional—Integral with Velocity feed—PIV & \(u=K_{\text{\emph{ref}}}\big{(}f_{d}-\hat{f}\big{)}-K_{\text{\emph{ref}}} \big{(}\hat{x}+K_{\text{\emph{ref}}}\int\big{(}f_{d}-\hat{f}\big{)}dt\), & (9) \\ Proportional with Feedforward—P + FF & \(u=FF+K_{\text{\emph{ref}}}\big{(}f_{d}-\hat{f}\big{)}\), & (10) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Typical control action for outer force loops. The expression for this matrix depends on several factors. First, it is influenced by the location of the position/velocity sensor for the feedback of the inner loop. It may be located on the motor (a typical configuration for rigid robots) or on the link (for the elastic ones). The cartesian stiffness matrix is not equal in all the working range of the robot. It may be essential to know the expression for the stiffness matrix to deduce where to perform the task, what will be the errors, etc. Another important factor is how the inner loop coordinate transformation is performed. The force control must be programmed in cartesian space. However, the motors are controlled in joint space. Thus, cartesian coordinates must be transformed into joint coordinates. This can be implemented in two ways, through the Jacobian inverse method or the Jacobian transpose method. Thus, the control action of the inner position loop can be computed with these two methods by the robot controller [33]. In the first case, the first step is to compute the cartesian position error and use the Jacobian inverse to transform it into joint coordinate errors. Then, the control action is carried out. In the second case, the regulator is applied directly to the cartesian position error. The result is multiplied by the Jacobian transpose to obtain the input torques of the motors. These two possible configurations, called Jacobian inverse control and Jacobian transpose control, can be seen in Figure 2.  
In Section 4.1, the cartesian stiffness matrix is analysed depending on the location of the position/velocity sensor, and the type of inner loop.