Sunteți pe pagina 1din 23

AUTO-1029

Lecture 6

Slide 1

AUTO-1029: AUTOMOTIVE SYSTEMS & CONTROL


Prof Pavel M. TRIVAILO, PhD (Professor of Aerospace Engineering) E-mail: trivailo@rmit.edu.au
SAMME, RMIT University, Melbourne, Australia

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 2

Lecture 7: INTRODUCTION INTO OPTIMAL CONTROL LINEAR QUADRATIC REGULATOR (LQR) LQR Control of 2-DOF Systems using SIMULINK (diagram method)

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 3

Lecture 7: FEEDBACK? PROBLEMS?

ANNOUNCEMENT: A-2 Assignment is due on Friday, 21-Sept-2012, 18:00 Groups (with up to 4 Members) Registration of your Groups is due today!
Lecturer: Prof P.M.Trivailo c 2012 SAMME, RMIT

AUTO-1029

Lecture 6

Slide 4

LINEAR QUADRATIC REGULATOR (LQR)

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 5

HINTS: LQR Let us inspect a cost function J for a linearised nDOF system with state vector x = [q q ]T

COST:

J=
0

(xT Qx + uT Ru + 2xT N u) dt

Firstly, let us determine the dimensions of the matrices in the cost function matrix expression: for n-DOF:
Lecturer: Prof P.M.Trivailo c 2012

x2n1; un1; Q2n2n; Rnn; N2nn


SAMME, RMIT

AUTO-1029

Lecture 6

Slide 6

These matrices will be used in the lqr(SYS,Q,R,N) or lqr(A,B,Q,R,...) MATLAB commands. Note, that in these commands, there are peculiar requirements to the matrices, for example: the [R] matrix must be symmetric positive denite with as many columns as [B ]. Also, [Q N;N R] must be positive denite (you can use EIG to check positivity).

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 7

Let us then distinquish a special case (we will call it Case-V ), for which [ k ] n n [ 0 ] n n ; [Q ] = [ 0 ] n n [ 0 ] n n

[R] [0]nn;

[N ] = [0]2nn;

Please observe that for this case the cost is approximately equal to the doubled POTENTIAL ENERGY of the system V : J 2q T [k ]q = 2V
Lecturer: Prof P.M.Trivailo c 2012 SAMME, RMIT

AUTO-1029

Lecture 6

Slide 8

Therefore,

Case-V will correspond to the control

strategy, where the main consideration is given to the minimisation of the potential energy of the system. Similarly, let us distinquish a case (we will call it Case-T ), for which [0]nn [0]nn ; [Q ] = [ 0 ] n n [ m ] n n

Lecturer: Prof P.M.Trivailo c 2012

[R] [0]nn;

[N ] = [0]2nn;
SAMME, RMIT

AUTO-1029

Lecture 6

Slide 9

Prove that for this case the cost is approximately equal to the doubled system T : J 2q T [m]q = 2T Therefore, Case-T will correspond to the control KINETIC ENERGY of the

strategy, where the main consideration is given to the minimisation of the kinetic energy of the system.
Lecturer: Prof P.M.Trivailo c 2012 SAMME, RMIT

AUTO-1029

Lecture 6

Slide 10

Combining two previous cases, we can introduce case (we will call it

Case-E ), for which

[ k ] n n [ 0 ] n n ; [Q ] = [ 0 ] n n [ m ] n n

[R] [0]nn;

[N ] = [0]2nn;

Please observe that for this case the cost is approximately equal to the doubled of the system E = V + T : J 2 q T [k ]q + 2 q T [m]q = 2V + 2T = 2E
Lecturer: Prof P.M.Trivailo c 2012 SAMME, RMIT

TOTAL ENERGY

AUTO-1029

Lecture 6

Slide 11

Therefore, the last

Case-E will correspond to the

