Keywords

1 Introduction

With the rapid development of control theory and computer science, the importance of manipulators is gradually improved. In modern manufacturing system [1], industrial manipulator has become an indispensable role, which greatly improves the production efficiency and quality of manufacturing industry. The wide use of manipulators in mechanical manufacturing, aviation, electronic product manufacturing and other fields has promoted the development of manipulator control theory. But the dynamic equation of multi-joint manipulators is extremely complex and nonlinear [2], which restricts the further development of industrial manipulators. The traditional PID control has a good performance on the linear system [3]. While it maybe impractical to the nonlinear and strong real-time manipulator system [4]. With the improvement of artificial intelligence algorithm and control theory, advanced intelligent control methods have been proposed, which provide an effective solution for the control of complex dynamic manipulator system [5].

At present, neural network adaptive control is widely adopted to control the manipulator systems. Shao et al. used neural network adaptive control to control the manipulator with unknown disturbance. The results show that it can ensure the transient response of the system and realizes asymptotic convergence [6]. Bang et al. proposed a robust neural network adaptive control method, which can effectively compensate the system uncertainty, and can ensure the rapid stability of the manipulator system [7]. To solve the tracking control problem of n-joint manipulator with large jump parameters, Li et.developed a weighted multi-model neural network adaptive control method, and the simulation showd that it has good performance [8].

Force control of the manipulator is the basis for the manipulator to be applied to tasks such as assembly, polishing, deburring, etc. [9]. Force control technology can significantly improve the performance of the manipulator when it is in contact with the environment, and can improve the intelligence of the manipulator [10]. Most existing paper focus on position control of the manipulator rather than the force control [11], which motivate our works. The main contribution of this paper can be summarized as follows:

  1. (i).

    The Lagrangian-Euler method is used to model the dynamics of 3R manipulator and the RBF network is adopted to fit the dynamics model of 3R manipulator.

  2. (ii).

    An adaptive control algorithm based on RBF neural network is proposed for the force control of 3R manipulator in the workspace. The control goal is to make the manipulator track the impedance trajectory to realize the flexible contact between the manipulator and the environment.

The rest of this paper is organized as follows: In Sect. 2, dynamics modelling of 3R manipulator is given. In Sect. 3, the neural network modelling is given and an adaptive controller of 3R manipulator is designed, Sect. 4 shows the simulation results and Sect. 5 gets the conclusions.

2 Dynamics Modeling of 3R Manipulator

2.1 Structure and Standard D-H Parameters of 3R Manipulator

In this paper, the parameter table of 3R manipulator is established by standard D-H method, the D-H coordinate system can be represented by \(a_ i\),\(\alpha _ i\),\(\theta _ i\),\(d_i \).

The mechanical structure of 3R manipulator is shown Fig. 1. The length of connecting rod 1, connecting rod 2 and connecting rod 3 are \({l_1} = 0.5\,\textrm{m} \), \({l_2} = 1\,\textrm{m} \), \({m_1} = 0.8\,\textrm{m} \), respectively. The mass is \({m_1} = 0.5\,\textrm{kg}\), \({m_2} = 1\,\textrm{kg} \), \({m_3} = 0.8\,\textrm{kg} \), respectively. The rotation angles of the three joints are \({q_1} \), \({q_2} \), \({q_3} \), and the standard D-H parameters of the manipulator can be obtained in Table 1 [12].

Table 1. 3R manipulator standard DH parameters
Fig. 1.
figure 1

Mechanical structure of 3R manipulator

2.2 Lagrange Euler Dynamics Modeling of 3R Manipulator

The Lagrange-Euler dynamic equation is closed-loop, which is convenient for the design and implementation of the controller. Therefore, the Lagrange-Euler method is adopted for dynamic modelling. For a 3-joint manipulator, the Lagrangian dynamic equation of its joint space can be expressed as

$$\begin{aligned} D(q)\ddot{q} + C(q,\dot{q})\dot{q} + G(q) = \tau \end{aligned}$$
(1)

