# Constant Force PID Control for Robotic Manipulator Based on Fuzzy Neural Network Algorithm

Authors: Zhu Dachang; Du Baolin; Zhu Puchen; Chen Shouyan
Journal: Complexity
 (2020)

---

## Abstract

The increased demand for robotic manipulator has driven the development of industrial manufacturing. In particular, the trajectory tracking and contact constant force control of the robotic manipulator for the working environment under contact condition has become popular because of its high precision and quality operation. However, the two factors are opposite, that is to say, to maintain constant force control, it is necessary to make limited adjustment to the trajectory. It is difficult for the traditional PID controller because of the complexity parameters and nonlinear characteristics. In order to overcome this issue, a PID controller based on fuzzy neural network algorithm is developed in this paper for tracking the trajectory and contact constant force simultaneously. Firstly, the kinetic and potential energy is calculated, and the Lagrange function is constructed for a two-link robotic manipulator. Furthermore, a precise dynamic model is built for analyzing. Secondly, fuzzy neural network algorithm is proposed, and two kinds of turning parameters are derived for trajectory tracking and contact constant force control. Finally, numerical simulation results are reported to demonstrate the effectiveness of the proposed method.


---

## Body

## 1. Introduction

Nowadays, the increased involvement of robotic manipulators in various industrial manufacturing facilities, such as precision assembly, and polishing in the field of ceramic sanitary ware or aircraft engine, precision surgery, and automobile manufacturing lead to new and innovative developments in the domain of dynamic modeling of mechanisms and control [1–3]. According to the working conditions of the robotic manipulators, there are two types: contract and noncontact. The vital features of the contact working condition are highly precise trajectory tracking capabilities; at the same time, it should have the ability to adjust the contact force/twist flexible [4, 5]. Along with the complexity and nonlinearity issues, the robotic manipulator suffered from various uncertainties, external disturbances, payload variations, and parameter variations during their operations [6, 7]. Therefore, it is not possible for the traditional proportional-integral-derivative (PID) controllers to provide effective control for trajectory tracking and constant force/twist control simultaneously.According to the given valuert and the actual output value ct, the traditional PID control combines the deviation et=rt−ct by proportion (P), integration (I), and differentiation (D) to form the control quantity. The control law is given by(1)ut=Kpet+1Ti∫0tetdt+Tddetdt=Kpet+Ki∫0tetdt+Kddetdt,where Kp is proportionality coefficient, Ti is integral time constant, Td is differential time constant, andKi=Kp/Tiis integral coefficient and Kd=Kp⋅Td is differential coefficient. The parameter selection of a traditional PID controller must take into account the dynamic and static performance requirements. By using the method of closed-loop response, a heuristic tuning method of PID parameters is proposed by Ziegler and Nichols in the 1940s.In recent times, an overwhelming development in the terrain of advantage PID control schemes for parameters tuning has encouraged various control engineers to work in this developing field. Differential evolution (DE), genetic algorithm (GA), and particle swarm optimization (PSO) were used to determine the optimal gains of the position domain PID controller, and three distinct fitness functions were also used to quantify the contour tracking performance of each solution set in [8]. In order to expand the robustness and adaptive capabilities of conventional PID controller, a neural network- (NN-) based PID controller which is tuned when the controller is operating in an online mode for high-performance magnet synchronous motor position control was proposed by Kumar et al. [9], and the training algorithm for the PID controller gain initialization based on the minimum norm least square solution was also proposed. For the last few years, several works have been cited on the intelligent algorithm as well as online policy iterative approach, adaptive optimal control, sliding mode control, and neural network control for different processes or plants such as uncertain nonlinear systems [10, 11], autonomous under water vehicle (AUV) [12], mobile robot [13], permanent magnet synchronous motor drivers [14], and many others [15–19].Recently, real-time trajectory optimization of robotic manipulators has received a lot of attention and research due to the increasing demand to improve movement speed, accuracy, and lower energy consumption when executing tasks. Several authors have been working toward intelligent PID control techniques of trajectory tracking for robotic manipulators, such as global asymptotic saturated PID control [20], fuzzy PID for enhanced position control in surgery robot [21], mobile robot [22–25], and flexible joint robot [26]. However, trajectory tracking is not the only factor to ensure the accuracy of the operation during the contact working conditions of the robotic manipulator, such as high precision flexible assembly, surface polishing, and location of clamp in minimally invasive surgery (shown in Figure 1).Figure 1
Constant working conditions. (a) High precision flexible assembly; (b) minimally invasive surgery; (c) complexity surface polishing.
(a)(b)(c)With the changes of the pressure, temperature, friction, and wear of the contact surface, the contact force/twist between the robot and the work piece will also change. Although the robotic manipulator can run accurately according to the present trajectory, the machining quality or assembly quality on the contact surface will decline. By using a modified hybrid computed torque method based on the principle of orthogonalization, Sanchez presented an improving force tracking control structure to reduce the number of sensors with a velocity observer [27]. Cortesao proposed double active observer architecture to tackle precise force control in the presence of heart motion, and one controls the desired interaction force, and the other one is responsible for compensating heart motion autonomously [28]. An adaptive fuzzy backstepping position tracking control scheme was proposed for multirobot manipulator systems, and extra terms were also added to the control signals to consider the force tracking problem by utilizing the properties of internal forces in [29]. Accurate and robust force/twist control is still a great challenge for robot-environment contact applications, such as in drilling operations [30], polishing [31–33], welding [34], and surgical tasks [35].In general, the traditional PID controller helps in eliminating the steady state error. However, this controller does not provide effective control in presence of nonlinearities and uncertainties. Moreover, motivated by the research studies carried out in [36, 37]. We proposed in this paper fuzzy neural network proportion-integration-differentiation (FNN-PID) constant force/twist control of the robotic manipulator for contact working conditions. The main contributions of the current paper are summarized as follows:(1)
By using Lagrange energy function, the precise dynamic model of two-link robotic manipulator is built. Compared with the literature [38], it completely represents the relationship between actuated torque and displacement and velocity and acceleration in joint space.(2)
For the contact working condition, the change of contact force will reduce the machining quality, so it is important to keep the contact constant force during manufacturing process. However, constant contact force and trajectory tracking are opposite to each other. In order to tune PID controller parameters quickly and effectively, a fuzzy neural network algorithm is proposed for two kinds functions of PID controller, that is, trajectory tracking and limited change online while contact constant force control.This paper is organized in the following manner. Section2 presents the precise dynamic modeling method, and the precise dynamic model of two types of planar robotic manipulator with RR (revolute joint) and RP (prismatic joint) are derived. Section 3 describes the PID controller with fuzzy neural network, and its stability is analyzed. Section 4 discusses the relationship between the contact force/twist with the trajectory according to the contact working conditions, and numerial simulation results are reported to demonstrate the effectiveness of the proposed method. Finally, conclusions are given in Section 5.


