ee5102 - multivariable control systems part ii homework i

13
EE5102 - Multivariable Control Systems Part II Homework I Swee King Phang A0033585A March 30, 2011 1 Motivation In this project, a problem description on an unmanned helicopter ight control system is proposed. We are required to use the LQR controller design, the Kalman lter design and their combination, the LQG/LQR control methodology to design a measurement feedback control law that meet the following specication: 1. The overall system is stabilized; 2. The dynamics of the helicopter will be driven to the hovering state, i.e. all state variables are to be driven to 0, as quickly as possible from the given initial condition. The proposed LQG/LQR controller design has been developed by researchers for the past decades. Without concerning about the derivation of the controller, we can design the controller by just following 3 simple steps given in the lecture notes prepared by Professor Ben M. Chen from NUS. 2 Unmanned Helicopter State Space Model According to the given parameters, the unmanned aerial vehicle (UAV) platform codenamed HeLion has a linearized state space model as described below: _ x = Ax + Bu y = Cx where A = 0 B B B B B B B B B B B B B B B B @ 0:1778 0 0 0 0 9:7807 9:7807 0 0 0 0 0 0:3104 0 0 9:7807 0 0 9:7807 0 0 0 0:3326 0:5353 0 0 0 0 75:764 343:86 0 0 0 0:1903 0:2490 0 0 0 0 172:62 59:958 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 8:1222 4:6535 0 0 0 0 0 1 0 0 0 0:0921 8:1222 0 0 0 0 0 0 0 0 0 0 0 0:6821 0:0535 0 0 0 0 0 0 0 0 0 0:2892 5:5561 36:674 0 0 0 0 0 0 0 0 0 2:7492 11:112 1 C C C C C C C C C C C C C C C C A ; 1

Upload: others

Post on 06-Nov-2021

4 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: EE5102 - Multivariable Control Systems Part II Homework I

EE5102 - Multivariable Control Systems

Part II Homework I

Swee King PhangA0033585A

March 30, 2011

1 Motivation

In this project, a problem description on an unmanned helicopter flight control system is proposed. We arerequired to use the LQR controller design, the Kalman filter design and their combination, the LQG/LQRcontrol methodology to design a measurement feedback control law that meet the following specification:

1. The overall system is stabilized;

2. The dynamics of the helicopter will be driven to the hovering state, i.e. all state variables are to bedriven to 0, as quickly as possible from the given initial condition.

The proposed LQG/LQR controller design has been developed by researchers for the past decades. Withoutconcerning about the derivation of the controller, we can design the controller by just following 3 simplesteps given in the lecture notes prepared by Professor Ben M. Chen from NUS.

2 Unmanned Helicopter State Space Model

According to the given parameters, the unmanned aerial vehicle (UAV) platform codenamed HeLion has alinearized state space model as described below:

x = Ax+Bu

y = Cx

where

A =

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

−0.1778 0 0 0 0 −9.7807 −9.7807 0 0 0 00 −0.3104 0 0 9.7807 0 0 9.7807 0 0 0

−0.3326 −0.5353 0 0 0 0 75.764 343.86 0 0 0−0.1903 −0.2490 0 0 0 0 172.62 −59.958 0 0 0

0 0 1 0 0 0 0 0 0 0 00 0 0 1 0 0 0 0 0 0 00 0 0 −1 0 0 −8.1222 4.6535 0 0 00 0 −1 0 0 0 −0.0921 −8.1222 0 0 00 0 0 0 0 0 0 0 −0.6821 −0.0535 00 0 0 0 0 0 0 0 −0.2892 −5.5561 −36.6740 0 0 0 0 0 0 0 0 2.7492 −11.112

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠,

1

Page 2: EE5102 - Multivariable Control Systems Part II Homework I

B =

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

0 0 0 00 0 0 00 0 0 00 0 0 00 0 0 00 0 0 0

0.0496 2.6224 0 02.4928 0.1741 0 0

0 0 7.8246 00 0 1.6349 −58.40530 0 0 0

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠, x =

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

UVpq��asbsWrrfb

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠, u =

⎛⎜⎜⎝�lat�lon�col�ped

⎞⎟⎟⎠

C =

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

1 0 0 0 0 0 0 0 0 0 00 1 0 0 0 0 0 0 0 0 00 0 1 0 0 0 0 0 0 0 00 0 0 1 0 0 0 0 0 0 00 0 0 0 1 0 0 0 0 0 00 0 0 0 0 1 0 0 0 0 00 0 0 0 0 0 0 0 1 0 00 0 0 0 0 0 0 0 0 1 0

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠.

Furthermore, in the second part of the simulation, a form of wind gust disturbance will be considered in theproblem formulation. Thus the dynamical equation is modified as

x = Ax+Bu+ Ew

where

E = A

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

1 0 00 1 00 0 00 0 00 0 00 0 00 0 00 0 00 0 10 0 00 0 0

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠, w =

⎛⎝uwindvwindwwind

⎞⎠ =

⎛⎝10 cos(2�40 (t− 20)

)10 cos

(2�40 (t− 20)

)3 cos

(2�40 (t− 20)

)⎞⎠ , 10 ≤ t ≤ 30

