AUTO_L7_2012 Control Lecture Note

download AUTO_L7_2012 Control Lecture Note

of 23

Transcript of AUTO_L7_2012 Control Lecture Note

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    1/23

    AUTO-1029 Lecture 6 Slide 1

    AUTO-1029: AUTOMOTIVESYSTEMS & CONTROL

    Prof Pavel M. TRIVAILO, PhD(Professor of Aerospace Engineering)

    E-mail: [email protected]

    SAMME, RMIT University, Melbourne, Australia

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    2/23

    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 c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    3/23

    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 c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    4/23

    AUTO-1029 Lecture 6 Slide 4

    LINEAR QUADRATIC

    REGULATOR(LQR)

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    5/23

    AUTO-1029 Lecture 6 Slide 5

    HINTS: LQR

    Let us inspect a cost function J for a linearised n-

    DOF system with state vector x = [q q]T

    COST: J=

    0

    (xTQx + uTRu + 2xTNu) dt

    Firstly, let us determine the dimensions of the ma-

    trices in the cost function matrix expression:

    for n-DOF: x2n1; un1; Q2n2n; Rnn; N2nnLecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    6/23

    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 definite

    with as many columns as [B]. Also, [Q N;N R] must

    be positive definite (you can use EIG to check pos-

    itivity).

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    7/23

    AUTO-1029 Lecture 6 Slide 7

    Let us then distinquish a special case (we will call it

    Case-V), for which

    [Q] =

    [k]nn [0]nn[0]nn [0]nn

    ; [R] [0]nn; [N] = [0]2nn;

    Please observe that for this case the cost is approxi-

    mately equal to the doubled POTENTIAL ENERGY

    of the system V:

    J 2qT[k]q = 2V

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    8/23

    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

    [Q] =

    [0]nn [0]nn

    [0]nn [m]nn

    ; [R] [0]nn; [N] = [0]2nn

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    9/23

    AUTO-1029 Lecture 6 Slide 9

    Prove that for this case the cost is approximately

    equal to the doubled KINETIC ENERGY of the

    system T:

    J 2qT[m]q = 2T

    Therefore, Case-T will correspond to the control

    strategy, where the main consideration is given to

    the minimisation of the kinetic energy of the sys-

    tem.

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    10/23

    AUTO-1029 Lecture 6 Slide 10

    Combining two previous cases, we can introduce

    case (we will call it Case-E), for which

    [Q] =

    [k]nn [0]nn

    [0]nn [m]nn

    ; [R] [0]nn; [N] = [0]2nn

    Please observe that for this case the cost is approx-

    imately equal to the doubled TOTAL ENERGY

    of the system E = V+ T:

    J 2 qT[k]q + 2 qT[m]q = 2V+ 2T = 2 E

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    11/23

    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 strtate-

    gies, including minimisation of the control efforts

    (Case-u) : [Q] [0]2n2n; [R] = [diag(1)]nn; [N] =[0]2nn OR a mixture of the abovementioned Cases.

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    12/23

    AUTO-1029 Lecture 6 Slide 12

    All of these control strategies can be easily imple-mented 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 c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    13/23

    AUTO-1029 Lecture 6 Slide 13

    Describe (represent) the system in MATLAB, us-

    ing the ss MATLAB comand:

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

    Based on the requirements to your system, in-troduce matrices [Q], [R] and [N], as discussed

    before on Slides 5-11.

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

    http://-/?-http://-/?-http://-/?-http://-/?-
  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    14/23

    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] a nd [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 c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    15/23

    AUTO-1029 Lecture 6 Slide 15

    Create a SIMULINK closed-loop model for yoursystem

    Simulate your system in SIMULINK

    Plot results of the simulation in MATLAB

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    16/23

    AUTO-1029 Lecture 6 Slide 16

    LQR EXAMPLE: Test 2-DOF System

    Parameters: m1 = 2; m3 = 3 kg

    k1 = 600; k2 = 280 N/mADDED DAMPING: c1 = 3.8; c2 = 10 Ns/m.

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    17/23

    AUTO-1029 Lecture 6 Slide 17

    EXCITATION EXTERNAL FORCES

    0 5 10 15

    0

    1

    2

    3

    4

    5

    Q1

    [N]

    0 5 10 151

    0.5

    0

    0.5

    1

    Q

    2[N]

    time [s]

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    18/23

    AUTO-1029 Lecture 6 Slide 18

    LQR: SIMULINK DIAGRAM

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    19/23

    AUTO-1029 Lecture 6 Slide 19

    TRICK: option for GAIN

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    20/23

    AUTO-1029 Lecture 6 Slide 20

    LQR: RESULTS for displacements q1 and q2

    0 5 10 150

    2

    4

    Q1,2

    [N]

    Q1

    Q2

    0 5 10 155

    0

    5

    10

    15x 10

    3

    q1

    [m]

    0 5 10 150.01

    0

    0.01

    0.02

    q2

    [m]

    time [s]

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    21/23

    AUTO-1029 Lecture 6 Slide 21

    LQR: RESULTS for velocities q1 and q2

    0 5 10 150

    2

    4

    Q1,2

    [N]

    Q1

    Q2

    0 5 10 150.1

    0.05

    0

    0.05

    0.1

    q1

    [m/s]

    0 5 10 150.1

    0.05

    0

    0.05

    0.1

    q2

    [m/s]

    time [s]

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    22/23

    AUTO-1029 Lecture 6 Slide 22

    COMARISON: NO CONTROL vs LQR

    0 5 10 15

    5

    0

    5

    10

    15x 10

    3

    q1

    [m]

    NO CONTROL

    0 5 10 15

    5

    0

    5

    10

    15x 10

    3

    LQR CONTROL

    0 5 10 15

    5

    0

    5

    10

    15

    x 103

    q2[m]

    time [s]0 5 10 15

    5

    0

    5

    10

    15

    x 103

    q2[m]

    time [s]

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

  • 7/27/2019 AUTO_L7_2012 Control Lecture Note

    23/23

    AUTO-1029 Lecture 6 Slide 23

    INSPECT MATLAB FILE

    My detailed MATLAB/SIMULINK example file is

    provided. In order to re-produce simulation you can

    run one single file twoDOFprojectALL.m:

    >> twoDOFprojectALL

    Note that the SIMULINK model twoDOFprojectLQR.m

    (shown on Slide 18) is run from inside MATLAB

    using the following command:

    >> sim(twoDOFprojectLQR);

    Lecturer: Prof P.M.Trivailo c2012 SAMME, RMIT

    http://-/?-http://-/?-