design of a linear state feedback controller

27
1 Design of a Linear StateFeedback Controller Assignment for EE5101R – Linear System by Mohammad Ikhsan A0117954X [email protected] November 12, 2013

Upload: mohammad-ikhsan

Post on 22-Oct-2015

45 views

Category:

Documents


5 download

DESCRIPTION

Linear State Feedback Controller Design

TRANSCRIPT

Page 1: Design of a Linear State Feedback Controller

1  

Design of a Linear State‐Feedback Controller  

 

 

Assignment for EE5101R – Linear System 

 

 

by  

 

Mohammad Ikhsan  

A0117954X 

[email protected] 

 

 

 

 

 

November 12, 2013 

   

Page 2: Design of a Linear State Feedback Controller

2  

    Design of a Linear State‐Feedback Controller  

 

by 

Mohammad Ikhsan 

A0117954X 

[email protected] 

Abstract 

This project describes the various controllers that can be designed to stabilize a single input single output plant. In this project, a third order single input single output plant was provided. The state-space representation of the plant was obtained and its dynamic characteristics were simulated and analyzed. With the states assumed to be measurable, the LQR method was used to create a state-feedback controller to stabilize the plant. The effects of weighting factors Q and R were also investigated. Results showed that the importance of states are controlled by individual values of the diagonal of , while the importance of the control input is controlled by the value of . Next, an observer-based controller was designed using the pole placement method. Several observers were designed to analyze the effect of the observer pole placement on the overall system response. The results showed that the observer poles are best kept between 3 – 5 times farther from the origin than the control poles. Finally, a controller was designed to allow tracking and disturbance rejection in steady state. A full order and reduced order servo controller was designed and simulated in the project. Results showed that a lower-ordered controller will have less overshoot, faster response time, as well as take up less computational power to perform the calculations. 

   

Page 3: Design of a Linear State Feedback Controller

3  

Table of Contents 

 1 Introduction 4

2 State-Space Representation of the Plant 5

3 State-Feedback Controller using the LQR Method 9

4 Full Order State Observer using the Pole Placement Method 16

5 Servo Controller Design 22

6 Conclusion 26

7 Reference 27

   

Page 4: Design of a Linear State Feedback Controller

4  

Section 1: Introduction  

In this project, the plant in Fig. 1.1 was analyzed, and a controller was designed to stabilize and servo the system to a desired output.

 Figure 1.1 Block Diagram of the Plant

The plant is a third order system consisting of two internal blocks and an internal disturbance source. The goal of the project is to design a linear state-feedback controller to control the plant described above. Specifically, the following tasks were completed during the project:

1. A state-space model of the plant was determined, analyzed, and simulated for the plant’s dynamic characteristics;

2. A linear state-feedback controller was designed using the LQR method. The controller was simulated for state responses to non-zero initial state with zero external inputs. The effects of weightings on Q and R on the system performance was also analyzed;

3. A state observer was designed using the pole placement method to estimate the states of the system for the state-feedback controller. The effects of observer pole location on the state estimation error and the closed-loop control performance was also analyzed;

4. A servo controller was designed to achieve zero steady-state error when the input and disturbance were of step type.