## 2. Dynamic Modeling of Two-Link Robot

The dynamic mathematical model for a rigid planar robotic manipulator having two links and a contact surface and the external force acted on the surface, as shown in Figure2. According to the coordinate system o−xy, it consists of two links having link length l1 and l2 with their center of mass m1 and m2 lying at the middle of links, respectively. The length of center of mass are p1 and p2, respectively.Figure 2
Two-link robotic manipulator plant with contact force at tip.Different from the literature [39], the Lagrange method is used to build the precise dynamic model of two-link robotic manipulator with their nominal values as listed in Table 1.Table 1
Variables description of two-link robotic manipulator [39].
DescriptionNominal valueDescriptionNominal valueCenter of mass link 1:m1 (kg)0.1Center of mass link 2:m2 (kg)0.1Length of link 1:l1 (m)0.8Length of link 2:l2 (m)0.4Length of center of mass link 1:p1 (m)0.4Length of center of mass link 2:p2 (m)0.2Centroid inertia of link 1:I1 (kgm2)0.064Centroid inertia of link 2:I2 (kgm2)0.016Joint variable of link 1:θ1 (rad)—Joint variable of link 2:θ2 (rad)—Torque of link 1:τ1 (Nm)—Torque of link 2:τ2 (Nm)—The location coordinates and the square of velocity of1# center of mass can be derived as follows:(2)x1=p1sinθ1,y1=p1cosθ1,x˙12+y˙12=p1θ˙12.The location coordinates and the square of velocity of1# center of mass can also be derived as follows:(3)x2=l1sinθ1+p2sinθ1+θ2,y2=l1cosθ1+p2cosθ1+θ2,x˙22+y˙22=l12θ˙12+p22θ˙1+θ˙22+2l1p2θ˙12+θ˙1θ˙2cosθ2.The total kinetic energy of the two-link robotic manipulator is(4)Ek=Ek1+Ek2=12m1p12θ˙12+12m2l12θ˙12+12m2p22θ˙1+θ˙22+m2l1p2θ˙12+θ˙1θ˙2cosθ2.The total potential energy of the two-link robotic manipulator is(5)Ep=Ep1+Ep2=m1gp1cosθ1+m2gl1cosθ1+p2cosθ1+θ2.The Lagrange function is constructed as follows:(6)L=Ek−Ep.The dynamic equation of the two-link robotic manipulator can be calculated by(7)τi=ddt∂L∂θ˙i−∂L∂θi,i=1,2.The torque of joint 1τ1 can be derived as follows:(8)∂L∂θ˙1=m1p12+m2l12θ˙1+m2l1p22θ˙1+θ˙2c2+m2p22θ˙1+θ˙2,∂L∂θ1=−m1gp1s1−m2gl1s1+p2s12,τ1=ddt∂L∂θ˙1−∂L∂θ1=D11θ¨1+D12θ¨2+D112θ˙1θ˙2+D122θ˙22+D1,where s1=sinθ1, c1=cosθ1, s12=sinθ1+θ2, and(9)D11=m1p12+m2p22+m2l12+2m2l1p2c2,D12=m2p22+m2l1p2c2,D112=−2m2l1p2s2,D122=−m2l1p2s2,D1=m1p1+m2l1gs1+m2p2gs12.Meanwhile, the torque of joint 2τ2 can be also derived as(10)τ2=ddt∂L∂θ˙2−∂L∂θ2=D21θ¨1+D22θ¨2+D212θ˙1θ˙2+D211θ˙22+D2,where(11)D21=m1p22+m2l1p2c2,D22=m2p22,D212=0,D211=m2l1p2s2,D2=m2p2gs12.Combined (8) with (10), the robotic plant can be rewritten with the following mathematical model:(12)D11D12D21D22θ¨1θ¨2+D112D212θ˙1θ˙2θ˙2θ˙1+D211D122θ˙22θ˙12+D1D2=τ1τ2.Comparing with the literature [39], (12) completely represents the relationship between actuated torque and displacement and velocity and acceleration in joint space. The issues with D11 and D22 represent the moment of inertia caused by the acceleration of joint 1 and joint 2, respectively. The issues with D12 and D21 represent the moment of inertia of the acceleration coupling between two joints. The issues with D122 and D211 represent the coupling moment term of the centripetal force caused by the velocity between two joints. The issues with D112 and D212 represent the coupling moment term of the Coriolis force between two joints. D1 and D2 represent the gravity moment term. Considering the effect of centroid inertia, (12) can be modified by(13)D11′=I1+I2+D11,D12′=I2+D12,D21′=I2+D21,D22′=I2+D22.Furthermore, to consider the effect of contact force act on the end-effector, right side of (12) can be replaced by(14)τ′=τ−JTqhe,where he is the force and moment vector applied by the end-effector in the working environment, and JTq is the velocity Jacobian matrix, which yields to(15)Jq=−l1s1−l2s12−l2s12,l1c1+l2c12l2c12.


