arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Inverted Pendulum

This manual documents the modelling of an inverted pendulum, developing a full state feedback control using LQR to balance the unstable equilibrium and evaluatin the LQR on the hardware setup.

hashtag
Introduction

hashtag
Proportional (Derivative) Control Determined through LQR Analysis

This experiment will demonstrate the control of a system using full state feedback, where the control system is designed using the principles of Linear Quadratic Regulator (LQR) theory. This is an analysis technique that would be seen in more detail during advanced studies. You are not required to completely understand the derivation of the method itself. However, you should understand how to formulate the required matrices (Q and R) and why the overall goal (to minimize the cost, J) leads to the requirements on those matrices, as well as the reasoning behind the formulation of the cost equation, which serves as the purpose behind the method’s derivation.

hashtag
Linear Quadratic Theory (LQR)

Consider the system

where is a state vector and is a control input vector. Therefore, and are matrices of dimensions and , respectively. Let us suppose that we wish to design a state-feedback controller

such that the closed-loop system

is stable. Here is a matrix of gains of dimensions . In achieving closed-loop stability, we wish to use as little control effort as possible. We also wish to avoid large overshoot of the trajectories during the transients. One way to achieve both of these objectives is to find a control law which minimizes the following quadratic cost

where and are weighing matrices of appropriate dimensions. In order for the previous problem to make sense we must ensure that the two terms in the integral are positive. The requirement that

for all vectors is satisfied if the matrix is positive semi-definite (all its eigenvalues are greater than or equal to zero). The requirement that

for all vectors is satisfied if the matrix is positive definite (all its eigenvalues are greater than zero). This optimization problem has a closed-form solution. The optimal gain matrix is given by

where the matrix is the positive definite solution of the following Algebraic Riccati Equation (ARE):

hashtag
Example of a Simple Mass/Spring/Damper System

We will demonstrate the previous LQR design using a simple mass-spring-damper system as shown in Fig. 7.2. The equation of motion is

or in state-space form

where and . Let and . The system matrices are

Choose the weighting matrices as

The Riccati equation gives

Expanding, we obtain

Solving these equations, we get

or that

Notice that the solution matrix P is positive definite. Its eigenvalues are .

The optimal gain matrix is given by

The closed-loop system matrix is

and the eigenvalues are

circle-info

The closed-loop system is stable.

hashtag
Control of an Inverted Pendulum

hashtag
Objective

The purpose of this experiment is to design a balance control using the principles of linear quadratic regulator (LQR) theory for an inverted pendulum mechanism.

hashtag
Equipment Required

hashtag
Introduction

In this lab, we demonstrate a control design using modern “state-space” methods. The plant consists of an inverted pendulum on a cart. The plant has two distinct equilibrium points of which one is stable and the other is unstable. In this experiment, we will show how the plant in its unstable configuration can be controlled using a suitable controller. The methodology used to design the control law is based on the linear quadratic regulator (LQR) theory. The inverted pendulum mechanism to be used in this lab is shown in Fig. 7.3.

hashtag
Mathematical Model of the Inverted Pendulum Mechanism

Consider an inverted pendulum of mass and length connected on a sliding cart of mass as shown in Fig. 7.4.

The angle is measured from the up-right position. We can apply a force to the cart through the cartwheel motors. We wish to design a controller to balance the pendulum to the upright position . Note that the problem of balancing a pendulum is akin to the problem of stabilizing a rocket during ascent.

The equations of motion for the system can be easily derived using the free-body diagrams shown in Fig. 7.6 as follows (here we assume that the track on which the cart moves without sliding):

where is the moment of inertia about the pendulum's mass center given by .

This system has two equilibria which are and .

The first equilibrium corresponds to the down position (stable) and the second equilibrium corresponds to the upright position (unstable) of the pendulum. Linearizing the previous equations about the equilibrium of interest we obtain the following equations:

