<<

applied sciences

Article An Improved PID Controller for the Compliant Constant- Actuator Based on BP Neural Network and Smith Predictor

Guojin Pei 1,2,3, Ming Yu 1,2, Yaohui Xu 1,2, Cui Ma 1,2, Houhu Lai 1,2, Fokui Chen 1,2 and Hui Lin 1,2,*

1 Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences, Shenzhen 518055, China; [email protected] (G.P.); [email protected] (M.Y.); [email protected] (Y.X.); [email protected] (C.M.); [email protected] (H.L.); [email protected] (F.C.) 2 Shenzhen Key Laboratory of Precision Engineering, Shenzhen 518055, China 3 College of Mechanical and Transportation Engineering, China University of Petroleum, Changping, Beijing 102200, China * Correspondence: [email protected]

Abstract: A compliant constant-force actuator based on the cylinder is an important tool for the contact operation of robots. Due to the nonlinearity and time delay of the pneumatic system, the traditional proportional––derivative (PID) method for constant force control does not work so well. In this paper, an improved PID control method combining a backpropagation (BP) neural network and the Smith predictor is proposed. Through MATLAB simulation and experimental validation, the results show that the proposed method can shorten the maximum and the adjustment time compared with traditional the PID method.

  Keywords: compliant force control; PID; neural network; Smith predictor

Citation: Pei, G.; Yu, M.; Xu, Y.; Ma, C.; Lai, H.; Chen, F.; Lin, H. An Improved PID Controller for the 1. Introduction Compliant Constant-Force Actuator Based on BP Neural Network and With the continuous development of industrial , the application of robots Smith Predictor. Appl. Sci. 2021, 11, is becoming more extensive [1]. Robots are required to have the capabilities of precise 2685. https://doi.org/10.3390/ force perception and force control in contact operations such as grinding, polishing and app11062685 assembly, as subtle changes in the contact force will affect processing quality [2,3]. In recent years, a number of compliant constant-force actuators have been developed based Academic Editor: Manuel Armada on gasbag [4], voice coil motor [5], cylinder [6–9], artificial muscle [10,11] and special mechanical structures [12,13]. Among them, the pneumatic system based on the cylinder is Received: 16 December 2020 the most widely used because air has good compliance. However, the pneumatic system Accepted: 12 March 2021 is a complex , due to the compressibility of air and the inevitable static Published: 17 March 2021 friction [14]. Therefore, achieving precise force control in the pneumatic system is both practical and challenging. Publisher’s Note: MDPI stays neutral In recent years, intelligent control algorithms such as , neural networks with regard to jurisdictional claims in and expert systems have been developed rapidly, providing new ideas for the design of a published maps and institutional affil- pneumatic force [15–21]. The traditional proportional–integral–derivative iations. (PID) method is a classic controller that was used for years because of its simplicity and effectiveness. However, with the requirement of low force control error in modern industry, it is difficult for a traditional PID controller to achieve the expected control quality indices in such complex nonlinear systems. Scholars made great efforts in the Copyright: © 2021 by the authors. combination of intelligent control and traditional PID control, especially the combination Licensee MDPI, Basel, Switzerland. of a backpropagation neural network (BPNN) and a PID controller. Kang et al. applied the This article is an open access article BPNN-PID control method to the pneumatic force control system and demonstrated that distributed under the terms and the controller had better robustness and control performance [17–19]. conditions of the Creative Commons These intelligent controllers have improved the performance of force control in the Attribution (CC BY) license (https:// pneumatic nonlinear system to some extent. Nevertheless, besides the nonlinear property, creativecommons.org/licenses/by/ there is a pure time delay link in the pneumatic systems based on pneumatic cylinders [22]. 4.0/).

Appl. Sci. 2021, 11, 2685. https://doi.org/10.3390/app11062685 https://www.mdpi.com/journal/applsci Appl. Sci. 2021, 11, 2685 2 of 19 Appl. Sci. 2021, 11, 2685 2 of 18

there is a pure time delay link in the pneumatic systems based on pneumatic cylinders In[22]. the In implementation the implementation of such of such stabilizing stabilizin feedbackg control, control, even even a smalla small time time delay delay may causemay cause destabilization destabilization of the of controllerthe controller [23], [23], because because the the time time delay delay makes makes the the controlled con- variablestrolled variables unable unable to reflect to reflect the disturbance the disturbance of the of systemthe system in time, in time, which which will will produce pro- a largerduce a overshoot larger overshoot and longer and longer adjustment adjustment time [time24]. [24]. InIn some other other control control systems, systems, such such as as chem chemicalical engineering, engineering, oil oilrefining, refining, metallurgy metallurgy andand heatheat engineeringengineering processprocess controlcontrol systems,systems, thethe SmithSmithpredictor predictorhas has been been used used effectively effec- fortively compensating for compensating for the for pure the pure time time delay de [lay25, 26[25,26].]. For For a given a give signal,n signal, the the Smith Smith predictor pre- estimatesdictor estimates the dynamic the dynamic characteristics characteristics of the systemof the system under under disturbance disturbance in advance in advance and then compensatesand then compensates the time delaythe time error delay to reduceerror to the reduce overshoot the overshoot of the system of the and system shorten and the shorten the adjustment process [27]. However, the Smith predictor depends on the system adjustment process [27]. However, the Smith predictor depends on the system model, so model, so its performance is very sensitive to modeling errors. Pneumatic force control its performance is very sensitive to modeling errors. Pneumatic force control systems are systems are usually complex and time-varying, so it is difficult to build accurate mathe- usually complex and time-varying, so it is difficult to build accurate mathematical models. matical models. As a result, the Smith predictor is rarely used in such systems to the best As a result, the Smith predictor is rarely used in such systems to the best of our knowledge. of our knowledge. In order to improve the modeling accuracy and make the Smith predictor suitable for In order to improve the modeling accuracy and make the Smith predictor suitable for use in a pneumatic force control system, this paper brings the neural network algorithm into use in a pneumatic force control system, this paper brings the neural network algorithm theinto structure the structure of the of Smiththe Smith predictor. predictor. Moreover, Moreover, the the improved improved Smith Smith predictor predictor is connectedis con- withnected the with BPNN-PID the BPNN-PID controller controller to optimize to opti themize overall the overall control control performance. performance. Therefore, There- the structurefore, the structure of this improved of this improved controller contro (backpropagationller (backpropagation neural network-Smithneural network-Smith predictor- proportional–integral–derivativepredictor-proportional–integral–derivative (BPNN-SP-PID)) (BPNN-SP-PID)) proposed inproposed this paper in isthis mainly paper divided is intomainly two divided parts. Oneinto two part parts. is to One combine part is the to artificialcombine the neural artificial network neural (ANN) network with (ANN) the PID controller.with the PID An controller. online learning An online backpropagation learning backpropagation neural network neural ANN1 network is taken ANN1 to adjustis thetaken PID to adjust parameters the PID adaptively parameters to adaptively improve to the improve dynamic the performancedynamic performance of the controller. of the Thecontroller. other partThe other is to combinepart is to combine the artificial the artificial neural networkneural network with the with Smith the Smith predictor. pre- A neuraldictor. networkA neural ANN2network is usedANN2 for is identifyingused for identifying the nonlinear the nonlinear model of model the controlled of the con- object totrolled improve object its to modelingimprove its accuracy, modeling so accuracy, that the so Smith that the predictor Smith predictor can compensate can compen- for the puresate for time the delay pure time well. delay The integrationwell. The integration of a BPNN-PID of a BPNN-PID controller controller and the and Smith the Smith predictor improvespredictor improves the robustness the robustness and and of speed the pneumatic of the pneumatic force control force control system. system. TheThe restrest ofof thisthis paperpaper isis organizedorganized as follows. Section 22 introducesintroduces the system structurestruc- andture modeland model of the of compliant the compliant constant-force constant-forc actuator.e actuator. Section Section3 introduces 3 introduces the the design design of the BPNN-SP-PIDof the BPNN-SP-PID controller. controller. Section Section4 shows 4 shows the simulationthe simulation and and experimental experimental results results and givesand gives a discussion. a discussion. Section Section5 gives 5 gives the the conclusive conclusive points. points.

