RNN for Motion-Force Control of Redundant Manipulators with Optimal Joint Torque

Precise position force control is the core and difﬁculty of robot technology, especially for robots with redundant degrees of freedom. For example, track-based controls often fail to grind the robot due to the intolerable impact force applied to the end-effector. The main difﬁculties lie in the coupling of motion and contact forces, redundancy analysis and physical constraints. In this chapter, we propose a new motion force control strategy under the framework of recursive neural network. The tracking error and contact force are described respectively in the orthogonal space. By choosing the minimum joint torque as the secondary task, the control problem is transformed into the QP problem under multi-constraint conditions. In order to obtain real-time optimization of the joint torque relative to the non-convex joint angle, the original QP is reconstructed at the velocity level, and the original objective function is replaced by the time derivative. Then a convergent dynamic neural network is established to solve the improved QP problem online. The robot position control based on recursive neural network is extended to the robot position control based on position force, which opens a new way for the robot to turn from simple control angle to crossover design with convergence and optimality. Numerical results show that the proposed method can realize precise position force control, deal with inequality constraints such as joint angular velocity and torque limitation, and reduce joint torque consumption by 16% on average.


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.

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  [25] and [23], no projection operations are introduced in those control strategies ‡ In [23], only some certain kinds of inequalities can be handled by [23]  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 where θ ∈ R n is the vector of joint angles, and x ∈ R m represents the end-effector s coordinate vector in frame R 0 , f (•) : R n → R m is used to describe the forward kinematics operator. For a redundant manipulator, we have n > m.
By differentiating x(t) with respect to time t, we can get the relationship between Cartesian velocityẋ(t) ∈ R m and joint velocity (or joint control signal)θ(t) ∈ R n as follows: where J (θ (t)) = ∂ f (θ (t))/∂θ (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 δ X t be the displacement between effector and its position command, then the contact force F t can be formulated as where k f > 0 is the stiffness coefficient, Σ t = diag(0, 0, 1). Diagonal matrix Σ 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 e t =Σ t δ X t , (6.4) whereΣ t = I − Σ 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 δ X be the corresponding description of F t , e t and δ X t in coordinate frame R 0 , then we have F = S T t F t , e t = S t e 0 and δ X t = S t δ X . Therefore, F and e 0 can be rewritten as Notable that in frame R 0 , the displacement δ X can be described as δ X = x − x d , where x d is the desired position signals described in R 0 . Using (6.1), (6.5) can be rewritten as (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 δ X in R 0 . δ 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 s and trajectory command x d , the manipulator s end-effector is expected to offer contact force F d while tracking x d , i.e., F → F d , e 0 → 0. For the convenience of writing in the following . Then (6.6) can be reformulated as Therefore, the control objective of position-force control is to adjust the joint angles θ , to ensure r → r d .

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 τ can be formulated as 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 τ T τ/2. The smaller τ T τ/2, the less energy consumption.
In real implementations, the system is limited by physical constraints. For example, the joint angles θ and velocitiesθ must not exceed their limits: θ min ,θ max ,θ min , θ 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 τ is described as τ min ≤ τ ≤ τ max .

Optimization Problem Formulation
According to the descriptions above, the position-force control problem for redundant manipulators considering torque optimization can be formulated as with θ 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 τ 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 To solve (6.10), there are two main challenges. Firstly, as an objective function to be minimized, F T J (θ )J T (θ )F/2 is usually non-convex relative to θ , because it is a function of J (θ ). 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).

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.

Reconstruction of Objective Function
As to F T J (θ )J T (θ )F/2, we will replace F with the desired value F d . Therefore, the optimization function can be formulated as There are two main reasons: firstly, according to the control objective, the contact force F is expected to track F d , if the controller is proper designed, F will eventually converge to F d , consequently, this replacement will reduce the computational complexity in the control process.
Differentiating G 2 with respect to time, we havė Obviously,Ġ 2 describes the change of G 2 . By minimizingĠ 2 , the system will be compelled to develop in the direction of decreasing G 2 . Therefore, in this chapter, we useĠ 2 instead of G 2 as the new objective function. Notable that d(J T (θ )F d )/dt can be formulated as , then (6.11) can be converted aṡ It is worth pointing that the second term of (6.13) is independent ofθ , therefore, the objective function is equivalent to F T d J Hθ .

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 d = [F − F d ; e 0 ], according to (6.7), e can be formulated as Differentiating e and combing (6.2) yieldṡ To ensure that e converges to zero, a simple controller can be designed asė = −ke, where k > 0 is a positive constant. According to (6.14), (6.15), the equality constrains can be converted in velocity level as As to the inequality constraints (6.10c) and (6.10d), according to [27], let ω =θ and define α ≥ 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 ω min ≤ ω ≤ ω max , (6.17) where ω min = max{α(θ min − θ),θ min }, and ω max = min{α(θ max − θ),θ max }. Similarly, (6.10e) can be built indirectly by limiting its derivative: where β is a positive constant. By combing (6.12), the boundedness of joint torque can be rewritten as an inequality constraint about a function g(ω) as

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 } is a convex set. It is remarkable that the objective function described in (6.19a) is non-convex relative to ω. Therefore, (6.19b) is introduced to convexity (6.19a). The final form of optimization problem is described as 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.

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.

RNN Design
Firstly, let λ 1 ∈ R 2m and λ 2 ∈ R 2n be dual variables to constraints (6.20b) and (6.20c), a Lagrange function is defined as According to Karush−Kuhn−Tucker condition, the optimal solution of the optimization problem (6.20) can be equivalently formulated as where P Ω (x) = argmin y∈Ω ||y − x|| is a projection operation to convex set Ω, and (x) 0). In order to solve (6.22), an expanded recurrent neural network is designed as ing the convergence of (6.23). The pseudo code of the RNN-based strategy is shown in Algorithm 5.

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.
Lemma 6.1 [38] A dynamic neural network is said to converge to the equilibrium point if it satisfies κẋ = −ẋ + P S (x − F(x)), (6.24) where κ > 0 and > 0 are constant parameters, and P S = argmin y∈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 ξ = [ω T , λ T 1 , λ T 2 ] T , the proposed RNN (6.23) can be written as It is remarkable that According to the description of (6.23) and (6.25), PΩ can be formulated as PΩ = [P Ω ; P R ; P ], where P R ∈ R 2m is a projection operator of λ 1 to set R, with the upper and lower bounds being ±∞. Furthermore, (•) + is a special case of P , in which = R 2n + is the nonnegative quadrant of R 2n . Therefore, PΩ is a projection operator to closed setΩ. 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.

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 T J T F 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.

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 d is aligned with the vertical direction. The stiffness coefficient k f is

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 θ 0 = [1.57, −1.26, −0.52, −0.52] T rad. The desired trajectory is defined as x d = [0.25 + 0.1cos(0.5t), 0] T , and the contact force is defined as F d = [0, −1] 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.

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.  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.  Fig. 6.5. We also define a index to scale the torque consumption as J τ = T 0 ||τ (t)|| 2 2 dt. 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 τ 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  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  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.

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 ω ∈ R n , λ 1 ∈ R 2m and λ 2 ∈ 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. Answer: Σ f andΣ 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 Σ f ,Σ 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 Ω plays an important role in guaranteeing the bounded-ness of the output of neural network i.e., the boundedness of ω can be ensured introducing P Ω . 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.

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.
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.