Journal of the Korean Society of Manufacturing Technology Engineers 22:5 (2013) 837~844

http://dx.doi.org/10.7735/ksmte.2013.22.5.837 ISSN 2233-6036

Control of a Rotary Inverted Pendulum System Using Brain Emotional Learning Based Intelligent Controller Jae-Won Kima, Chae-Youn Ohb*

BELBIC을 이용한 Rotary Inverted Pendulum 제어

김재원a, 오재윤b*

a Department of Bio-Nano System Engineering, Chonbuk National University, 664-14 1-Ga, Deokjin-Dong, Deokjin-Gu, Jeonju, Jeonbuk, 561-756, Republic of Korea b Division of Mechanical System Engineering, Chonbuk National University, 664-14 1-Ga, Deokjin-Dong, Deokjin-Gu, Jeonju, Jeonbuk, 561-756, Republic of Korea

ARTICLE INFO ABSTRACT

Article history: This study performs erection of a pendulum hanging at a free end of an Received 15 April 2013 arm by rotating the arm to the upright position. A mathematical model of Revised 12 July 2013 a rotary inverted pendulum system (RIPS) is derived. A brain emotional Accepted 23 September 2013 learning based intelligent controller (BELBIC) is designed and used as a controller for swinging up and balancing the pendulum of the RIPS. In Keywords: simulations performed in the study, a pendulum is initially inclined at 45° BELBIC (Brain Emotional Learning Based with respect to the upright position. A simulation is also performed for Intelligent Controller) evaluating the adaptiveness of the designed BELBIC in the case of system RIPS (Rotary Inverted Pendulum System) variation. In addition, a simulation is performed for evaluating the robustness SI (Sensory Input) of the designed BELBIC against a disturbance in the control input. ES (Emotional Signal) End mass Adaptiveness Robustness

1. Introduction swings the pendulum to erect it upward position. Control problem of a RIPS is composed of two processes. One process A rotary inverted pendulum System (RIPS) is composed of is to swing a pendulum for erecting upward position. The other three parts; motor, arm, and pendulum. The pendulum is hanging process is to balance the pendulum at upright position. In a at free end of arm. The pendulum sways in a vertical plane RIPS, since upright position of the pendulum is naturally by kinetic energy which is generated by rotational movement unstable, control for raising the pendulum to upward position, of the arm. The arm is connected to the shaft of the motor, and then balancing the pendulum by rotating the arm from rotates in a horizontal plane with the shaft of the motor, and downward position of the pendulum which is naturally stable

* Corresponding author. Tel.: +82-63-270-2377 Fax: +82-63-270-2388 E-mail address: [email protected] (Chae-Youn Oh).

837 Jae-Won Kim, Chae-Youn Oh

is difficult. In addition, what makes control of a RIPS difficult basically is that a RIPS is a nonminimum system as well as an underactuated system which has more joint than actuator. A RIPS has been utilized as a test-bed for evaluating an efficiency and effectiveness of a new control scheme. [1,2] Control schemes based on linearization have been proposed for RIPS control. Linear controllers are simple to design. However, they can be applied for RIPS control only in the vicinity of an operating point. In order to overcome the shortcoming inherent in linear controllers, a variety of nonlinear control schemes such as gradient-based nonlinear model [3] [4,5] [6] Fig. 1 Schematic diagram of an inverted pendulum system predictive control , genetic , and fuzzy control have been studied for RIPS control. However, those nonlinear control schemes have difficulties 2. Modeling of a rotary inverted pendulum system finding control rules which exhibit the highest levels of [7-10] performance. Hybrid control schemes which combine A RIPS considered in this paper connects an arm with a motor merits of a linear control (PD (Proportional-Derivative), PID shaft, and connects a pendulum at free end of the arm as shown (Proportional-Integral-Derivative) or LQR (Linear Quadratic in Fig. 1. Forces N and P given in Equations (1) and (2) Regulation) controller) and nonlinear control scheme (Fuzzy respectively are forces acting at a joint connecting the pendulum or neural Network controller) have been proposed. However, and rotating arm. They are given by following two equations. those hybrid controllers show difficulties to cope with parameter    variations and external disturbances.   ′  ′sin ′cos (1) One of intelligent controllers which attracts attention recently is Brain Emotional Learning Based Intelligent Controller     ′ ′ ′cos  ′sin (2) (BELBIC). BELBIC is a controller which describes inter- relationship of 's major organs such as Amygdala, In Eqs. (1) and (2), α represents a rotational position of the (OFC), Thalamus, and Sensory cortex arm, and θ represents a rotational position of the pendulum. mathematically to mimic emotional learning process of a [11,12] r is a length of the arm, lp is a length from a joint to the mass mammal . BELBIC is easy to implement, is able to apply center of the pendulum, and 2lp is a length of the pendulum. for a real time control because of less computational load, and mp is a mass of the pendulum, and me is a mass of an additional shows a good robustness and adaptiveness. BELBIC was applied mass (called end mass) attached at the end of the pendulum. to variety systems not only which can be described as a linear   [11,13]      model but also which have a large nonlinearity and various In addition, ′  , and ′ . If we apply   [14,15] conditions . Until now, a study using BELBIC for control Newton's law to the RIPS, we derive the equations of motion a RIPS has not been reported in the literature. of the RIPS as follows. This paper derives a mathematical model of a RIPS, and designs BELBIC as a controller for control the arm and pendulum        (3) of a RIPS. A simulation for evaluating adaptiveness of developed BELBIC for a system variation is performed. In addition, a   ′ cos ′ sin    (4) simulation for evaluating robustness of developed BELBIC for     disturbance of control input is performed. In Eqs. (3) and (4), Jp is a mass moment of the pendulum,