2.2. SystemSystem Description AsAs Figure1 1 shows, shows, thethe pneumaticpneumatic constant force actuator actuator mainly mainly included included a a tilt tilt sen- sensor (KELAGsor (KELAG Kabel Kabel variante variante kas90), kas90), a cylinder a cylinde (SMCr (SMC MGPM20-30Z), MGPM20-30Z), a force a force sensor sensor (LH (LH Z05A- 200N),Z05A-200N), a base, a abase, proportional a proportion pressureal regulator regulator (Festo (Festo VPPE-3-1-1/8-10-010-E1) VPPE-3-1-1/8-10-010-E1) and and an electromagnetican electromagnetic valve valve (Parker (Parker A05PS25X-1s). A05PS25X-1s). Among Among them, them, the the base base was was connected connected with thewith robot the robot by bolts, by bolts, and theand forcethe force sensor sensor had had its threadits thread for for connecting connecting the the workpiece. workpiece.

Figure 1. Compliant constant-force actuator structure diagram.

The pneumatic system control diagram is shown in Figure2. The force sensor fed back the contact force F to the electrical signal Uf in real time, and the tilt sensor was used for obtaining the attitude signal Ut of the actuator. The signals were transmitted to the Appl. Sci. 2021, 11, 2685 3 of 19

Figure 1. Compliant constant-force actuator structure diagram.

Appl. Sci. 2021, 11, 2685 The pneumatic system control diagram is shown in Figure 2. The force sensor3 of fed 18 back the contact force F to the electrical signal Uf in real time, and the tilt sensor was used for obtaining the attitude signal Ut of the actuator. The signals were transmitted to the hosthost computercomputer throughthrough thethe datadata acquisitionacquisition (DAQ)(DAQ) board.board. Then,Then, thethe hosthost computercomputer ranran thethe controllercontroller andand adjustedadjusted thethe controlcontrol voltagevoltage UUcc ofof thethe proportionalproportional pressurepressure regulator,regulator, makingmaking thethe outputoutput forceforce FF meetmeet thethe setset value.value. ItIt alsoalso controlledcontrolled thethe onon andand offoffstate stateof ofthe the electromagneticelectromagnetic valve valve to to change change the the direction direction of of the the force. force. As Asa aresult, result,the thesystem systemhad hadforce force perceptionperception andand forceforce controlcontrol capabilities. capabilities.

Figure 2. Pneumatic system control diagram. Figure 2. Pneumatic system control diagram. The pneumatic system has nonlinear factors that are difficult to quantify [13]. To The pneumatic system has nonlinear factors that are difficult to quantify [13]. To un- understand the characteristics of the system intuitively and to facilitate the following derstand the characteristics of the system intuitively and to facilitate the following simu- simulations, a linear approximate model of the system needed to be obtained first. lations, a linear approximate model of the system needed to be obtained first. The mathematical model G(s) of the system represents the corresponding relationship betweenThe themathematical control voltage model of theG(s) proportional of the system pressure represents regulator the corresponding Uc(s) and the relation- output forceship between of the actuator the control F(s), voltage including of the three propor links:tional the pressure control voltage regulator Uc(s) Uc(s) to and the the output out- pressureput force of of the the proportional actuator F(s), pressure including regulator three links: Pu(s); the the control Pu(s)to voltage the input Uc(s) pressure to the output of the cylinderpressure action of the chamber proportional Pd(s); pressure and the Pd(s)regulato to ther Pu(s); output the force Pu(s) F(s). to the input pressure of the cylinderAccording action to the chamber device Pd(s); structure and above, the Pd(s) it is to divided the output into threeforce partsF(s). to calculate the mathematicalAccording to the model. device The structure first part above, is the it proportional is divided into pressure three parts regulator. to calculate The schematic the math- diagramematical ofmodel. its internal The first structure part is isthe shown propor intional the Figure pressure3. The regulator. following The equation schematic is thedia- forcegram balance of its internal equation structure of the proportionalis shown in the pressure Figure regulator 3. The following spool: equation is the force balance equation of the proportional pressure regulator spool: . Ppv A1 + Pdv A2 + mg − Pdv A1 − Psv A2 − cxv − k f (xv + x0) − Fc = 0 (1) 𝑃𝐴 +𝑃𝐴 +𝑚𝑔−𝑃𝐴 −𝑃𝐴 −𝑐𝑥 −𝑘(𝑥 +𝑥) −𝐹 =0 (1)

wherewhereP pv𝑃is is the the air air pressure pressure in thein the pilot pilot cavity; cavity;Pdv is𝑃 the is output the output pressure pressure of the of proportional the propor- pressure regulator; P is the supply pressure of the proportional pressure regulator; A tional pressure regulator;sv 𝑃 is the supply pressure of the proportional pressure regula-1 is the effective area of the diaphragm; A is the cross-sectional area of the valve chamber; tor; 𝐴 is the effective area of the diaphragm;2 𝐴 is the cross-sectional area of the valve m is the self- of the valve spool; x is the displacement of the valve spool; x is the chamber; m is the self-weight of the valvev spool; 𝑥 is the displacement of the valve0 spool; initial deformation of the spring; c is the viscous coefficient; k is the equivalent 𝑥 is the initial deformation of the spring; 𝑐 is the viscous damping coefficient;f 𝑘 is the spring stiffness; and Fc is the Coulomb friction. equivalent spring stiffness; and 𝐹 is the Coulomb friction. IgnoringIgnoring thethe influence influence of of the the Coulomb Coulomb friction, friction, we we can can write write Equation Equation (1) in (1) incremen- in incre- talmental form form and performand perform a Laplace a : transform:   cs + k f ∆xv(s) − ∆Ppv(s)A1 + ∆Pdv(s)(A1 − A2) = 0 (2)

According to the properties of the proportional pressure regulator, the spool displace- ment xv and the air pressure Ppv of the pilot cavity can be approximated as proportional to the control voltage Uc. Appl. Sci. 2021, 11, 2685 4 of 19

𝑐𝑠 +𝑘 ∆𝑥(𝑠) −∆𝑃(𝑠)𝐴 +∆𝑃(𝑠)(𝐴 − 𝐴) =0 (2) Appl. Sci. 2021, 11, 2685 4 of 18 According to the properties of the proportional pressure regulator, the spool dis- placement 𝑥 and the air pressure 𝑃 of the pilot cavity can be approximated as propor- tional to the control voltage 𝑈.   cs + k f K1∆Uc(s) − K2 A1∆Uc(s) + ∆Pdv(s)(A1 − A2) = 0 (3) 𝑐𝑠 +𝑘 𝐾∆𝑈(𝑠) − 𝐾 𝐴∆𝑈(𝑠) + ∆𝑃 (𝑠)(𝐴 − 𝐴) =0 (3)