In (1), q represents the joint angle, \(\tau \) represents the joint torque matrix, which are all three-dimensional vectors, \(D\left( q\right) \) represents the inertia matrix, \(C \left( q, \dot{q} \right) \)represents the centrifugal force and Coriolis force matrix, \(G\left( q \right) \)represents the gravity matrix, D(q), C(q) is a \(3\times 3\) square matrix and G(q) is a \(3\times 1\) matrix.

However, the force control of 3R manipulator is working in the workspace. So it is necessary to convert the dynamic equation of joint space into the workspace by using the Jacobian matrix. Let x be the position coordinates of the end of the manipulator in the base coordinate system, then we get [13]

$$\begin{aligned} \dot{x}=J(q)\dot{q} \end{aligned}$$
(2)
$$\begin{aligned} \ddot{x}=J\left( q\right) \ddot{q}+\dot{J}(q)\dot{q} \end{aligned}$$
(3)
$$\begin{aligned} \tau =J^T(q)F_x \end{aligned}$$
(4)
$$\begin{aligned} D_x\left( q\right) \ddot{x}+C_x\left( q,\dot{q}\right) \dot{x}+G_x\left( q\right) =F_x \end{aligned}$$
(5)
$$\begin{aligned} D_x\left( q\right) =J^{-T}(q)D\left( q\right) J^{-1}(q) \end{aligned}$$
(6)
$$\begin{aligned} C_x\left( q,\dot{q}\right) =J^{-T}(q)(C\left( q,\dot{q}\right) -D\left( q\right) J^{-T}(q)\dot{J}(q))J^{-1}(q) \end{aligned}$$
(7)
$$\begin{aligned} G_x\left( q\right) =J^{-T}(q)G\left( q\right) \end{aligned}$$
(8)

The Jacobian matrix J(q) is defined as \(J(q) = \partial h(q)/\partial q\). \(F_x\) denotes the force in the workspace, \(D_x\left( q\right) \), \(C_x\left( q,\dot{q}\right) \), \(G_x\left( q\right) \) denotes the inertia matrix, centrifugal force and Coriolis force matrix, gravity matrix in the workspace, respectively.

3 3R Manipulator Neural Network Adaptive Force Control

3.1 3R Manipulator Neural Network Modeling

The dynamic model of the manipulator in the workspace can be expressed as:

$$\begin{aligned} D_x\left( q\right) \ddot{x}+C_x\left( q,\dot{q}\right) \dot{x}+G_x\left( q\right) =F_x \end{aligned}$$
(9)

The main aim of neural network modeling is to use a RBF neural network to fit the inertia matrix \(D_x\left( q\right) \), centrifugal force and Coriolis force matrix \(C_x\left( q,\dot{q}\right) \), gravity matrix \(G_x\left( q\right) \).

$$\begin{aligned} \begin{aligned} d_{xkj}\left( q\right) =\sum _{i=1}^{l}Q_{kjl}\xi _{kjl}\left( q\right) + \epsilon _{dkj}(q)=Q_{kj}^T\xi _{kj}(q)+\epsilon _{dkj}(q) \end{aligned} \end{aligned}$$
(10)
$$\begin{aligned} \begin{aligned} c_{xkj}\left( q,\dot{q}\right) =\sum _{i=1}^{l}\alpha _{kjl}\xi _{kjl}\left( z\right) + \epsilon _{ckj}\left( z\right) =\alpha _{kj}^T\xi _{kj}\left( q\right) +\epsilon _{ckj}\left( z\right) \end{aligned} \end{aligned}$$
(11)
$$\begin{aligned} \begin{aligned} g_{xk}\left( q\right) =\sum _{i=1}^{l}\beta _{kl}\eta _{kl}\left( q\right) + \epsilon _{gk}(q)=\beta _k^T\eta _k(q)+\epsilon _{gk}(q) \end{aligned} \end{aligned}$$
(12)

