6.1 Introduction

Redundant manipulators, which have more DOFs than those required to complete a given task, are more flexible than non-redundant ones. The redundant DOFs enable manipulators to realize the fault tolerant control, improve operation performance and enhance reliability. Therefore, redundant manipulators have been widely used in industry, agriculture, military, space exploration, etc. Consequently, the research on the redundant manipulator has been studied intensively [1,2,3,4].

Motion control and force control are two main modes of redundant manipulator control. In motion control problems, a basic assumption is that there is no contact between the robot and the environment, that is, the robot can move freely in the workspace [5]. This problem is well-reflected in coating, welding, stacking, stacking and other applications. Then the core problem is to design control commands that drive the robot to follow a predetermined trajectory. The control command may be joint angular sequence [6], velocity sequence [7], acceleration sequence [8, 9] or torque sequences [10,11,12]. The redundancy resolution is usually used to achieve a secondary task, such as avoiding obstacles [13], avoiding singularities [14], etc. Different from motion control, force control involves the direct interaction between a robot and its environment. The control of contact force can enhance the robustness and flexibility of the robot in the weak structure environment, so as to enhance the robot\('\)s operation ability [15]. Corresponding typical applications in polishing, grinding, assembly, polishing, polishing and other fields [16, 17]. In [18], the theoretical framework of impedance control is proposed. The basic idea is to use the environment as admittance and the robot as impedance.By maintaining the dynamic relationship between force and motion, the controller is represented as a spring-mass-damping system. In [19], a hybrid position force controller is proposed which combines position information with force information to realize the simultaneous control of position constraint and force constraint. Based on these two control frameworks, a series of controllers are proposed and verified by simulation or experiments [20,21,22].

Although the above work has achieved great success in motion force control of non-redundant robots, the control of redundant robots has not attracted enough attention. It is worth noting that the redundancy of the manipulator provides an opportunity to meet secondary objectives, but also sets up mathematical difficulties. In [23], in order to realize the flexible control of unknown obstacles, a position force control strategy is proposed. The motion of the robot is completely decoupled into two parts, namely the motion of the end-effector and the internal motion. The motion of the end-effector is controlled to achieve positional force control over the environment, while the internal motion is designed to avoid obstacles by minimizing impact. In [24], a robust control strategy with the ability to adjust contact force and apparent impedance is designed. The controller has strong robustness in dynamic and kinematic uncertainties. In [25], Patel et al. proposed a hybrid impedance control scheme based on pseudo inverse jacobian. The limitation of joint angle is avoided by defining a function that scales the difference between joint angle and its boundary. However, these literatures require continuous computation of the pseudo inverse of the jacobian matrix, which brings huge computational burden and is difficult to deal with multiple constraints [26].

In order to solve the redundant solution problem of redundant robots, a feasible method is to transform the control problem into an optimization problem under constraints [27]. The objective function is established according to the secondary task, and the constraint conditions are established according to the primary task and physical constraints. This optimization problem is often described as a QP problem [28]. Because of the high efficiency of parallel computing, recursive neural network is often used to solve QP-based redundant solutions online [29]. In recent years, the controller based on recursive neural network (RNN) has been introduced into the motion control of redundant robots. A new redundancy decomposition method is proposed, which constructs a robust neural network at the velocity level to guarantee the boundary of joint acceleration [30]. In [31], RNN is improved to allow projection operations on non-convex sets, avoiding the accumulation of tracking errors to system noise. In [32], a method is proposed to realize operational optimization through indirect maximization of time derivative. In [33], cooperative control of distributed multi-robot is studied. Recently, RNN has been extended to control flexible robots, model uncertainties and other issues [34,35,36,37]. Although the motion control of redundant robot based on RNN has obtained good research results, as far as we know, there is no research report on the application of RNN in motion force control of robot.

On this basis, we propose a position force control scheme based on RNN, which is an important extension of recursive neural network in robot control. Table 6.1 provides a brief comparison between the proposed and existing programmes. Unlike [25] and [23], in this chapter the motion force controller is established in the joint velocity stage and allows for multiple inequality constraints. The non-convex optimization problem is studied without loss of generality. With [31, 32, 34] the existing similar motion controller, the proposed motion force controller is no longer needed the pseudo inverse Jacobian.

This chapter mainly studies the following aspects. In the second part, the tracking error and contact force are modeled, and the control problem is written as QP problem. In Chap. 3, QP is reformulated at the velocity level by rewriting the objective function and constraints. In the fourth part, we set up an RNN to solve the redundant resolution problem. Stability has also been demonstrated. In the fifth part, the numerical experiments of 4-DOF planar manipulator are carried out. Finally, the sixth part carries on the summary to the full text. By the end of this section, the main contributions are as follows:

  • As far as we know, this is the first research to study the motion force control of redundant robots in the framework of RNNs. It is worth noting that force sensitive manipulators, such as milling robots and polishing robots, cannot successfully control the use of existing results in RNNs, while the RNN model built in this work can do this.

  • In the proposed control scheme, the motion-force control problem as well as redundancy resolution problem are reconstructed to facilitate practical implementations.

  • The controller is capable of handling multiple inequality constraints, including but not limited to angle constraints, angular velocity constraints and torque constraints. This is of great significance in improving system security.

  • The contribution of this chapter also lies in the realization of real-time optimization of joint torque, which is helpful to save energy in industrial applications.

Table 6.1 Comparisons among the Proposed Motion-force Control Scheme and Existing Ones

6.2 Problem Formulation

6.2.1 Problem Formulation

In this chapter, we focus on position-force control problem for redundant manipulators. Figure 6.1 gives a brief introduction of a redundant robot and its operation on an workpiece. The robot is expected to offer a desired contact force in the vertical direction of the contact surface, at the same time, the end-effector is required to track a predefined trajectory along the surface. In the base coordinate frame \(R_0(0_0,x_0,y_0,z_0)\), forward kinematics of a serial manipulator can be written as

$$\begin{aligned} f(\theta (t))=x(t), \end{aligned}$$
(6.1)

where \(\theta \in \mathbb {R}^n\) is the vector of joint angles, and \(x\in \mathbb {R}^m\) represents the end-effector\('\)s coordinate vector in frame \(R_0\), \(f(\bullet ): \mathbb {R}^n\rightarrow \mathbb {R}^m\) is used to describe the forward kinematics operator. For a redundant manipulator, we have \(n>m\).

Fig. 6.1
figure 1

A brief diagram of a planar redundant manipulator and its operation on a workpiece

By differentiating x(t) with respect to time t, we can get the relationship between Cartesian velocity \(\dot{x}(t)\in \mathbb {R}^m\) and joint velocity (or joint control signal) \(\dot{\theta }(t)\in \mathbb {R}^n\) as follows:

$$\begin{aligned} J(\theta (t))\dot{\theta }(t)=\dot{x}(t), \end{aligned}$$
(6.2)

where \(J(\theta (t))=\partial {f(\theta (t))/\partial \theta (t)}\) is called Jacobian matrix.

In position-force control tasks, the end-effector\('\)s motion is constrained by the contact surface. For simplicity, we define a tool coordinate system as \(R_t(x_t,y_t,z_t)\), in which the axis \(z_t\) is set in alignment with the vertical direction of the contact surface. Obviously, the motion of end-effector can be specified along \(x_t\) and \(y_t\). In this chapter, frictional force between the robot and contact surface is ignored, therefore, the contact force F is in alignment with \(z_t\).

In the tool coordinate system \(R_t\), let \(\delta X_t\) be the displacement between effector and its position command, then the contact force \(F_t\) can be formulated as

$$\begin{aligned} F_t=k_f\varSigma _t\delta X_t, \end{aligned}$$
(6.3)

where \(k_f>0\) is the stiffness coefficient, \(\varSigma _t=diag(0,0,1)\). Diagonal matrix \(\varSigma _t\) describes the relationship between the contact force and relative displacement along different axes: 1 means that displacement component along \(z_t\) affects the contact force, and 0 otherwise.

Similarly, in tool coordinate system \(R_t\), the position tracking error \(e_t\) can be written as

$$\begin{aligned} e_t=\bar{\varSigma }_t\delta X_t, \end{aligned}$$
(6.4)

where \(\bar{\varSigma }_t=I-\varSigma _f=diag(1,1,0)\), 1 means there is a DOF of movement along the corresponding direction, and 0 otherwise.

When the contact surface is prior known, \(R_t\) can be obtained from \(R_0\) by a rotation matrix \(S_t\). Let F, \(e_0\) and \(\delta X\) be the corresponding description of \(F_t\), \(e_t\) and \(\delta X_t\) in coordinate frame \(R_0\), then we have \(F=S_t^{\text{ T }}F_t\), \(e_t=S_te_0\) and \(\delta X_t=S_t\delta X\). Therefore, F and \(e_0\) can be rewritten as

$$\begin{aligned} \left\{ \begin{aligned} F&=k_fS_t^{\text{ T }}\varSigma _tS_t\delta X,\\ e_0&=S_f^{\text{ T }}\bar{\varSigma }_tS_f\delta X. \end{aligned} \right. \end{aligned}$$
(6.5)

Notable that in frame \(R_0\), the displacement \(\delta X\) can be described as \(\delta X=x-x_{\text{ d }}\), where \(x_{\text{ d }}\) is the desired position signals described in \(R_0\). Using (6.1), (6.5) can be rewritten as

$$\begin{aligned} \left\{ \begin{aligned} F&=k_fS_t^{\text{ T }}\varSigma _fS_t(f(\theta )-x_{\text{ d }}),\\ e_0&=S_t^{\text{ T }}\bar{\varSigma }_fS_t(f(\theta )-x_{\text{ d }}). \end{aligned} \right. \end{aligned}$$
(6.6)

Remark 6.1

Equation (6.6) gives the unified description of the relationship between the contact force F, position tracking error \(e_0\) and displacement \(\delta X\) in \(R_0\). \(\delta X\) will lead to contact force F in the vertical direction, and position tracking error \(e_0\) along the contact surface.

In real implementations, given the desired contact force \(F_{\text{ s }}\) and trajectory command \(x_{\text{ d }}\), the manipulator\('\)s end-effector is expected to offer contact force \(F_{\text{ d }}\) while tracking \(x_{\text{ d }}\), i.e., \(F\rightarrow F_{\text{ d }}\), \(e_0\rightarrow 0\). For the convenience of writing in the following sections, let \(A=[k_fS_t^{\text{ T }}\varSigma _tS_t;S_t^{\text{ T }}\bar{\varSigma }_fS_t]\), \(r=[F^{\text{ T }},e_0^{\text{ T }}]^{\text{ T }}\), and \(r_{\text{ d }}=[F_{\text{ d }};0]\). Then (6.6) can be reformulated as

$$\begin{aligned} A(f(\theta )-x_{\text{ d }})=r. \end{aligned}$$
(6.7)

Therefore, the control objective of position-force control is to adjust the joint angles \(\theta \), to ensure \(r\rightarrow r_{\text{ d }}\).

6.2.2 Joint Torque and Physical Constraints

When the end-effector offers a contact force F, the corresponding torque is provided by motors at every joint. The relationship between contact force F and the joint torque \(\tau \) can be formulated as

$$\begin{aligned} \tau =J^{\text{ T }}(\theta )F. \end{aligned}$$
(6.8)

In the control of redundant manipulators, there would be infinite groups of solutions to a certain control task. In order to save energy during the control process, we select a objective function scaling energy consumption as \(\tau ^{\text{ T }}\tau /2\). The smaller \(\tau ^{\text{ T }}\tau /2\), the less energy consumption.

In real implementations, the system is limited by physical constraints. For example, the joint angles \(\theta \) and velocities \(\dot{\theta }\) must not exceed their limits: \(\theta ^{\text {min}}\),\(\theta ^{\text {max}}\), \(\dot{\theta }^{\text {min}}\), \(\dot{\theta }^{\text {max}}\), since the possible collisions or overheating of motor would lead to irreversible damages. At the same time, considering the bounded torque output of the motors, the limitation of joint torque \(\tau \) is described as \(\tau ^{\text {min}}\le \tau \le \tau ^{\text {max}}\).

6.2.3 Optimization Problem Formulation

According to the descriptions above, the position-force control problem for redundant manipulators considering torque optimization can be formulated as

$$\begin{aligned} \text {min}&~~~~~~~G_1=\tau ^{\text{ T }}\tau /2,\end{aligned}$$
(6.9a)
$$\begin{aligned} \text {s.t.}&~~~~~~~\tau =J^{\text{ T }}F,\end{aligned}$$
(6.9b)
$$\begin{aligned}&~~~~~~~r_{\text{ d }}=A(f(\theta )-x_{\text{ d }}),\end{aligned}$$
(6.9c)
$$\begin{aligned}&~~~~~~~\theta ^{\text {min}}\le \theta \le \theta ^{\text {max}},\end{aligned}$$
(6.9d)
$$\begin{aligned}&~~~~~~~\dot{\theta }^{\text {min}}\le \dot{\theta }\le \dot{\theta }^{\text {max}},\end{aligned}$$
(6.9e)
$$\begin{aligned}&~~~~~~~\tau ^{\text {min}}\le \tau \le \tau ^{\text {max}}, \end{aligned}$$
(6.9f)

with \(\theta \) being the decision variable. Equation (6.9a) is the cost function to be minimized, the equality constraint (6.9b) describes the relationship between the resulting joint torque \(\tau \) and contact force F. The force and motion tasks of the robot are described in (6.9c), and inequality constraints (6.9e), (6.9d) and (6.9f) show the physical limitations to be satisfied. By substituting (6.9b) into (6.9a), the optimization problem can be rewritten as

$$\begin{aligned} \text {min}&~~~~~G_1=F^{\text{ T }}J(\theta )J^{\text{ T }}(\theta )F/2,\end{aligned}$$
(6.10a)
$$\begin{aligned} \text {s.t.}&~~~~~r_{\text{ d }}=A(f(\theta )-x_{\text{ d }}),\end{aligned}$$
(6.10b)
$$\begin{aligned}&~~~~~\theta ^{\text {min}}\le \theta \le \theta ^{\text {max}},\end{aligned}$$
(6.10c)
$$\begin{aligned}&~~~~~\dot{\theta }^{\text {min}}\le \dot{\theta }\le \dot{\theta }^{\text {max}},\end{aligned}$$
(6.10d)
$$\begin{aligned}&~~~~~\tau ^{\text {min}}\le \tau \le \tau ^{\text {max}}. \end{aligned}$$
(6.10e)

To solve (6.10), there are two main challenges. Firstly, as an objective function to be minimized, \(F^{\text{ T }}J(\theta )J^{\text{ T }}(\theta )F/2\) is usually non-convex relative to \(\theta \), because it is a function of \(J(\theta )\). Secondly, the equation constrain (6.10b) is highly nonlinear, and at the same time, it remains difficult to handle the inequality constraints, especially (6.10d) and (6.10e).

6.3 Reconstruction of Optimization Problem

In this section, in order to overcome the above difficulties, the redundancy resolution problem (6.10) will be reconstructed. The objective function is firstly redefined, and both equality and inequality constrains are rebuilt in velocity level.

6.3.1 Reconstruction of Objective Function

As to \(F^{\text{ T }}J(\theta )J^{\text{ T }}(\theta )F/2\), we will replace F with the desired value \(F_{\text{ d }}\). Therefore, the optimization function can be formulated as \(G_2=F^{\text{ T }}_{\text{ d }}J(\theta )J^{\text{ T }}(\theta )F_{\text{ d }}/2\).

Remark 6.2

There are two main reasons: firstly, according to the control objective, the contact force F is expected to track \(F_{\text{ d }}\), if the controller is proper designed, F will eventually converge to \(F_{\text{ d }}\), consequently, \(F_{\text{ d }}^{\text{ T }}J(\theta )J^{\text{ T }}(\theta )F_{\text{ d }}/2\) will be equivalent to \(F^{\text{ T }}J(\theta )J^{\text{ T }}(\theta )F/2\). Secondly, \(F_{\text{ d }}\) is independent of \(\theta \), this replacement will reduce the computational complexity in the control process.

Differentiating \(G_2\) with respect to time, we have

$$\begin{aligned} \dot{G}_2=(J^{\text{ T }}(\theta )F_{\text{ d }})^{\text{ T }}\dfrac{\text{ d }(J^{\text{ T }}(\theta )F_{\text{ d }})}{\text{ d }t}. \end{aligned}$$
(6.11)

Obviously, \(\dot{G}_2\) describes the change of \(G_2\). By minimizing \(\dot{G}_2\), the system will be compelled to develop in the direction of decreasing \(G_2\). Therefore, in this chapter, we use \(\dot{G}_2\) instead of \(G_2\) as the new objective function. Notable that \(\text{ d }(J^{\text{ T }}(\theta )F_{\text{ d }})/\text{ d }t\) can be formulated as

$$\begin{aligned} \begin{aligned} \dfrac{\text{ d }}{\text{ d }t}(J^{\text{ T }}(\theta )F_{\text{ d }})&=\sum _{i=1}^n\dfrac{\partial (J^{\text{ T }}(\theta )F_{\text{ d }})}{\partial \theta _i}\dot{\theta }_i+J^{\text{ T }}(\theta )\dot{F}_{\text{ d }}\\&=[H_i,\cdots ,H_n]\dot{\theta }+J^{\text{ T }}(\theta )\dot{F}_{\text{ d }}, \end{aligned} \end{aligned}$$
(6.12)

where \(H_i\in \mathbb {R}^n\) is

$$\begin{aligned}\nonumber H_i=\dfrac{\partial (J^{\text{ T }}(\theta )F_{\text{ d }})}{\partial \theta _i}=\begin{bmatrix} \sum _{j=1}^m(\partial (J(j,1)F_{\text{ d }}(j))/\partial \theta _i)\\ \sum _{j=1}^m(\partial (J(j,2)F_{\text{ d }}(j))/\partial \theta _i)\\ \cdots \\ \sum _{j=1}^m(\partial (J(j,n)F_{\text{ d }}(j))/\partial \theta _i) \end{bmatrix}. \end{aligned}$$

Let \(H=[H_1,\cdots ,H_n]\), then (6.11) can be converted as

$$\begin{aligned} \dot{G}_2=F^{\text{ T }}_{\text{ d }}JH\dot{\theta }+F^{\text{ T }}_{\text{ d }}JJ^{\text{ T }}\dot{F}_{\text{ d }}. \end{aligned}$$
(6.13)

It is worth pointing that the second term of (6.13) is independent of \(\dot{\theta }\), therefore, the objective function is equivalent to \(F^{\text{ T }}_{\text{ d }}JH\dot{\theta }\).

6.3.2 Reconstruction of Constraints

In this part, we will transform the constrains into velocity level. First of all, we define a concatenated vector describing force and position errors as \(e=r-r_{\text{ d }}=[F-F_{\text{ d }};e_0]\), according to (6.7), e can be formulated as

$$\begin{aligned} e=A(f(\theta )-x_{\text{ d }})-r_{\text{ d }}. \end{aligned}$$
(6.14)

Differentiating e and combing (6.2) yields

$$\begin{aligned} \dot{e}=A(J\dot{\theta }-\dot{x}_{\text{ d }})-\dot{r}_{\text{ d }}. \end{aligned}$$
(6.15)

To ensure that e converges to zero, a simple controller can be designed as \(\dot{e}=-ke\), where \(k>0\) is a positive constant. According to (6.14), (6.15), the equality constrains can be converted in velocity level as

$$\begin{aligned} AJ\dot{\theta }=\dot{r}_{\text{ d }}+A\dot{x}_{\text{ d }}-k(Af(\theta )-x_{\text{ d }}). \end{aligned}$$
(6.16)

As to the inequality constraints (6.10c) and (6.10d), according to [27], let \(\omega =\dot{\theta }\) and define \(\alpha \ge 0\) as a constant parameter to scale the negative feedback to conform the joint constraints, these two constraints can be formulated in the speed level as

$$\begin{aligned} \omega ^{\text{ min }}\le \omega \le \omega ^{\text{ max }}, \end{aligned}$$
(6.17)

where \(\omega ^{\text{ min }}=\text {max}\{\alpha (\theta ^{\text{ min }}-\theta ),\dot{\theta }^{\text {min}}\}\), and \(\omega ^{\text{ max }}=\text {min}\{\alpha (\theta ^{\text{ max }}-\theta ),\dot{\theta }^{\text {max}}\}\).

Similarly, (6.10e) can be built indirectly by limiting its derivative: \(\beta (\tau ^{\text {min}}-\tau )\le \dot{\tau }\le \beta (\tau ^{\text {max}}-\tau )\), where \(\beta \) is a positive constant. By combing (6.12), the boundedness of joint torque can be rewritten as an inequality constraint about a function \(g(\omega )\) as

$$\begin{aligned} g(\omega )\le 0, \end{aligned}$$
(6.18)

where \(g(\omega )=[\beta (\tau ^{\text {min}}-\tau )-J^{\text{ T }}\dot{F}_{\text{ d }}-H\omega , H\omega -\beta (\tau ^{\text {max}}-\tau )J^{\text{ T }}+\dot{F}_{\text{ d }}]^{\text{ T }}\in \mathbb {R}^{2n}\).

6.3.3 Reformulation and Convexification

According to the above description, in order to achieve position-force control of redundant manipulators, instead of solving (6.10) directly, one feasible solution is to solve the optimization problem in velocity level as

$$\begin{aligned} \text {min}&~~~~~~~F^{\text{ T }}_{\text{ d }}JH\omega ,\end{aligned}$$
(6.19a)
$$\begin{aligned} \text {s.t.}&~~~~~~~r_r=AJ\omega ,\end{aligned}$$
(6.19b)
$$\begin{aligned}&~~~~~~~g(\omega )\le 0,\end{aligned}$$
(6.19c)
$$\begin{aligned}&~~~~~~~\omega \in \varOmega , \end{aligned}$$
(6.19d)

where \(r_r=\dot{r}_d+A\dot{x}_{\text{ d }}-k(Af(\theta )-x_{\text{ d }})\), \(\varOmega =\{\omega \in \mathbb {R}^n\arrowvert \omega _i^{\text{ min }}\le \omega _i\le \omega _i^{\text{ max }}\}\) is a convex set. It is remarkable that the objective function described in (6.19a) is non-convex relative to \(\omega \). Therefore, (6.19b) is introduced to convexity (6.19a). The final form of optimization problem is described as

$$\begin{aligned} \text {min}&~~~~F^{\text{ T }}_{\text{ d }}JH\omega +(AJ\omega -r_r)^{\text{ T }}(AJ\omega -r_r),\end{aligned}$$
(6.20a)
$$\begin{aligned} \text {s.t.}&~~~~~~~~r_r=AJ\omega ,\end{aligned}$$
(6.20b)
$$\begin{aligned}&~~~~~~~~g(\omega )\le 0,\end{aligned}$$
(6.20c)
$$\begin{aligned}&~~~~~~~~\omega \in \varOmega . \end{aligned}$$
(6.20d)

So far, we have reconstructed the position-force control with joint torque optimization problem into a quadratic programming issue under constraints. However, the QP problem (6.20) cannot be solved directly.

6.4 RNN Based Redundancy Resolution

In this chapter, in order to solve the optimization problem (6.20), an expanded recurrent neural network is built to obtain the optimal solution of (6.20). Stability will be also discussed.

6.4.1 RNN Design

Firstly, let \(\lambda _1\in \mathbb {R}^{2m}\) and \(\lambda _2\in \mathbb {R}^{2n}\) be dual variables to constraints (6.20b) and (6.20c), a Lagrange function is defined as

$$\begin{aligned} L=&F^{\text{ T }}_{\text{ d }}JH\omega +(AJ\omega -r_r)^{\text{ T }}(AJ\omega -r_r)\nonumber \\&~~+\lambda _1^{\text{ T }}(r_r-AJ\omega )+\lambda _2^{\text{ T }}g(\omega ). \end{aligned}$$
(6.21)

According to Karush−Kuhn−Tucker condition, the optimal solution of the optimization problem (6.20) can be equivalently formulated as

$$\begin{aligned} \omega&=P_{\varOmega }(\omega -\dfrac{\partial {L}}{\partial \omega }),\end{aligned}$$
(6.22a)
$$\begin{aligned} r_r&=AJ\omega ,\end{aligned}$$
(6.22b)
$$\begin{aligned} \lambda _2&=(\lambda _2+g(\omega ))^{+}, \end{aligned}$$
(6.22c)

where \(P_{\varOmega }(x)=\text {argmin}_{y\in \varOmega }||y-x||\) is a projection operation to convex set \(\varOmega \), and \((x)^+=(x_1^+,\cdots ,x_{2n}^+)^{\text{ T }}\), \(x_i^+=\text {max}(x_i,0)\).

In order to solve (6.22), an expanded recurrent neural network is designed as

$$\begin{aligned} \varepsilon \dot{\omega }=&-\omega +P_{\varOmega }(\omega -H^{\text{ T }}J^{\text{ T }}F_{\text{ d }}-J^{\text{ T }}A^{\text{ T }}(AJ\omega -r_r)\nonumber \\&+J^{\text{ T }}A^{\text{ T }}\lambda _1-\nabla g\lambda _2),\end{aligned}$$
(6.23a)
$$\begin{aligned} \varepsilon \dot{\lambda }_1=&r_r-AJ\omega ,\end{aligned}$$
(6.23b)
$$\begin{aligned} \varepsilon \dot{\lambda }_2=&(\lambda _2-(\lambda _2+g(\omega ))^+), \end{aligned}$$
(6.23c)

where \(\nabla g=(\dfrac{\partial {g_1}}{\partial \omega },\cdots ,\dfrac{\partial {g_{2m}}}{\partial \omega })=[-H^{\text{ T }},H^{\text{ T }}]\in \mathbb {R}^{n\times 2n}\), \(\varepsilon \) is a positive constant scaling the convergence of (6.23). The pseudo code of the RNN-based strategy is shown in Algorithm 5.

figure a

6.4.2 Stability Analysis

In this part, theoretical analysis of stability and convergence of closed-loop system using the proposed neural network (6.23).

First of all, several important definitions and Lammas are presented, which is very useful in stability analysis.

Definition 6.1

A continuously differentiable function \(F(\bullet )\) is said to be monotone if \(\nabla F+{\nabla F}^{\text{ T }}\) is positive semi-definite, where \(\nabla F\) is the gradient of \(F(\bullet )\).

Lemma 6.1

[38] A dynamic neural network is said to converge to the equilibrium point if it satisfies

$$\begin{aligned} \kappa \dot{x}=-\dot{x}+P_S(x-\varrho F(x)), \end{aligned}$$
(6.24)

where \(\kappa >0\) and \(\varrho >0\) are constant parameters, and \(P_S=\text {argmin}_{y\in S}||y-x||\) is a projection operator to closed set S.

So far, a theorem about the convergence of the redundancy resolution problem can be described as follows

Theorem 6.1

Given the motion-force control problem for redundant manipulators with torque optimization under physical constraints as (6.20), the recurrent neural network (6.23) is stable and will globally converge to the optimal solution of (6.20).

Proof

Let \(\xi =[\omega ^{\text{ T }},\lambda _1^{\text{ T }},\lambda _2^{\text{ T }}]^{\text{ T }}\), the proposed RNN (6.23) can be written as

$$\begin{aligned} \varepsilon \dot{\xi }=-\xi +P_{\bar{\varOmega }}[\xi -F(\xi )], \end{aligned}$$
(6.25)

where \(F(\xi )=[F_1(\xi ),F_2(\xi ),F_3(\xi )]^{\text{ T }}\in \mathbb {R}^{2m+3n}\), in which

$$\begin{aligned} \begin{bmatrix} F_1\\ F_2\\ F_3 \end{bmatrix}=\begin{bmatrix} H^{\text{ T }}J^{\text{ T }}F_{\text{ d }}+J^{\text{ T }}A^{\text{ T }}(AJ\omega -r_r)-J^{\text{ T }}A^{\text{ T }}\lambda _1+\nabla g\lambda _2\\ \lambda _1-r_r+AJ\omega \\ -g(\omega ) \end{bmatrix}.\nonumber \end{aligned}$$

Let \(\nabla F(\xi )=\partial F/\partial \xi \), we have

$$\begin{aligned} \nabla F(\xi )=\begin{bmatrix} J^{\text{ T }}A^{\text{ T }}AJ&{}&{}-J^{\text{ T }}A^{\text{ T }}&{}&{}\nabla g\\ AJ&{}&{}I&{}&{}0\\ -(\nabla g)^{\text{ T }}&{}&{}0&{}&{}0 \end{bmatrix}. \end{aligned}$$
(6.26)

It is remarkable that

$$\begin{aligned} \nabla F(\xi )+(\nabla F(\xi ))^{\text{ T }}=\begin{bmatrix} 2J^{\text{ T }}A^{\text{ T }}AJ&{}&{}0&{}&{}0\\ 0&{}&{}2I&{}&{}0\\ 0&{}&{}0&{}&{}0 \end{bmatrix}. \end{aligned}$$
(6.27)

From Definition 6.1, \(F(\xi )\) is a monotone function of \(\xi \).

According to the description of (6.23) and (6.25), \(P_{\bar{\varOmega }}\) can be formulated as \(P_{\bar{\varOmega }}=[P_{\varOmega };P_{R};P_{\Lambda }]\), where \(P_{R}\in \mathbb {R}^{2m}\) is a projection operator of \(\lambda _1\) to set R, with the upper and lower bounds being \(\pm \infty \). Furthermore, \((\bullet )^+\) is a special case of \(P_{\Lambda }\), in which \(\Lambda =\mathbb {R}_+^{2n}\) is the nonnegative quadrant of \(\mathbb {R}^{2n}\). Therefore, \(P_{\bar{\varOmega }}\) is a projection operator to closed set \(\bar{\varOmega }\). Based on Lemma 6.1, the proposed neural network (6.23) is stable and will globally converge to the optimal solution of (6.20). The proof is completed. \(\Box \)

6.5 Illustrative Examples

In this chapter, taking the planar 4-DOF manipulator as an example, numerical calculation is carried out to verify the effectiveness of the proposed control scheme. First, we will check the control performance without joint torque optimization by making \(H^{\text{ T }}J^{\text{ T }}F_{\text{ d }}\) in (6.23a) be 0. Secondly, a dynamic simulation example of joint torque optimization is introduced to illustrate the superiority of the control strategy. Finally, the adaptability and optimization performance of this method are verified by simulation experiments under different initial conditions.

6.5.1 Simulation Setup

As shown in Fig. 6.2, a contact surface in the workspace can be described as \(y=0\), the end-effector can move freely along the horizontal axis, and the desired contact force \(F_{\text{ d }}\) is aligned with the vertical direction. The stiffness coefficient \(k_f\) is set to be 1000N/mm. Control positive control gains are set as \(\alpha =10\), \(\beta =10\), \(k=8\), \(\varepsilon =0.005\), respectively. Physical constraints of joint angles, velocities and torque are defined as \(\theta ^{\text{ min }}=[-2,-2,-2,-2]^{\text{ T }}\) rad, \(\theta ^{\text{ max }}=[2,2,2,2]^{\text{ T }}\) rad, \(\dot{\theta }^{\text{ min }}=[-2,-2,-2,-2]^{\text{ T }}\) rad/s, \(\dot{\theta }^{\text{ max }}=[2,2,2,2]^{\text{ T }}\) rad/s, \(\tau ^{\text {min}}=[-10,-10,-10,-10]^{\text{ T }}\) Nm, \(\tau ^{\text {max}}=[10,10,10,10]^{\text{ T }}\) Nm, respectively.

Fig. 6.2
figure 2

Physical structure of the 4-link robot manipulator

Fig. 6.3
figure 3

Numerical results when tracking a time varying force command along a trajectory without optimization. a Profiles of the end-effector (black dashed line) and the corresponding joint configurations. b Profiles of position error. c Profiles of contact force. d Profiles of joint angles. e Profiles of joint velocities. f Profiles of joint torque

6.5.2 Position-Force Control Without Optimization

In this part, the robot is controlled to offer a constant contact force on the surface while tracking a given trajectory. It is remarkable that joint torque optimization is not investigated yet. The initial joint angles are selected as \(\theta _0=[1.57, -1.26, -0.52, -0.52]^{\text{ T }}\) rad. The desired trajectory is defined as \(x_{\text{ d }}=[0.25+0.1cos(0.5t),0]^{\text{ T }}\), and the contact force is defined as \(F_{\text{ d }}=[0,-1]^{\text{ T }}\) N. Numerical results are shown in Fig. 6.3. When simulation begins (\(t<0.5s\)), the position error is big, and there is no contact between the robot and surface. Correspondingly, both contact force and result torque are zero. Under the RNN based controller (6.23), joint velocities reach the maximum value, the end-effector approaches to the surface rapidly from the initial position, and the tracking error converges to zero quickly, the corresponding joint configurations are shown in Fig. 6.3a. As the robot approaches the contact surface, the robot slows down quickly, and the contact force rises from zero, the then converges to the desired value smoothly. In the stable state (\(t>2\) s), both contact force F and end-effector track the desired command, the tracking errors are zero, which means the robot tracks both desired trajectory and force successfully. Correspondingly, joint angles change periodically, which enables the robot to achieve dynamic tracking. This will also lead to a periodic change in result torque in joint space, as shown in Fig. 6.3f. During the whole process, boundary of joint angles, velocities and torque are all ensured.

6.5.3 Position-Force Control with Optimization

In this part, joint torque optimization is introduced to make full use of redundancy resolution. The proposed position-force control scheme is firstly validated in a fixed point case, and then extended to dynamic cases.

(1) Position-Force Control on A Fixed Point

In this simulation, the robot is wished to offer a constant contact force \(F_{\text{ d }}=[0,-10]^{\text{ T }}\) at a fixed point \(x_{\text{ d }}=[0.3,0]^{\text{ T }}\). The initial values of joint angles are also \(\theta _0=[1.57, -1.26, -0.52, -0.52]^{\text{ T }}\)rad. Numerical results are shown in Fig. 6.4. At the beginning of simulation, the robot moves at its maximum speed (2 rad/s), making the regulation error converge quickly. Then it slows down as the regulation error is small. At \(t=0.5\,s\), robot touches the surface, which leads to the emergence of contact force. Using the proposed controller, both control error of motion and force converge to zero smoothly. Correspondingly, the Euclidean norm of joint torque also converges to a constant value (3.7 N\(^2\)/m\(^2\)). From Fig. 6.4e, f, joint angles and velocities do not exceed their limits, showing that the proposed scheme could handle inequality constraints effectively. To further demonstrate the validity of the optimization scheme, comparative simulations without optimization are also carried out. The obtained Euclidean norm of joint torque without optimization is shown as the red dashed line (4.3 \(N^2/m^2\) in stable state). After introducing joint torque optimization strategy, 16\(\%\) off of torque consumption is achieved.

(2) Position-Force Control Along A Straight Line

Then we check the optimization scheme in dynamic control. Both the desired path \(x_{\text{ d }}\) and desired force \(F_{\text{ d }}\) are time varying. The expected signals are defined as \(x_{\text{ d }}=[0.25+0.1cos(0.5t),0]^{\text{ T }}\), \(F_{\text{ d }}=[0, 20-2cos(0.5t)]^{\text{ T }}\) N, respectively. The initial values of joint angles are the same as the previous case. Numerical results are shown in Fig. 6.5. We also define a index to scale the torque consumption as \(J_{\tau }=\int _0^{T}||\tau (t)||_2^2 \text {d}t\).

Fig. 6.4
figure 4

Numerical results when the robot is controlled to offer constant force at a fixed point. a Profiles of the end-effector (black dashed line) and the corresponding joint configurations. b Profiles of position error. c Profiles of contact force. d Comparison of Euclidean norm of joint torque with and without optimization. e Profiles of joint angles. f Profiles of joint velocities

Fig. 6.5
figure 5

Numerical results when tracking a time varying force command along a straight line with optimization. a Profiles of the end-effector (black curve) and the corresponding joint configurations. b Profiles of position error. c Profiles of contact force. d Comparison of Euclidean norm of joint torque with and without optimization. e Profiles of joint anges. f Profiles of joint velocities

Fig. 6.6
figure 6

Numerical results when tracking a time varying force command along an arc surface with optimization. a Time history of the end-effector (black curve) and the corresponding joint configurations with optimization. b Time history of the end-effector (black curve) and the corresponding joint configurations without optimization. c Profiles of contact force. d Profiles of position error. e Comparison of Euclidean norm of joint torque with and without optimization. f Profiles of joint angles

When simulation begins, high joint speed ensures the fast convergence of tracking error, which is very similar to the previous simulation. After \(t=2s\), high precision trajectory tracking is realized by the control strategy, as well as the contact force. Comparative simulation without joint torque optimization is carried out. Figure 6.5d shows the comparison of Euclidean norms of joint torque with and without optimization. Correspondingly, \(J_{\tau }\) decreases \(16.2\%\) from 142 to 119, showing the validity of the proposed scheme. It is notable that all physical constraints are guaranteed. Dynamic change of joint configurations is shown in Fig. 6.5a.

(3) Position-Force Control Along An Arc Surface

In this part, the end-effector is controlled to track a quarter-circular surface, which is centered at \([0.3, 0.3]^{\text{ T }}\)m with radius 0.2 m, and is provided a constant force of 10 N in the vertical direction. The initial values of joint angles are selected as \(\theta _0=[1.5708,-0.9851,-1.1714,0]^{\text{ T }}\)rad. Numerical results are shown in Fig. 6.6. The trajectory of end-effector is shown in Fig. 6.6a, while in Fig. 6.6b, optimization is not introduced. The proposed controller enables the robot to achieve precision control of both position and force, and at the same time, by adjusting its joint angles, the joint torque consumption is reduced, i.e., \(J_{\tau }\) decreases \(17.6\%\) from 88.1 to 72.6. It is remarkable that the physical constraints are also guaranteed.

(4) Adaptability to Different Initial Settings

To further illustrate the joint optimization scheme, another fixed-point control is presented. Desired signals are set as \(x_{\text{ d }}=[0.3,0]^{\text{ T }}\) and \(F_{\text{ d }}=[0,-10]^{\text{ T }}\). The initial values of joint angles is selected as \(\theta _0=[1.8850, -1.8850, -1.2566, 0]^{\text{ T }}\) rad, consequently, the corresponding position of the end-effector is exactly the same as \(x_{\text{ d }}\). As shown in Fig. 6.7a, the robot adjusts its posture and stops in final state, while keeping its end-effector on the fixed point. This phenomenon is similar to the null-space movement based on pseudo-inverse methods. However, different with pseudo-inverse based method, the RNN based motion-force controller is capable of handling physical inequalities, at the same time, joint torque optimization is achieved from 4.3 to 3.7. Further more, there in no need to calculate pseudo-inverse of Jacobian matrix, which will save computing cost effectively.

Finally, a group of verifications for fixed point position-force control with different initial joint angles are carried out, the desired signals are the same as the previous simulation. As shown in Fig. 6.8, although the initial joint angles are different, at steady state, the robot reaches the same joint angle, which shows the adaptability of the RNN based control strategy.

Fig. 6.7
figure 7

Numerical results when the initial position of end-effector locates on the desired fixed point. a Profiles of joint configurations. b Profiles of Euclidean norm of joint torque with and without optimization. c Profiles of joint angles. d Profiles of joint velocities

Fig. 6.8
figure 8

Time history of robot\('\)s joint configurations in fixed point control from different initial joint angle \(\theta _0\). a \(\theta _0=[0.9, -0.75, -1.5, -1.6]^{\text{ T }}\) rad. b \(\theta _0=[1.8, -0.3, -1.6, 0.6]^{\text{ T }}\) rad. c \(\theta _0=[1.9, -1.5, -1.6, -0.6]^{\text{ T }}\) rad. d \(\theta _0=[0.5, -0.5, -1.6, -0.6]^{\text{ T }}\) rad. e \(\theta _0=[0.7, -0.3, -2, 0.2]^{\text{ T }}\) rad. f \(\theta _0=[0.3, -1.5, -1.6, -0.6]^{\text{ T }}\) rad

6.6 Question and Answer

Q1:What’s the complexity of the proposed RNN?

Answer: The network is organized in a one-layer architecture, which consists of \(2m+3n\) neurons, namely \(\omega \in \mathbb {R}^n\), \(\lambda _1\in \mathbb {R}^{2m}\) and \(\lambda _2\in \mathbb {R}^{2n}\). Despite the difference between the proposed neural network with traditional recurrent neural networks, from both the mathematical description Eq. (23) and the architecture, one characteristic of the established neural network can be found that the neural network uses its historical information to calculate the output at current moment, which is also a typical feature of recurrent neural networks.

Q2:As described in Section II, the matrices \(\varSigma _f\) and \(\bar{\varSigma }_f\) are crucial in the controller design, however, the authors didnt show the details. How to obtain those matrices in actual applications requires detailed description.

Answer: \(\varSigma _f\) and \(\bar{\varSigma }_f\) are used to realize the decoupling of the contact force and tracking error of the end-effector. When the contact surface is known, the combination of \(\varSigma _f\), \(\bar{\varSigma }_f\) and \({S}_t\) enables the normalized description of the control tasks.

Q3: “Limited stiffness of the manipulator elements can lead to state variables oscillations. Have you observed such work of the object?”

Answer: The limited stiffness of the manipulator elements can lead to state variables oscillations. In this chapter, the QP type formulation is obtained based on static modeling method, and inertial force is not taken into account. The condition of the modeling method is that the process is quasi-static. In other words, the relative motion of the end-effector and the workpiece is very slow. In the experiment tests, we also found that some oscillation would occur if some parameters are appropriately tuned. In this case, a damping coefficient can be introduced to handle the oscillations.

Q4:In real manipulator significant issue is related to control of electric drives. In mentioned structures, internal control loop, related to torque control, introduces some delays for external speed controllers. Have you considered such problem?

Answer: In this chapter, we mainly focus on projection RNN based controller design in kinematic level, and the control command is selected as joint velocity signals. Therefore, we assume that the robot controller can provide an ideal response to the joint velocity command. Although the delay is unavoidable for real systems, when the control frequency is set as 100 Hz, experimental results could show the effectiveness of the proposed controller. From Eq. (23), it can be observed that the force control is realized by adjusting the joint velocities base on the RNN, which is consistent with the idea of admittance control. In our experiment, the velocity control in the inner loop is done by the robot controller, and we assume that it provide an ideal response to the joint velocity command. It is remarkable that the uncertainties in the dynamic level such as friction and disturbances do affect the performance of position-force control in the outer loop, but these uncertainties can be suppressed by the closed-loop control mechanism of the controller itself.

Q5:Could you explain real impact of projection operator PR on work of the control system?

Answer: The projection operator \(P_{\varOmega }\) plays an important role in guaranteeing the bounded-ness of the output of neural network i.e., the boundedness of \(\omega \) can be ensured introducing \(P_{\varOmega }\). As described in Eq. (17), based on escape velocity method, both the boundedness of joint angles and velocities are guaranteed.

Q6:RNN uses delays during data processing, so the calculation step size seems to be important for overall work. Have you considered such issue?

Answer: We did consider this problem. The faster the RNN calculates, the better performance can be achieved. But at the same time, it would also lead to a increase of computational burden, which may make the system unstable. In our experiment, the control period is set to be 10 ms.

6.7 Summary

This chapter focuses on motion-force control problem for redundant manipulators, while physical constraints and torque optimization are taken into consideration. Firstly, tracking error and contact force are modeled in orthogonal spaces respectively, and then the control problem is turned into a QP problem, which is further rewritten in velocity level by rewriting objective function and constraints. To handle multiple physical constraints, an RNN based scheme is designed to solve the redundancy resolution online. Numerical experiment results show the validity of the proposed control scheme. Before ending this chapter, it is noteworthy that this is the first chapter to deal with motion-force control of redundant manipulators in the framework of RNNs and redundant manipulators with force sensitivity, e.g., grinding robots, can be readily controlled with the proposed RNN model but cannot with existing RNN models in this field.