# Adjusting LQG with Noise Signals, PID Controller for Acrobot System

Authors: Nguyen Cong Danh
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

Acrobot is a robotic system that is actuated to achieve a certain degree through a controller and/or motion motors. In order to control acrobot in a given position, the designers have to come up with appropriate algorithms. In fact, input signals into the system are affected by noise signals. Therefore, it is necessary to remove noisy signals. In this paper, a method to control the balance under the influence of noise signals affecting the system (LQG) is proposed. Through acrobot's equations of motion, the system is linearized to facilitate the use of the above regulator for positions around the equilibrium point. The role of a Kalman filter of an LQG regulator is also depicted. Besides, a PID controller was used to survey this system as a comprehensive assessment of the effectiveness of control methods for acrobot. As acrobot stability surveys are rare in recent years according to the data referenced below, this paper is useful for acrobot control purposes and can serve as an important database for the application of acrobots in practice. Simulations are performed on Matlab.


---

## Body

## 1. Introduction

Nowadays, controllers such as PID, fuzzy, and sliding mode are applied to control all kinds of robots. This is a strong step toward helping robots achieve the requirements set out. For the acrobot system, the algorithms to control the balance are always focused on the selection of controllers. Modern robots are controlled with classical algorithms and genetic algorithms [1] and intelligent algorithms [2] where noise signals are not taken into account. In [1, 2], it is possible that the noise signals considered are negligible. Algorithms can be widely applied in the future such as self-driving subways, self-driving fighter planes, and so on. In this paper, a method to control the balance under the influence of noise signals affecting the system (LQG) is proposed. In the section presented below, the role of Kalman filter to form an LQG regulator is depicted. This method will optimally control a system in the presence of unwanted signals.Other systems have similar motion characteristics like acrobot, including pendulum, inverted pendulum [3], and reaction wheel inverted pendulum [4], which are nonlinear systems such as single-input multi-output (SIMO). In SIMO systems, the designers have a lot of difficulty in determining the exact position that has been placed for the pendulum according to the requirements. The flexible structured models using the algorithms in [5–7] are interesting experiences. Robustness in the optimal control method based on multivariable control design [8] is a new topic. Some extensions of loop transfer recovery [9] for flexible structures are regarded as a promising application. Loop recovery and robust state estimate feedback designs [10] for robotic systems are always welcome. Loop transfer recovery with nonminimum phase zeros [11] for electric motors is also interesting work. The LQG/LTE procedure for multivariable feedback design [12] is necessary to experience the application of any particular model. Multivariable feedback design concepts for a classical/modern synthesis [13] are useful as a reference for setting up newer algorithms. Feedback property of multivariable systems [14] is an interesting subject for its application to a system with a flexible structure. It is necessary to develop algorithms [15–19] so that they are more in line with today's trend. Based on [20–23], the author applied algorithms [20–23] for robot models. The author used modern algorithms such as neural control, adaptive fuzzy control, and sliding fuzzy control to control the model [24–27], and efficiency levels of the above control methods are presented in detail. This paper focuses on the process of investigating the effectiveness of using two control methods as mentioned in the problem. The purpose of this is to cater to practical requirements and considerations in the selection of control methods. Acrobot is a new automated system, which has many utilities in life. The aforementioned studies have not dealt with acrobots in detail, so it is always an interesting experience to investigate the properties of acrobot systems. The acrobot system is described by a link between link 1 and link 2 as shown below (Figure 1).Figure 1
Mathematical model of acrobot system.


## 2. Dynamic Equation of Model System