In (10), \({d_{xkj}}\) represents inertia Matrix \(D_x\left( q\right) \) k-row j-column elements, similarly \({c_{xkj}}\), \({g_{xk}}\) in (11), (12). \(Q_{kjl}\) and \(\beta _{kl}\) are the weight that fit j-row elements of \(D_x\left( q\right) \), k-row elements of \(G_x\left( q\right) \), respectively. \(\xi _{kjl}(q)\) and \(\eta _{kl}(q)\) are the radial basis functions with input q. \(\epsilon _{dkj}(q)\) and \(\epsilon _{gk}(q)\) are the modeling errors of \(d_{xkj}(q)\) and \(g_{xk}(q)\), respectively, and assume that they are bounded. In (11) where \(z=\left[ q^T\ {\dot{q}}^T\right] ,\ \alpha _{kjl}\) is the weight, \(\xi _{ kjl}\) is the radial basis function whose input is the vector z, which is also the Gaussian basis function, \(\epsilon _{ckj}\left( z\right) \) is \(c_{xkj}\left( q,\dot{q }\right) \) modeling errors and assume it is bounded.

Using the GL matrix [15] and its multiplication operation \(D_x\left( q\right) \) can be written as:

$$\begin{aligned} \begin{aligned} D_x\left( q\right) =\left[ \left\{ Q\right\} ^T.\left\{ E(q)\right\} \right] +E_D(q) \end{aligned} \end{aligned}$$
(13)

where \(\left\{ Q\right\} ^T\) and \(\left\{ E(q)\right\} \) are GL matrices whose elements are \(Q_{kj}\) and \(\xi _{kj}\), respectively. \(E_D(q)\) is a matrix whose elements are modeling errors \(\epsilon _{dkj}\). Similarly, for \(C_x\left( q,\dot{q}\right) \), \(G_x\left( q\right) \) there are:

$$\begin{aligned} \begin{aligned} C_x\left( q,\dot{q}\right) =\left[ \left\{ A\right\} ^T.\left\{ Z(z)\right\} \right] +E_c(z) \end{aligned} \end{aligned}$$
(14)
$$\begin{aligned} \begin{aligned} G_x\left( q\right) =\left[ \left\{ B\right\} ^T.\left\{ H(q)\right\} \right] +E_G(q) \end{aligned} \end{aligned}$$
(15)

where \(\left\{ A\right\} \), \(\left\{ \mathrm {Z(z)}\right\} \), \(\left\{ \textrm{B}\right\} \), \(\left\{ \mathrm {H(q)}\right\} \) is the GL matrix whose elements are \(\alpha _{kj}\), \(\xi _{kj}(z)\), \(\beta _k\), \(\eta _k(q)\). \(E_c(z)\) and \(E_G(q)\) are matrices whose elements are modeling errors \(\epsilon _{ckj}\) and \(\epsilon _{gk}\).

3.2 Position-Based Impedance Control

The impedance control of the manipulator is to establish the relationship between the displacement of the manipulator end and the contact force by equivalently controlling the force/position of the end of the manipulator as a “spring-mass-damping” system. [14].

The contact force at the end of the manipulator is \(F_e\), and the kinetics are described as [16]

$$\begin{aligned} M_m\left( {\ddot{x}}_c-\ddot{x}\right) +B_m\left( {\dot{x}}_c-\dot{x}\right) +K_m(x_c-x)=F_e \end{aligned}$$
(16)

where \(x_c\) is the reference trajectory of the command position, x is the actual position, so the position error can be denoted as \(x_c-x\), \(x(0)=x_c(0)\), \(M_m\), \(B_m\), \(K_m\) are the mass, damping and stiffness coefficient matrices, respectively. By solving the differential Eq. (16), one can get the impedance trajectory \(x_d\).

In impedance control, the environmental dynamics model needs to be considered. For simplicity, the environmental dynamics model is assumed to be the stiffness model.

$$\begin{aligned} F=K_e(x-x_e) \end{aligned}$$
(17)

In 3R manipulator control, \(F_e\) is the \(3\times 1\)-dimensional vector, which represents the contact force between the manipulator end and the environment. \(x_e\) represents the location of the environment. Assuming the environment as a stiffness model, where \(K_e\) is a \(3\times 3\)-dimensional matrix represents the stiffness matrix of the environment, similar to \(M_d\), \(K_d\), \(B_d\) in impedance control, is also a positive definite diagonal matrix, which means that the environment is decoupled in each coordinate direction in the workspace.