## 3. PID Controller with Fuzzy Neural Network Algorithm

In order to design a fuzzy neural network PID (FNN-PID) controller for trajectory tracking and constant force control of the robotic manipulator, it is essential to derive the absolute error and the rate change of the external force act on the end-effector as the inputs for the fuzzy controller, which are calculated as(16)Δe1=rt−yt,Δe2=ct−τt,where Δe1 is the error of trajectory tracking, rt is the given planning trajectory, yt is output trajectory at time t, Δe2 is the error of contact force, ct is the given contact constant force, and τt is the output contact force. A block diagram illustrating the proposed FNN-PID controller is shown in Figure 3.Figure 3
Block diagram of the proposed fuzzy PID with NN.The fuzzy control algorithm comprises the following three units: fuzzification, fuzzy rules, and defuzzification:(1)
Fuzzification: it takese and ec as input language variables and Kp, KI, and KD as output language variables. The fuzzy subset of input and output variables are expressed as negative big (NB), negative middle (NM), negative small (NS), zero (ZO), positive small (PS), positive middle (PM), and positive big (PB). The domain of e and ec is −33, and the domain of Kp, KI, and KD are −0.30.3, −0.060.06, and 33, respectively. The membership function for the proposed fuzzy algorithm is shown in Figure 4.(2)
Fuzzy rules: fuzzy rules were designed for tuning the gain control parameters of the PID controller (the same rules for trajectory tracking and constant force) as follows:(i)
When the error is large, in order to maintain a rapid response and make the absolute or errors reduce with the maximum speed,Kp should be bigger and KI and KD should be smaller. As the error decreases, to prevent an excessively large overshoot, KD should be added, and Kp and KI should be decreased uniformly.(ii)
When the system is over the steady state and the error is increasing, in order to decrease the overshoot,KD should be bigger and KI and KD should be smaller.(iii)
When the system is tending toward a steady state,KP should be assigned a bigger value in order to enhance the response speed and access the steady state quickly. KD should be added to decrease the overshoot and KI should be reduced to avoid the oscillations caused by integral overshoot.(iv)
When the overshoot of the system is negative and the error is increasing,KD should be assigned a bigger value. When the error reaches the maximum and the system tends toward a steady state, KD should be decreased and KP and KI should be increased.Forty-nine fuzzy rules are obtained for the proposed fuzzy algorithm as follows:Rule one:if (e is NB) and (ec is NB) then (KPis PB), (KIis NB), and (KDis PS)Rule two: if (e is NB) and (ec is NM) then (KPis PB), (KIis NB), and (KDis NS)Rule three: if (e is NB) and (ec is NS) then (KPis PM), (KIis NM), and (KDis NB)⋯⋯⋯Fuzzy rule setting forKp, KI, and KD is given by Table 2.(3)
Defuzzification: defuzzification was performed to extract the values from all of the rules given above, where the number of rules was transformed into the number of variables by using a membership function. A center of gravity method is employed for defuzzification in this paper [40].Figure 4
Fuzzy membership function.
(a)(b)(c)(d)(e)Table 2
Fuzzy rule setting forKp, KI, and KD.
e, ecNBNMNSZOPSPMPBNBPB/NB/PSPB/NB/NSPM/NM/NBPM/NM/NBPS/NS/NBZO/ZO/NMZO/ZO/PSNMPB/NB/PSPB/NB/NSPM/NM/NBPS/NS/NMPS/NS/NMZO/ZO/NSNS/ZO/ZONSPM/NM/ZOPM/NM/NSPS/NS/NMPS/NS/NMZO/ZO/NSNS/PS/NSNS/PS/ZOZOPM/NM/ZOPM/NM/NSPS/NS/NSZO/ZO/NSNS/PS/NSNM/PM/NSNM/PM/ZOPSPS/NM/ZOPS/NS/ZOZO/ZO/ZONS/PS/ZONS/PS/ZONM/PM/ZONM/PB/ZOPMPS/ZO/PBZO/ZO/NSNS/PS/PSNM/PS/PSNM/PM/PSNM/PB/PSNB/PB/PBPBZO/ZO/PBZO/ZO/PMNM/PS/PMNM/PM/PMNM/PM/PSNB/PB/PSNB/PB/PBFurthermore, in order to accelerate the trajectory tracking and constant force control by the fuzzy PID controller, the NN is utilized in the proposed method previously.Neural network function solves nonlinear problems, which change into linear ones, by mapping the low-dimension original space to the high-dimension feature space and approximating any continuous function with the weighted sum of multiple basis functions. The neural network structure is shown in Figure5.Figure 5
Structure diagram of NN algorithm for two-link robotic manipulator.In the network structure,X=rt,ctT is the input, Y=yt,τtT is the output, H=h1,h2,⋯,hmT is the vector of radial basis, and hj is usually the Gauss function:(17)hj=exp−X−Cj22bj2,X=rt,ctT,where Cj=cj1,cj2,⋯,cjnT is the center vector of the nth node and B=b1,b2,⋯,bmT is the width of the basis vector; the weight vector of network is selected as W=w1,w2,…,wmT.The output of the neural network is given by(18)Ymt=w1h1+w2h2+⋯+wmhm.The optimization objective function is given by(19)F=12Yt−Ymt2=12ut2.According to the gradient descent method, the iteration algorithm of the neural network parameters is satisfied as follows:(20)wjk=wjk−1+ηuthj+αwjk−1−wjk−2,Δbj=utwjhjX−Cj2bj3,bjk=bjk−1+ηΔbj+αbjk−1−bjk−2,Δcji=utwjxj−cjibj2,cjik=cjik−1+ηΔcji+αcjik−1−cjik−2,where η is the learning rate and α is the momentum factor.Regarding the sensitivity of the output to input changes, the algorithm is given as follows:(21)∂Y∂u=∑j=1mwjhjcji−Δubj2.