It is necessary to establish a mathematical equation that describes the motion of any model. Through these equations of motion, controllers can be installed inside the system. They will be connected to the system via wireless devices or wired devices. Usually, control systems have one or more controllers connected to the systems by wired devices. With the successful establishment of the mathematical equations, the author calculated the values ofK in LQG regulator. For example, acrobot or an inverted pendulum is described by mathematical equations. Acrobot has a similar structure to Pendubot [3], but the difference between the two lies in their control joint positions. The two-dimensional coordinate system: Ox and Oy, is depicted in Figure 1 [28].Parameters of the acrobot system are listed in Table1. Variables are q1, q2, and τ2, where q1 and q2 are output signals and τ2 is input signal. The selection of variables was based on the structure of the system as shown in Figure 1. Variables have unknown values. In the process of designing controllers for these systems, readers can better understand the nature of the relationships between input signals and output signals through voltage signals and the torque of an electric motor. That is, these values do not have a specific value during the analysis, but their influence on the system is important.Table 1
Parameters of model.
Parameters and variablesDescriptionq1Angle of link 1q2Angle of link 2q˙1Angular velocity of link 1q˙2Angular velocity of link 2m1Mass of link 1L1Length of link 1Lc1Distance from passive joint to the center of mass of link 1m2Mass of link 2L2Length of link 2Lc2Distance from active joint to the center of mass of link 1J1Moment of inertia of link 1J2Moment of inertia of link 2gGravitational accelerationτ2Torque applied to active jointIn Figure1, the x-axis of the Cartesian coordinate system was chosen to be the reference level of zero potential energy. Letting Xi=Xix,XiyT∈R2 be the absolute position of the COM of the ith link gives [24](1)X1=Lc1sinq1Lc1cosq1,X2=L1sinq1+Lc2sinq1+q2L1cosq1+Lc2cosq1+q2.The kinetic energy isKq,q˙, and the potential energy is V(q):(2)Kq,q˙=12∑i=12miX˙i2+J1q˙12+J2q˙1+q˙22,Kq,q˙=12q˙1q˙2Mq2q˙1q˙2,where(3)Mq2=a1+a2+2a3cosq2a2+a3cosq2a2+a3cosq2a2,a1=m1Lc12+m2L12+J1,a2=m2Lc22+J2,a3=m2L1Lc2,a4=m1Lc1+m2L1g,a5=m2Lc2g.Considering that friction is very small, the author used Lagrangian of acrobot; then, the dynamic equation of the mechanical system is(4)Vq=m1gX1y+m2gX2y=a4cosq1+a5cosq1+q2,(5)ddt∂Lq,q˙∂q˙i−∂Lq,q˙∂qi=τ˙i,i=1,2,where Lq,q˙=Kq,q˙−Vq and τ1=0. Equation (5) is equivalent to(6)Mq2q¨+Cq,q˙q˙+Gq=0τ2,where(7)q=q1q2T,Cq,q˙=−a3q˙2sinq2−a3q˙1+q˙2sinq2a3q˙1sinq20,Gq=−a4sinq1−a5sinq1+q2−a5sinq1+q2.State-space equations are created as(8)x=x1x2x3x4T=q1q˙1q2q˙2T.Let(9)Hq,q˙=H1q,q˙H2q,q˙T≔Cq,q˙q˙+Gq.Dynamic equation (6) can be described as(10)x˙=fx+gxτ2,where(11)fx=x2P1,1x4P2,1,Tgx=0Z1,10Z2,1T.P(i, j) and Z(i, j) are matrices having the ith row and jth column of P and Z. Therefore, P and Z are determined as(12)P=−M−1q2H1q,q˙H2q,q˙,Z=M−1q201.The establishment of acrobot’s equation of state is based on the values of Table2.Table 2
Parameters of the acrobot system.
ParametersValuesm10.8 kgL10.18 kgLc10.11 mm20.2 kgL20.18 mLc20.09 mJ10.0022 kg m2J20.00054 kg m2The state variable equations of the system are described as follows:(13)x˙=Ax+Bu,c=Cx+Dx,A=∂f1∂x1∂f1∂x2∂f1∂x3∂f1∂x4...∂f1∂xn∂f2∂x1∂f2∂x2∂f2∂x3∂f2∂x4...∂f2∂xn..................∂fn∂x1∂fn∂x2∂fn∂x3∂fn∂x4...∂fn∂xn,B=∂f1∂u∂f2∂u...∂fn∂u.With the above parameters and matricesA and B of the state-space model, G1(s), G2(s), G3(s), and G4(s) are calculated:(14)A=010070.6961−19.6783000001−94.9903130.945800,B=0−185.73550927.3017,C=1000010000100001,D=0.Transfer function of acrobot:(15)G1s=−185.7s2+19.68s−70.7,G2s=927.3s2−6074s−4.791×104s4+19.68s3−70.7s2,G3s=−185.7ss2+19.68s−70.7,G4s=927.3s2−6074s−4.791×104s3+19.68s2−70.7s.