838 Journal of the Korean Society of Manufacturing Technology Engineers 22:5 (2013) 837~844

and Ja is a mass moment of the arm. T is a torque generated Ra is an electric resistance of the motor, Kt is a torque constant, by the deriving motor. cp and ca are damping coefficients of and Kb is a back electromotive force constant. Table 1 shows the joint and the motor respectively. If Eqs. (3) and (4) are dimensions and descriptions of parameters for RIPS considered  rearranged with respect to  and , the equations of motion in this paper. of the RIPS are represented by the following Equations. 3. BELBIC      ′′ ′ ′ sin ′′                     ′  ′′  ′′cos  This paper performs a study on erecting a pendulum hanging ′ ′ cos′ ′  sin          at a free end of an arm by rotating an arm to upright position  ′  ′′ ′′cos        using BELBIC. Control inputs of BELBIC are sensory input (SI), and internal reward signal. SI is induced by external sensory  ′ ′ cos   ′′sincos organ's output against stimuli. Reward signal is a emotional                ′  ′′  ′′cos  learning value, and also called as emotional signal (ES). BELBIC ′ ′ sin    ′  [11]       was described in discrete form as follows .         ′  ′′  ′′cos 

   ×  (8) A torque generated by the driving motor is represented by the following equation.     ×  (9)

                         ∆ × × max    (10)     (7)    

In Eq. (7), n is a gear ratio of the motor, V is an input voltage, ∆   × ×      (11)  

Table 1 Dimensions and descriptions of parameters for RIPS

    (12) Parameter Value Unit Description   mp 0.1 kg Mass of the pendulum

me - kg Mass of the end mass Eqs. (8) and (9) are output of amygdala (Ai) and OFC (OCi) r 0.19 m Length of the arm respectively. In Eq. (9), GOCi is a gain of OFC, and SI is sensory Length from a joint to the lp 0.203 m OFC mass center of the pendulum input. Output of represented by Eq. (9) performs a role 2 Ja 0.0108 Nm Mass moment of the arm to regulate output of amygdala. In Eq. (10), we can see that

2 Mass moment of the GAi, gain of amygdala, always increases monotonically. It is Jp 0.005 Nm pendulum very close to the fact that emotional value of mammalian limbic Kt 0.0302 Nm/A Torque constant of the motor system's amygdala increases against input stimuli, and then is Back electromotive force Kb 0.0301 Vsec/rad delivered. In the equation, ES represents emotional signal. Eqs. constant of the motor G G Electric resistance of the (10) and (11) are used for update Ai and OCi respectively. Ra 0.316 Ω motor In Eqs. (10) and (11), α and β represent learning rates. They n 15 - Gear ratio of the motor are generally assigned to the same value. Otherwise, a bigger Damping coefficients of the α MO cp 0.0777 Nmsec/rad value is assigned to . The control effort of BELBIC, is pendulum joint represented by Eq. (12), and is a difference of amygdala output Damping coefficients of the ca 0.61 Nmsec/rad OFC motor and output. BELBIC described in discrete form has a 2 g 9.8 m/sec Acceleration of gravity shortcoming that it acts discontinuously against stimuli.

839 Jae-Won Kim, Chae-Youn Oh

BELBIC was described in the form of differential equations     (18) in order to make it possible to apply BELBIC to a continuous [16] system . Since maximum operator has little effect on     (19) simulation results in a continuous system, we remove maximum operator in Eq. (10) for simplicity. BELBIC can be described As Eq. (18) shows, SI value is computed by summing angular in the form of differential equations as follows. position error of a pendulum multiplied by -K1 and angular