## 4. Simulation and Discussion

In this section, numerical simulation is conducted to demonstrate the performance of the proposed controller. The initialization parameters are determined asη=0.25 and α=0.04. The initial value of the weight vector, the node center, and the width value of the basis function are shown as follows:(22)W=−0.6132,−0.9216,0.1835,0.6783,−0.2210,−0.3275T,B=1.5039,0.3736,2.6521,2.4361,0.2505,1.5362T,C=0.58620.6302−0.8965−2.0464−1.84351.6532−1.0356−0.29871.05360.56262.37480.5032−2.1452−0.20981.83642.68691.05922.1782T.Surface schematic representations of the gain control parameters comprisingKP, KI, and KD are shown in Figure 6.Figure 6
Surface schematic representations forKP, KI, and KD.
(a)(b)(c)The contact constant force is loaded as10N, and the response curves of two control strategies are shown in Figure 7. The constant force traction error in the stability interval (1.5–10 s) is shown in Figure 8. As shown in Figures 7 and 8, the response time of the complete tracking process in 1.5 s and the maximum traction error is 0.22 N. The parameters of the FNN-PID controller are self-adjusted; therefore, the response speed improved and the constant force tracking process is more stable.Figure 7
Comparison of response curves of two control strategies.Figure 8
The constant force tracking error.While maintaining constant force control, simulation comparisons of the displacement trajectory tracking performance are derived. Displacement of the directions ofx and y of the end-effector is shown in Figures 9(a) and 9(b), respectively, and the trajectory tracking errors of the end-effector are derived and shown as Figure 10. It shows that the maximum error is 0.03 mm, and the error is close to balance position and keeps stabilities after 0.8 s.Figure 9
Displacement tracking of (a)x direction; (b) y direction.
(a)(b)Figure 10
Position tracking errors of the end-effector of two-link robotic manipulator.In order to test the dynamic characteristics of the proposed system, step function is used as an external disturbance at 5 s, and the displacement tracking of directionsx and y is shown in Figure 11.Figure 11
Displacement tracking (a)x direction and (b) y direction with external disturbance.
(a)(b)It shows that the tracking performance is convergence behind 0.85 s forx direction and 0.25 s for y direction, respectively. Furthermore, the constant force tracking is also adjusted convergence with external disturbance, as shown in Figure 12.Figure 12
Constant force tracking with external disturbance.


## 5. Conclusions

The framework of the fuzzy-neural-network PID (FNN-PID) control of the robotic manipulator has been presented in this article. By using Lagrange energy function, a precise dynamic model of two-link robotic manipulator is built, and the relationship among actuated torque, displacement, velocity, and acceleration in joint space is presented. In order to tune PID controller parameters quickly and effectively, a fuzzy neural network algorithm is proposed for two kinds of PID controller, that is, trajectory tracking and limited change online while in contact with constant force control. Numerical simulations are conducted and analyzed to illustrate the effectiveness of the proposed method.



---

*Source: 3491845-2020-07-17.xml*