## 3. LQG Regulator

LQG Regulator (linear quadratic Gaussian) is used for optimal control of a system while noise signals “affect” the system. The author considered the following diagram (Figure2).Figure 2
Diagram of a regulator for an object with noise signals (“v”: the white noise and “w”: the color noise signal).The goal of adjusting is to stabilize the output at zero; under the influence of input white noise signals (w) and noise signals due to (v), the control signal is “u,” and the equation of state is(16)x˙=Ax+Bu+Gw,y¯=Cx+Du+Hw+v.LQG Regulator consists of using a state feedback unit and a state estimator (Kalman filter) (Figure3).Figure 3
LQG regulator with noise signals (“v”: the white noise and “w”: the color noise signal).The quality indicator (J) is used to find the state feedback matrix K=lqrA,B,Q,R,N.(17)Ju=∫0∞xTQx+2xTNu+uTRudt.The control signal isu=−K×x^,andx^is inferred as(18)x^˙=Ax^+Bu+Ly¯−Cx^−Du,where “L” is the Kalman gain and “L” is calculated by the following commands:(19)kest,L,P=Kalmansys,Qn,Rn,Nn,kest,L,P,M,Z=kalmdsys,Qn,Rn,Ts,kest,L,P=Kalmansys,Qn,Rn,Nn,sensors,known,kest,L,P,M,Z=Kalmansys,Qn,Rn,Nn,where Qn, Rn, and Ts represent the variance of the noise signal.EwwT=Qn,EvvT=Rn,EwvT=Nn, and kest is the model of the Kalman filter.Kalman filter calculatesx^ to minimize the variance:(20)P=limt⟶∞Ex−x^x−x^T.The equation of state for a regulator (LQG) is(21)ddtx^=A−LC−B−LDx^+Ly¯,where u=−Kx^ is created by the following commands:(22)rlqg=lqgregkest,k,rlqg=lqgregkest,k,current,rlqg=lqgregkest,k,controls,where rlqg is the state-space model of a set of LQG, the output is u, the input is y¯, and the state is x^.Finally, the command is requested:(23)rsys=regsys,K,L,rsys=regsys,K,L,sensors,known,controls.The author established a closed system with the value of “sys” as the object model, and the value of “K” is the state feedback matrix, “L” is the state estimation matrix, “sensors” represent a subset of outputs, the value of “y” returns the estimator, “known” represents the inputs, “ud” affects the estimator, and “controls” are inputs of “sys” that is used for control.


## 4. Simulation Results and Discussion