position error of an arm multiplied by -K2. Since angular position   ×  (13) error of a pendulum is more influential over unstability of a RIPS than angular position error of an arm, we assigned a bigger    ×  (14) value to K1 than K2. ES representing emotional learning is defined by Eq. (19) which is a form similar to PI (Proportional-Integral)    ×     (15) controller.

 4. Simulation   ×       (16) Simulations for erecting a pendulum of a RIPS to upright      (17) position with BELBIC were performed. Simulations were

Fig. 2 Simulink block diagram for RIPS simulation

Fig. 3 BELBIC controller block diagram for RIPS simulation

840 Journal of the Korean Society of Manufacturing Technology Engineers 22:5 (2013) 837~844

(a) Angular displacement of pendulum (b) Angular displacement of arm

(c) BELBIC output (d) Amygdala and OFC output Fig. 4 Simulation results of RIPS in case of not attaching an end mass

(a) Angular displacement of pendulum (b) Angular displacement of arm

(c) BELBIC output (d) Amygdala and OFC output Fig. 5 Simulation results of RIPS in case of attaching an end mass

841 Jae-Won Kim, Chae-Youn Oh

variation of defined BELBIC. Finally, we performed a simulation with a motor control input disturbed by a noise in order to evaluate robustness against external disturbance of defined BELBIC. Figs. 4 show results of the simulation performed with a pendulum not attached an end mass. As Fig. 4(a) shows, a big control input was applied to the motor at the very beginning of simulation. The big control input rotated the arm toward the inclined pendulum drastically to erect the pendulum upright

Fig. 6 Noise added to BELBIC output position. Then, after the arm wagged twice, the pendulum balanced at upright position. The pendulum was reached at a [17] performed with MATLAB Simulink . Fig. 2 and 3 shows steady state in around 5 seconds. a block diagram composed with MATLAB Simulink, and used In order to show adaptiveness of BELBIC, a simulation was for simulations. performed with a pendulum attached an end mass, and with In simulations performed in this paper, a pendulum was BELBIC used in the above simulation. The end mass has a inclined 45° with respect to upright position initially. Five weight of half of the pendulum. Figs. 5 show simulation results. coefficients required for design BELBIC were found by trial As Figs. 5 show, the pendulum and arm reached in a steady and error method, and set to K1=200, K2=20, K3=10, α=100 state after they wagged one and half. The pendulum reached and β=90. First, we performed a simulation with a pendulum in a steady state faster in the simulation performed with an at which an end mass was not attached at the end the pendulum. end mass than in the simulation performed without an end mass. Then, we performed a simulation with a pendulum attached The faster stabilization was resulted because the end mass played an end mass in order to evaluate adaptiveness against a system a role as a stabilizing weight.

(a) Angular displacement of pendulum (b) Angular displacement of arm

(c) BELBIC output (d) Amygdala and OFC output Fig. 7 Simulation results of RIPS in case of adding a noise

842 Journal of the Korean Society of Manufacturing Technology Engineers 22:5 (2013) 837~844