3.3 Neural Network Adaptive Force Control Controller Design and Stability Analysis

Let \(x_d\) be the impedance trajectory in the workspace, then \({\dot{x}}_d\) and \({\ddot{x}}_d\) are the ideal impedance velocity and impedance acceleration, respectively.

Define

$$\begin{aligned} e(t)=x_d(t)-x(t) \end{aligned}$$
(18)
$$\begin{aligned} {\dot{x}}_r(t)={\dot{x}}_d(t)+\mathrm {\Lambda e}(t) \end{aligned}$$
(19)
$$\begin{aligned} r(t)={\dot{x}}_r(t)-x(t)=\dot{e}(t)+\mathrm {\Lambda e}(t) \end{aligned}$$
(20)

Using \(\left( \hat{.}\right) \) to represent the estimated value of \(\left( .\right) \), define \(\left( \widetilde{.}\right) =\left( .\right) - \left( \hat{.}\right) \), then \(\left\{ \hat{Q}\right\} \), \(\left\{ \hat{A}\right\} \) and \(\left\{ \hat{B}\right\} \) represent the estimated values of \(\left\{ Q\right\} \), \(\left\{ A\right\} \) and \(\left\{ B\right\} \), respectively.

The controller can be designed as:

$$\begin{aligned} F_x=\left[ \left\{ \hat{Q}\right\} ^T.\left\{ E\left( q\right) \right\} \right] \ddot{x_r}+\left[ \left\{ \hat{A}\right\} ^T.\left\{ Z\left( z\right) \right\} \right] {\dot{x}}_r \nonumber \\ +\left[ \left\{ \hat{B}\right\} ^T.\left\{ H(q)\right\} \right] +F_e+Kr+k_ssgn(r) \end{aligned}$$
(21)

In (21), where \(K\in R>0\), \(k_s>E\), \(E=E_D(q)\ddot{x_r}+E_C(z){\dot{x}}_r+E_G(q )\). The first three terms of the controller are model-based control, the Kr term is equivalent to proportional-differential control, \(F_e\) is the contact force, and the last term of is the robust term to inhibit the neural network construction modeling error. The dynamic model of the manipulator can be modeled as

$$\begin{aligned} D_x\left( q\right) \ddot{x}+C_x\left( q,\dot{q}\right) \dot{x}+G_x\left( q\right) +F_e=F_x \end{aligned}$$
(22)

The stability of system (22) is given by the following theorem.

Theorem 1: For the closed-loop system (22), if \(K\in R>0\), \(k_s>\left\| \mathrm{{E}} \right\| \), the design adaptive law is