The input force in the above equations can be written in terms of the input voltage applied to the motor of the cart and the cart velocity as shown below.

First, we write the motor equation as

or

where

  • : voltage applied to motor (Volts)

  • : current in motor (Amp)

  • : back EMF constant (Volt/(rad/sec))

The torque generated at the output of the motor is given by

where is the motor torque constant given by

where is the conversion factor from volt-amp to N-m given by

Thus, the force transmitted to the cart via the pinion is

and on substituting the values of

we get

Letting and , the input force F can be written as

Substitution of the above expression for F in the linearized equations results in

The above set of linear differential equations is of the form , where . We seek a linear control law of the form , where is a vector of gains.

hashtag
Linear Quadratic Regulator (LQR) Design

The LQR formulation provides a linear control law

which minimizes the quadratic cost given by

for some user-defined matrices and . It is assumed that is positive semi-definite (all the eigenvalues are non-negative) and is positive definite (all the eigenvalues are positive). Here is the input voltage, given by

is the state vector, and given by

is the controller gain vector. Note that the input voltage is scalar and therefore, is also scalar. In practice, the weighting matrices and are chosen to be diagonal. A simple way for choosing and is the following (Bryson's rule):

Assuming the time-domain design specifications are:

one can choose

Further tuning of and may be required for improving the controller performance. Note that increasing means increasing the penalty on the control input (using less control effort). Similarly, increasing means increasing the penalty on the states (states reaching equilibrium position quickly and with less overshoot).

The block diagram of the experimental setup in the lab is shown in Fig. 7.7.

(Note: Conventional error signal shown, but )

where is position of the cart, is velocity of the cart, is angular position of the rod from the vertical, is angular velocity of the rod, and is a vector of feedback gains .

hashtag
Controller Design Procedure

  1. Obtain the A and B matrices of the system using , and .

  2. Choose and based on the following:

    Assume that:

hashtag
Controller Implementation and Evaluation

triangle-exclamation

CAUTION: Always be ready to stop the experiment if the cart goes unstable. This can be done either by pressing the stop button in the Simulink or turning the power off.

  1. Turn the power on.

  2. Open the MATLAB and locate the file InvPendulum_LQR.mdl under the path C:\AE4610_Controls_Lab\Inverted_Pendulum and open it. This is the block diagram for this part of the experiment.

hashtag
Analysis

  • Individual: Include the results from the controller design procedure Steps 1-5.

  • Group: Build a SIMULINK block diagram using Fig. 7.7 and obtain the simulated response to the same command input used in the experiment. Compare the simulated response with the experimental response and explain any differences between them.

circle-info

Average the first 5 seconds of the experimental data to obtain initial conditions for your state-space block in SIMULINK

Power module for the PCI Multi-Q board and the pendulum mechanism.

KgK_gKg​ : gear ratio in motor gearbox

  • RmR_mRm​ : motor armature resistance (Ohms)

  • ωg\omega_gωg​ : angular velocity of the wheel (rad/sec)

  • x˙\dot{x}x˙ : cart velocity (m/sec)

  • rrr : radius of motor pinion that meshes with the track (m)

  • 0.4m≤∣xmax∣≤0.5m0.4m\leq|x_{max}|\leq0.5m0.4m≤∣xmax​∣≤0.5m

  • π6rad≤∣θmax∣≤π4rad\frac{\pi}{6}rad\leq|\theta_{max}|\leq\frac{\pi}{4}rad6π​rad≤∣θmax​∣≤4π​rad

  • 6 volts≤∣Vmax∣≤10 volts6\space volts\leq|V_{max}|\leq10\space volts6 volts≤∣Vmax​∣≤10 volts

  • No constraints on x˙max⁡\dot{x}_{\max}x˙max​ and θ˙max\dot{\theta}_{max}θ˙max​ . (They can go to infinity…)

    According to Bryson’s rule, this will result in the following QQQ and RRR matrices:

    Q=[400001.62110000000000]Q= \begin{bmatrix} 4 & 0&0&0 \\ 0&1.6211&0&0 \\ 0&0&0&0 \\ 0&0&0&0 \end{bmatrix}Q=​4000​01.621100​0000​0000​​ and R=[0.01]R= [0.01]R=[0.01]

  • Using the lqr command in MATLAB, calculate the optimal feedback gain vector K. The lqr command basically solves the Algebraic Ricatti Equation that you met earlier. >> [k,s,e] = lqr(A,B,Q,R);

  • Compute the open-loop and closed-loop eigenvalues of the system and comment on the stability of the open and closed-loop systems.

  • Compute the natural frequencies and damping ratios of the closed-loop system.

  • To build the model, click the down arrow on Monitor & Tune under the Hardware tab and then click Build for monitoring . This generates the controller code.

  • Switch the Command Signal block to 0.

  • Enter the gains you obtained in the corresponding gain blocks.

  • Put the cart right in the middle of the track and hold up the pendulum fixed and straight. Do not release it until the controller is on.

  • Double click on the scopes and open then.

  • Press Connect button under Monitor & Tune and then press Start .

  • Gently disturb the pendulum to see the effect of the controller and then stop the simulation.

  • Switch the command signal to step input. It should make the cart to move 20 cm to the right after 10 seconds.

  • Save the data with a descriptive name. DO NOT SAVE THE MODEL.

  • Turn the POWER OFF

  • X˙=AX+BU(7.1)\dot{X}=AX+BU \tag{7.1}X˙=AX+BU(7.1)
    XXX
    UUU
    m×1m \times1m×1
    AAA
    BBB
    n×nn\times nn×n
    n×mn\times mn×m
    U=−KX(7.2)U=-KX \tag{7.2}U=−KX(7.2)
    X˙=(A−BK)X(7.3)\dot{X}=(A-BK)X \tag{7.3}X˙=(A−BK)X(7.3)
    KKK
    m×nm\times nm×n
    J=∫0∞(XTQX+UTRU)dt(7.4)J=\int_{0}^\infty(X^TQX+U^TRU) dt \tag{7.4}J=∫0∞​(XTQX+UTRU)dt(7.4)
    QQQ
    RRR
    XTQX≥0(7.5)X^TQX\geq0 \tag{7.5}XTQX≥0(7.5)
    XXX
    QQQ
    UTRU>0(7.6)U^TRU>0 \tag{7.6}UTRU>0(7.6)
    UUU
    RRR
    KKK
    K=R−1BTP(7.7)K=R^{-1}B^TP \tag{7.7}K=R−1BTP(7.7)
    n×nn\times nn×n
    PPP
    0=ATP+PA−PBR−1BTP+Q(7.8)0=A^TP+PA-PBR^{-1}B^TP+Q \tag{7.8}0=ATP+PA−PBR−1BTP+Q(7.8)
    mx¨+cx˙+kx=Fm\ddot{x}+c\dot{x}+kx=Fmx¨+cx˙+kx=F
    [x˙1x˙2]=[01−km−cm][x1x2]+[01m]F\begin{bmatrix} \dot{x}_1 \\[1ex] \dot{x}_2 \end{bmatrix} = \begin{bmatrix} 0 & 1 \\[1ex] -\frac{k}{m} & -\frac{c}{m} \end{bmatrix} \begin{bmatrix} x_1 \\[1ex] x_2 \end{bmatrix} + \begin{bmatrix} 0 \\[1ex] \frac{1}{m} \end{bmatrix}F[x˙1​x˙2​​]=[0−mk​​1−mc​​][x1​x2​​]+[0m1​​]F
    x1=xx_1=xx1​=x
    x2=x˙x_2=\dot{x}x2​=x˙
    m=1, k=2m=1,\space k=2m=1, k=2
    c=1c=1c=1
    A=[01−2−1],B=[01]A = \begin{bmatrix} 0 & 1 \\[1ex] -2 & -1 \end{bmatrix}, \qquad B = \begin{bmatrix} 0 \\[1ex] 1 \end{bmatrix}A=[0−2​1−1​],B=[01​]
    Q=[12004],R=1Q = \begin{bmatrix} 12 & 0 \\[1ex] 0 & 4 \end{bmatrix}, \qquad R = 1Q=[120​04​],R=1
    [0 ⁣ ⁣00 ⁣ ⁣0] ⁣= ⁣[0 ⁣ ⁣−21 ⁣ ⁣−1] ⁣[p11 ⁣ ⁣p12p21 ⁣ ⁣p22] ⁣+ ⁣[p11 ⁣ ⁣p12p21 ⁣ ⁣p22] ⁣[0 ⁣ ⁣1−2 ⁣ ⁣−1] ⁣− ⁣[p11 ⁣ ⁣p12p21 ⁣ ⁣p22] ⁣[ ⁣01] ⁣[0 ⁣ ⁣1] ⁣[p11 ⁣ ⁣p12p21 ⁣ ⁣p22] ⁣+ ⁣[12 ⁣ ⁣00 ⁣ ⁣4]\begin{bmatrix} 0 \! & \! 0 \\[0.5ex] 0 \! & \! 0 \end{bmatrix} \! = \! \begin{bmatrix} 0 \! & \! -2 \\[0.5ex] 1 \! & \! -1 \end{bmatrix} \! \begin{bmatrix} p_{11} \! & \! p_{12} \\[0.5ex] p_{21} \! & \! p_{22} \end{bmatrix} \! + \! \begin{bmatrix} p_{11} \! & \! p_{12} \\[0.5ex] p_{21} \! & \! p_{22} \end{bmatrix} \! \begin{bmatrix} 0 \! & \! 1 \\[0.5ex] -2 \! & \! -1 \end{bmatrix} \! - \! \begin{bmatrix} p_{11} \! & \! p_{12} \\[0.5ex] p_{21} \! & \! p_{22} \end{bmatrix} \! \begin{bmatrix} \! 0 \\[0.5ex] 1 \end{bmatrix} \! \begin{bmatrix} 0 \! & \! 1 \end{bmatrix} \! \begin{bmatrix} p_{11} \! & \! p_{12} \\[0.5ex] p_{21} \! & \! p_{22} \end{bmatrix} \! + \!\begin{bmatrix} 12 \! & \! 0 \\[0.5ex] 0 \! & \! 4 \end{bmatrix}[00​00​]=[01​−2−1​][p11​p21​​p12​p22​​]+[p11​p21​​p12​p22​​][0−2​1−1​]−[p11​p21​​p12​p22​​][01​][0​1​][p11​p21​​p12​p22​​]+[120​04​]
    p122+4p12−12=0p11−2p22−p12−p12p22=0p222−2p12+2p22−4=0p_{12}^2+4p_{12}-12=0\\[5pt] p_{11}-2p_{22}-p_{12}-p_{12}p_{22}=0\\[5pt] p_{22}^2-2p_{12}+2p_{22}-4=0p122​+4p12​−12=0p11​−2p22​−p12​−p12​p22​=0p222​−2p12​+2p22​−4=0
    p11=10,p12=2,p22=2p_{11}=10, \quad p_{12}=2, \quad p_{22}=2p11​=10,p12​=2,p22​=2
    P=[10222]P=\begin{bmatrix} 10 & 2\\ 2 & 2 \end{bmatrix}P=[102​22​]
    λ1,2=10.472, 1.528\lambda_{1,2}=10.472,\space1.528λ1,2​=10.472, 1.528
    K=R−1BTPK=[01][10222]=[22]K=R^{-1}B^TP\\[5pt] K=\begin{bmatrix} 0 & 1 \end{bmatrix} \begin{bmatrix} 10 & 2 \\ 2 & 2 \end{bmatrix} = \begin{bmatrix} 2 & 2 \end{bmatrix}K=R−1BTPK=[0​1​][102​22​]=[2​2​]
    A−BK=[01−4−3]A-BK=\begin{bmatrix} 0&1\\ -4 & -3 \end{bmatrix}A−BK=[0−4​1−3​]
    λ1,2=−1.5±i1.323.\lambda_{1,2}=-1.5\pm i1.323.λ1,2​=−1.5±i1.323.
    mpm_pmp​
    2lp2l_p2lp​
    mcm_cmc​
    θ\thetaθ
    θ=0\theta=0θ=0
    (mp+mc)x¨+mpθ¨lpcos⁡(θ)−mpθ˙2lpsin⁡(θ)=Fmplpcos⁡(θ)x¨+Iθ¨+mpθ¨lp2−mpglpsin⁡(θ)=0\begin{equation} \tag{7.9} \begin{aligned}(m_p+m_c)\ddot{x} + m_p\ddot{\theta}l_p\cos(\theta) -m_p\dot{\theta}^2l_p\sin(\theta) &= F \\[5pt] m_pl_p\cos(\theta)\ddot{x} + I\ddot{\theta} + m_p\ddot{\theta}l_p^2 - m_pgl_p\sin(\theta) &= 0 \end{aligned} \end{equation}(mp​+mc​)x¨+mp​θ¨lp​cos(θ)−mp​θ˙2lp​sin(θ)mp​lp​cos(θ)x¨+Iθ¨+mp​θ¨lp2​−mp​glp​sin(θ)​=F=0​​(7.9)​
    III
    I=mplp23I=\cfrac{m_pl_p^2}{3}I=3mp​lp2​​
    (x˙=x¨=θ˙=θ¨=0)(\dot{x}=\ddot{x}=\dot{\theta}=\ddot{\theta}=0)(x˙=x¨=θ˙=θ¨=0)
    (xe1,θe1)=(0,π)(x_{e1},\theta_{e1})=(0,\pi)(xe1​,θe1​)=(0,π)
    (xe2,θe2)=(0,0)(x_{e2}, \theta_{e2})=(0,0)(xe2​,θe2​)=(0,0)
    (0,0)(0, 0)(0,0)
    ddt[xθx˙θ˙]=[001000010−3mpgmp+4mc0003(mp+mc)g(mp+4mc)lp00][xθx˙θ˙]+[004mp+4mc−3(mp+4mc)lp]F(7.10) \frac{d}{dt} \begin{bmatrix} x \\[1ex] \theta \\[1ex] \dot{x} \\[1ex] \dot{\theta} \end{bmatrix} = \begin{bmatrix} 0 & 0 & 1 & 0 \\[1ex] 0 & 0 & 0 & 1 \\[1ex] 0 & -\cfrac{3m_pg}{m_p+4m_c} & 0 & 0 \\[1ex] 0 & \cfrac{3(m_p+m_c)g}{(m_p+4m_c)l_p} & 0 & 0 \end{bmatrix} \begin{bmatrix} x \\[1ex] \theta \\[1ex] \dot{x} \\[1ex] \dot{\theta} \end{bmatrix} + \begin{bmatrix} 0 \\[1ex] 0 \\[1ex] \cfrac{4}{m_p+4m_c} \\[1ex] -\cfrac{3}{(m_p+4m_c)l_p} \end{bmatrix}F \tag{7.10}dtd​​xθx˙θ˙​​=​0000​00−mp​+4mc​3mp​g​(mp​+4mc​)lp​3(mp​+mc​)g​​1000​0100​​​xθx˙θ˙​​+​00mp​+4mc​4​−(mp​+4mc​)lp​3​​​F(7.10)
    FFF
    VVV
    x˙\dot{x}x˙
    V=ImRm+KmKgωg=ImRm+KmKgx˙rV=I_mR_m+K_mK_g\omega_g=I_mR_m+K_mK_g\frac{\dot{x}}{r}V=Im​Rm​+Km​Kg​ωg​=Im​Rm​+Km​Kg​rx˙​
    Im=VRm−KmKgRmx˙r(7.11)I_m=\frac{V}{R_m}-\frac{K_mK_g}{R_m}\frac{\dot{x}}{r} \tag{7.11}Im​=Rm​V​−Rm​Km​Kg​​rx˙​(7.11)
    VVV
    ImI_mIm​
    KmK_mKm​
    Tm=KtKgIm(7.12)T_m=K_tK_gI_m \tag{7.12}Tm​=Kt​Kg​Im​(7.12)
    KmK_mKm​
    Kt=kKm(7.13)K_t=k K_m \tag{7.13}Kt​=kKm​(7.13)
    kkk
    k=1.3558 N−m/s/(volt−amp)k = 1.3558 \mathrm{~N-m/s/(volt-amp)}k=1.3558 N−m/s/(volt−amp)
    F=Tmr=KtKgVrRm−KtKgKmKgRmx˙r2=kKmKgVrRm−k(KmKg)2Rmx˙r2(7.14)F=\frac{T_m}{r}=\frac{K_tK_gV}{rR_m}-\frac{K_tK_gK_mK_g}{R_m}\frac{\dot{x}}{r^2}=\frac{kK_mK_gV}{rR_m}-\frac{k(K_mK_g)^2}{R_m}\frac{\dot{x}}{r^2} \tag{7.14}F=rTm​​=rRm​Kt​Kg​V​−Rm​Kt​Kg​Km​Kg​​r2x˙​=rRm​kKm​Kg​V​−Rm​k(Km​Kg​)2​r2x˙​(7.14)
    Km=0.00767 volt−amp/rad/s,Kg=3.7k=1.3558 N−m/s/(volt−amp),r=0.00635 m,Rm=2.6 ohmsK_m=0.00767~ \mathrm{volt-amp/rad/s},\quad K_g=3.7 \\ k=1.3558~\mathrm{N-m/s/(volt-amp)},\quad r=0.00635~\mathrm{m},\quad R_m=2.6\space \mathrm{ohms}Km​=0.00767 volt−amp/rad/s,Kg​=3.7k=1.3558 N−m/s/(volt−amp),r=0.00635 m,Rm​=2.6 ohms
    F=2.3305V−10.4152x˙(7.15)F=2.3305V-10.4152\dot{x} \tag{7.15}F=2.3305V−10.4152x˙(7.15)
    a1=2.3305a_1=2.3305a1​=2.3305
    a2=10.4152a_2=10.4152a2​=10.4152
    F=a1V−a2x˙(7.16)F=a_1V-a_2\dot{x} \tag{7.16}F=a1​V−a2​x˙(7.16)
    ddt[xθx˙θ˙]=[001000010−3mpgmp+4mc−4a2mp+4mc003(mp+mc)g(mp+4mc)lp3a2(mp+4mc)lp0][xθx˙θ˙]+[004a1mp+4mc−3a1(mp+4mc)lp]F(7.17)\frac{d}{dt} \begin{bmatrix} x \\[1ex] \theta \\[1ex] \dot{x} \\[1ex] \dot{\theta} \end{bmatrix} = \begin{bmatrix} 0 & 0 & 1 & 0 \\[1ex] 0 & 0 & 0 & 1 \\[1ex] 0 & -\cfrac{3m_pg}{m_p+4m_c} & -\cfrac{4a_2}{m_p+4m_c} & 0 \\[3ex] 0 & \cfrac{3(m_p+m_c)g}{(m_p+4m_c)l_p} & \cfrac{3a_2}{(m_p+4m_c)l_p} & 0 \end{bmatrix} \begin{bmatrix} x \\[1ex] \theta \\[1ex] \dot{x} \\[1ex] \dot{\theta} \end{bmatrix} + \begin{bmatrix} 0 \\[1ex] 0 \\[1ex] \cfrac{4a_1}{m_p+4m_c} \\[3ex] -\cfrac{3a_1}{(m_p+4m_c)l_p} \end{bmatrix}F \quad \tag{7.17}dtd​​xθx˙θ˙​​=​0000​00−mp​+4mc​3mp​g​(mp​+4mc​)lp​3(mp​+mc​)g​​10−mp​+4mc​4a2​​(mp​+4mc​)lp​3a2​​​0100​​​xθx˙θ˙​​+​00mp​+4mc​4a1​​−(mp​+4mc​)lp​3a1​​​​F(7.17)
    X˙=AX+BV\dot{X}=AX+BVX˙=AX+BV
    X=[x, θ, x˙, θ˙]⊤X=[x,~\theta,~ \dot{x},~\dot{\theta}]^\topX=[x, θ, x˙, θ˙]⊤
    V=−KXV=-KXV=−KX
    KKK
    1×41 \times 41×4
    V=−KX(7.18)V=-KX \tag{7.18}V=−KX(7.18)
    J=∫0∞(XTQX+VTRV)dt(7.19)J=\int_0^{\infty}(X^T QX+V^T RV) dt \tag{7.19}J=∫0∞​(XTQX+VTRV)dt(7.19)
    Q=QTQ=Q^TQ=QT
    R=RTR=R^TR=RT
    QQQ
    RRR
    VVV
    XXX
    X=[xθx˙θ˙](7.20)X=\begin{bmatrix} x\\[1ex] \theta \\[1ex] \dot{x} \\[1ex] \dot{\theta} \end{bmatrix} \tag{7.20}X=​xθx˙θ˙​​(7.20)
    KKK
    K=[k1  k2  k3  k4](7.21)K = [ k_1 ~~ k_2 ~~ k_3 ~~ k_4] \tag{7.21}K=[k1​  k2​  k3​  k4​](7.21)
    VVV
    RRR
    QQQ
    RRR
    QQQ
    RRR
    ∣V∣≤Vˉ,∣Xi∣≤Xiˉ|V|\leq\bar{V}, \quad|X_i|\leq\bar{X_i}∣V∣≤Vˉ,∣Xi​∣≤Xi​ˉ​
    R=1Vˉ2,Q=diag(1Xˉi2)(7.22)R=\frac{1}{\bar{V}^2},\quad Q=\mathrm{diag} \left(\frac{1}{\bar{X}_i^2} \right) \tag{7.22}R=Vˉ21​,Q=diag(Xˉi2​1​)(7.22)
    RRR
    QQQ
    RRR
    QQQ
    u=−KΔX,ΔX=X−XCu=-K\Delta X, \Delta X=X-X_Cu=−KΔX,ΔX=X−XC​
    xxx
    x˙\dot{x}x˙
    θ\thetaθ
    θ˙\dot{\theta}θ˙
    KKK
    K=[k1 k2 k3 k4]K = [ k_1 ~ k_2 ~ k_3 ~ k_4]K=[k1​ k2​ k3​ k4​]
    mp=0.21 kg, mc=0.815 kgm_p=0.21\space kg,\space m_c=0.815\space kgmp​=0.21 kg, mc​=0.815 kg
    lp=0.305 ml_p=0.305\space mlp​=0.305 m
    Q≥0Q\geq0Q≥0
    R>0R>0R>0
    Figure 7.1: Inverted pendulum mechanism [Image source: https://grabcad.com/library/inverted-pendulum-1]
    Figure 7.2: A simple mass / spring / damper system
    Figure 7.3: Inverted Pendulum mechanism in the lab
    Figure 7.4: Inverted pendulum mechanism
    Figure 7.5: Powered rocket during ascent
    Figure 7.6: Free Body Diagrams
    Fig 7.7: Block diagram of the experimental set-up