Simulation results are shown in Figures4–35.Figure 4
Step response of LQG regulator for the closed system “G1(s).”Figure 5
Step response of LQG regulator for the open system “G1(s).”Figure 6
Impulse response of LQG regulator for the closed system “G1(s).”Figure 7
Impulse response of LQG regulator for the open system “G1(s).”Figure 8
Step response of LQG regulator for the closed system “G2(s).”Figure 9
Step response of LQG regulator for the open system “G2(s).”Figure 10
Impulse response of LQG regulator for the closed system “G2(s).”Figure 11
Impulse response of LQG regulator for the open system “G2(s).”Figure 12
Step response of LQG regulator for the closed system “G3(s).”Figure 13
Step response of LQG regulator for the open system “G3(s).”Figure 14
Impulse response of LQG regulator for the closed system “G3(s).”Figure 15
Impulse response of LQG regulator for the open system “G3(s).”Figure 16
Step response of LQG regulator for the closed system “G4(s).”Figure 17
Step response of LQG regulator for the open system “G4(s).”Figure 18
Impulse response of LQG regulator for the closed system “G4(s).”Figure 19
Impulse response of LQG regulator for the open system “G4(s).”Figure 20
Impulse response of PID controller for the closed system “G1(s).”Figure 21
Impulse response of PID controller for the open system “G1(s).”Figure 22
Step response of PID controller for the closed system “G1(s).”Figure 23
Step response of PID controller for the open system “G1(s).”Figure 24
Impulse response of PID controller for the closed system “G3(s).”Figure 25
Impulse response of PID controller for the open system “G3(s).”Figure 26
Step response of PID controller for the closed system “G3(s).”Figure 27
Step response of PID controller for the open system “G3(s).”Figure 28
Impulse response of PID controller for the closed system “G2(s).”Figure 29
Impulse response of PID controller for the open system “G2(s).”Figure 30
Step response of PID controller for the closed system “G2(s).”Figure 31
Step response of PID controller for the open system “G2(s).”Figure 32
Impulse response of PID controller for the closed system “G4(s).”Figure 33
Impulse response of PID controller for the open system “G4(s).”Figure 34
Step response of PID controller for the closed system “G4(s).”Figure 35
Step response of PID controller for the open system “G4(s).”Diagram of the system using the LQG regulator is shown in Figures36–39.Figure 36
LQG regulator forG1(s).Figure 37
LQG regulator forG2(s).Figure 38
LQG regulator forG3(s).Figure 39
LQG regulator forG4(s).Diagram of the system using the PID controller is shown in Figures40–43.Figure 40
PID controller forG1(s), Kp = 506.71, Ki = 46.1, and Kd = 562.44.Figure 41
PID controller forG2(s), Kp = 506.71, Ki = 46.1, and Kd = 562.44.Figure 42
PID controller forG3(s), Kp = 506.71, Ki = 46.1, and Kd = 562.44.Figure 43
PID controller forG4(s), Kp = 506.71, Ki = 46.1, and Kd = 562.44.In Figures36–39, the value of “d” is a color noise signal with a spectral density of less than 10 rad/s, and the value of “n” is a white noise signal En2=0.01. The quality indicator is ‘J’: Ju=∫0∞10y2+u2dt. The model of the object is x˙=Ax+Bu+Bd,y¯=Cx+n.The impulse response for the closed system (highlighted in red in Figure6) is better than that for the open system (highlighted in green in Figure 7). The value of amplitude of the oscillation of the closed system in this case is zero, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. The value of amplitude of the oscillation of the open system in this case is large, and the open system does not reach a steady state.The step response for the closed system (highlighted in blue in Figure4) is better than that for the open system (highlighted in red in Figure 5). The value of amplitude of the oscillation of the closed system in this case is −0.6, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. Meanwhile, the open system cannot respond well. In general, for a regulator of this type, the system responds well to the presence of noisy signals.The impulse response for the closed system (highlighted in red in Figure10) is better than that for the open system (highlighted in blue in Figure 11). The value of amplitude of the oscillation of the closed system in this case is zero, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. The value of amplitude of the oscillation of the open system in this case is large, and the open system does not reach a steady state.The step response for the closed system (highlighted in green in Figure8) is better than that for the open system (highlighted in green in Figure 9). The value of amplitude of the oscillation of the closed system in this case is −30, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. Meanwhile, the open system cannot respond well. In general, for a regulator of this type, the system responds well to the presence of noisy signals.The impulse response for the closed system (highlighted in blue in Figure14) is better than that for the open system (highlighted in green in Figure 15). The value of amplitude of the oscillation of the closed system in this case is zero, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. The value of amplitude of the oscillation of the open system in this case is large, and the open system does not reach a steady state.The step response for the closed system (highlighted in red in Figure12) is better than that for the open system (highlighted in red in Figure 13). The value of amplitude of the oscillation of the closed system in this case is zero, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. Meanwhile, the open system cannot respond well. In general, for a regulator of this type, the system responds well to the presence of noisy signals.The impulse response for the closed system (highlighted in blue in Figure18) is better than that for the open system (highlighted in green in Figure 19). The value of amplitude of the oscillation of the closed system in this case is zero, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. The value of amplitude of the oscillation of the open system in this case is large, and the open system does not reach a steady state.The step response for the closed system (highlighted in green in Figure16) is better than that for the open system (highlighted in red in Figure 17). The value of amplitude of the oscillation of the closed system in this case is −200, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. Meanwhile, the open system cannot respond well. In general, for a regulator of this type, the system responds well to the presence of noisy signals.The impulse response for the closed system (highlighted in green in Figure20) is worse than that for the open system (highlighted in blue in Figure 21). The value of amplitude of the oscillation of the closed system in this case is large, and the closed system does not reach a steady state. For this type of regulator, the closed system does not respond well. The value of amplitude of the oscillation of the open system in this case is large, and the open system does not reach a steady state.The step response for the closed system (highlighted in red in Figure22) is better than that for the open system (highlighted in green in Figure 23). The value of amplitude of the oscillation of the closed system in this case is large, and the closed system does not reach a steady state. For this type of regulator, the closed system does not respond well. Meanwhile, the open system cannot respond well. In general, for a regulator of this type, the system does not respond well.The impulse response for the closed system (highlighted in green in Figure28) is better than that for the open system (highlighted in blue in Figure 29). The value of amplitude of the oscillation of the closed system in this case is zero, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. The value of amplitude of the oscillation of the open system in this case is large, and the open system does not reach a steady state.The step response for the closed system (highlighted in red in Figure30) is better than that for the open system (highlighted in green in Figure 31). The value of amplitude of the oscillation of the closed system in this case is 1.0, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. Meanwhile, the open system cannot respond well. In general, for a regulator of this type, the system responds well.The impulse response for the closed system (highlighted in red in Figure24) is better than that for the open system (highlighted in green in Figure 25). The value of amplitude of the oscillation of the closed system in this case is zero, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. The value of amplitude of the oscillation of the open system in this case is large, and the open system does not reach a steady state.The step response for the closed system (highlighted in green in Figure26) is better than that for the open system (highlighted in red in Figure 27). The value of amplitude of the oscillation of the closed system in this case is 0.992, and the closed system reaches a steady state. For this type of regulator, the closed system responds well. Meanwhile, the open system cannot respond well. In general, for a regulator of this type, the system responds well.The impulse response for the closed system (highlighted in green in Figure32) is better than that for the open system (highlighted in blue in Figure 33). The value of amplitude of the oscillation of the closed system in this case is large, and the closed system does not reach a steady state. For this type of regulator, the closed system does not respond well. The value of amplitude of the oscillation of the open system in this case is large, and the open system does not reach a steady state.The step response for the closed system (highlighted in blue in Figure34) is better than that for the open system (highlighted in red in Figure 35). The value of amplitude of the oscillation of the closed system in this case is large, and the closed system does not reach a steady state. For this type of regulator, the closed system does not respond well. Meanwhile, the open system cannot respond well. In general, for a regulator of this type, the system does not respond well.The efficiency of the above control methods is in the following descending order:(A) LQG regulator(B) PID controller


## 5. Conclusions

LQG regulator in the case of interference signals affecting this system has been proposed in this study. Simulation shows positive results. This allows the closed system to reach steady state in a short time. At the same time, it also helps the open system to reach steady state in half the time compared to the closed system at the beginning of the operating cycle of the system. Although the steady state is achieved, simulation results of this type of regulator are only true in the case where the link angle between link 1 and link 2 is small compared to the equilibrium point. To widen the link angle between link 1 and link 2, further studies can be conducted in the future.



---

*Source: 4164382-2021-08-27.xml*