$$\begin{aligned} \left\{ \begin{array}{l} \mathop {{{\hat{Q}}_k}}\limits ^. = {\varGamma _k}.\left\{ {{\xi _k}(q)} \right\} {{\ddot{x}}_r}{r_k}\\ \mathop {{{\hat{\alpha }}_k}}\limits ^. = {\mathrm{{M}}_k}.\left\{ {{\xi _k}(z)} \right\} {{\dot{x}}_r}{r_k}\\ \mathop {{{\hat{\beta }}_k}}\limits ^. = {\mathrm{{N}}_k}{\eta _k}{r_k} \end{array} \right. \end{aligned}$$
(23)

where \({\mathrm {\Gamma }_k}^T=\mathrm {\Gamma }_k>0\),\(\ {M_k}^T=M_k>0,\ {N_k}^T=N_k>0\), And \(\mathop {\hat{Q} }\nolimits _k \), \(\mathop {\hat{\alpha }}\nolimits _k \) are matices whose elements are \({\hat{Q}}_{kj}\) and \({\hat{\alpha }}_{kj}\), respectively. Then \({\hat{Q} }_k \), \({\hat{\beta _k}}\), \({\hat{\alpha }}_k,\mathrm {\in }\textrm{L}_\mathrm {\infty }\), \( e\in L_2^n\cap L_\infty ^n\). e is continuous, and when \(\mathrm {t\rightarrow \infty }\), \(\mathrm {e\rightarrow 0}\), \(\ \dot{e}\rightarrow 0\).

Proof

In [15], the author has proved the position controller is stable under the adaptive law (23), with the similar approach, it is easily to prove that designed force controller is stable.

4 Simulation

Consider the situation: the manipulator is tracking spiral trajectory (24), but there is an obstacle at \(x=1\), therefore, when \(x \ge 1\), the manipulator will have contact with the obstacle.

$$\begin{aligned} \left\{ \begin{array}{l} {x_d} = 1 + 0.3\cos (\pi t)\\ {y_d} = 1 + 0.3\sin (\pi t)\\ {z_d} = 0.05t \end{array} \right. \end{aligned}$$
(24)

The mechanical model of this obstacle is the stiffness model, that is,

$$\begin{aligned} F_e=K_e(x-x_e) \end{aligned}$$
(25)

Set obstacle stiffness \({K_e} = \left[ {\begin{array}{*{20}{c}} {800}&{}0&{}0\\ 0&{}{800}&{}0\\ 0&{}0&{}{800} \end{array}} \right] \), the stiffness matrix of the manipulator is \({K_d} = \left[ {\begin{array}{*{20}{c}} {900}&{}0&{}0\\ 0&{}{900}&{}0\\ 0&{}0&{}{900} \end{array}} \right] \), the damping matrix is \({B_d} = \left[ {\begin{array}{*{20}{c}} {40}&{}0&{}0\\ 0&{}{40}&{}0\\ 0&{}0&{}{40} \end{array}} \right] \) inertia matrix is \({M_b} = \left[ {\begin{array}{*{20}{c}} {1}&{}0&{}0\\ 0&{}{1}&{}0\\ 0&{}0&{}{1} \end{array}} \right] \), the gain coefficient of the adaptive law is \({\varGamma _k}= \left[ {\begin{array}{*{20}{c}} 0.4&{}0&{}0\\ 0&{}0.4&{}0\\ 0&{}0&{}0.4 \end{array}} \right] \) \({\mathrm{{M}}_k}=\left[ {\begin{array}{*{20}{c}} {0.8}&{}0&{}0\\ 0&{}{0.8}&{}0\\ 0&{}0&{}{0.8} \end{array}} \right] \) \({\mathrm{{N}}_k}= \left[ {\begin{array}{*{20}{c}} 0.6&{}0&{}0\\ 0&{}0.6&{}0\\ 0&{}0&{}0.6 \end{array}} \right] \). Figure 2 shows the impedance trajectory, as long as this impedance trajectory is tracked, the manipulator can achieve flexible contact with the environment. Figure 3 offers the tracking performance of the impedance trajectory. Figure 4 shows the tracking performance of the ideal trajectory. From Fig. 3 and Fig. 4, we can conclude that when \(x>1\), the manipulator track the impedance trajectory rather than the ideal trajectory. Therefore, the flexible contact between the manipulator and the environment can be achieved. From Fig. 5, we can conclude that the contact force does not experience a sudden increase, which means the compliant control is successful.

Fig. 2.
figure 2

Impedance trajectory

Fig. 3.
figure 3

Comprassion between impedance and actual

Fig. 4.
figure 4

Comprassion between impedance and actual

Fig. 5.
figure 5

External force

5 Conclusion

The main focus of this paper is the neural network adaptive control of 3R manipulator. By applying the Lagrangian-Euler method to the 3R manipulator to model the joint space dynamics and use the Jacobian matrix to convert the joint space dynamics into the workspace. A RBF neural network is adopted to fit the dynamical model. In force control, our focus is impedance control based on position control. According to the force measured by the force sensor at the end of the manipulator, the impedance trajectory is calculated, and the desired impedance model can be generated by tracking this impedance trajectory. If the manipulator encounters an obstacle in the middle, the contact force between the objects changes the trajectory to have a compliant contact with the environment.