Research Journal of Recent Sciences _________________________________________________ ISSN 2277-2502 Vol. 2(11), 50-54, November (2013) Res.J.Recent Sci. International Science Congress Association 50 PID Controller for Robotic Manipulator Nonlinear Model and Compare with Sliding Mode ControllerHashemipour S.H., Ghoreishi A., Mahdavinasab S.M.1 and Moghaddasi M.N.3 Department of Electrical Engineering, Young Researcher Club, Roudsar and Amlash Branch, Islamic Azad University, Roudsar, IRAN Department of Electrical Engineering, South Tehran Branch, Islamic Azad University, Tehran, IRAN Department of Electrical Engineering, Sciences and Research Branch, Islamic Azad University, Tehran, IRANAvailable online at: www.isca.in , www.isca.me Received 11th April 2013, revised 12th May 2013, accepted 12th June 2013Abstract In this paper, the nonlinear model of the robotic manipulator has been chosen as the model to be studied. Nowadays, complicated controllers are commonly discussed in many researches. In this work, it will be shown that a simple, practical PID controller operates much better than a robust and nonlinear sliding mode controller in the aforesaid system. Simulation results and the comparison of these two controllers prove this claim to be true. Finally, a robust analysis has been done by which the resistance of these controllers is assessed. Keywords: Robotic manipulator; sliding mode, PID controller. Introduction Control of robotic trajectory is a very sophisticated problem because of its coupled and nonlinear structure for system dynamics. Also, when a robotic manipulator does the required operations at high speed, some things may cause a large system error1,2. These things are the effects of nonlinear properties, time variant coefficients and other unknown events, such as backlash, friction, etc. one of the most important works is related to finding an effective controller to attain accurate tracking of the desired motion. There are many algorithms for robot trajectory control, such as fuzzy control, neural network, sliding modeand robust control. Sliding mode control acts as a robust strategy. It has applied in different areas, such as power converters, aerospace, robotics and industrial process. In sliding mode control, all trajectories that exist in the state space are directed toward the sliding surface. Upon the reaching of system state to the sliding surface, it slides along it and the system will have no sensitivity to a group of disturbances and parameter variations. It must be mentioned that a traditional sliding mode control have some drawbacks in practical motion control. The first problem is related to obtain the system parameters. It will be difficult. In Neuro-Sliding, two neural networks are used in parallel to calculate the equivalent control and also the correct control of the sliding mode. It can be seen from robust control that a neural network is used for achieving the uncertainty related to a robust control system. The second drawback is the high frequency oscillation in the control input. This problem that exists always is called “chattering”. Oscillations are generated by the required high speed switching. The “chattering” can excite no modeled high frequency plant dynamics; therefore, it can cause unpredictable instabilities. For these reasons, chattering is not desirable in many real applications. A simple way to overcome the chattering is to consider a boundary layerbut it does not ensure that the state trajectories of system converge to the sliding surface. This situation may results the existence of the steady state error. Also, the system dynamics analysis in the boundary layer is very difficult. In order to eliminate the chattering10 use the auto-tuning neuron as the direct adaptive neural controller. When the state trajectory of system goes into the boundary layer, this neuron replaces the sliding mode control. In this paper, a simple and commonly used PID controller has been applied to control the dynamic robotic manipulator and obtained results are compared with those of the nonlinear sliding mode controller. It is obvious that applying a PID controller is practically quite simple and of low cost. In fact, this paper discusses that PID controllers can be effective in many complicated and nonlinear systems. Always, using controllers with different and complicated structures, whose disassembling would cause huge problems, is not a solution for controlling systems. This paper is organized as follows. Section 2 describes the robot dynamics and some of its fundamental properties and the problem statement. In section 3, the design and analysis of the controller is presented. The simulation results of the two link manipulator are given in section 4 and finally the conclusion is in section 5. Dynamic of Robotic ManipulatorThe dynamic equation of an n -link robotic manipulator is ()(,)()MqqCqqqGq t ++=  (1) Research Journal of Recent Sciences ______________________________________________________________ ISSN 2277-2502Vol. 2(11), 50-54, November (2013) Res. J. Recent Sci. International Science Congress Association 51 Where joint position vector, q  joint velocity vector, q  joint acceleration vector, M (q) inertia matrix, (,) Cqq  matrix of centripetal and Coriolis forces, G (q) the gravity vector, t the motor torque vector. This matrix is as follow 1 ,11. 222 121222122222122 222212222111()coscos444()11cos44 mmlmlmllqmlmllq Mqmlmllqml  ++++  =   +   2122221222 21212sinsin()sin0 mllqqmllqq Cqmllqq  --  =      (2) 12112212221211 ()coscos() 22()cos() mmglqmlgqq Gqmlgqq  +++  =   +   Where l and l are the lengths; m and m are the mass of the links, respectively. Figure-1 shows the geometric structure of a manipulator with two links. Figure-1 Two-link robotic manipulator The dynamics of a robotic manipulator has five properties as follows11: i. Symmetric and positive definite M=M. ii. The parameter M (q) is bounded, i.e., 12 (q)IM(q)(q)I m££m , where () q m and () q m are scalars. For revolute links, they are constants. I is an identical matrix. iii. Matrix 2 MC is skew symmetric, i.e., for any vector X, X(M2C)X0. -= iv. (,) Cqqq  is quadratic q  to and bounded as 2 3 C(q,q)q(q)q £m  ,where , () q m is a scalar constant for revolute links. v. The gravity vector G is bounded as 4 G(q)(q) £m, where () q m is a scalar constant for revolute links. It is independent of q. Design ControllerSliding Mode: Sliding mode control is a tracking method. The purpose of this paper is track the reference signal by robotic manipulator. Therefore, error is defined as follows: d qqq =- (3)Where q  is tracking error and d q is reference signal. The dynamic equations of the robot arm are of two orders; hence sliding surfaces are defined as follows. 1 (,) Sxtx dt=+ \n  Where n=2 and Sqq l =+  According to the sliding mode method 0 S = and control law is derived as follows. dd Sqqqqqq lll =+=-+-  To derive the control law expression of the matrix M is multiplied on both sides. () dd MSMqMqMqq =-+-  If the system parameters are constant values, then 0. MS = therefore, using equation (1) control law is: (,)()() eqdd CqqqGqMqMqq tl=++--  Since the operating system parameters are not constant and change, Sliding mode method was chosen for this system. for change the parameters of the sliding mode controllers have good resistance, sign function is added to the control law. Hence ()() eq SKsignsKsigns tt=-=- (9)For investigate the stability of the system is chosen Lyapunov function as below: 2 1 2 Vs The derivative of V is 111 ()(())0,0 222 Vsssksignsskifk ==-=-&#x-323;.58; Therefore, system stability is guaranteed. PID controller: To design a PID controller, it has been tried so that the tracking error would be minimized and system output could reach a desired level. Setting PID controller parameters has been done through the trial and error method. The controlling block of this system is shown in figure-2. (4) (5) (6) (7) (8) (10) (11) Research Journal of Recent Sciences ______________________________________________________________ ISSN 2277-2502Vol. 2(11), 50-54, November (2013) Res. J. Recent Sci. International Science Congress Association 52 Figure-2 PID Controller Schematic In this paper, two parallel PID controllers have been used to control the nonlinear dynamic of the robotic manipulator. Results and Discussion Dynamic model of the robotic manipulator is shown in figure-1. Values of model parameters and initial conditions are as follows 11. 12121212 4,2,2,1,9.8/, (0)0.5,(0)0.5,(0)0,(0)0. mkgmkglmlmgms qqqq========= The purpose of this paper is track the reference signal by controlling the robot arm. Reference signal is [1.5sin(2/3)2sin(2/3)] T d qtt pp (12) For simulation, a friction vector is considered, too. Hence, system model was considered as follows. ()(,)()() MqqCqqqGqFq t +++=  (13) Where [ ] 1122 ()200.8sgn()40.16sgn() T Fqqqqq=++ (14) To show the capability Controller is designed, an external disturbance D (t) is also considered. Despite disturbance, simulations have been performed. Disturbance equation is ()[560sin85sin] T Dttt (15) In figure-3 position robot with reference signal and torque applied to robotic manipulator is demonstrated by applying the sliding mode controller. Chattering phenomenon in torque applied to the robotic manipulator clearly exists in this case. Figure-3a Position first joint robot by sliding mode control Figure-3b Position second joint robot by sliding mode control 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -1.5 -1 -0.5 0 0.5 1 1.5 2 timeangular position 1 Sliding mode Refrence 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 timeangular position 2 Sliding mode Refrence q Error + + - + d PID Controller Dynamic Robot Manipulator Disturbance Research Journal of Recent Sciences ______________________________________________________________ ISSN 2277-2502Vol. 2(11), 50-54, November (2013) Res. J. Recent Sci. International Science Congress Association 53 Figure-3c Torque first joint robot by sliding mode control Figure-3d Torque second joint robot by sliding mode control In figures-4a and 4b, the position of the robotic manipulator is shown using a PID controller and the reference signal. It can be noticed that tracking has been done quite well and the PID controller has operated successfully. In 4c and 4d figures, the robotic manipulator applied torque is shown where no chattering of the sliding mode controller is observed. Figure-5 shows the robust analysis. The mass of the robotic manipulator varies by m=10. Simulation results indicate that besides its good tracking performance, PID controller is resistant to the variation of parameters. Table 2 shows the sum of tracking error squares and the applied torque energy of the robotic manipulator. Also, this table shows the superiority of the PID controller over the sliding mode controller. Figure-4a Position first joint robot by PID controller Figure-4b Position second joint robot by PID controller Figure-4c Torque joint first robot by PID controller 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -1500 -1000 -500 0 500 1000 1500 2000 timeTorques 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -600 -400 -200 0 200 400 600 800 timeTorques 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 timeangular position1 PID Refrence 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 timeangular position2 PID Refrence 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -2.5 -2 -1.5 -1 -0.5 0 0.5 x 10 timeTorques1 Research Journal of Recent Sciences ______________________________________________________________ ISSN 2277-2502Vol. 2(11), 50-54, November (2013) Res. J. Recent Sci. International Science Congress Association 54 Figure-4d Torque joint second robot by PID controller Figure-5a Position first joint robot (robustness analyze) Figure-5b Position second joint robot (robustness analyze) ConclusionIn this paper, a PID controller was designed for the nonlinear model of the robotic manipulator. Performance results of this controller were compared with the sliding mode controller. Besides the fact that PID controller has performed quite well in tracking, no chattering, which is the issue in sliding mode controllers, was observed. In fact, this paper indicates that it’s not always beneficial to search for complicated controllers with different combinations. Instead, many systems can be controlled by a simple controller and expected to show an acceptable behavior. Table-2 Sum of error squares and applied torque energy of the robotic manipulator in PID and sliding mode controllers Second joint Torque First joint Torque Second joint Error First joint Error 1.1162e9 1.6106e9 2.8178 6.7227 PID Controller 3.938e9 1.6127e10 46.7418 290.9145 Sliding Mode References1.Hashemipour S.H., Karimi H. and Adeli A., Neural Network MLP with Sliding Mode Controller for Robotic Manipulator, J. Basic. Appl. Sci. Res., 512- 520 (2013)2.Liangyong Wang, Tianyou Chai and Chunyu Yang, Neural-Network-Based Contouring Control for RoboticManipulators in Operational Space, IEEE Trans. Control Systems Technology,20, 1073–1080 (2012)3.Wakilah B.A.M. and Gill K.F., Robot control using self-organizing fuzzy logic, Computation Industry, 15(3), 175-186 (1990)4.Yaonan Wang, Self-learning Controller Based On Neural Networks for Robotic Manipulator, Journal of Automation, 23(5), 335-340 (1997)5.Q.P. Ha et al., Fuzzy Sliding-Mode Controllers with Applications, IEEE Trans. Ind. Electron, 48(1), 38-46 (2001)6.Wei Sun, The Researches of Intelligent Neural Network Theories and Their Applications on Robot Control, Changsha: Hunan University (2002)7.Yueming Hu, Theory of Variable Structure Control and its applications, Beijing: Technology Press (2003)8.Tsai C.H., Chung H.Y. and Yu F.M., Neuro-Sliding Mode Control with Its Applications to Seesaw Systems, IEEE Trans Neural Networks, 15(1), 124-134 (2004)9.Yeung K.S. and Chen Y.P., A New Controller Design for Manipulators Using the Theory of Variable Structure Systems, IEEE Trans. Automat. Control, 33(2), 200-209 (1988)10.Chang W.D., Hwang R.C. and Hsieh J.G., Application of an Auto-Tuning Neuron to Sliding Mode Control, IEEE Trans. Syst., Man, Cybern, 32(4), 517-522 (2002)11.Hung-Ching Lu, Cheng-Hung Tsai, Ming-Hung Chang, Radial basis function neural network with sliding mode control for robotic manipulators, International IEEE Conference on Systems Man and Cybernetics (SMC) (2010) 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -10000 -8000 -6000 -4000 -2000 0 2000 4000 timeTorques2 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 timeangular position1 PID sliding Mode Refrence 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 timeangular position2 PID Sliding Mode Refrence