The above tasks will be discussed in more detail throughout this report. The work done in this project was done using both manual calculation and MATLAB.

)( sY 

)( sD 

)( sU 11

22 4 . 1  aass  )(1 sG )(2 sG

Page 5: Design of a Linear State Feedback Controller

5  

Section 2: State‐Space Representation of the Plant 

 

 

The plant in Fig. 1.1 has the transfer functions 1

4 2

(2.1)

3 (2.2)

where a is based on the last four numerical digits of the writer’s matriculation number A0117954X. A state-space representation of the plant is to be determined and the plant dynamics are to be simulated and analyzed.

2.1  State‐Space Representation 

The last four numerical digits of the matriculation number is 7954. Therefore, the parameter a in the plant is given by 7954

10007.954 (2.3)

The transfer function of the plant becomes 1

4 15.908

(2.4)

3 (2.5)

The number of states in the state-space representation is determined by the overall order of the plant. Since is of second order and is of first order, the plant is a third order system. The output of is chosen as the first state variable, . The output of is chosen as the second state variable , and the derivative of the output of is chosen as the third state variable . Based on the above representation scheme, the relationships between the signals in the plant can be illustrated by the set of equations below.

Page 6: Design of a Linear State Feedback Controller

6  

From the transfer function in , the relationship between the input and the output of the block (also the second state variable ) is given by 4 15.908

(2.6)

The inverse Laplace transform of (2.6) is 4 15.908 (2.7) Since , then . From this relationship and (2.7), can be derived as 4 15.908

(2.8)

The relationship between the output and input of the block is given by 3 (2.9) The inverse Laplace transform of (2.9) is 3 (3.0) From the above relationships, a state-space representation of the system is given by ,

(3.1)

where 0 3 00 0 10 15.908 4

, 001

, 300

, and 1 0 0 .

2.2  Simulation of Plant Dynamics 

The state-space representation of the plant was simulated in MATLAB for its dynamic characteristics. First, the open-loop bode plot of the plant is shown in Fig. 2.1. From the bode plot, the gain margin of the plant is 26.5 dB while the phase margin is 87.3 degrees.

Page 7: Design of a Linear State Feedback Controller

7  

Figure 2.1 Bode Plot of Plant

The zero input response was also simulated where the initial condition was set at

0.1 0.1 0.1 . The result of this simulation is shown in Fig. 2.2. The result shows that the plant’s output does not return to zero when the initial condition is non-zero and the input is set to zero. This is evidence that shows that the plant is not asymptotically stable. In fact, the poles of the plant are 0 2 3.4508 2 3.4508 . Since the two poles with the negative real parts are stable, the instability of the plant may be caused by the zero pole.

Figure 2.2 Zero Input Response with Initial Condition 0.1 0.1 0.1

Next, the plant was subjected to a step input and constant disturbance with responses shown in Figure 2.3 and Figure 2.4. Both results show that the output of the plant grows unbounded when the plant is subjected to a constant input or disturbance. This shows that the system is not BIBO stable.

Page 8: Design of a Linear State Feedback Controller

8  

Figure 2.3 Response of Plant from a Step Input

Figure 2.4 Response of Plant due to a Constant Disturbance

In order to stabilize the plant, a controller needs to be designed. The next section describes the design of a linear state-feedback controller that attempts to stabilize the plant described above.

   

Page 9: Design of a Linear State Feedback Controller

9  

Section 3: 

State‐Feedback Controller using the LQR Method 

The goal of the LQR method is to stabilize the system by minimizing the cost function

12

(3.1)

The optimal control law that minimizes (3.1) is in the form of a linear state feedback given by

(3.2)

When (3.1) is minimized, unlike in Section 1, the non-zero initial condition response will converge to zero in finite time. The control equation using the LQR method is (3.3) In the above equation, is the solution to the Riccati equation 0 (3.4) where and are weighting matrices. In order to use the LQR method, the following conditions have to be met:

1. The plant is controllable; 2. The pair , , where , is observable; 3. The weighting matrices and are semi-positive definite and positive definite

respectively. They both are also symmetric.

3.1  State‐Feedback Controller Design

First, the plant’s controllability is checked. The controllability matrix for the plant is given by 0 0 3

0 1 41 4 0.0920

(3.5)

Page 10: Design of a Linear State Feedback Controller

10  

Since the controllability matrix is of full rank, the plant is controllable and the first requirement is fulfilled. Next, the simplest form of and are chosen to fulfill the second and third requirements of the LQR method. The values for and chosen are given by

1 0 00 1 00 0 1

(3.6)

1 (3.7) To get the matrix , the Riccati equation can be solved by using the LQR command in MATLAB. Using this command, three values are obtained. The first value, the value of from the Riccati equation, is given by 5.5775 4.3184 1

4.3184 5.6261 0.82451 0.8245 0.3184

(3.8)

The second value, the state-feedback gain, is given by 1 0.8245 0.3184 (3.9) The third value, the closed-loop eigenvalues of the state-feedback control system, is given by 0.1880

2.0652 3.41922.0652 3.4192

(3.10)

From the above values, especially the closed-loop eigenvalues, it can be predicted that the system will be stable since the eigenvalues are all located in the negative real coordinate plane. Next, the plant with the state-feedback controller is simulated using MATLAB with the same initial state 0.1 0.1 0.1 . The result of the simulation is shown in Fig. 3.1. As seen in Fig. 3.1, the output of the system, represented by state if disturbance is ignored, now converges to zero. This suggests that the state-feedback controller has made the overall system asymtotically stable.

3.2  Effect of Weighting Factor Q

First, the effect of weighting factor is investigated. This is done by changing individual values of the diagonal of . In theory, the values of the diagonal of Q represents the weighting factor for the corresponding state variables. In this case, is the weighting factor for state , is the weighting factor for state , and is the weighting factor for state

. More importance is put on the state variable with the higher weighting factor.

Page 11: Design of a Linear State Feedback Controller

11  

Figure 3.1 Zero Input Response with State-Feedback Controller Attached

To see the effect of each weighting factor on the output of the system, three new controllers are designed with different weighting factors magnified by 100 for each individual case. In the first controller the weighting factor is kept the same while the weighting factor is set to 100 0 0

0 1 00 0 1

(3.11)

Using the LQR command in MATLAB with as in (3.11) and 1, the following state-feedback controller gain was obtained. 10 8.7108 1.8670 (3.12) The result of the simulation is shown in Fig. 3.2. The effect of increasing the weighting factor of the first state is seen clearly in the simulation result. As seen in Fig. 3.2, the state converges to zero significantly faster than it did in the previous simulation of Fig. 3.1. This also applies for the other two states, although the effect is not as significant. The control signal for the new controller is significantly larger than the first controller. This is logical because of the need for the faster system response. As mentioned before, if disturbance at the output of the system is ignored, the first state is the same as the output of the system. Therefore, by increasing the importance of the first state, better perfomance is achieved with the tradeoff of a larger control signal.

Page 12: Design of a Linear State Feedback Controller

12  

Figure 3.1 Zero Input Response with 100 0 00 1 00 0 1

Next, the weighting factor for the second state is amplified by 100. The weighting factor matrix becomes 1 0 0

0 100 00 0 1

(3.13)

The feedback controller gain for the controller is given by 1 3.6533 0.9302 (3.14) The result of the zero input response simulation is shown in Fig. 3.2. From the result of the simulation, it can be seen that the response is a little slower than the original controller. The control input is also similar. The difference lies in the response of the second state. The second state, as predicted, converges to zero faster. Finally, the weighting factor for the third state is amplified by 100. The weighting factor matrix becomes 1 0 0

0 1 00 0 100

(3.15)

The feedback controller gain for the controller is given by 1 1.9743 6.9521 (3.16)

Page 13: Design of a Linear State Feedback Controller

13  

Figure 3.2 Zero Input Response with 1 0 00 100 00 0 1

Figure 3.3 Zero Input Response with 1 0 00 1 00 0 100

The result of the zero input response simulation is shown in Fig. 3.3. The result is similar to the result for the previous controller except the third state convergers faster. The results above show that the weighting factor affects individual states of the system. It changes the response time as well as the control input needed to achieve that response time.

Page 14: Design of a Linear State Feedback Controller

14  

3.3  Effect of Weighting Factor R

Similar to the previous section, two new controllers are designed with a different weighting factor . To illustrate the difference, these two controllers have weighting factors 0.1 and 10 to illustrate the effect of a smaller and larger weighting factor . For 0.1 the feedback controller gain obtained is given by 3.1623 3.3697 1.7218 (3.17) For 10, the feedback controller gain obtained is given by 0.3162 0.2442 0.0729 (3.18)

Figure 3.4 Zero Input Response with 0.1

The zero input response simulations for 0.1 and 10 can be seen in Fig. 3.4 and Fig. 3.5 respectively. As seen in the figures below, when the weighting factor 0.1, the output of the system converges to zero faster. This is due to the control input that is larger than the original controller seen in Fig. 3.1. This is the opposite of what occurs in the last controller when the weighting factor 10. Here, the response is very slow while the control input is small. The results of the simulation support the LQR method theory. In the cost function, is the weighting factor for the control input . Because if that, if is small, then the importance of

becomes small and it is allowed to have a larger value. When is large, more importance is put on the control input to be minimized. Therefore, the value of will be smaller.

Page 15: Design of a Linear State Feedback Controller

15  

Figure 3.5 Zero Input Response with 10

In both cases of weighting factors and , larger weighting factors will cause a larger controller gain in the states or inputs that the factors affect respectively. In general, this will cause the response to be faster for the state or input affected. However, the simulations done were without noise or any non-ideal conditions. If these were to occur, larger gains will cause problems if they were too large.

 

   

Page 16: Design of a Linear State Feedback Controller

16  

Section 4: 

Full Order  State Observer Using  the  Pole  Placement 

Method 

In practical applications, the initial states of a plant are usually unavailable. Therefore, they need to be estimated using the input, output, and model of the system using an observer. Before the observer can be designed, a state-feedback controller needs to be designed using the pole placement method.

4.1  Full Order State Observer Design

Using the pole placement method, stable system poles need to be selected in order to make it stable. Since the plant described is a third order system, three stable poles need to be selected as the desired system poles. The second order dominant pole strategy is used where two conjugate stable poles are chosen along with a third pole located far away from the origin to allow it to decay fast enough to be ignored. For simplicity, the poles chosen for the system are 1 , 1 , and 10. The desired characteristic polynomial is then 1 1 10 12 22 20 (4.1) Using Ackermann’s formula, the state-feedback controller gain is then given by 0 0 1

0 0 1 12 22 20

0 0 10 0 30 1 41 4 0.0920

20 18.276 240 107.264 25.9080 412.1445 3.6320

6.6667 6.0920 8

(4.2)

Next, the observer poles are selected. In theory, the placement of the observer poles depend on the speed of the response desired and constraints driven by noise, saturation, and non-linearity of the plant. As a basic guideline, the poles of the observer should be placed 3 – 5 times farther from the origin than the control poles selected above. Therefore, observer poles that were 3 times farther from the origin as the control poles were chosen. These observer poles are 3 3 , 3 3 , and 30. The desired characteristic polynomial for the observer is then 3 3 3 3 30 36 198 540 (4.3) Using Ackermann’s formula, the observer gain is given by

Page 17: Design of a Linear State Feedback Controller

17  

001

36 198 540001

540 546.2760 960 30.944 54.0920 860.4955 185.424

1 0 00 3 00 0 3

001

32

18.030761.808

(4.4)

The zero input response and control input, using the initial conditions 0.1 0.1 0.1 and 0.1 0.1 0.1 , can be seen in Fig. 4.1. The state estimation error for the observer designed above can be seen in Fig. 4.2.

Figure 4.1 Zero Input Response with Observer Poles 3 Times Control Poles

As can be seen from Fig. 4.1, there is a slight difference between the output of the system with an observer and without an observer. However, they both converge to zero at around the same time. The state estimation error also converges to zero. The same is true for the control input. With observer poles three times the control poles, the control input is very similar to the control input when all states are assumed to be known. From Fig. 4.2, it can be seen that the state estimation errors converge to zero before the output converges to zero which is a desirable characteristic.

Page 18: Design of a Linear State Feedback Controller

18  

4.2  Effect of Observer Pole Location

Next, the effect of observer pole location on the system response is investigated. This is done by creating 3 other observers with observer poles at 1,5, and 10 times the control poles. The selected poles and their respective observer gains are listed in Table 4.1.

Figure 4.2 State Estimation Error with Observer Poles 3x Control Poles

Observer Poles Observer Gain

1 1 10 8 8.636 1.2107 5 5 5 5 50 56 103.364 122.928 10 10 10 10 100 116 573.4 3758.1

Table 4.1 Observer Poles and Their Respective Observer Gains

The zero input response and control input of all the observers above are shown in Fig. 4.3 and Fig. 4.4 respectively. The state estimation errors for the three observers in Table 4.1 are shown in Fig. 4.5, Fig. 4.6, and Fig. 4.7. From Fig 4.3 it can be seen that the controller with observer poles located at the same location as the control poles has very slow response time and a large overshoot. As the observer poles are amplified higher the response moves closer to the response of the controller with all states known. It even performs better when the observer poles are at 10 times the control poles. It can be deduced that the farther the observer poles are from the origin, the better the system response. From Fig 4.4, the control input needed for the controller with observer poles 3 and 5 times the control poles are very similar to the original controller with all the states known. The control input of the controller with observer poles that were the same as the control poles

Page 19: Design of a Linear State Feedback Controller

19  

were relatively large and did not follow the same pattern as the other controllers. The largest control input came from the controller with observer poles that were 10 times the control poles. This suggest that to get the a faster response, a larger control input is needed. Fig 4.5 – 4.7 shows similar pattern to the zero input response in that the farther away the observer poles are from the origin, the faster the states converge to zero.

Figure 4.3 Zero Input Response of Controller with Various Observer Poles

Figure 4.4 Control Input of Controller with Various Observer Poles

From the results of the simulation, we can conclude that the observer poles have to be far enough from the origin to guarantee the desired control performance. The pattern suggests that the farther away the observer poles are from the origin, the better the performance of the system. In practice however, this will be limited by the capabilities of the physical system used to implement the controller and observer. With real physical systems, observer poles that are too large may even cause instability or unsatisfactory performance. Therefore, the

Page 20: Design of a Linear State Feedback Controller

20  

guideline of observer poles located 3 – 5 times farther than the control poles should be followed for satisfactory control performance of the state-feedback controller implementing a full state observer.

Figure 4.5 State Estimation Error with Observer Poles 1x Control Poles

Figure 4.6 State Estimation Error with Observer Poles 5x Control Poles

Page 21: Design of a Linear State Feedback Controller

21  

Figure 4.7 State Estimation Error with Observer Poles 10x Control Poles

   

Page 22: Design of a Linear State Feedback Controller

22  

Section 5: 

Servo Controller Design 

So far, the controller designed can ensure stability of the system by using the estimated states of the system as feedback. However, the controller has not yet addresed the issue of steady state error. To address this, a servo mechanism is added to the controller to enable tracking of a desired output value as well as address disturbance that may occur in the system. Since the system is single input single ouput case, the polynomial approach can be used. In the general polynomial case, the disturbance is located after the plant before the output. In the plant described in this project, the disturbance is located between the plants and . To be able to use the polynomial approach, the system is modified to the form illustrated in Fig. 5.1.  

Figure 5.1 Modified System with Disturbance Moved After Plant

In the modified system above, the plant transfer function is given by

1

4 15.9083 3

4 15.908

(5.1)

The servo mechanism takes the least common denominator of the plant output and disturbance. Since the disturbance is of step form, the servo mechanism is given by 1 1

(5.2)

The generalized plant is created by cascading the servo mechanism of (5.2) with the plant of (5.1). This generalized plant is

Page 23: Design of a Linear State Feedback Controller

23  

1 1 34 15.908

34 15.908

(5.3)

The generalized plant is strictly proper, and, since is a polynomial with a degree larger than 1 and has no root which is a zero of , the generalized plant can be stabilized. This

can be done with a controller of the form . Since the order of the generalized

plant is 5, the controller needs to be of order 4. For simplicity, the desired polynomial of the system is then chosen as 1 (5.4) The controller can then be calculated from the equation (5.5) The solution of (5.5) yields the coefficients of the controller. This is given by 1 123.9231 545.5813 12 3 1/3

5 0.092 4.092 108.1685 (5.6)

The plant and controller was simulated with a step input of 1 at 1 and a step disturbance of 0.1 at 40. The result of the simulation is shown in Fig. 5.2.

Figure 5.2 Step Response of Servo Controller

From Fig. 5.2, it can be seen that the output of the system converges to 1 at steady state after both the input and disturbance have been applied. Therefore, the servo controller has done its job of tracking and disturbance rejection. However, the system response is not good as the

Page 24: Design of a Linear State Feedback Controller

24  

overshoot is large. The high overshoot can occur because the controller has a higher order than necessary. Therefore, the controller has to be simplified as much as possible. This can be done by creating a reduced order servo controller. In the current plant, there are two things that can be done to reduce the order of the generalized system in Fig. 5.1. First, since the system has an integrator term in , only 1 more integrator term needs to be added to fulfill the servo mechanism. Second, stable pole zero cancellation can be used in the controller design to select the numerator that will reduce the order of the system but keep its stability in tact. Under the considerations described above, the controller is then chosen as 4 15.908

(5.7)

Since the stable pole in D is cancelled out by the controller design above, the characteristic polynomial for the whole system is defined by 3 3 (5.8) The characteristic polynomial is a fifth order polynomial. Therefore, to ensure stability, we can set this polynomial to be the desired polynomial 1 5 10 10 5 1 (5.9) By comparing the coefficients of (5.8) and (5.9) the following reduced order controller is derived 4 15.908 1.6667 0.3333

5 10 101.6667 7 27.8467 5.3027

5 10 10

(5.10)

The new controller was simulated with a step input of 1 at 1 and a step disturbance of 0.1 at 40. The result of the simulation is shown in Fig. 5.3. As can be seen in Fig. 5.3, the servo mechanism is still in tact as the system converges to 1 in steady state. The difference here is that the overshoot has been dampened and the settling time has been shortened considerably both during the first step input and during disturbance rejection. This is due to the smaller order controller which created a lower order closed-loop transfer function. With the above controller, not only is the response more desirable, the computational effort to produce the response is reduced because of the lower-ordered system.

Page 25: Design of a Linear State Feedback Controller

25  

Figure 5.2 Step Response of Reduced Order Servo Controller

 

   

Page 26: Design of a Linear State Feedback Controller

26  

Section 5: 

Conclusion 

In this project, controllers were designed to stabilize a single input single output plant. First, the plant’s open loop characteristics were analyzed. Simulations of the plant’s characteristics showed that it was neither asymptotically stable nor BIBO stable. A state-feedback controller was designed to stabilize the system. First, the state-feedback controller was designed using the LQR method. Assuming that all states were measurable, the state-feedback controller designed was able to stabilize the plant. This controller was then altered to analyze the effects of weighting factors and in the LQR method. Results showed that the importance of states are controlled by individual values of the diagonal of , while the importance of the control input is controlled by the value of . Next, since in practical application not all states of the plant are known, an observer-based controller was designed using the pole placement method. Several observers were designed to analyze the effect of the observer pole placement on the overall system response. The results showed that the observer poles are best kept between 3 – 5 times farther from the origin than the control poles. This ensures that the state estimation errors are kept at a satisfactory level while keeping the implementation possible with various physical limitations the system has. Finally, a controller was designed to allow tracking and disturbance rejection in steady state. A full order and reduced order servo controller was designed and simulated in the project. Results showed that a lower-ordered controller will have less overshoot, faster response time, as well as take up less computational power to perform the calculations.

 

 

 

 

 

 

 

 

   

Page 27: Design of a Linear State Feedback Controller

27  

Reference  1. Wang Qing-Guo and Ong Chong Jin. Lecture Notes for Module EE5101R. Accessed

through IVLE. 2013. 2. Xiang Cheng. Lecture Notes for EE5103R Computer Control Systems. Accessed through

IVLE. 2013. 3. MATLAB Documentation Center. Last Accessed November, 18, 2013, from

http://www.mathworks.com.