3 LQG/LQR Controller Design

In our simulation, we are required to show that all state variables are able to be driven to 0 from an initialcondition of

x0 =(

1 0 0 0 0 −0.1 0 0 0 0 0)T

and the input to the system is limited as

∣�lat∣ < 0.35

∣�lon∣ < 0.35

∣�col∣ < 0.12

∣�ped∣ < 0.40

due to physical limitation and safety. Here, to design a LQG/LQR control law for this system, 3 major stepsare required as shown below.

2

Page 3: EE5102 - Multivariable Control Systems Part II Homework I

3.1 LQR Control Law

The first of the 3 steps given, we will design an LQR controller with control law u = −Fx which minimizethe energy function

J =

∫ ∞0

(xTQx+ uTRu)dt, Q ≥ 0, R > 0

with the system x = Ax+Bu by solving the Riccati Equation

PA+ATP − PBR−1BTP +Q = 0, P > 0,

and the controller gain, F = R−1BTP . It can be solved by using Matlab function [K,S,e] = lqr(A,B,Q,R).In our case, for both matrix Q and R are identity matrices, we can obtain the feedback gain

F =

⎛⎜⎜⎝0.1850 0.8168 0.7987 −0.2491 4.5452 −1.0632 0.7828 12.5570 0 0 0−0.8992 0.1704 0.2617 0.8695 1.0065 4.7697 8.9794 1.5218 0 0 0

0 0 0 0 0 0 0 0 0.9163 0.0213 −0.00190 0 0 0 0 0 0 0 0.0276 −0.8932 0.3383

⎞⎟⎟⎠ .

We can also check that the closed-loop system is stable by evaluating the closed-loop poles with the help ofMatlab. Here, the poles are all located in the open left half plane as shown below.

−17.9515± 25.3203j

−13.6871± 17.6950j

−2.1456± 2.1284j

−2.1588± 2.0997j

−56.7404

−12.1306

−7.8513

3.2 Kalman filter Design

Due to measurement noise and the existence of unmeasurable state variables, an observer is needed to observethe system’s states. In this second step, we are required to design a Kalman filter for the plant to estimatethe state variables of the system. Similar to the previous problem, Kalman filter can be designed by choosingan appropriate Qe and Re matrix and solving the Riccati Equation

PeAT +APe − PeCTR−1e CPe +Qe = 0, Pe > 0,

and the Kalman gain, Ke = PeCTR−1. Similarly, it can be solved by using Matlab function [L,P,e] =

lqe(Ae,Ge,Ce,Qe,Re). In our design, for both matrix Qe and Re are identity matrices, the resulting Kalmangain is given by

Ke =

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

4.3890 −0.0023 −0.1017 −0.2895 −0.0052 −1.0854 0 0−0.0023 4.2730 0.1650 −0.0800 1.0767 −0.0049 0 0−0.1017 0.1650 11.7215 −0.1670 0.2930 −0.0898 0 0−0.2895 −0.0800 −0.1670 6.5832 0.0918 0.3034 0 0−0.0052 1.0767 0.2930 0.0918 0.5764 0.0001 0 0−1.0854 −0.0049 −0.0898 0.3034 0.0001 0.5731 0 00.0070 0.0045 0.2635 0.0764 −0.0018 −0.0243 0 00.0032 0.0021 0.1407 −0.1338 −0.0211 0.0017 0 0

0 0 0 0 0 0 0.5288 −0.01130 0 0 0 0 0 −0.0113 0.29490 0 0 0 0 0 −0.0024 −0.0321

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠

3

Page 4: EE5102 - Multivariable Control Systems Part II Homework I

Figure 1: Block diagram of LQG/LQR controller design (given by Prof. Ben M. Chen in the lecture note)

We can verify that the designed observer is stable by evaluating the observer pole positions. Here, all thepoles are at open left half plane as shown below.

−9.2826± 20.0559j

−8.0034± 14.0777j

−2.5708± 2.3344j

−2.5676± 2.3295j

−8.4819± 9.7508j

−1.2101

3.3 LQG Control Law

In this last step, we design the LQG control law by assigning u = −Fx, where x is the output of the Kalmanfilter from the previous step, and u is the input to the UAV plant. The overall system will then be

˙x = (A−BF −KeC)x+Key

u = −Fx.

In picture, Fig. 1 shows the connection of each blocks.

4 Simulation Results

Since the UAV model parameters and controller gains have already derived in the previous section, simulationcan be done by using Matlab and Simulink. In this section, two simulation results will be provided: 1) closed-loop system with input and measurement noise; 2) closed-loop system with input and measurement noise,together with a wind gust disturbance in the form of sine wave to the velocity channels.

4.1 With Input and Measurement Noise

Fig. 2 shows the Simulink block diagram of the controller design in this part. Here, the random noise addedto the input and the measurement output are in Normal distribution with mean 0 and variance 0.01. In thissimulation, both Q,R of the LQR controller is set to be identity matrix, while both Qe, Re of the Kalmanfilter is also set as identity matrix. The simulation results in Fig. 3 to Fig. 5 has verified that this set ofmatrices is able to give good responses to the closed-loop system.

