<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">WJET</journal-id><journal-title-group><journal-title>World Journal of Engineering and Technology</journal-title></journal-title-group><issn pub-type="epub">2331-4222</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/wjet.2015.32008</article-id><article-id pub-id-type="publisher-id">WJET-56561</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Chemistry&amp;Materials Science</subject><subject> Engineering</subject></subj-group></article-categories><title-group><article-title>
 
 
  Performance Study of PID Controller and LQR Technique for Inverted Pendulum
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>khil</surname><given-names>Jose</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Clint</surname><given-names>Augustine</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Shinu</surname><given-names>Mohanan Malola</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Keerthi</surname><given-names>Chacko</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Department of Electronics and Instrumentation Engineering, Vimal Jyothi Engineering College, Kannur, India</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>akhiljose@vjec.ac.in(KJ)</email>;<email>clintaug@vjec.ac.in(CA)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>07</day><month>04</month><year>2015</year></pub-date><volume>03</volume><issue>02</issue><fpage>76</fpage><lpage>81</lpage><history><date date-type="received"><day>8</day>	<month>April</month>	<year>2015</year></date><date date-type="rev-recd"><day>accepted</day>	<month>19</month>	<year>May</year>	</date><date date-type="accepted"><day>22</day>	<month>May</month>	<year>2015</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  The inverted pendulum is a classic problem in dynamics and control theory and is widely used as a benchmark for testing control algorithms. It is unstable without control. The process is non linear and unstable with one input signal and several output signals. It is hence obvious that feedback of the state of the pendulum is needed to stabilize the pendulum. The aim of the study is to stabilize the pendulum such that the position of the carriage on the track is controlled quickly and accurately. The problem involves an arm, able to move horizontally in angular motion, and a pendulum, hinged to the arm at the bottom of its length such that the pendulum can move in the same plane as the arm. The conventional PID controller can be used for virtually any process condition. This makes elimination the offset of the proportional mode possible and still provides fast response. In this paper, we have modelled the system and studied conventional controller and LQR controller. It is observed that the LQR method works better compared to conventional controller.
 