control strategy, where the main consideration is given to the minimisation of the total energy of the system. We can also introduce some other control strtategies, including minimisation of the control eorts (Case-u) : [Q] [0]2n2n; [R] = [diag (1)]nn; [N ] = [0]2nn OR a mixture of the abovementioned Cases.
Lecturer: Prof P.M.Trivailo c 2012 SAMME, RMIT

AUTO-1029

Lecture 6

Slide 12

All of these control strategies can be easily implemented in MATLAB and/or SIMULINK. You may employ the following steps:

Enter the system matrices [m], [k], [c].

Calculate the state-space matrices [A], [B ], [C ] and [D].


Lecturer: Prof P.M.Trivailo c 2012 SAMME, RMIT

AUTO-1029

Lecture 6

Slide 13

Describe (represent) the system in MATLAB, using the ss MATLAB comand:

>> SYS = ss(A,B,C,D)

Based on the requirements to your system, introduce matrices [Q], [R] and [N ], as discussed before on Slides 5-11.
Lecturer: Prof P.M.Trivailo c 2012 SAMME, RMIT

AUTO-1029

Lecture 6

Slide 14

Calculate the optimal control gain matrix K using the MATLAB command >> [K,S,e] = lqr(SYS,Q,R,N) In the Project, we do not need to use calculated matrices [S ] and [e]. However, the matrix [K ] will be very important. The values in this matrix, gains, will be used to calculate the optimal control feedback as u = Kx.
Lecturer: Prof P.M.Trivailo c 2012 SAMME, RMIT

AUTO-1029

Lecture 6

Slide 15

Create a SIMULINK closed-loop model for your system

Simulate your system in SIMULINK

Plot results of the simulation in MATLAB

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 16

LQR EXAMPLE: Test 2-DOF System

Parameters:

m1 = 2; m3 = 3 kg k1 = 600; k2 = 280 N/m c1 = 3.8; c2 = 10 Ns/m.


SAMME, RMIT

ADDED DAMPING:

Lecturer: Prof P.M.Trivailo c 2012

AUTO-1029

Lecture 6

Slide 17

EXCITATION EXTERNAL FORCES


5 4 Q [N] 3 2 1 0 0 5 10 15

0.5 Q [N]

0.5

5 time [s]

10

15

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 18

LQR: SIMULINK DIAGRAM

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 19

TRICK: option for GAIN

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 20

LQR: RESULTS for displacements q1 and q2


4 Q1,2 [N] 2 0 0 15 10 q [m]
1

Q1 Q2

5
3

10

15

x 10

5 0 5 0 5 10 15

0.02 0.01 0 0.01

q [m]

5 time [s]

10

15

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 21

LQR: RESULTS for velocities q 1 and q 2


4 Q1,2 [N] Q1 Q2

0 0 0.1 q [m/s] 0.05 0 0.05 0.1 0 5 10 15 5 10 15

0.1 q [m/s] 0.05 0 0.05 0.1 0 5 time [s] 10 15

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 22

COMARISON: NO CONTROL vs LQR


x 10 15 10 q1 [m] 5 0 5 0 5 10 15
3

NO CONTROL 15 10 5 0 5

x 10

LQR CONTROL

10

15

x 10 15 10 q2 [m] 5 0 5 0

x 10 15 10 q2 [m] 5 0 5 5 time [s] 10 15 0

5 time [s]

10

15

Lecturer: Prof P.M.Trivailo c 2012

SAMME, RMIT

AUTO-1029

Lecture 6

Slide 23

INSPECT MATLAB FILE My detailed MATLAB/SIMULINK example le is provided. In order to re-produce simulation you can run one single le twoDOFprojectALL.m: >> twoDOFprojectALL

Note that the SIMULINK model twoDOFprojectLQR.md (shown on Slide 18) is run from inside MATLAB using the following command: >> sim(twoDOFprojectLQR);
Lecturer: Prof P.M.Trivailo c 2012 SAMME, RMIT

S-ar putea să vă placă și