Figure 3. The internal structure of the proportional pressurepressure regulator.regulator. (SUP(SUP == supply;supply; EXHEXH == exhaust; and OUT == output).

Then, we can obtain the following relationship: ( ) 𝐾 𝑐𝑠 +𝐾 𝑘 −𝐾 𝐴 ∆𝑃 𝑠 K cs + K k − K A ∆Pu(s) = 1 1 f 2 1 =𝑘𝑠+𝑘 (4) ∆𝑈(𝑠)= 𝐴 − 𝐴 = k1s + k2 (4) ∆Uc(s) A1 − A2 where 𝐾, 𝑘 (n = 1, 2, 3…) are all undetermined coefficients. whereTheKn second, kn (n = part 1, 2, is 3 the . . . gas ) are pipeline. all undetermined coefficients. AssumingThe second that part the is trachea the gas pipeline.is circular and the airflow movement is laminar, according Assuming that the trachea is circular and the airflow movement is laminar, according to Anderson theory [28], we have to Anderson theory [28], we have ∆𝑞(𝑠) =𝐾∆𝑃(𝑠) −∆𝑃(𝑠) (5) ∆qm(s) = K3(∆Pu(s) − ∆Pd(s)) (5) where 𝑞 is the flow rate. whereTheqm gasis the enters mass the flow cylinder rate. through the proportional pressure regulator and the gas pipe.The Assume gas enters that the the gas cylinder in the throughcylinder theis ideal proportional and satisfies pressure the ideal regulator gas law: and the gas pipe. Assume that the gas in the cylinder is ideal and satisfies the ideal gas law: 𝑃 =𝜌𝑅𝑇 (6)

where 𝑅 is the proportionality coefficient;Pd = ρ𝜌dR c isT dthe density; 𝑇 is the ; and(6) 𝑉 is the volume of the gas. whereAssumingRc is the proportionalitythat the temperature coefficient; in theρ gasd is thecirculation density; processTd is the satisfies temperature; the adiabatic and Vd is the volume of the gas. process, 𝑞 is equal to the rate of change of the gas mass m in the cavity. Combining the above,Assuming we get that the temperature in the gas circulation process satisfies the adiabatic process, qm is equal to the rate of change of the gas mass m in the cavity. Combining the above, we get 1 𝑉 𝑑𝑃 𝑞 = (7) 1 𝑘V𝑅d𝑇dP𝑑𝑡d qm = (7) where 𝑘 is an undetermined coefficient. k RcTd dt whereWritek is anEquation undetermined (7) in incremental coefficient. form and perform a Laplace transformation: Write Equation (7) in incremental form and perform a Laplace transformation:

1 Vd ∆qm(s) = s∆Pd(s) = K4s∆Pd(s) (8) k RcTd Appl. Sci. 2021, 11, 2685 5 of 19

Appl. Sci. 2021, 11, 2685 5 of 18

1 𝑉 ∆𝑞(𝑠) = 𝑠∆𝑃(𝑠) =𝐾𝑠∆𝑃(𝑠) (8) 𝑘 𝑅𝑇 Combine Equations (5) and (8) to get Combine Equations (5) and (8) to get

∆P∆𝑃(s)(𝑠) K𝐾3 11 d = = (9) ( ) = + = + (9) ∆P∆𝑃u s(𝑠) K𝐾4s𝑠+𝐾K3 k𝑘3s𝑠+11 The third part is the cylinder. The force analysis of the cylinder is carried out according to Newton’s second law, and the friction is ignored:

𝑀𝑠2 ∆𝑌(𝑠) +𝐶𝑠∆𝑌(𝑠) +∆𝐹(𝑠) =∆𝑃 (𝑠)𝐴 (10) Ms ∆Y(s) + Cs∆Y(s) + ∆F(s) = ∆Pd(s)A3 (10) where 𝑀 is the total mass of the cylinder rod; 𝐶 is the viscous damping coefficient; 𝐹 is where M is the total mass of the cylinder rod; C is the viscous damping coefficient; F is the the output force; 𝐴 is the cylinder cross-section; and 𝑌 is the displacement of the cylin- output force; A is the cylinder cross-section; and Y is the displacement of the cylinder. der. 3 The force causes slight deformation of the workpiece, and the actuator passively The force causes slight deformation of the workpiece, and the actuator passively gen- generates displacement y. Set the equivalent stiffness coefficient to K: erates displacement y. Set the equivalent stiffness coefficient to 𝐾: ∆F∆𝐹(s()𝑠=) =𝐾∆𝑌K∆Y(s()𝑠) (11)(11)

Combine Equations (10) and (11) to get

∆𝐹(𝑠) 𝐾𝐴 𝑘 ∆F(s) = KA3 = k7 (12) = = ∆𝑃(𝑠) 𝑀𝑠2 +𝐶𝑠+𝐾 𝑘𝑠2 +𝑘𝑠+𝑘 (12) ∆Pd(s) Ms + Cs + K k4s + k5s + k6 According to the above derivation, the of each link is listed in Figure 4. According to the above derivation, the transfer function of each link is listed in Figure4.

Figure 4. The transfer function of the system.

Therefore, the open-loop open-loop mathematical mathematical model model GGo(s)o(s) ofof the the system system can can be be obtained obtained as asfollows: follows: k (k s + k ) ( ) = 7 1 2 Go s 𝑘(𝑘2𝑠+𝑘) (13) (k3s + 1)(k4s + k5s + k6) 𝐺(𝑠) = (13) (𝑘𝑠 + 1)(𝑘𝑠 +𝑘𝑠+𝑘) where kn (n = 1, 2, ... , 7) in Figure4 and Equation (13) represents undetermined coefficients. Itwhere can be 𝑘 seen (n = that 1, 2, the …, mathematical 7) in Figure 4 model and Equati of theon system (13) represents has three poles undetermined and one zero. coeffi- cients.The It can undetermined be seen that coefficients the mathematical are identified model of through the system the has gray three box poles experimental and one method.zero. The system is loaded with an input signal, and the corresponding output signal is collectedThe undetermined over time. When coefficients the loaded are signalidentified is a stepthrough signal, the the gray output box signalexperimental always takesmethod. ~70 The ms system before itis startsloaded to with respond, an input as shown signal, in and Figure the5 corresponding, so a time delay output link needssignal tois collected be added over to the time. mathematical When the loaded model. signal Afterward, is a step the signal, MATLAB the systemoutput identificationsignal always tooltakes is ~70 used ms for before analyzing it starts the to relationship respond, as between shown in the Figure collected 5, so input a time signal delay and link output needs signalto be added [29]. Asto athe mathematical mathematical model model. with Afterward, three poles, the oneMATLAB zero and system a pure identification time delay linktool areis used used for for analyzing identification. the relationship The approximate between mathematical the collected model input including signal and the output pure time-delaysignal [29]. G(s)As a ismathematical obtained: model with three poles, one zero and a pure time delay link are used for identification. The approximate mathematical model including the pure time- 2s + 15.6 delay G(s) is obtained: G(s) = e−0.07s (14) s3 + 15.8s2 + 130.7s + 350.7 2𝑠 + 15.6 𝐺(𝑠) = e. (14) The step response curve of the𝑠 mathematical+15.8𝑠 + 130.7𝑠 model is + calculated350.7 in MATLAB Simulink and compared with the actual curve for model validation. It can be seen from Figure5 The step response curve of the mathematical model is calculated in MATLAB Sim- that the identified mathematical model matches the actual one well. The approximate ulink and compared with the actual curve for model validation. It can be seen from Figure mathematical model will be used in the simulation of Section4. Appl. Sci. 2021, 11, 2685 6 of 19

Appl. Sci. 2021, 11, 2685 6 of 18 5 that the identified mathematical model matches the actual one well. The approximate mathematical model will be used in the simulation of Section 4.

FigureFigure 5. 5. ComparisonComparison of of the the open-loop open-loop step step response response between between the the mathematical mathematical and actual mod- models. els. 3. Controller Design 3. ControllerThe structure Design of the improved PID control method proposed in this paper is shown in FigureThe structure6. The BP of neural the improved network-Smith PID control predictor-PID method proposed (BPNN-SP-PID) in this paper controller is shown was individed Figure into6. The two BP parts. neural One network-Smit part was theh BPNN-PIDpredictor-PID controller. (BPNN-SP-PID) ANN1 could controller realize was self- dividedoptimization into two of theparts. PID One parameters part was and the improveBPNN-PID the controller. control performance. ANN1 could The realize other self- part optimizationwas the Smith of predictor.the PID parameters The Smith and predictor improve was the used control for reducingperformance. the influence The other of part the waspure the time Smith delay predictor. [27]. ANN2 The was Smith used predictor for identifying was used the open-loopfor reducing model the influence of the controlled of the pureobject time Go(s), delay eliminating [27]. ANN2 the was pure used time for delay. identifying Higheridentification the open-loop accuracy model of brought the con- by Appl. Sci. 2021, 11, 2685 7 of 19 trolledANN2 object could makeGo(s), the eliminating Smith predictor the pure compensate time delay. the timeHigher delay identifica more effectively.tion accuracy The broughttwo parts by are ANN2 described could inmake detail the below. Smith predictor compensate the time delay more effec- tively. The two parts are described in detail below.

Figure 6.6. BackpropagationBackpropagation neuralneural network-Smithnetwork-Smith predictor-proportional–integral–derivativepredictor-proportional–integral–derivative (BPNN-SP-PID)(BPNN-SP-PID) controller structure diagram.diagram.

3.1. BPNN-PID The neural network has a strong self-adaptive ability and can be combined well with other control methods [18]. On the basis of PID control, in order to optimize the perfor- mance of the controller, the online learning type BP neural network ANN1 was applied. The BPNN-PID controller consisted of two parts: the PID controller and the BP net- work ANN1. The PID controller directly controlled the controlled object in the closed loop, and the BPNN adjusted the three parameters of the PID controller in real time ac- cording to the error function J. The structure of the neural network ANN1 is shown in Figure 7.

Figure 7. Schematic diagram of the neural network ANN1’s structure, part of the BPNN-PID con- troller depicted in Figure 6.

The input and output of the network are Appl. Sci. 2021, 11, 2685 7 of 19

Appl. Sci. 2021, 11, 2685 7 of 18 Figure 6. Backpropagation neural network-Smith predictor-proportional–integral–derivative (BPNN-SP-PID) controller structure diagram.

3.1.3.1. BPNN-PIDBPNN-PID TheThe neuralneural networknetwork hashas aa strongstrong self-adaptiveself-adaptive abilityability andand cancan bebe combinedcombined wellwell withwith otherother controlcontrol methodsmethods [[18].18]. OnOn thethe basisbasis ofof PIDPID control,control, inin orderorder toto optimizeoptimize thethe perfor-perfor- mancemance ofof thethe controller,controller, the the online online learning learning type type BP BP neural neural network network ANN1 ANN1 was was applied. applied. TheThe BPNN-PIDBPNN-PID controller consisted consisted of of two two parts: parts: the the PID PID controller controller and and the theBP net- BP networkwork ANN1. ANN1. The The PID PID controller controller directly directly controlled controlled the the controlled controlled object inin thethe closedclosed loop,loop, andand the BPNN BPNN adjusted adjusted the the three three paramete parametersrs of of the the PID PID controller controller in inreal real time time ac- accordingcording to to the the error error function function J. J. TheThe structurestructure ofof thethe neuralneural networknetwork ANN1ANN1 isis shownshown in in Figure Figure7 .7.

FigureFigure 7.7. SchematicSchematic diagram diagram of of the the neural neural network network ANN1’s ANN1’s structure, structure, part partof the of BPNN-PID the BPNN-PID con- controllertroller depicted depicted in Figure in Figure 6. 6.

TheThe inputinput andand outputoutput ofof thethe networknetwork areare (  T Oi(t) = R(t) E(t) F(t)  T (15) netk(t) = kp ki kd

where t is the discrete time series (t = 1, 2, 3...); R(t) is the set force at time t; E(t) is the error at time t; F(t) is the actual output force at time t; and kp, ki, kd indicate the proportional, integral and differential parameters of the PID controller, respectively. The activation function of the hidden layer was the tanh function. Since PID parame- ters cannot be negative, the activation function of the output layer was taken as a sigmoid function. Based on the previous paper [30], other parameters of the neural network were determined, as shown in Table1.

Table 1. Parameters of neural network ANN1.

Type Value Learning type Online Learning rate (η) 0.3 Inertia index (α) 0.15 Number of hidden layer neurons 8 Hidden layer activation function Tanh Output layer activation function Sigmoid Initialization weight method 0.03rands(n, 1) 1 1 rands(n, 1) returns an random matrix of n rows and one column, and the range of elements in the matrix is (−1, 1). Appl. Sci. 2021, 11, 2685 8 of 18

The incremental PID control algorithm is used for calculating the control voltage Uc(t):   Uc(t) = Uc(t − 1) + E(t) − E(t − 1) E(t) E(t) − 2E(t − 1) + E(t − 2) ·netk(t) (16)

The error function J [18,19] is expressed as

1 J = (R(t) − F(t))2 (17) 2 According to the gradient descent method, the of the output layer and hidden layer of the network are adjusted in turn, and an inertia term α∆ω(t − 1) is added to avoid falling into the local minimum:

∂J(t) ∆ω(t) = −η + α∆ω(t − 1) (18) ∂ω In Equation (18), ∆ω(t) is the weights adjusting value; η is the learning rate; and α is the coefficient of inertia. In application, this BPNN-PID control algorithm could be roughly divided into the following steps, as shown in Figure8: 1. Determine the structure of the BP neural network. The parameters of the neural network are listed in Table1; 2. Give the initial value of each layer’s weights; 3. The input data R(t), F(t) is sampled, and the error E(t) is calculated; 4. Calculate the input and output values of each layer of neurons, and the output values of the output layer are PID parameters kp, ki, kd; 5. Calculate the control voltage Uc(t) based on the incremental PID control algorithm; 6. Perform online learning of neural networks, and adjust the weights of the hidden Appl. Sci. 2021, 11, 2685 9 of 19 layers and the output layer; 7. Return to Step 3 for the next round of training.

FigureFigure 8. ANN1 8. ANN1 training training flowchart. flowchart.

3.2. Smith Predictor To optimize the response speed of the control system, the Smith predictor is added for predictive compensation. Its structure is shown in Figure 6, and the transfer function G(s) of the Smith predictor compensator is expressed as

G(s) =G(𝑠)(1−𝑒 ) (19) where G(𝑠) ∙𝑒 is the open-loop transfer function of the controlled object considering the time delay. When the Smith predictor is not added, the closed-loop transfer function of the sys- tem is 𝐺(𝑠)𝐺(𝑠)𝑒 G(s) = (20) 1+𝐺(𝑠)𝐺(𝑠)𝑒

where 𝐺(𝑠) is the transfer function of the controller. After adding the Smith predictor, the closed-loop transfer function of the system changes:

𝐺(𝑠)𝐺(𝑠) G(s) = 𝑒 (21) 1+𝐺(𝑠)𝐺(𝑠) By comparison of Equations (20) and (21), it can be found that the Smith predictor uses compensation to separate the pure time delay 𝑒 and Go(s), which is equivalent to putting the pure time delay of the controlled object outside the control closed loop. As the Smith predictor depends on the prior system model, a BP neural network shown in Figure 9 was used for identifying the system to improve modeling accuracy. Appl. Sci. 2021, 11, 2685 9 of 18

3.2. Smith Predictor To optimize the response speed of the control system, the Smith predictor is added for predictive compensation. Its structure is shown in Figure6, and the transfer function Gm(s) of the Smith predictor compensator is expressed as

−τs Gm(s) = Go(s) 1 − e (19)

−τs where Go(s)·e is the open-loop transfer function of the controlled object considering the time delay. When the Smith predictor is not added, the closed-loop transfer function of the system is G (s)G (s)e−τs ( ) = c o G s −τs (20) 1 + Gc(s)Go(s)e

where Gc(s) is the transfer function of the controller. After adding the Smith predictor, the closed-loop transfer function of the system changes:

G (s)G (s) G(s) = c o e−τs (21) 1 + Gc(s)Go(s)

By comparison of Equations (20) and (21), it can be found that the Smith predictor −τs uses compensation to separate the pure time delay e and Go(s), which is equivalent to putting the pure time delay of the controlled object outside the control closed loop. Appl. Sci. 2021, 11, 2685 10 of 19 As the Smith predictor depends on the prior system model, a BP neural network shown in Figure9 was used for identifying the system to improve modeling accuracy.

FigureFigure 9. 9.Schematic Schematic diagram diagram of of the the neural neural network network ANN2 ANN2 structure, structure, part part of theof the BPNN-PID BPNN-PID controller con- depictedtroller depicted in Figure in6 Figure. 6. The controlled object was a single-input single-output (SISO) nonlinear system, which The controlled object was a single-input single-output (SISO) nonlinear system, can be described as follows: which can be described as follows: ( + ) = [ ( ) ( − ) ( ) ( − )] F t𝐹(𝑡+11 )f=F𝑓t[𝐹,...,(𝑡),…,𝐹F t (𝑡−𝑛n , U),𝑈c t(,...,𝑡),…,𝑈Uc t(𝑡−𝑚m )] (22)(22)

wherewhereF(t) F(t)and andUc(t) Uc(t)are are the the input input and and output output of of the the object object at at time timet ,t, respectively; respectively;m mand andn n markmark thethe ordersorders of ofF(t) F(t)and andUc Uc (t) (t),, respectively; respectively; and andf 𝑓[•][•] represents represents a a nonlinear nonlinear function. function. The input 𝑂1(𝑡) of the network is The input Oi (t) of the network is  𝑈(𝑡−𝑖+1),0≤𝑖≤𝑚+1 𝑂 (𝑡) = U (t − i + 1), 0 ≤ i ≤ m + 1 (23) O1(t) = 𝐹(𝑡−𝑖+𝑚−2c ),𝑚+2≤𝑖≤𝑚+𝑛+2 (23) i F(t − i + m − 2), m + 2 ≤ i ≤ m + n + 2 The output 𝑛𝑒𝑡(𝑡) is

𝑛𝑒𝑡(𝑡) =𝐹(𝑡+1) (24) The neural network ANN2 also used the BP algorithm, and its structural parameters were determined as shown in Table 2.

Table 2. Parameters of neural network ANN2.

Type Value learning type Offline Learning rate (𝜂) 0.3 Inertia index (α) 0.15 Number of hidden layer neurons 15 Hidden layer activation function tanh Output layer activation function tanh Initialization weight method 0.03rands (n, 1) Time orders m,n 4

The neural network ANN2 was trained offline. As Figure 10 shows, the main training steps of the neural network ANN2 are listed as follows: Appl. Sci. 2021, 11, 2685 10 of 18

The output netk(t) is netk(t) = F(t + 1) (24) The neural network ANN2 also used the BP algorithm, and its structural parameters were determined as shown in Table2.

Table 2. Parameters of neural network ANN2.

Type Value learning type Offline Learning rate (η) 0.3 Inertia index (α) 0.15 Number of hidden layer neurons 15 Hidden layer activation function tanh Output layer activation function tanh Initialization weight method 0.03rands (n, 1) Time orders m,n 4

The neural network ANN2 was trained offline. As Figure 10 shows, the main training steps of the neural network ANN2 are listed as follows: 1. Determine the structure of the neural network, including the number of hidden layers, neuron activation functions and training samples; 2. Take a small initial value for the weight; 3. Import samples for training; 4. Calculate the input and output of each layer of neurons; 5. For each iteration, calculate the weight adjustment of the hidden layer and the output layer; 6. Check whether the network training error is less than the error tolerance. If it meets the requirements, go to Step 7, and if not, go to Step 8; 7. Solidify and save each weight. The training is successful, and you can call it through

Appl. Sci. 2021, 11, 2685 Labview or MATLAB Simulink; 11 of 19 8. Check whether the current iteration number exceeds the upper limit. If not, return to Step 3 for further training; otherwise, the training failed. Return to Step 1 to restart training.

Figure 10. ANN2 training flowchart. Figure 10. ANN2 training flowchart.

1. Determine the structure of the neural network, including the number of hidden lay- ers, neuron activation functions and training samples; 2. Take a small initial value for the weight; 3. Import samples for training; 4. Calculate the input and output of each layer of neurons; 5. For each iteration, calculate the weight adjustment of the hidden layer and the output layer; 6. Check whether the network training error is less than the error tolerance. If it meets the requirements, go to Step 7, and if not, go to Step 8; 7. Solidify and save each weight. The training is successful, and you can call it through Labview or MATLAB Simulink; 8. Check whether the current iteration number exceeds the upper limit. If not, return to Step 3 for further training; otherwise, the training failed. Return to Step 1 to restart training.

4. Results and Discussion In this section, the performance of the proposed BPNN-SP-PID method is validated through simulation and experiments. First, according to the mathematical model deduced in Section 2, a simulation block diagram of the system was built in MATLAB Simulink. Three types of controllers (PID, BPNN-PID and BPNN-SP-PID) were tested and com- pared. Then, an experimental prototype was built, and the force response curves under step input and sinusoid input were collected. Finally, a comprehensive discussion was made based on the results of the simulation and experiment.

4.1. Simulation Results In the block diagram shown in Figure 11, ANN2 is a neural network that describes the controlled object. It was trained and solidified to generate a Simulink module and added to the block diagram. The inside of the BPNN-PID structure was the packed neural Appl. Sci. 2021, 11, 2685 11 of 18

4. Results and Discussion In this section, the performance of the proposed BPNN-SP-PID method is validated through simulation and experiments. First, according to the mathematical model deduced in Section2, a simulation block diagram of the system was built in MATLAB Simulink. Three types of controllers (PID, BPNN-PID and BPNN-SP-PID) were tested and compared. Then, an experimental prototype was built, and the force response curves under step input and sinusoid input were collected. Finally, a comprehensive discussion was made based on the results of the simulation and experiment.

Appl. Sci. 2021, 11, 2685 12 of 19 4.1. Simulation Results In the block diagram shown in Figure 11, ANN2 is a neural network that describes the controlled object. It was trained and solidified to generate a Simulink module and added to thenetwork block diagram.ANN1 and The a PID inside controller. of the BPNN-PID The onlin structuree learning was neural the packednetwork neural ANN1 network was re- ANN1alized andby using a PID the controller. S-function The module. online There learning were neural two kinds network of input ANN1 signals was as realized the setting by usingforce: the a step S-function signal with module. an amplitude There were of 20 two N kindsand a ofsin input signal signals with an as amplitude the setting of force: 20 N aand step frequency signal with of an 0.2 amplitude Hz. The ofsimulation 20 N and data a sin of signal the withthree ancontrollers amplitude were of 20 exported N and frequencythrough the of 0.2simout Hz. module. The simulation data of the three controllers were exported through the simout module.

Figure 11. MATLAB Simulink simulation block diagram. Figure 11. MATLAB Simulink simulation block diagram. 4.1.1. Step Response 4.1.1. Step Response The response curve under step signal input with an amplitude of 20 N is shown in FigureThe 12. response curve under step signal input with an amplitude of 20 N is shown in FigureAll 12. three controllers could make the output response meet the target values. However, there wereAll three differences controllers at the could beginning make stagethe output and the response approaching meet stage.the target At the values. beginning How- stage,ever, thethere BPNN-SP-PID were differences controller at the actedbeginning first, andstage the and reaction the approaching time was almost stage. zero.At the The be- actionginning time stage, of BPNN-PID the BPNN-SP-PID and PID wascontroller almost acted the same, first, and taking the ~80 reaction ms to time start was the action.almost Atzero. the The approaching action time stage, of BPNN-PID the PID method and PID produced was almost the largest the same, overshoot taking of ~80 6.1% ms among to start thethe three, action. and At thethe overshootsapproaching of stage, BPNN-PID the PID and method BPNN-SP-PID produced werethe largest 0.45% overshoot and 0.15%, of respectively.6.1% among At the the three, stable and stage, the theovershoots residuals of of BPNN-PID the three were and allBPNN-SP-PID close to zero were due to 0.45% the integraland 0.15%, part respectively. of the PID controller. At the stable stage, the residuals of the three were all close to zero dueBy to comparisonthe integral part of the of three the PID response controller. curves, two phenomena could be observed. First, the useBy of comparison a BPNN greatly of the enhanced three response the robustness curves, two of the phenomena system. Due could tothe be observed. self-adjusting First, abilitythe use of of neural a BPNN networks, greatly enhanced the approaching the robustne processesss of the of BPNN-PIDsystem. Due and to the BPNN-SP-PID self-adjusting wereability more of neural stable thannetworks, PID, and the thereapproachin was almostg processes no overshoot of BPNN-PID or oscillation. and BPNN-SP-PID Second, the were more stable than PID, and there was almost no overshoot or oscillation. Second, the application of the Smith predictor could significantly improve the speed. Though BPNN- PID and BPNN-SP-PID showed good robustness, BPNN-SP-PID had a much faster reac- tion than BPNN-PID, especially at the beginning stage. This was mainly because the Smith predictor based on ANN2 could fit the system model precisely, resulting in a compensa- tion for the inherent time delay of the system. Appl. Sci. 2021, 11, 2685 12 of 18

Appl. Sci. 2021, 11, 2685 13 of 19 application of the Smith predictor could significantly improve the speed. Though BPNN- PID and BPNN-SP-PID showed good robustness, BPNN-SP-PID had a much faster reaction Appl. Sci. 2021, 11, 2685 than BPNN-PID, especially at the beginning stage. This was mainly because13 the of 19 Smith

predictor based on ANN2 could fit the system model precisely, resulting in a compensation for the inherent time delay of the system.

Figure 12. Comparison of step responses of the three controllers in the simulation.

4.1.2. SinusoidFigure 12. TrackComparison of step responses of the three controllers in the simulation. Figure 12. Comparison of step responses of the three controllers in the simulation. A sinusoidal signal with an amplitude of 20 N and frequency of 0.2 Hz was set for 4.1.2. Sinusoid Track the4.1.2. simulation, Sinusoid and Track the response curves of the three controllers were obtained, as shown in Figure 13.A sinusoidal signal with an amplitude of 20 N and frequency of 0.2 Hz was set for the A sinusoidal signal with an amplitude of 20 N and frequency of 0.2 Hz was set for Allsimulation, three controllers and the could response smoothly curves follow of the the three setting controllers curve but were had obtained, different as de- shown in the simulation, and the response curves of the three controllers were obtained, as shown grees ofFigure lag. BPNN-SP-PID 13. produced the smallest lag, followed by BPNN-PID, and the in Figure 13. worst was fromAll three the controllersPID method. could The smoothly difference follow in response the setting time curve also but brought had different about a degrees All three controllers could smoothly follow the setting curve but had different de- differenceof lag. in control BPNN-SP-PID accuracy. produced The maximum the smallest force lag,error followed of PID reached by BPNN-PID, 3.22 N, and the worst grees of lag. BPNN-SP-PID produced the smallest lag, followed by BPNN-PID, and the averagewas error from reached the PID 2.09 method. N. The The maximum difference error in responseof BPNN-PID time alsowas brought2.65 N, and about the a differenceav- worst was from the PID method. The difference in response time also brought about a erage errorin control was 1.68 accuracy. N. The The maximum maximum error force of BPNN-SP-PID error of PID reached was 2.63 3.22 N, N, and and the the average average error differencereached in 2.09control N. Theaccuracy. maximum The maximum error of BPNN-PID force error was of 2.65PID N,reached and the 3.22 average N, and error the was error was 1.59 N. average1.68 error N. The reached maximum 2.09 errorN. The of maximum BPNN-SP-PID error was of BPNN-PID 2.63 N, and was the average 2.65 N, errorand the was av- 1.59 N. It can be seen that the BPNN-SP-PID controller had the best dynamic adjustment erage errorIt was can 1.68 be seen N. The that maximum the BPNN-SP-PID error of BPNN-SP-PID controller had was the 2.63 best N, dynamicand the average adjustment performance among the three controllers. errorperformance was 1.59 N. among the three controllers. It can be seen that the BPNN-SP-PID controller had the best dynamic adjustment performance among the three controllers.

Figure 13. Comparison of sinusoid tracking response curves in the simulation. Figure 13. Comparison of sinusoid tracking response curves in the simulation.

Figure 13. Comparison of sinusoid tracking response curves in the simulation.

Appl.Appl. Sci.Sci. 20212021,, 1111,, 26852685 1414 ofof 1919 Appl. Sci. 2021, 11, 2685 13 of 18

4.2.4.2. ExperimentalExperimental ValidationValidation 4.2. Experimental Validation AA prototypeprototype ofof thethe compliantcompliant constant-forceconstant-force actuatoractuator waswas builtbuilt andand mountedmounted onon thethe A prototype of the compliant constant-force actuator was built and mounted on the robotrobot ABBABB 12001200 forfor thethe experimentexperiment asas shownshown inin FigureFigure 14.14. TheThe wholewhole experimentalexperimental plat-plat- robot ABB 1200 for the experiment as shown in Figure 14. The whole experimental platform formform mainlymainly includedincluded anan airair compressor,compressor, aa cocontrolntrol cabinet,cabinet, aa robot,robot, aa computercomputer andand thethe mainly included an air compressor, a control cabinet, a robot, a computer and the constant- constant-forceconstant-force actuatoractuator prototype.prototype. TheThe DAQDAQ boardboard (Zhongtai(Zhongtai USB7660BD)USB7660BD) inin thethe controlcontrol force actuator prototype. The DAQ board (Zhongtai USB7660BD) in the control cabinet cabinetcabinet waswas usedused forfor signalsignal inputinput andand outputoutput.. TheThe controlcontrol andand datadata acquisitionacquisition programprogram was used for signal input and output. The control and data acquisition program on the on the host computer was programmed through Labview, shown in Figure 15. The prac- hoston the computer host computer was programmed was programmed through throug Labview,h Labview, shown shown in Figure in Figure 15. The 15. practicalThe prac- tical application of the BPNN-SP-PID controller in this system was completed by the joint applicationtical application of the of BPNN-SP-PIDthe BPNN-SP-PID controller controller in thisin this system system was was completed completed by by the the joint joint compilation of Labview and MATLAB [31,32]. In order to reduce the influence of the pos- compilationcompilation ofof Labview and and MATLAB MATLAB [31,32]. [31,32]. In In order order to toreduce reduce the theinfluence influence of the of pos- the ture and the surface shape of the workpiece, the posture of the robot arm was kept vertical postureture and and the thesurface surface shape shape of the of workpiece, the workpiece, the posture the posture of the ofrobot the arm robot was arm kept was vertical kept verticalduringduring the duringthe entireentire the experiment,experiment, entire experiment, andand aa flatflat and ststeel aeel flat plateplate steel waswas plate selectedselected was selected asas thethe workpiece.workpiece. as the workpiece.

FigureFigureFigure 14. 14.14. Schematic Schematic diagramdiagramdiagram ofofof thethethe experimentalexperimentalexperimental platform. platform.platform.

FigureFigureFigure 15. 15.15. Software Software interfaceinterfaceinterface diagramdiagramdiagram in inin Labview. Labview.Labview.

4.2.1.4.2.1.4.2.1. StepStep ResponseResponse WhenWhenWhen thethethe inputinputinput waswaswas aaa stepstepstep signalsignalsignal withwithwith ananan amplitudeamplitudeamplitude ofofof 202020 N, N,N, the thethe response responseresponse curve curvecurve of ofof thethethe outputoutputoutput force forceforce obtained obtainedobtained was waswas as asas shown shownshown in inin Figure FigureFigure 16 16.16.. TheTheThe experimentalexperimentalexperimental resultsresultsresults coincidedcoincidedcoincided withwithwith the thethe simulation simulationsimulation results. results.results. The TheThe BPNN-SP-PID BPNN-SP-PIDBPNN-SP-PID controller was the fastest at the beginning stage, which needed ~30 ms of action time, controllercontroller waswas thethe fastestfastest atat thethe beginningbeginning ststage,age, whichwhich neededneeded ~30~30 msms ofof actionaction time,time, while BPNN-PID and PID took ~70 ms and ~80 ms, respectively. At the approaching stage, whilewhile BPNN-PIDBPNN-PID andand PIDPID tooktook ~70~70 msms andand ~80~80 ms,ms, respectively.respectively. AtAt thethe approachingapproaching stage,stage, BPNN-SP-PID was still the fastest to reach the set value of 20 N and to enter the ideal Appl. Sci. 2021, 11, 2685 15 of 19 Appl. Sci. 2021, 11, 2685 14 of 18

BPNN-SP-PID was still the fastest to reach the set value of 20 N and to enter the ideal range.range. The The adjustment adjustment times times of of the the BPNN-SP-PID, BPNN-SP-PID, BPNN-PID BPNN-PID and and PID PID were were 0.16 0.16 s, s, 0.46 0.46 s s andand 0.48 0.48 s, s, respectively. respectively. The threethree controllerscontrollers also also presented presented different different degrees degrees of overshoot.of over- shoot.The overshoot The overshoot of BPNN-SP-PID of BPNN-SP-PID was the was smallest, the smallest, being onlybeing 1.6%, only while1.6%, thewhile overshoots the over- of shootsBPNN-PID of BPNN-PID and PID and were PID 4.9% were and 4.9% 9.7%, and respectively. 9.7%, respectively. At the stable At stage,the stable the residualsstage, the of residualsthe three of were the differentthree were from different the ideal from scenario the ideal in the scenario simulation, in the but simulation, the steady state but errorthe steadycould state also beerror guaranteed could also to be be guaranteed within 0.2 N.to be within 0.2 N. ByBy comparison comparison with with Section Section 4.1.1, 4.1.1 ,it it can can be be found found that that the the experimental experimental results werewere a a bitbit worseworse than than the the simulation simulation due due to theto the influence influence of uncontrollable of uncontrollable nonlinear nonlinear factors factors under underthe actual the actual experiment. experiment. BPNN-SP-PID BPNN-SP-PID still presented still presented the best the performance best performance among theamong three thecontrollers three controllers in the experiment, in the experiment, which could which significantly could significantly improve the improve reaction the speed reaction while speedmaintaining while maintaining stability. stability.

FigureFigure 16. 16. ComparisonComparison of of the the step step responses responses of of three three controllers controllers in in the the experiment. experiment.

4.2.2.4.2.2. Sinusoid Sinusoid Track Track TheThe input input was was then then changed changed to to the the sinusoidal sinusoidal signal signal with with an an amplitude amplitude of of 20 20 N N and and frequencyfrequency of of 0.2 0.2 Hz, Hz, and and the the response response curve curve is shown is shown in Figure in Figure 17. The 17. data The collection data collection rate wasrate 1 wassampling/10 1 sampling/10 ms, and ms, the and total the number total number of samples of samples was 900 was in 9009 s. inThe 9 s.error The data error betweendata between the set the value set and value the and actual the actualvalue valuecollected collected in Figure in Figure 17a was 17a calculated was calculated and sta- and tisticallystatistically analyzed, analyzed, and and the theprobability probability distribution distribution of ofthe the 900 900 error error data data within within ±3± 3N N is is shownshown in in Figure Figure 17b. 17b. TheThe sinusoid sinusoid curve curve tracking tracking in the in theexperime experimentnt was wasnot as not smooth as smooth as that as in that the insim- the ulationsimulation (Figure (Figure 13), and13), andthe theresponse response curve curve fluctuated fluctuated up upand and down down around around the the target target curve.curve. Among Among the the three three controllers, controllers, the the BPNN BPNN-SP-PID-SP-PID gave gave the the smoothest smoothest response response and and thethe smallest smallest fluctuation. fluctuation. The The maximum maximum error error was was 1.88 1.88 N, N, and and the the average average error error was was only only 0.68 N. Meanwhile, the maximum errors of the BPNN-PID and PID controllers were both 0.68 N. Meanwhile, the maximum errors of the BPNN-PID and PID controllers were both above 2 N, and the average errors reached 0.74 N and 0.98 N, respectively. The force control above 2 N, and the average errors reached 0.74 N and 0.98 N, respectively. The force con- accuracy was expected to be ±1 N in some robot contact operations, such as robot grinding, trol accuracy was expected to be ±1 N in some robot contact operations, such as robot and BPNN-SP-PID could meet the requirements well. grinding, and BPNN-SP-PID could meet the requirements well. According to the histogram of the tracking errors, it can be seen that the error distribu- According to the histogram of the tracking errors, it can be seen that the error distri- tion of BPNN-SP-PID was concentrated around zero, showing better precision than the bution of BPNN-SP-PID was concentrated around zero, showing better precision than the other two controllers. The addition of the neural network and Smith predictor made the other two controllers. The addition of the neural network and Smith predictor made the control system more robust and quicker, resulting in a reduction of the tracking error. control system more robust and quicker, resulting in a reduction of the tracking error. Appl. Sci. 2021, 11, 2685 16 of 19 Appl. Sci. 2021, 11, 2685 15 of 18

(a) (b)

FigureFigure 17. 17. ComparisonComparison of actual of actual sinusoid sinusoid tracking tracking response response curves curves in inthe the experiment. experiment. (a) (Responsea) Response curves curves of the of the three three controllers.controllers. (b) (Histogramb) Histogram of the of the tracking tracking errors. errors.

4.3.4.3. Discussion Discussion TheThe specific specific indicators indicators [33] [33 of] ofthe the three three controllers controllers are are listed listed in inTable Table 3.3 . It canIt can be belearned learned that that there there were were some some gaps gaps between between the the experiment experiment and and simulation simulation results.results. First, First, the thesteady steady state state error error in the in experiment the experiment could could not be not ignored be ignored like that like in that the in simulationthe simulation because because of the envi of theronmental environmental noise, the noise, sensor the sensorerror and error other and nonlinear other nonlinear fac- torsfactors (such (suchas the as motion the motion of the of robot, the robot, air so airurce source instability instability and and cylinder cylinder friction). friction). Second, Second, somesome indicators indicators in the in theexperiment, experiment, such such as th ase settling the settling time timeand the and errors the errors of the ofsinusoid the sinu- track,soid were track, even were better even than better those than in the those simulation. in the simulation. This was mainly This was because mainly the because simula- the tionsimulation started from started the linear from theapproximation linear approximation model, while model, the experimental while the experimental model was model es- timatedwas estimated through experimental through experimental data. Despite data. this, Despite the simulation this, the simulation and experiment and experiment results bothresults showed both the showed same theresult: same the result: BPNN-S the BPNN-SP-PIDP-PID had the hadbest the performance best performance among among the threethe controllers. three controllers. BPNN-SP-PIDBPNN-SP-PID and and BPNN-PID BPNN-PID were were obviousl obviouslyy better better than than traditional traditional PID, PID, as asthe the BPNNBPNN could could adaptively adaptively adjust adjust the the PID PID parame parametersters when when dealing dealing with with the the influence influence of of nonlinearnonlinear factors. factors. The The indicator indicator of of the the ma maximumximum overshoot provedproved that that BPNN-SP-PID BPNN-SP-PID had hadthe the best best robustness. robustness. On On the the other other hand, hand, it it is is interesting interesting to to find find that that the the performance performance gap gapbetween between BPNN-SP-PID BPNN-SP-PID and and BPNN-PID BPNN-PID was was different different inin thethe stepstep responseresponse andand sinusoidsinus- oidtrack. track. InIn thethe case of the step step response response,, the the BPNN-SP-PID BPNN-SP-PID showed showed a huge a huge improvement improvement comparedcompared with with BPNN-PID. BPNN-PID. The The maximum maximum over overshootshoot and and settling settling time time of ofBPNN-SP-PID BPNN-SP-PID werewere reduced reduced by by68% 68% and and 65% 65% in inthe the experiment experiment,, respectively. respectively. In Inthe the case case of ofthe the sinusoid sinusoid track,track, however, however, the the BPNN-SP-PID BPNN-SP-PID was was just just a litter a litter better better than than the the BPNN-PID BPNN-PID controller. controller. TheThe maximum maximum error error and and average average error error of the of the BPNN-SP-PID BPNN-SP-PID were were only only reduced reduced by by9% 9% and and 8%8% in the in the experiment, experiment, respectively. respectively. The The reason reason for for this this was was probably probably that that the the setting setting force force in inthe the sinusoid sinusoid track track process process was was time-varying, time-varying, which which would would partially partially affect affect the the fitting fitting precisionprecision of ofthe the Smith Smith predictor predictor and and weaken weaken the the effect effect of ofit. it.A potential A potential solution solution is adding is adding a neurala neural network network identifier identifier to toupdate update the the AN ANN2N2 to to further further enhance enhance the the matching matching degree of of the theoretical model and the actual one.

Appl. Sci. 2021, 11, 2685 16 of 18

Table 3. Comparison of overall performance indicators of three controllers.

Performance Indicators of Three Controllers Type PID BPNN-PID BPNN-SP-PID Simulation Step response Steady-state error (N) ~0 ~0 ~0 Settling time1 (s) 0.76 0.76 0.59 Maximum overshoot (%) 6.10 0.45 0.15 Sinusoid track Maximum error (N) 3.22 2.65 2.63 Average error (N) 2.09 1.68 1.59 Experiment Step response Steady-state error (N) 0.18 0.12 0.12 Settling time1 (s) 0.48 0.46 0.16 Maximum overshoot (%) 9.70 4.90 1.56 Sinusoid track Maximum error (N) 2.70 2.06 1.88 Average error (N) 0.98 0.74 0.68 1 The minimum time required for the system response to reach and maintain a value within 5% of the final value.

5. Conclusions Aiming at the nonlinearity and time delay of pneumatic constant force actuators, this paper proposes an improved PID control method combining a BPNN and the Smith predictor. An on-line BPNN ANN1 is used for adjusting the PID coefficients intelligently, which can enhance the robustness of a nonlinear system. The Smith predictor, with the aid of off-line neutral network ANN2, compensates the pure time delay, which can improve the adjustment speed of the system. The simulation and experiment results both showed that the BPNN-SP-PID control method was feasible and superior compared with the traditional PID controller. The matching error between the theoretical model and the actual model is concerned with the control performance. In a simulation, Smith predictor can compensate almost all of the time delay. In practical applications, the posture of the actuator is time-varying, and the system model will also change accordingly. As the offline ANN2 cannot fully fit the time-varying nonlinear system, the time delay compensation effect is not as good as that found in simulation. Adding a neural network identifier to update ANN2 will be beneficial for identifying the actual model in time so that the adaptability of the controller will be stronger. This will be the focus of future work.

Author Contributions: H.L. (Hui Lin) contributed to the main idea of this paper; G.P. performed the simulation and experiments, analyzed the data and wrote the paper; Y.X. and F.C. helped to build the prototype; M.Y. and H.L. (Houhu Lai) helped to design the data acquisition code; C.M. and H.L. (Hui Lin) reviewed and edited the paper. All authors have read and agreed to the published version of the manuscript. Funding: The presented work was supported by the following grants: National Natural Science Foundation of China Grant No. U1713210 and Shenzhen Fundamental Research Program Grant No. JCYJ20170818163928953. Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable. Data Availability Statement: Data sharing not applicable. Conflicts of Interest: The authors declare no conflict of interest. Appl. Sci. 2021, 11, 2685 17 of 18

References 1. Berg, A.; Buffie, E.F.; Zanna, L.F. Should We Fear the Robot Revolution? (The Correct Answer is Yes). J. Monet. Econ. 2018, 97, 117–148. [CrossRef] 2. Zhang, X.; Chen, H.; Yang, N. A structure and control design of constant force polishing end actuator based on polishing robot. In Proceedings of the 2017 IEEE International Conference on Information and Automation (ICIA), Macau, China, 18–20 July 2017; pp. 764–768. 3. Liu, M.H.; Tolle, H. Force-Controlled Robotic Deburring. IFAC Proc. Vol. 1993, 26, 855–858. [CrossRef] 4. Jin, M.; Ji, S.; Pan, Y.; Ao, H.; Han, S. Effect of downward depth and inflation pressure on contact force of gasbag polishing. Precis. Eng. J. Int. Soc. Precis. Eng. Nanotechnol. 2017, 47, 81–89. [CrossRef] 5. Mohammad, A.E.K.; Hong, J.; Wang, D. Design of a force-controlled end-effector with low-inertia effect for robotic polishing using macro-mini robot approach. Robot. Comput. Integr. Manuf. 2018, 49, 54–65. [CrossRef] 6. Rouzbeh, B.; Bone, G.M. Optimal Force Allocation and Control of Hybrid Pneumatic–Electric Linear Actuators. Actuators 2020, 9, 86. [CrossRef] 7. Naderer, R.; Ferrara, P.; Rohrhofer, A. Active Handling Apparatus and Method for Contact Tasks. U.S. Patent 9,375,840, 28 June 2016. 8. Ning, F.; Shi, Y.; Cai, M.; Wang, Y.; Xu, W. Research Progress of Related Technologies of Electric-Pneumatic Pressure Proportional Valves. Appl. Sci. 2017, 7, 1074. [CrossRef] 9. Ben-Dov, D.; Salcudean, S.E. A force-controlled pneumatic actuator. Int. Conf. Robot. Autom. 1995, 11, 906–911. [CrossRef] 10. Liu, S.; Wang, F.; Zhang, G.; Liu, Z.; Zhang, W.; Tian, Y.; Zhang, D. A Novel Dual-Drive Soft Pneumatic Actuator with the Improved Output Force. In Proceedings of the International Conference on Intelligent Robotics and Applications, Shenyang, China, 8–11 August 2019; pp. 16–25. 11. Robinson, R.M.; Kothera, C.S.; Sanner, R.M.; Wereley, N.M. Nonlinear Control of Robotic Manipulators Driven by Pneumatic Artificial Muscles. IEEE-ASME Trans. Mechatron. 2016, 21, 55–68. [CrossRef] 12. Liu, Y.; Zhang, Y.; Xu, Q. Design and Control of a Novel Compliant Constant-Force Gripper Based on Buckled Fixed-Guided Beams. IEEE-ASME Trans. Mechatron. 2017, 22, 476–486. [CrossRef] 13. Joo, S.; Waki, H.; Miyazaki, F. On the mechanics of elastomer shear pads for remote center compliance (RCC). In Proceedings of the IEEE International Conference on Robotics and Automation, Minneapolis, MN, USA, 22–28 April 1996; Volume 9, pp. 291–298. 14. Fan, J.; Zhong, J.; Zhao, J.; Zhu, Y. BP neural network tuned PID controller for position tracking of a pneumatic artificial muscle. Technol. Health Care 2015, 23, S231–S238. [CrossRef] 15. Guoku, L.; Quanlin, D.; Meilin, S. Design of Control System of Pneumatic Regulating Valves Based on STM32. In Proceedings of the 2018 IEEE 4th International Conference on Control Science and Systems Engineering (ICCSSE), Wuhan, China, 21–23 August 2018. 16. Hägglund, T. A friction compensator for pneumatic control valves. J. 2002, 12, 897–904. [CrossRef] 17. Kang, J.; Meng, W.; Abraham, A.; Liu, H. An adaptive PID neural network for complex nonlinear system control. Neurocomputing 2014, 135, 79–85. [CrossRef] 18. Zhao, D.; Sun, C.; Wang, Q.; Yang, W. Neural Network Based PID Control for Quadrotor Aircraft. In IScIDE 2015, Proceedings of the 5th International Conference on Intelligence Science and Big Data Engineering, Suzhou, China, 14–16 June 2015; Big Data and Machine Learning Techniques; Springer: Berlin/Heidelberg, Germany, 2015; Volume 9243, pp. 287–297. 19. Cheng, F.; Fan, K.-C.; Miao, J.; Li, B.-K.; Wang, H.-Y. A BPNN-PID based long-stroke nanopositioning control scheme driven by ultrasonic motor. Precis. Eng. J. Int. Soc. Precis. Eng. Nanotechnol. 2012, 36, 485–493. [CrossRef] 20. Milovanovi´c,M.B.; Anti´c,D.S.; Milojkovi´c,M.T.; Nikoli´c,S.S.; Peri´c,S.L.; Spasi´c,M.D. Adaptive PID control based on orthogonal endocrine neural networks. Neural Netw. 2016, 84, 80–90. [CrossRef][PubMed] 21. Fan, C.; Hong, G.S.; Zhao, J.; Zhang, L.; Zhao, J.; Sun, L. The integral sliding mode control of a pneumatic force servo for the polishing process. Precis. Eng. J. Int. Soc. Precis. Eng. Nanotechnol. 2019, 55, 154–170. [CrossRef] 22. Edjekouane, E.; Riachy, S.; Ghanes, M.; Barbot, J.-P. Homogeneous Control of Pneumatic Cylinders Based on Time Delay Model and Artstein Transformation. Asian J. Control 2017, 19, 792–798. [CrossRef] 23. Guo, F.; Yu, W.; Huang, F. Robustness with respect to small delays for exponential stability of non-autonomous systems. J. Math. Anal. Appl. 2003, 288, 671–679. [CrossRef] 24. Feng, D.-M.; Pan, F.; Han, R.-C. Improved self-adaptive Smith predictive control scheme for time-delay system. In Proceedings of the International Conference on Machine Learning and Cybernetics, Beijing, China, 4–5 November 2002; Volume 1, pp. 463–466. 25. Dehghani, A.; Khodadadi, H. Designing a neuro-fuzzy PID controller based on smith predictor for heating system. In Proceedings of the 2017 17th International Conference on Control, Automation and Systems (ICCAS), Jeju, Korea, 18–21 October 2017; pp. 15–20. 26. Özbek, N.S.; Eker, I.˙ Design of an optimal fractional fuzzy gain-scheduled Smith Predictor for a time-delay process with experimental application. ISA Trans. 2020, 97, 14–35. [CrossRef][PubMed] 27. Fliess, M.; Marquez, R.; Mounier, H. An extension of predictive control, PID regulators and Smith predictors to some linear delay systems. Int. J. Control 2002, 75, 728–743. [CrossRef] 28. Parr, A. Hydraulics and Pneumatics. Plast. Syst. Eng. 1999, 4, 85–124. Appl. Sci. 2021, 11, 2685 18 of 18

29. Abo-Elmagd, M.; Sadek, A.M. Development of a model using the MATLAB System identification toolbox to estimate 222Rn equilibrium factor from CR-39 based passive measurements. J. Environ. Radioact. 2014, 138, 33–37. [CrossRef][PubMed] 30. Hecht-Nielsen, R. Theory of the backpropagation neural network. In Proceedings of the International 1989 Joint Conference on Neural Networks, Washington, DC, USA, 1 February 1989; pp. 593–605. 31. Somwanshi, D.; Bundele, M.; Kumar, G.; Parashar, G. Comparison of Fuzzy-PID and PID Controller for Speed Control of DC Motor using LabVIEW. Procedia Comput. Sci. 2019, 152, 252–260. [CrossRef] 32. National Instruments. LabVIEW User Manual [Z]; National Instruments: Austin, TX, USA, 1998. 33. Dorf, R.C.; Sinha, N.K. Modern control systems. IEEE Trans. Syst. Man Cybern. 1981, 11, 580. [CrossRef]