vgu control theory

48
Control Theory Mechatronic and Sensor Systems Technology VGU Prof. Dr. Frieder Keller Karlsruhe University of Applied Sciences [email protected]

Upload: nguhien

Post on 01-Oct-2015

20 views

Category:

Documents


3 download

DESCRIPTION

Control Theory for student in Vietnam German University

TRANSCRIPT

  • Control Theory

    Mechatronic and Sensor Systems Technology VGU

    Prof. Dr. Frieder Keller

    Karlsruhe University of Applied Sciences

    [email protected]

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 1

    Contents

    1 Recommended Literature

    2 Examples of Control Systems

    3 General Structure of a Control Loop

    4 Block Diagrams

    5 Mathematical Description of Dynamic Systems

    6 Differential Equations

    7 Laplace-Transform

    8 Frequency-Response Analysis

    9 Basic Functional Elements

    10 Analysis of Control Systems

    11 Stability Analysis of Control Systems

    12 Tuning-Rules for Control-Parameters

    13 Modifications of the Standard Control Loop

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 2

    Recommended Literature [1] Nise, Norman S. Control systems engineering, John Wiley, 2000. [2] Ogata, Katsuhiko Modern Control Engineering, Prentice Hall [3] Ogata, Katsuhiko System Dynamics, Pearson, Prentice Hall It is also recommended to visit the Internet-page: [4] http://www.engin.umich.edu/group/ctm/ which provides a Control Systems Tutorial You can also access this tutorial offline by clicking on index.html on the subdirectory tutorial in the public directory. This tutorial covers much more aspects than the lec-ture.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 3

    Examples of Control Systems

    control knob

    heater

    temperaturesensor

    Temperature Control

    inertia

    motoru

    nc

    nr

    speedsensor

    nc

    controller

    Speed Control

    spindle

    motoru

    xc

    xr

    controller

    positionsensor

    xc

    Position Control

    qin

    pump

    u

    levelsensor

    controller

    hc

    hr

    hc

    Liquid Level Control

    coil

    iron ball

    solarcell

    lamp

    Position Control (suspended ball)

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 4

    Structure of a Control Loop

    controller motor-

    nc

    x Ks

    nrx Ks

    u(nr)

    Speed Control System

    controller motor-

    ncnrx Ks

    Equivalent System

    controller process-

    r ce y

    General structure of a Control Loop

    r: request signal, input signal, reference input e: error signal y: controller output c: controlled variable, plant output

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 5

    Controlled variable:

    The controlled variable is the output of the process. It is measured by a sensor element and controlled.

    Reference input:

    The reference input is the desired value for the controlled variable. It may be a constant value or may be a time-dependent signal.

    Manipulated variable:

    The manipulated variable is the output of the controller and the input of the process. The goal is to affect the value of the controlled variable to minimize the deviation of the controlled variable from the desired value.

    Process:

    Any operation to be controlled is called a process. Disturbance:

    A disturbance influences the process and tends to affect the value of the con-trolled variable.

    Feedback control or closed loop control:

    A system where the controlled variable is measured and compared with the desired value. Any deviation leads to a controller output which reduces the dif-ference between the desired value and the controlled variable.

    Open loop control:

    In an open-loop control system the output is not measured and thus not com-pared with the input signal. The effect of disturbances cannot be compen-sated.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 6

    Goals in Control Engineering:

    Stability, Dynamics, Accuracy, Overshoot

    0 5 10 15 20 25 30 0

    0.5

    1

    1.5

    t

    r,c

    accuracyovershoot

    dynamics

    Dynamics, Overshoot, Accuracy

    0 5 10 15 20 25 30-1

    -0.5

    0

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    t

    r,c

    Step Response of an unstable System

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 7

    Signals and Block Diagrams

    t

    (t)

    1

    t

    r(t)

    1

    00 1

    t

    (t)

    1

    0 t

    approximationfor (t)

    0

    1/

    UNIT STEP UNIT RAMP

    DIRAC PULSE

    Basic functions

    systeminput signal output signal

    Functional Block

    yG1(s)

    -G2(s)

    x

    summing point branch point

    Block Diagram

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 8

    Mathematical Description of Dynamic Systems - Differential Equations,

    - Laplace-Transformation

    LTI-

    systeminput signal output signal

    x(t) y(t)

    Linear, time-invariant system

    a d y tdt

    a d y tdt

    a dy tdt

    a y t b d x tdt

    b d x tdt

    b x tnn

    n n

    n

    n m

    m

    m m

    m

    m( ) ( ) ... ( ) ( ) ( ) ( ) ... ( )+ + + + = + + +

    1

    1

    1 1 0 1

    1

    1 0

    for technical systems: n m

    Differential Equation

    1) Given: x(t), inital conditions Obtain: y(t) solution of the differentail equation

    2) Given: x(t)=(t), inital conditions = 0 Obtain: y(t) = h(t) step response 3) Given: )sin()( 0 txtx = Obtain: y(t) for steady state

    frequency response 4) Given: x(t) and y(t) Obtain: coefficients ai and bi

    system identification 5) Check the stability of the system

    stability test

    Standard Problems

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 9

    Definition of the Laplace-Transform: ( ){ }L f t F s f t e dts t= = ( ) ( )0

    Some rules:

    ( ){ } ( ){ } ( ){ }( ){ } ( ){ }

    ( ){ }( ) { }

    L L L

    L L

    L L

    L L

    f t g t f t g t

    a f t a f tdf tdt

    s f t f t

    f ds

    f tt

    + = + =

    = =

    =

    ( )

    ( )( )

    ( )

    0

    1

    0

    Small Laplace Transform Table:

    ( )t

    1s

    e a t 1s a+

    t 12s

    ( )1 1a e at ( )1s s a + ( )sin at a

    s a2 2+ ( )cos at s

    s a2 2+

    fr d1: ( )1 111 2

    2

    1 21 2

    21 2 + = T

    T Te T

    T Te mit T T d d

    tT

    tT

    ,

    12 12 2( )T s d T s s + +

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 10

    Some other rules:

    ( ){ } ( ){ }( ){ }

    0)at t sderivativeor their impulses no are there(if )(lim)0(

    exists) )f(t (if )(lim)()(

    0

    ==+=

    +==

    ssFf

    ssFtfasFtfe

    tfeTtf

    s

    s

    at

    sTD

    D

    L

    LL

    In practice Laplace-transform is performed using a table and the Laplace-theorems or a computer program like MAPLE or MATLAB with the symbolic toolbox. Inverse Laplace-transform also uses tables and computer programs. Sometimes the partial-fraction expansion method can be used to split a complicated expression in a sum of simpler expressions. Consider a LTI-system which is characterized by the following differential equation:

    a d y tdt

    a d y tdt

    a dy tdt

    a y t b d x tdt

    b d x tdt

    b x tnn

    n n

    n

    n m

    m

    m m

    m

    m( ) ( ) ... ( ) ( ) ( ) ( ) ... ( )+ + + + = + + +

    1

    1

    1 1 0 1

    1

    1 0

    Laplace-Transformation gives:

    a s Y s a s Y s a Y s b s X s b s X s b X sa s a s a Y s b s b s b X sY sX s

    b s b s ba s

    nn

    nn

    mm

    mm

    nn

    nn

    mm

    mm

    mm

    mm

    nn

    ( ) ( ) ... ( ) ( ) ( ) ... ( )( ... ) ( ) ( ... ) ( )

    ( )( )

    ...

    + + + = + + + + + = + + + = + + ++

    11

    0 11

    0

    11

    0 11

    0

    11

    0

    a s aG s

    nn

    + + =1 1 0... ( )

    G(s) is the transfer-function. To obtain the output y(t) with given input x(t) and initial conditions (here considered to be 0) the following recipe can be used:

    1. Obtain G(s) 2. Find the Laplace-transform of x(t) 3. Obtain Y(s)=G(s)X(s) 4. Find the inverse Laplace-transform of Y(s)

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 11

    Example: Obtain the step response of a 1st order lowpass with initial condition =0. Solution:

    differential equation: xyTy =+ & input signal: )()( ttx = initial condition: 0)0( ==ty

    to obtain output signal: )(ty

    Laplace-Transformation gives:

    )()()( sXsYsTsY =+

    This equation may be solved for Y(s)!

    sT

    sTssTsX

    sTsY 11

    1111

    1)(1

    1)( +

    =+=+=

    We have got the solution (but it is in Laplace-domain).

    With the help of our Laplace-table we obtain the inverse Laplace-transform:

    Tt

    ety= 1)(

    This is the well-known formula for the step response of a first order lowpass.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 12

    Example: Solution of a differential equation of 2nd order with nonzero initial condi-tions.

    differential equation: xyTy =+ &&2 input signal: 0)( =tx initial conditions: 00 )0()0( vtyyty ==== &

    to obtain signal: )(ty Solution:

    Preliminary considerations: The Laplace-Transform of a second derivative is:

    { } { } { }( )

    )0()0()()0()0()()0()((

    2 ========

    tytyssYstytytysstytysty

    &&&&&& LLL

    This way the initial conditions are included in the solution process. Now Laplace-Transformation of the differential equation gives:

    0)()( 02

    0222 =+ vTysTsYsTsY

    and we can solve for Y(s):

    ( )0202221 1)( vTysTsTsY ++= 0

    22

    0

    22

    022

    2

    022

    2

    1

    1

    111)( v

    TsTTy

    Ts

    svsT

    TysTsTsY

    ++

    +=+++

    =

    With the help of our Laplace-table we obtain:

    +

    =TtTv

    Ttyty sincos)( 00

    This describes for example the undamped oscillation of a spring-mass-system.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 13

    Example: Obtain the response of a 1st order lowpass with initial condition =0 for an input signal ( )txtx sin)( 0 = . Solution:

    differential equation: xyTy =+ & input signal: ( )txtx sin)( 0 = initial condition: 0)0( ==ty with Laplace-transformation:

    TssxsY ++= 1

    1)( 220

    written with partial fractions

    TsC

    sBAs

    TssxsY +++

    +=++= 111)( 22220

    The coefficients A,B,C are determined as follows:

    ( ) CT

    xCTss

    BAss

    x =+

    ++++=+ 22022220 1

    1

    ( ) BAjTj

    xBAjTj

    xsTsCBAs

    Tsx +=+=+++++=+ 1

    1;1

    111

    100

    220

    ( )( ) ( )( )22

    0

    0000

    00

    1

    112

    11112

    11

    11

    11;

    11

    TxB

    TjTjx

    TjTjTjTjxB

    Tjx

    Tjx

    BAjTj

    xBAjTj

    x

    +=+=+

    ++==++

    +=+=+

    ( )( ) ( )( )22

    0000

    00

    1

    112

    11112

    11

    11

    11;

    11

    TTA

    TjTjTjx

    TjTjTjTjxAj

    Tjx

    Tjx

    BAjTj

    xBAjTj

    x

    +=

    +=+

    ==+

    +=+=+

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 14

    With the coefficients A,B,C from the above calculations we can write Y(s) as:

    ++++++++

    =sTT

    TsTs

    sTTxsY

    /11

    111

    1)( 22222222220

    Inverse Laplace-transform gives:

    +++++

    = Tt

    eTTt

    Tt

    TTxty 2222220 1

    )sin(1

    1)cos(1

    )(

    ( )[ ]

    ++=

    Tt

    eTTTtVxty 220 1

    arctansin)(

    with

    ( ) 2222222

    11

    1

    1

    TT

    TV +=++=

    y(t) has two parts: the steady state solution ysteady(t) and the transient solution ytransient(t)

    ( )[ ]Tt

    transient

    steady

    eTTxty

    TtVxty

    +=

    =

    220

    0

    1)(

    arctansin)(

    The following figure shows x(t) and y(t) for T1= :

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 15

    0 0.5 1 1.5 2 2.5 3-1

    -0.8

    -0.6

    -0.4

    -0.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    t/T

    2

    /4

    ysteady and ytransient are depicted in the next figure:

    0 0.5 1 1.5 2 2.5 3-1

    -0.8

    -0.6

    -0.4

    -0.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    t/T

    x

    ysteady

    ytransient

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 16

    For this example it can be seen that the amplification factor V is given by:

    )( jGV =

    and the phase shift is: { }{ } )()(Re

    )(Imarctan jGjGjG ==

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 17

    Frequency-Response Analysis The two above relations are valid for all stable LTI-systems. This is shown in the following. We consider a system with input signal ( )txtx sin)( 0 = and transfer function G(s). The output signal y(t) has the Laplace-transform:

    )()( 220 sGsxsY +=

    With partial fraction expansion we have:

    .........

    ...

    ...)()( 22220 +++++=+=

    s

    BAssGs

    xsY

    In this expression all the terms with ... belong to the transient response which tend towards 0 for large values of t. This is only the case if the system under consideration is stable. For the steady state response it is only necessary to determine the values A and B. Multiplying both sides by 22 +s we have:

    ( )220 ...............)( + ++++= sBAssGx With s=j and s=-j we have:

    BAjBAjjGx

    BAjBAjjGx

    +=

    ++++=

    +=

    ++++=

    0.........

    ...

    ...)(

    0.........

    ...

    ...)(

    0

    0

    These are two equations for the two unknowns A and B. It can be easily seen that:

    { }{ })(Im

    )(Re

    0

    0

    jGxAjGxB

    ==

    So we have: { } { } .....)(Re)(Im)( 220220 ++

    ++=

    sjGx

    ssjGxsY

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 18

    With the inverse Laplace-transform we obtain: { } ( ) { } ( )[ ]

    { }{ } ....)(Re

    )(Imarctansin)()(

    ....sin)(Recos)(Im)(

    0

    0

    +

    +=

    =++=

    jGjGtjGxty

    tjGtjGxty

    This shows that for a stable LTI-system gain V and phase shift are given by:

    )( jGV =

    and: { }{ } )()(Re

    )(Imarctan jGjGjG ==

    For a sinusoidal input x(t) a stable LTI-system in steady state is characterized by a magnitude response and a phase response. Both, magnitude and phase depend on the frequency. Frequency response is obtained as follows:

    1. Replace s by j. in G(s) to obtain G(j) 2. The magnitude is given by G(j) 3. The phase is given by G(j)

    Note that s may only be substituted by j if the system is stable, otherwise a steady state response does not exist.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 19

    Bode diagram and Nyquist plot Bode diagrams and Nyquist plots are a graphical representation of )( jG . The Bode plot consists of two graphs: the magnitude and the phase

    )()( jGandjG The horizontal axis in the Bode plots show the frequency in logarithmic scale. The magnitude is expressed in decibels (dB):

    )(lg20 jGadB =

    Some special values are given in the following table:

    Gain 100

    1 101

    21

    22 1 2 10 100

    adB -40 -20 -6 -3 0 3 20 40 The phase is shown in linear scale. The following figure shows the Bode diagram for a first order system with

    sTwithTs

    sG 11

    1)( =+=1

    Frequency (rad/sec)

    Pha

    se (

    deg)

    ; M

    agni

    tude

    (dB

    )

    Bode Diagrams

    -20

    -15

    -10

    -5

    0From: U(1)

    10-1 100 101-100

    -80

    -60

    -40

    -20

    0

    To:

    Y(1

    )

    1 The plot is generated with MATLAB using the command bode(tf([1],[1 1]),'k')

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 20

    The Nyquist plot shows the real and imaginary parts of )( jG when is varied. Usually is varied between 0 and . The following figure is generated with MATLAB using the Nyquist-command2. MATLAB varies in the range -

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 21

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    f/f0

    a/dB

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -200

    -150

    -100

    -50

    0

    50

    100

    150

    200

    f/f0

    /

    -4 -3 -2 -1 0 1 2 3 4-4

    -3

    -2

    -1

    0

    1

    2

    3

    4

    real part

    imag

    inar

    y pa

    rt

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 22

    Basic functional elements

    The proportional element: Equation: xKy = . K is called the gain. Transfer function: KsG =)( Step response of the proportional element: )()( tKth = Bode-diagram:

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    f/f0

    a/dB

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -200

    -150

    -100

    -50

    0

    50

    100

    150

    200

    f/f0

    /

    Nyquist-plot:

    -4 -3 -2 -1 0 1 2 3 4-4

    -3

    -2

    -1

    0

    1

    2

    3

    4

    Examples:

    Mechanical beam Input signal is the position of the left end, output signal is the position of the beams right end

    Voltage divider using a potentiometer as position sensor. input: position of the wiper, output: output voltage

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 23

    The integrator: Equation: = xdtKy I . Transfer function:

    sKsG I=)(

    Step response: )()( trKth I = (the ramp function) Bode-diagram:

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    f/f0

    a/dB

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -200

    -150

    -100

    -50

    0

    50

    100

    150

    200

    f/f0

    /

    Nyquist-plot:

    -4 -3 -2 -1 0 1 2 3 4-4

    -3

    -2

    -1

    0

    1

    2

    3

    4

    Examples:

    - Water tank Input: flow rate, output: liquid level

    qin

    h

    out

    valve

    q

    - Relation between velocity and distance

    Input: velocity, output: distance

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 24

    The differentiator: Equation: xKy D &= .. Transfer function: sKsG D =)( Step response: )()( tKth D = (the Dirac pulse) Bode-diagram:

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    f/f0

    a/dB

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -200

    -150

    -100

    -50

    0

    50

    100

    150

    200

    f/f0

    /

    Nyquist-plot:

    -4 -3 -2 -1 0 1 2 3 4-4

    -3

    -2

    -1

    0

    1

    2

    3

    4

    Examples:

    Relation between velocity and acceleration input: velocity, output: acceleration

    Electronic differentiator (Opamp-circuit)

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 25

    The first order lowpass: Equation: xKyyT P =+ & Transfer function:

    TsKsG P+= 1)(

    Step response:

    = T

    t

    P eKth 1)(

    0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    t/T

    y

    At t=T the step-response reaches 63% of the final value. The tangent at t=0 intersects the line of the final value at t=T. Bode-diagram (for KP=1):

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    f/f0

    a/dB

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -200

    -150

    -100

    -50

    0

    50

    100

    150

    200

    f/f0

    /

    Nyquist-plot (for KP=1):

    -1 -0.5 0 0.5 1-1

    -0.8

    -0.6

    -0.4

    -0.2

    0

    0.2

    0.4

    0.6

    0.8

    1

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 26

    Examples:

    RC-lowpass filter input: input voltage, output: output voltage

    U2RC

    U1

    Electrical motor input: voltage u, output: speed

    Motorui

    inertia

    Inductance with resistance

    input: voltage, output: current Exercise: Draw the block diagram of an electrical motor. input: voltage, output: angular position

    Motorui

    inertia

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 27

    The first order highpass: Equation: xKyyT D && =+ Transfer function:

    TssKsG D+= 1)(

    Step response: Tt

    D eTKth

    =)( Drawing for KD=T:

    0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    t/T

    y

    Bode-diagram (for KD=T):

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    f/f0

    a/dB

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -200

    -150

    -100

    -50

    0

    50

    100

    150

    200

    f/f0

    /

    Nyquist-plot (for KD=T):

    -1 -0.5 0 0.5 1-1

    -0.8

    -0.6

    -0.4

    -0.2

    0

    0.2

    0.4

    0.6

    0.8

    1

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 28

    Examples:

    RC-highpass filter input: input voltage, output: output voltage

    U2R

    CU1

    Modified differentiator (exercise: draw the circuit)

    RC-lowpassfilter (exercise: find the appropriate input and output signal)

    Exercise: Represent the highpass by a series connection of a lowpass and a differentiator.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 29

    The second order lowpass: Equation: xKyyTdyT P =++ &&& 22 d is called the damping ratio.

    Transfer function: 2221)(

    sTdTsKsG P++=

    Step response:

    d>1

    ( )11)( 22,121

    2

    21

    1 21 =

    += ddTTmite

    TTTe

    TTTKth

    Tt

    Tt

    P

    d=1

    += Tt

    P eTtKth 11)(

    d

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 30

    Bode-diagram (for KP=1):

    10-2

    10-1

    100

    101

    102

    -80

    -70

    -60

    -50

    -40

    -30

    -20

    -10

    0

    10

    20

    / 0

    |G| i

    n dB

    Asymptote fr 0

    Asymptote fr

    d=0.2

    d=0.6

    d=1.0 d=1.4

    d=1.8

    10-2

    10-1

    100

    101

    102

    -200

    -180

    -160

    -140

    -120

    -100

    -80

    -60

    -40

    -20

    0

    / 0

    G

    Asymptote fr 0

    Asymptote fr

    d=0.2

    d=0.6 d=1.0

    d=1.4

    d=1.8

    Nyquist-plot (for KP=1):

    -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5

    -3

    -2.5

    -2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    Realteil

    Imag

    inr

    teil

    d=0.2

    d=0.6

    d=1.0

    d=1.4 d=1.8

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 31

    Examples:

    RLC-filter input: input voltage u1, output: output voltage u2

    U2RC

    U1 L

    Spring-mass-system input: force, output: position of the mass

    md

    cF

    y

    Exercise: Describe the above RLC-filter with a block diagram containing two integra-tors

    Exercise: Replace the series connection of two identical lowpasses of first order by a lowpass of 2nd order.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 32

    The delay element: Equation: )()( DP TtxKty = TD is called the delay-time. Transfer function: sTP DeKsG

    =)( Step response: )()( DP TtKth = Example: Conveyor belt:

    h1 h2

    l

    v

    Bode-diagram (for KP=1):

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    f/f0

    a/dB

    10-3

    10-2

    10-1

    100

    101

    102

    103

    -200

    -150

    -100

    -50

    0

    50

    100

    150

    200

    f/f0

    /

    Nyquist-plot (for KP=1):

    -1 -0.5 0 0.5 1-1

    -0.8

    -0.6

    -0.4

    -0.2

    0

    0.2

    0.4

    0.6

    0.8

    1

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 33

    Analysis of Control Systems Closed loop transferfunction:

    cG1(s)

    -G2(s)

    r

    controller process

    The transfer function of a closed loop is easily obtained. [ ]

    )()(1)()(

    )()(

    )()()()()(

    21

    21_

    21

    sGsGsGsG

    sRsCG

    sCsRsGsGsC

    loopclosed +==

    =

    The PID-controller: The equation of a controller with proportional-plus-integral-plus-derivative control ac-tion is:

    ++= eTedtTeKy diP &

    1

    An electronic circuit or PID-control-action is shown in the next figure:

    uin

    uout

    Rp

    R1

    R1

    R1

    R1

    R1

    Rd

    Cd

    Ri

    Ci

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 34

    The transfer function is:

    sTsTTsTKsG

    sTsT

    KsG

    i

    diiP

    di

    P

    ++=

    =

    ++=

    21)(

    11)(

    With the help of variable resistors RP, Ri and Rd the parameters KP, Ti and Td can be adjusted. Variation of a resistor does only affect one of the control parameters.A PID-controller may also be realized in a circuit with fewer components:

    uin uout

    R1

    CiR2CdR3

    However, varying one element affects not only one control parameter. So we prefer the first circuit for experimental tuning of control parameters and the second for reali-zation with reduced number of components. Exercise: Establish the transfer function of the above circuits and find the relation between the control and component parameters. Hint: The resistor R3 realizes modified differen-tiation.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 35

    Control of an integrating process

    r

    -

    ce uPK Ts

    1

    sKT

    sTK

    sTK

    sRsC

    PP

    P

    +=

    +=

    1

    111

    1

    )()(

    From this transfer function we conclude that - the control loop is stable (first order lowpass is stable) - the control loop has no overshoot (because a first order system cannot have an

    overshoot) - the control loop is accurate (because for s=0 we obtain a gain of 1) - the dynamics can be adjusted by the variation of KP (because the time constant

    is T/KP)

    Exercise: Obtain the transfer function)()(sRsU . Sketch u(t) for r=(t).

    Exercise: Analyze the following control loop, where z is a disturbance z=z0(t). Is the control loop still accurate?

    r

    -

    ce uPK Ts

    1

    z

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 36

    P-Control of a first order lowpass system

    r

    -

    ce uPK Ts

    K+1

    sKKTKKKK

    sTKKKK

    sTKKsT

    KK

    sRsC

    P

    P

    P

    P

    PP

    +++

    =++

    =++

    +=1

    1

    11

    11

    1)()(

    From this transfer function we conclude that - the control loop is stable (first order lowpass is stable) - the control loop has no overshoot (because a first order system cannot have an

    overshoot) - the control loop is not accurate (because for s=0 we obtain a gain of

    11

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 37

    Solution: We compare the transfer function with the standard form of a 2nd order lowpass.

    222 ''21

    1

    1

    1sTsdTs

    KTTs

    KT ii ++=++

    Now we find:

    KTTT i =' and

    TKT

    TTKKT

    KTTd

    KTdT i

    i

    iii

    ====

    22'2'2

    An overshoot exists if d

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 38

    Control of a 2nd order lowpass system From the above we may conclude that the strategy of pole compensation is also suit-able for a second order process. However, in this case a PID-controller is needed.

    r

    -ce u

    2221 sTdTsK

    ++sTi1

    PK

    sTd

    sKK

    TsTKKsTKK

    sTdTsK

    sTsTTsTK

    sTdTsK

    sTsTTsTK

    sTdTsKsT

    sTK

    sTdTsKsT

    sTK

    sRsC

    P

    i

    i

    P

    i

    P

    i

    idiP

    i

    idiP

    di

    P

    di

    P

    +=

    +

    =++

    +++++

    ++

    =++

    +++

    ++

    ++=

    1

    1

    121

    11

    211

    21111

    2111

    )()(

    22

    2

    22

    2

    22

    22

    We have chosen: dT

    TTTanddTTi

    di 22

    2

    === This leads to the same transfer function as in the previous example. However, in practice we have to take care for the output of the controllers differenti-ator not to go in saturation. This can be achieved by rate limiting of the input signal and/or modified differentiation. The realization of a rate limiter with an Opamp-circuit is shown in the following figure:

    R

    C

    R1

    R1

    R2

    R3

    uout

    uin

    Note that we usually choose a high gain of the non-inverting amplifier, so it may also go in saturation. Let umax and umin denote the maximum and minimum output voltage

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 39

    of the amplifier. Then RC

    udtduout minmax/

    minmax/= . With the negative feedback it is ensured

    that the output voltage always follows the input voltage. Note that the output is in-verted, so one needs an additional inverter to have the correct sign. Control of a 3rd order lowpass (academic example) Consider the following control loop:

    r cuTs+1

    1PK Ts+1

    1Ts+1

    1-

    e

    Exercise: Find the transfer function of the closed loop. What is the steady state error for KP=1, KP=3 and KP=9? Here we find that the control loop is unstable if the controller gain KP exceeds a cer-tain threshold (Kcritical=8). For KP

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 40

    Stability Analysis

    We will introduce two stability criterions. The first is based on the closed loops transfer function and its pole locations in the complex plane. The second is the Nyquist criterion. It analyzes the open loops Nyquist curve. The pole location criterion states: A system is stable if all poles of its transfer function are located in the left half of the complex plane if all poles have a negative real part. Note that this stability criterion can only be applied if the system does not contain any delay elements. For the above example we may evaluate the pole locations depending on the pa-rameter K. Often the pole locations are visualized in the so-called root-locus-diagram. The corresponding MATLAB-command is rlocus. The following graph is obtained with this procedure:

    -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0 0.5-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2Root Locus

    Real Axis

    Imag

    inar

    y Axi

    s

    There are three poles. As K is increasing one pole (blue line) is moving to the left, the other poles however are approaching the imaginary axis and for K>8 they are enter-ing the right half plane and the closed loop gets unstable. As another example consider P-control of a 2nd order lowpass. The corresponding root locus plot looks like this:

    -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2Root Locus

    Real Axis

    Imag

    inar

    y Axi

    s

    From this we conclude that the control loop cannot get unstable.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 41

    A powerful and complex theory has been developed on the basis of root locus plots including also the design of controllers. However these details are not treated in this lecture. The Rouths criterion allows us to determine whether the system is stable without explicitly evaluating the poles. Rouths stability criterion is outlined in the following: Write the polynomial (denominator of the closed loop) in the following form (it is as-sumed that 0na ):

    n

    nnnn asasasasa +++++ ...3322110

    Check if all the coefficients are nonzero and have the same sign. If not, the system is not stable or there are roots which are imaginary. However this is only a necessary but not a sufficient condition.

    Arrange the coefficients in rows and columns according to the following scheme:

    sn a0 a2 a4 a6 . . .

    sn-1 a1 a3 a5 a7 . . . sn-2 b1 b2 b3 b4 . . . sn-3 c1 c2 c3 c4 . . .

    . . . .

    .

    . s0 g1

    The coefficients ai have to be filled in from the polynomial. The coefficients bi, ci, are evaluated according to the following rule:

    1

    30211 a

    aaaab = 1

    50412 a

    aaaab =

    1

    21311 b

    baabc = 1

    31512 b

    baabc = The table is filled until we have completed the line with label s0. The system is stable if all coefficients in the first column have the same sign.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 42

    Exercise: Find the necessary and sufficient conditions for a system with transfer-

    function 32

    21

    30

    1)(asasasa

    sG +++= to be stable. Exercise: Apply the Routh criterion to the academic example The Nyquist criterion is based on the open loop:

    processu c

    controllerr

    -

    e

    If we use a sinusoidal input (e.g. from a function generator) for the controller the steady state output c(t) will also be a phase-shifted sine-function (provided the open loop is stable). In the case of our academic example it is found that the phase shift

    may be -1800 (for a frequency T3= ) and the gain may be 1 (for a controller gain

    8=PK ). This may be shown by analytical calculation and verified by simulation (see the following SIMULINK-model).

    1

    tau*tau*tau.s +3*tau*taus +3*taus+13 2

    Transfer Fcn

    Subtract

    8

    SliderGain2

    Sine Wave

    Scope

    Manual SwitchGround

    If we now toggle the switch and close the control loop the oscillation continues with-out changing the amplitude. This means the control loop is at the verge to instability. For higher values of the gain however the amplitude will increase: the control loop is unstable. For gains less than 8 the oscillation is damped and goes towards 0: the control loop is stable.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 43

    This example illustrates the simplified Nyquist criterion:

    A closed loop system is stable if the point (-1+0.j) of the complex plane is al-ways on the left side of the open loops Nyquist curve when is varied from 0 to . The application of this simplified form requires that the open-loop system is stable. However 2 poles are allowed at s=0.

    For a more detailed explanation of the general Nyquist criterion please refer to [2].

    There are two standard measures for the distance of the Nyqusit plot from the critical point: gain margin and phase margin. They are illustrated in the following figure:

    Im

    Re

    phase margin

    representing thegain margin

    unit circle

    1

    The gain and phase margin is easily obtained with the MATLAB-command margin. The next figure shows the result of margin when applied to the academic example.

    -120

    -100

    -80

    -60

    -40

    -20

    0

    Mag

    nitu

    de (dB

    )

    10-2

    10-1

    100

    101

    102

    -270

    -225

    -180

    -135

    -90

    -45

    0

    Pha

    se (de

    g)

    Bode DiagramGm = 18.1 dB (at 1.73 rad/sec) , Pm = -180 deg (at 0 rad/sec)

    Frequency (rad/sec)

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 44

    The gain margin is stated to be 18.1 dB. This corresponds to the well-known maxi-mum gain of 8, for which the control loop is still stable. As the Nyquist plot touches the unit circle at s=1, the phase margin is 180o.

    Tuning Rules for Control Parameters In the literature one finds a lot of different methods and recipes for tuning the pa-rameters of a controller. Some of them are based on the theory of differential equa-tions and use mathematical methods. Other methods propose a procedure for the experimental tuning of the parameters.

    In the following some methods are listed.

    Compensation of Poles This method was already mentioned. With a PID-controller it is possible to compen-sate up to 2 poles of the process transfer function. As it was shown earlier the pre-ferred transfer function of the open loop is an integrator resulting in a first order low-pass behaviour of the closed loop. If the process has more than two poles we may choose to compensate the dominating poles, these are the poles which are closest to the imaginary axis. Adjustment of the Phase Margin This method is based on the frequency response of the open loop. From the Nyquist criterion it is obvious that a control loops step response has increasing oscillations the closer it gets to the critical point -1. The recommended distance is a phase mar-gin of approx. 600. Note that the compensation of poles will prefers a phase margin of 90o, a phase margin which is less will usually result in an overshoot.

    Tuning Rule according to Ziegler-Nichols This rule was developed for processes with a transport delay in series with a first or-der element. But often the rule is also applied to other types of processes. Recipe:

    Start with P-control. Increase the amplification to Kcritical , where the control loop is marginally stable. Measure the period Tcritical of the oscillation. Adjust the parameters according to the following table:

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 45

    Controller K TI TD P-Controller 0.5.Kcritical - - PI-Controller 0.45. Kcritical 0.83.Tcritical - PID-Controller 0.6. Kcritical 0.50.Tcritical 0.125.Tcritical

    These parameter values may not give satisfactory results. But they may be good ini-tial values for further improving the dynamic behaviour of the control loop experimen-tally. Note that increasing the integral control action usually produces more oscilla-tions and increasing the differential control action has a damping effect. The reason for this is best seen in the Nyquist plot. Tuning Rule according to Tietze, Schenk This tuning rule may be used to find the control parameters for higher order proc-esses. - Start with P-control and increase the controller gain until the step response

    shows a damped oscillation. On a scope one should see 4-5 periods of oscilla-tion.

    - Continue with PD-control. Increase the differential control action to get rid of the oscillations.

    - Activate the integral control action and increase its weight until settling time is found to be good.

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 46

    Modifications of the Standard Control Loop Cascaded Control Loops

    In many applications not only one signal may be monitored by a sensor element. Cascading control loops then may be a powerful method for improving the perform-ance. The general structure is shown in the following figure:

    processpart 1

    ucontroller1

    r

    -controller

    2 -processpart 2

    c

    The tuning of the controller is of course done starting with the parameters of control-ler 1, and then adjusting the parameters of the outer control loop.

    Example: Position control with an inner control loop for speed control.

    Linearization of nonlinear processes

    If one has to deal with nonlinear processes linearization may be realized (in some but not all cases as for example saturation effects) as shown in the following figure.

    processu c

    controllerr

    -

    ef(u)f-1(u)

    f-1(u) is the inverse of f(u) and must be realized as part of the controller. In analog technique this is often very difficult, in digital controllers it may be easily done with the help of lookup-tables.

    Compensation of disturbances

    Sometimes an information about the disturbance z is available and it may be com-pensated as shown in the next figure. With this method we may efficiently suppress the effect of the disturbance before it affects the error signal and has to be compen-

  • Prof. Dr.-Ing. F. Keller VGU-Course: Control Theory VGU_Control_Theory_new.DOC Karlsruhe University of Applied Sciences page 47

    sated by the controller. In the ideal case Gz(s) is the inverse of the transfer function of process part 1, however an approximate realization of Gz(s) also may show signifi-cant effect.

    processpart 1

    r

    -controller processpart 2

    c-

    z

    ucontroller

    Gz(s)

    Rate limiting the reference input to avoid the windup phenomenon

    If the controller includes an integral control action overshoot of the controlled variable may occur due to the saturation of the controller output. In those cases rate limiting the reference input is a good countermeasure.

    processu c

    controllerr

    -

    eratelimiter