#### 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.

#### 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 value and the actual output value , the traditional PID control combines the deviation by proportion (P), integration (I), and differentiation (D) to form the control quantity. The control law is given bywhere is proportionality coefficient, is integral time constant, is differential time constant, andis integral coefficient and 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).

**(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. Section 2 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 Figure 2. According to the coordinate system , it consists of two links having link length and with their center of mass and lying at the middle of links, respectively. The length of center of mass are and , respectively.

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.

The location coordinates and the square of velocity of center of mass can be derived as follows:

The location coordinates and the square of velocity of center of mass can also be derived as follows:

The total kinetic energy of the two-link robotic manipulator is

The total potential energy of the two-link robotic manipulator is

The Lagrange function is constructed as follows:

The dynamic equation of the two-link robotic manipulator can be calculated by

The torque of joint 1 can be derived as follows:where , , , and

Meanwhile, the torque of joint 2 can be also derived aswhere

Combined (8) with (10), the robotic plant can be rewritten with the following mathematical model:

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 and represent the moment of inertia caused by the acceleration of joint 1 and joint 2, respectively. The issues with and represent the moment of inertia of the acceleration coupling between two joints. The issues with and represent the coupling moment term of the centripetal force caused by the velocity between two joints. The issues with and represent the coupling moment term of the Coriolis force between two joints. and represent the gravity moment term. Considering the effect of centroid inertia, (12) can be modified by

Furthermore, to consider the effect of contact force act on the end-effector, right side of (12) can be replaced bywhere is the force and moment vector applied by the end-effector in the working environment, and is the velocity Jacobian matrix, which yields to

#### 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 aswhere is the error of trajectory tracking, is the given planning trajectory, is output trajectory at time , is the error of contact force, is the given contact constant force, and is the output contact force. A block diagram illustrating the proposed FNN-PID controller is shown in Figure 3.

The fuzzy control algorithm comprises the following three units: fuzzification, fuzzy rules, and defuzzification:(1)Fuzzification: it takes and as input language variables and , , and 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 and is , and the domain of , , and are , , and , 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, should be bigger and and should be smaller. As the error decreases, to prevent an excessively large overshoot, should be added, and and should be decreased uniformly.(ii)When the system is over the steady state and the error is increasing, in order to decrease the overshoot, should be bigger and and should be smaller.(iii)When the system is tending toward a steady state, should be assigned a bigger value in order to enhance the response speed and access the steady state quickly. should be added to decrease the overshoot and 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, should be assigned a bigger value. When the error reaches the maximum and the system tends toward a steady state, should be decreased and and 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 (**is PB), (**is NB), and (**is PS)* Rule two*: if (e is NB) and (ec is NM) then (**is PB), (**is NB), and (**is NS)* Rule three*: if (e is NB) and (ec is NS) then (**is PM), (**is NM), and (**is NB)* Fuzzy rule setting for , , and 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].

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

Furthermore, 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 Figure 5.

In the network structure, is the input, is the output, is the vector of radial basis, and is usually the Gauss function:where is the center vector of the node and is the width of the basis vector; the weight vector of network is selected as .

The output of the neural network is given by

The optimization objective function is given by

According to the gradient descent method, the iteration algorithm of the neural network parameters is satisfied as follows: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:

#### 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 and . The initial value of the weight vector, the node center, and the width value of the basis function are shown as follows:

Surface schematic representations of the gain control parameters comprising , , and are shown in Figure 6.

**(a)**

**(b)**

**(c)**

The contact constant force is loaded as , 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.

While maintaining constant force control, simulation comparisons of the displacement trajectory tracking performance are derived. Displacement of the directions of and 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.

**(a)**

**(b)**

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 directions and is shown in Figure 11.

**(a)**

**(b)**

It shows that the tracking performance is convergence behind 0.85 s for direction and 0.25 s for direction, respectively. Furthermore, the constant force tracking is also adjusted convergence with external disturbance, as shown in Figure 12.

#### 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.

#### Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

The authors are grateful for the financial support from the National Natural Science Foundation of China (Grant no. 51165009) and Innovation School Project of Education Department of Guangdong Province, China (Grant nos. 2017KZDXM060 and 2018KCXTD023).