In order to show adaptiveness of BELBIC, a simulation was and β=90. In simulations performed in this paper, a pendulum performed with a pendulum attached an end mass, and with was inclined 45° with respect to upright position initially. In BELBIC used in the above simulation. The end mass has a the simulation performed with a pendulum not attached an end weight of half of the pendulum. Figs. 5 show simulation results. mass, the pendulum reached at a steady state in around 5 seconds. As Figs. 5 show, the pendulum and arm reached in a steady A simulation was performed with a pendulum attached an end state after they wagged one and half. The pendulum reached mass, and with BELBIC used in the above simulation. The in a steady state faster in the simulation performed with an pendulum reached in a steady state faster in the simulation end mass than in the simulation performed without an end mass. performed with an end mass than in the simulation performed The faster stabilization was resulted because the end mass played without an end mass. However, control input showed a a role as a stabilizing weight. continuous chattering for balancing the pendulum at upright In order to show robustness of BELBIC, a simulation was position after the pendulum reached in a steady state. In addition, performed with motor control input in which a noise was added a simulation was performed with motor control input in which as external disturbance, and with BELBIC used in the above a noise was added as external disturbance, and with BELBIC simulations. A pendulum with an end mass was used in the used in the above simulations. BELBIC controlled the arm and simulation. A noise added to motor control input was generated pendulum stably regardless of added noise. In spite of adding by combining a sinusoidal wave having a period of 0.5Hz and a noise to control input, angular displacements of the arm and an amplitude of ±2V, and a white noise having a sampling pendulum in case of adding a noise were about the same as rate of 100Hz and an amplitude of ±2V. Fig. 6 shows a noise those in case of not adding a noise. Therefore, we can say used in this paper. that BELBIC designed in this paper showed adaptiveness against Figs. 7 show simulation results. As Figs. 7(a) and (b) show, a system variation, and robustness against external disturbance BELBIC controlled the arm and pendulum stably regardless of control input. of added noise. In spite of adding a noise to control input, angular displacements of the arm and pendulum shown in Figs. References 7(a) and (b) (with a noise) were about the same as those shown in Figs. 5(a) and (b) (without a noise). [1] Iraj, H., Saleh, M., Abbas, H., 2008, Input-Output As Figs. 5(c) and 7(c) show, chattering was occurred in Linearization Cascade Controller Using Genetic BELBIC output. It was occurred since Amygdala and OFC Algorithm for Rotary Inverted Pendulum System, outputs correct interactively in a high frequency mode to balance American Journal of Applied Sciences 5:10 1322~1328. the pendulum at upright position by coping with drastically [2] Lachhab, N., Abbas, H., Werner, H., 2008, A neural- increased instability due to an end mass, and external network based technique for modelling and LPV control disturbance. In Figs. 4(a), 5(a), and 7(a), a jerk was occurred of an arm-driven inverted pendulum, Decision and around 1.3 sec. The jerk was occurred when Amygdala and Control 47th IEEE Conference 3860~3865. OFC outputs have the same value while they are moving opposite [3] Jung, S., Wen, J. T., 2004, Nonlinear Model Predictive Control for the Swing-Up of a Rotary Inverted Pendulum, direction before they reach a steady state. Journal of Dynamic Systems Measurement and Control 126 666~673. 5. Conclusions [4] Kaise, N., Fujimoto, Y., 1999, Applying the evolutionary neural networks with genetic to control a This paper derived a mathematical model of a RIPS. BELBIC rolling inverted pendulum, Springer Berlin Heidelberg was designed, and used for swing up the pendulum and balancing 223~230. the pendulum at upright position. Five parameters required to [5] Jung, D. Y., Kim, H. R., Han, S. H., 2004, Intelligent design BELBIC were set to K1=200, K2=20, K3=10, α=100 Controller of Mobile Robot Using Genetic Algorithm, KSMTE Spring Conference 2004 181~186.

843 Jae-Won Kim, Chae-Youn Oh

[6] Tack, H. H., Kim, M. G., 2001, The Stabilization control Computing 10:1 11~22. of inverted pendulum system using neuro fuzzy control [12] Moren, J., 2002, and Learning, Doctorate algorithm, Agricultural Technology Institute of Jinju Thesis, Department of Cognitive Science Lund University, Industrial College 14 207~214. Sweden. [7] Melba, M. P., Marimuthu, N. S., 2008, Design of [13] Rashidi, F., Rashidi, M., Hashemi, A., 2003, Appling intelligent hybrid controller for swing-up and stabilization intelligent controllers for speed regulation of DC motor, of rotary inverted pendulum, ARPN Journal of Engineering The 11th Mediterranean Conference on Control and and Applied Sciences 3:4 60~70. Automation 1~6. [8] Roh, S. B., Oh, S. K., 2001, The Design of hybrid fuzzy [14] Jafarzadeh, S., Mirheidari, R., Jahed-Motlagh, M. R., controller for inverted pendulum, KIEE Summer Conference Barkhordari, M., 2008, Designing PID and BELBIC 2702~2704. controllers in path tracking problem, International Journal [9] Krishen, J., Becerra, V. M., 2006, Efficient fuzzy control of Computers Communications & Control 3 343~348. of a rotary inverted pendulum based on LQR mapping, [15] Valizadeh, S., Jamali, M. R., Lucas, C., 2008, A particle- IEEE International Symposium on Intelligent Control swarm-based approach for optimum design of BELBIC 2701~2706. controller in AVR system, ICCAS 2008 International [10] Fallahi, M., Azadi, S., 2009, Adaptive Control of an Conference on. IEEE 2679~2684. Inverted Pendulum Using Adaptive PID Neural Network, [16] Arpit, J., 2009, Computational modeling of the brain IEEE International Conference on Signal Processing limbic system and its application in control engineering, System 589~593. Master Thesis, Engineering in Electronics Instrumentation [11] Lucas, C., Shahmirzadi, D., Sheikholeslami, N., 2004, & Control Engineering to Thapar University, India. Introducing BELBIC : Brain Emotional Learning Based [17] Matlab simulink, 2009, http://www.mathworks.co.kr/products Intelligent Control, Intelligent Automation and Soft /simulink/index.html.

844