4

Page 5: EE5102 - Multivariable Control Systems Part II Homework I

Figure 2: Simulink block diagram of LQG design

Specifically, Fig. 3 shows the U, V,W and p, q, r of the UAV in simulation from time t = 0 to t = 10 sec.For all the 6 state variables, Kalman filter not only is able to track the measurement output, but eliminateportion of the noise to give us a smooth response. Also noted that all the 6 state variables converges to 0(hovering flight) after a short period within 5 seconds. Particularly, we remember that the initial conditionof the forward velocity U is given as 1 m/s, while the initial condition for the Kalman filter is set as 0. Thusbase on the result in the U channel, it shows that the designed observer is able to trace the real output evenif there is an error in the initial response.

One might notice that there is a clear positive overshoot of the angular rate q during the initial response. Itindicates that there is a positive rotation movement on the pitch angle of the UAV, which possibly causedby the movement of the swashplate of HeLion, as a result to break its momentum from flying forward. Itcan be seen as an effort of braking to stop the UAV from moving forward, which makes good sense of whatthis controller is trying to achieve – to reach hover state from forward-moving state.

Fig. 4 shows the �, �, and the estimation of the unmeasurable internal dynamic state variables as, bs, rfb.Here, we can not obtain the measurement of these 3 state variables, and hence only estimations are given.Similar to the response above, the state variables converges to 0 after a short period. Again, judging fromthe plot of �, it justifies the discussion mentioned in the last paragraph.

Lastly, Fig. 5 shows the control input to the UAV. All the control inputs are reasonable within the limitgiven. It concludes that the controller works well even under minor input and measurement noise.

5

Page 6: EE5102 - Multivariable Control Systems Part II Homework I

Figure 3: Velocities and angular velocities of the UAV

6

Page 7: EE5102 - Multivariable Control Systems Part II Homework I

Figure 4: Euler angles of the UAV, and the 3 unmeasurable states

7

Page 8: EE5102 - Multivariable Control Systems Part II Homework I

Figure 5: Control signal of the UAV

8

Page 9: EE5102 - Multivariable Control Systems Part II Homework I

4.2 With Input and Measurement Noise, and External Disturbances

Fig. 6 shows the Simulink block diagram of the controller design in this part. Take note that the randomnoise added to the input and the measurement output are similar to the previous part. The additionaldisturbances added to the system is in the form of⎛⎝uwindvwind

wwind

⎞⎠ =

⎛⎝10 cos(2�40 (t− 20)

)10 cos

(2�40 (t− 20)

)3 cos

(2�40 (t− 20)

)⎞⎠ , 10 ≤ t ≤ 30

to the translational velocities of the system, i.e. U, V and W . The disturbances block is inserted to thesimulation block diagram shown in Fig 6.

In detail, Fig. 7 shows the U, V,W and p, q, r of the UAV in simulation from time t = 0 to t = 40 secs.However, at time t = 10 to t = 30 sec, the UAV is undergoing wind gust disturbances. The simulationresults show that the controller is not able to track the translation velocity states well, especially the Wvariable, where it deviates the most among the 3 state variables. It is mainly due to the physical design of aconventional single rotor helicopter which HeLion adopted, as the forces of the helicopter is mainly generatedby a large rotor by flowing the air from top to the bottom of the helicopter, and thus created the liftingforce. By having a wind gust disturbance to the z axis of the helicopter, it is amplified by the spinning mainrotor, and thus creating a large lifting force which ultimately cause bigger heave movement as compared toforward and lateral movement.

Fig. 8 shows the �, �, and the estimation of the unmeasurable internal dynamic state variables as, bs, rfb.Similarly, the estimated Euler angles during the period is not very accurate. However after the period ofdisturbance, the system is able to achieve asymptotic stable again as all state variables converges to 0.

Lastly, Fig. 5 shows the control input to the UAV. All the control inputs are reasonable within the limit given.

For both the simulation, one might observe that by relaxing the weight on the control input gain (increaseQ matrix or decrease R matrix) will improve the performance of the UAV with or without wind gustdisturbances. However, due to the limitation in the control input, the modification will cause large controlinput and hence violate the given specification. This poses a typical trade-off scenario where good controlperformance and low control effort has to be chosen depends on the application needs.

5 Conclusion

In conclusion, as can be seen from the results, the LQG/LQR controller is good at estimating states withinput and measurement noises. However, it is weak to reject disturbances, such as the wind gust disturbancesshown in this assignment. Therefore we need a more robust controller that has a capability to decrease theeffect of the disturbances, such as H2 and H∞ controller.

9

Page 10: EE5102 - Multivariable Control Systems Part II Homework I

Figure 6: Simulink block diagram of LQG design

10

Page 11: EE5102 - Multivariable Control Systems Part II Homework I

Figure 7: Velocities and angular velocities of the UAV

11

Page 12: EE5102 - Multivariable Control Systems Part II Homework I

Figure 8: Euler angles of the UAV, and the 3 unmeasurable states

12

Page 13: EE5102 - Multivariable Control Systems Part II Homework I

Figure 9: Control signal of the UAV

13