</p></abstract><kwd-group><kwd>Control System</kwd><kwd> LQR Technique</kwd><kwd> Conventional Controller</kwd><kwd> Inverted Pendulum</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Inverted pendulum is one of the most difficult systems to control in the field of control engineering, because it is a non-linear as well as an unstable system. It provides a platform to test various control techniques and is used to simulate experiments such as walking robots, missile guidance and flying objects in space. To design a control system that keeps the pendulum balanced and tracks the cart to a commanded position, the conventional PID controller is still used in industries, because of its simple in control structure, not too expensive and elective for a linear system. The conventional PID controller can be used for virtually any process condition. This makes elimination the offset of the proportional mode possible and still provides fast response.</p><p>Generally, all systems are initially checked with conventional controllers including P, PI, and PID [<xref ref-type="bibr" rid="scirp.56561-ref1">1</xref>] since it is easy to develop and implement. Various methods are available for tuning these controllers. If the response is not satisfactory advanced, controllers are considered. When the system is non-linear and with significant delay, conventional controllers cannot give a satisfactory result [<xref ref-type="bibr" rid="scirp.56561-ref2">2</xref>] . LQR controller is a suitable alternative in such case. It can deal with non-linear systems efficiently. Pole placement methods like Ackerman’s formula are very popular in designing the state feedback gain K and hence to place the poles in desired locations [<xref ref-type="bibr" rid="scirp.56561-ref3">3</xref>] -[<xref ref-type="bibr" rid="scirp.56561-ref5">5</xref>] . But in these methods, we need to specify the desired poles to seek the SVFB gain. Also these methods are only applicable for single input systems. However, it is very inconvenient to specify all the closed loop poles and we would like to have a technique that works for many numbers of inputs. Due to these constrains, we make use of the theory of optimal control for the design of a better controller. Optimal controllers are designed in sense of using the least required control effort to maintain equilibrium [<xref ref-type="bibr" rid="scirp.56561-ref6">6</xref>] . Optimal control principle is inspired from naturally occurring systems which are optimal.</p><p>In Section 2, the problem is identified and defined. In Section 3, a detailed description about the experimental setup and system modelling is given. Section 4 describes about the designing of PID controller and LQR controller for the system. In Section 5, the simulation results are compared and Section 6 contains conclusion.</p></sec><sec id="s2"><title>2. Problem Definition</title><p>The problem of controlling an inverted pendulum is to balance the pendulum in its upright position by moving the arm in opposite direction. The control output is limited by several constraints like the speed of motor controlling the arm. In this study, simulation of control in inverted pendulum system has been carried out using MATLAB and Simulink software.</p></sec><sec id="s3"><title>3. Experimental Setup and Description</title><p>A Quanser rotary inverted pendulum which we used for modelling is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>. The inverted pendulum is hinged to its arm.</p><p>The horizontal movement of the arm and the pendulum vertical position angle are measured by optical encoder. The encoders produce 4096 pulses for revolution, which gives a very reasonable precision in measurement. The arm motion is actuated by a DC motor. The DC motor is controlling the rotary motion of the arm. Encoder is used to feedback the angular position of the pendulum to servo electronics to generate actuating signal. The controller circuits provide the controlling signal which then drives the arm through the servomotor. Rotary motion of the arm applies moments on the inverted pendulum and keeps the pendulum upright.</p><p>To model the inverted model we consider a much more simplified model as shown in <xref ref-type="fig" rid="fig2">Figure 2</xref>. The system dynamics can be studied from its energy relations [<xref ref-type="bibr" rid="scirp.56561-ref7">7</xref>]</p><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> The quaser inverted pendulum system</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1560170x5.png"/></fig><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> Diagram model for the system</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1560170x6.png"/></fig><p>The kinetic and potential energies are given by the following equations:</p><disp-formula id="scirp.56561-formula2016"><label>(1)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1560170x7.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.56561-formula2017"><label>(2)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1560170x8.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.56561-formula2018"><label>(3)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1560170x9.png"  xlink:type="simple"/></disp-formula><p>where J<sub>p</sub><sub> </sub>and M<sub>p</sub> are arm inertia and pendulum mass respectively. Applying Lagrangian formula for the equations the state space model is obtained</p><disp-formula id="scirp.56561-formula2019"><label>(4)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1560170x10.png"  xlink:type="simple"/></disp-formula><p><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1560170x11.png" xlink:type="simple"/></inline-formula>is the torque of the motor. Known constant values are given in the table 1 shown below.</p><p>Substituting the known values in the equations we obtain the state space model of the system. The new state description of the system with voltage as input is given below:</p><disp-formula id="scirp.56561-formula2020"><label>(5)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1560170x12.png"  xlink:type="simple"/></disp-formula><p>The transfer function model of the system obtained is given as:</p><disp-formula id="scirp.56561-formula2021"><label>(6)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/6-1560170x13.png"  xlink:type="simple"/></disp-formula></sec><sec id="s4"><title>4. Controller Design</title><p>In this section, the LQR controller and PID controller design is discussed, also the controller design using MATLAB and Simulink is discussed in this section</p><sec id="s4_1"><title>4.1. PID controller Design</title><p>PID controller is the most widely used controllers for industrial applications [<xref ref-type="bibr" rid="scirp.56561-ref8">8</xref>] . PID controller design schemes are easy and robust in nature [<xref ref-type="bibr" rid="scirp.56561-ref9">9</xref>] . Defining “u” as the controller output, the final PID algorithm is of the form:</p><disp-formula id="scirp.56561-formula2022"><graphic  xlink:href="http://html.scirp.org/file/6-1560170x14.png"  xlink:type="simple"/></disp-formula><p>where K<sub>p</sub>, K<sub>i</sub>, K<sub>d</sub> are proportional, integral and derivative gains respectively which are the tuning parameters used to design a PID controller. We used the transfer function model of the system to design a PID controller in Simulink. The Simulink model of the PID controller is given in <xref ref-type="fig" rid="fig3">Figure 3</xref>.</p><p>The values of tuning parameters K<sub>p</sub>, K<sub>i</sub>, and K<sub>d</sub> are 516.35, 431.787 and 61.63 respectively.</p></sec><sec id="s4_2"><title>4.2. LQR Controller Design</title><p>In this section, an LQR controller is developed for the inverted pendulum system. The LQR method uses the state feedback approach for controller design. As discussed, the system is expressed in state variable form as<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1560170x15.png" xlink:type="simple"/></inline-formula>. We assume that all the states are measurable. The state variable feedback control can be found from the expression<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1560170x16.png" xlink:type="simple"/></inline-formula>.</p><p>Using this control closed loop system becomes <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1560170x17.png" xlink:type="simple"/></inline-formula> with A<sub>c</sub> the closed loop plant matrix and v(t) the new command input. C and D matrices are not used in the SVFB design.</p><p>To design an optimal SVFB we may define a performance index.</p><disp-formula id="scirp.56561-formula2023"><graphic  xlink:href="http://html.scirp.org/file/6-1560170x18.png"  xlink:type="simple"/></disp-formula><p>Substituting the SVFB we yields</p><disp-formula id="scirp.56561-formula2024"><graphic  xlink:href="http://html.scirp.org/file/6-1560170x19.png"  xlink:type="simple"/></disp-formula><p>We assume v(t) as zero as our only concern is internal stability of the system. The objective is to select the K that minimizes the performance index J. Q and R must be selected to be positive semi-definite and positive definite in order to minimize J. The feedback gain matrix K in LOR is solved using the equation<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1560170x20.png" xlink:type="simple"/></inline-formula>. To seek P we make use of a very important formula in modern control theory known as Algebraic Riccati Equation (ARE).</p><disp-formula id="scirp.56561-formula2025"><graphic  xlink:href="http://html.scirp.org/file/6-1560170x21.png"  xlink:type="simple"/></disp-formula><p>The design procedure for finding the feedback gain K for LQR can be formulated to 3 simple steps:</p><p>・ Select the design parameter matrices Q and R.</p><p>・ Find P by solving the ARE.</p><p>・ Find the state feedback matrix K using <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1560170x22.png" xlink:type="simple"/></inline-formula></p><fig id="fig3"  position="float"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> Simulink model for PID control of Inverted pendulum</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1560170x23.png"/></fig><p>The LQR guarantees pole placement and stability to the closed loop system as long as two LQR theorems [References] hold:</p><p>LQR theorem 1</p><p>Let the system (A, B) be reachable. Let R be positive definite and Q be positive definite. Then the closed loopsystem (A-BK) is asymptotically stable.</p><p>LQR theorem 2</p><p>Let the system (A, B) be stabilizable. Let R be positive definite, Q be positive semi definite, and <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1560170x24.png" xlink:type="simple"/></inline-formula> be observable. Then the closed loop system (A-BK) is asymptotically stable. The simulink model for state feedback controller is shown in <xref ref-type="fig" rid="fig4">Figure 4</xref>.</p><p>The SVFB gain K is found using lqr command in Matlab and this gain is given in the Simulink model to obtain the outout.</p><p>The value of Q matrix which gave the best pole placement was [100 0 0 0; 0 1 0 0; 0 0 200 0; 0 0 0 1] and R matrix was selected as [<xref ref-type="bibr" rid="scirp.56561-ref1">1</xref>] .</p><p>The value of K derived is [−10.0000 719.0337 −17.8791 129.8297].</p></sec></sec><sec id="s5"><title>5. Results and Discussion</title><p>The PID and LQR controller performance for the system is simulated MATLAB Simulink. Q and R values are selected based on fine tuning by trial and error method. Responses of both the systems are studied with a square wave as input. The results of both the controllers are discussed in this section.</p><sec id="s5_1"><title>5.1. PID Controller Response</title><p>The response of the system with PID controller is shown in <xref ref-type="fig" rid="fig5">Figure 5</xref>. PID controller tuning for the proposed system model is showing only a very narrow region of stability. When the gains are increased, the system is settled fast but the overshoot is very high. When we reduce the overshoot by reducing the gain, the settling time has to pay the price. <xref ref-type="fig" rid="fig5">Figure 5</xref> shows a reasonably good response obtained by tuning the PID controller.</p></sec><sec id="s5_2"><title>5.2. LQR Response</title><p>The LQR controller gives a much stable and robust response for the system. The response of the system with LQR controller is given in <xref ref-type="fig" rid="fig6">Figure 6</xref>.</p><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> Simulink model for state feedback control</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1560170x25.png"/></fig><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> Response of system with PID controller</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1560170x26.png"/></fig><fig id="fig6"  position="float"><label><xref ref-type="fig" rid="fig6">Figure 6</xref></label><caption><title> Regulatory response of PI controller and FLC</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/6-1560170x27.png"/></fig><p>There is a considerable reduction in overshoot and settling time with the LQR controller. The response is more stable and robust.</p></sec></sec></body><back><ref-list><title>References</title><ref id="scirp.56561-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Lozano, R., Fantoni, I. and Block, D.J. (2000) Stabilization of the Inverted Pendulum around Its Homoclinic Orbit. Systems &amp; Control Letters, 40, 197-204.  
http://dx.doi.org/10.1016/S0167-6911(00)00025-6</mixed-citation></ref><ref id="scirp.56561-ref2"><label>2</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Furuta</surname><given-names> K. </given-names></name>,<etal>et al</etal>. (<year>1991</year>)<article-title>Swing up Control of Inverted Pendulum, Industrial Electronics</article-title><source> Control and Instrumentation</source><volume> 3</volume>,<fpage> 2193</fpage>-<lpage>2198</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.56561-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Ogata, K. (1997) Modern Control Engineering. 3rd Edition, Prentice Hall India,</mixed-citation></ref><ref id="scirp.56561-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Kuo, B.C. (1967) Automatic Control Systems. 2nd Edition, Oxford University Press, Oxford.</mixed-citation></ref><ref id="scirp.56561-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Dorf, R.C. and Bishop, R.H. (1998) Modern Control Systems. 8th Edition, Addison Wesley, Boston.</mixed-citation></ref><ref id="scirp.56561-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Kwakernaak, H. and Sivan, R. (1972) Linear Optimal Control Systems. 1st Edition, Wiley-Interscience, Hoboken.</mixed-citation></ref><ref id="scirp.56561-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">(2000) Discrete State Space Based Control of a Rotary Inverted Pendulum Rodrigo Maria, Joao Trovao, Rui Cortesao, UrbanoNumes. CONTROLO 2000: 4th Portuguese Conference on Automatic Control, Guimaraes, 647-652.</mixed-citation></ref><ref id="scirp.56561-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Bennett, S. (1993) A History of Control Engineering, 1930-1955. IET Publication.  
http://dx.doi.org/10.1049/pbce047e</mixed-citation></ref><ref id="scirp.56561-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Chen, C.-T. (1999) Linear System Theory and Design. 3rd Edition, Oxford University Press, Oxford.</mixed-citation></ref></ref-list></back></article>