Supplement control

Embed Size (px)

DESCRIPTION

control engineering

Citation preview

  • Linear Systems Control and Vibrations for Mechanical Engineers

    Dr. Robert L. Williams II

    Mechanical Engineering, Ohio University

    NotesBook Supplement for ME 3012 System Vibrations, Analysis, and Control

    2014 Dr. Bob Productions

    [email protected] www.ohio.edu/people/williar4

    These notes supplement the ME 3012 NotesBook by Dr. Bob This document presents supplemental notes to accompany the ME 3012 NotesBook. The outline given in the Table of Contents on the next page dovetails with and augments the ME 3012 NotesBook outline and hence is incomplete here.

  • 2

    ME 3012 Supplement Table of Contents

    1. INTRODUCTION ................................................................................................................................................................ 3

    1.1 CONTROL SYSTEMS AND MECHANICAL VIBRATIONS DEFINITIONS .............................................................................. 3 1.4 MATLAB INTRODUCTION ............................................................................................................................................... 6

    2. LINEAR SYSTEM SIMULATION .................................................................................................................................... 7

    2.1 SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS .................................................................................................... 7 2.1.1 First-Order ODEs ....................................................................................................................................................... 9 2.1.2 Second-Order ODEs ................................................................................................................................................. 13 2.1.3 MATLAB Functions for ODEs .................................................................................................................................. 18

    2.2 THE LAPLACE TRANSFORM ........................................................................................................................................... 19 2.2.2 ODE Solution via Laplace Transforms .................................................................................................................... 21

    3. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS ................................................................................................ 22

    3.1 TRANSFER FUNCTIONS ................................................................................................................................................... 22 3.2 BLOCK DIAGRAMS .......................................................................................................................................................... 23 3.4 FEEDBACK ...................................................................................................................................................................... 26 3.5 SIMULINK TUTORIAL ..................................................................................................................................................... 27

    4. TRANSIENT RESPONSE ................................................................................................................................................. 30

    4.1 SECOND-ORDER SYSTEM DAMPING CONDITIONS ........................................................................................................ 30 4.2 SECOND-ORDER SYSTEM PERFORMANCE SPECIFICATIONS ......................................................................................... 38 4.3 OPEN-LOOP AND CLOSED-LOOP SYSTEM EXAMPLE .................................................................................................... 43 4.4 FIRST- AND SECOND-ORDER TRANSIENT RESPONSE CHARACTERISTICS .................................................................... 47 4.5 SYSTEM TYPE ................................................................................................................................................................. 52 4.7 TERM EXAMPLE OPEN-LOOP TRANSIENT RESPONSE .................................................................................................. 53

    5. CONTROLLER DESIGN .................................................................................................................................................. 56

    5.1 CONTROLLER DESIGN INTRODUCTION ......................................................................................................................... 56 5.2 ROOT-LOCUS METHOD .................................................................................................................................................. 61 5.8 CONTROLLER DESIGN EXAMPLE 2 UNSTABLE G(S) ................................................................................................... 64 5.9 CONTROLLER DESIGN EXAMPLE 3 G(S) WITH A ZERO .............................................................................................. 68 5.10 HIGHER-ORDER SYSTEM CONTROLLER DESIGN ........................................................................................................ 72 5.11 CLOSED-LOOP CONTROLLER INPUT EFFORT ............................................................................................................. 76 5.12 DISTURBANCE EVALUATION AFTER CONTROLLER DESIGN ....................................................................................... 83 5.13 WHOLE T(S) MATCHING CONTROLLER DESIGN THE J-METHOD .......................................................................... 88 5.14 TERM EXAMPLE CONTROLLER DESIGN .................................................................................................................... 103 5.15 TERM EXAMPLE DISTURBANCES AND STEADY-STATE ERROR ................................................................................ 115

    6. VIBRATIONAL RESPONSES ........................................................................................................................................ 120

    6.1 FREE VIBRATIONAL RESPONSES .................................................................................................................................. 120 6.1.1 Undamped Second-Order System Free Responses: Simple Harmonic Motion ...................................................... 120 6.1.2 Damped Second-Order System Free Responses .................................................................................................... 141

    6.2 FORCED VIBRATIONAL RESPONSES ............................................................................................................................. 161 6.2.1 Undamped Second-Order System Harmonically-Forced Responses ..................................................................... 161 6.2.2 Damped Second-Order System Harmonically-Forced Responses ......................................................................... 187 6.2.3 General Forcing Functions .................................................................................................................................... 235

    7. HARDWARE CONTROL IN THE OHIO UNIVERSITY ROBOTICS LAB ........................................................... 244

    7.1 QUANSER/SIMULINK CONTROLLER ARCHITECTURE ................................................................................................. 244 7.2 PROGRAMMABLE LOGIC CONTROLLER (PLC) ARCHITECTURE ............................................................................... 250

  • 3

    1. Introduction 1.1 Control Systems and Mechanical Vibrations Definitions This section presents some important definitions for linear control systems and mechanical vibrations concepts, used throughout the ME 3012 NotesBook. You may be familiar with some these terms if some are unfamiliar, dont panic, we will discuss them later. control To make an engineering system behave as desired using a sensor, actuator,

    and computer software. controller The software component in a feedback control system that automatically

    calculates the actuator input every time cycle to improve the output. stability A system is said to be stable if its output is bounded for all bounded

    inputs. open-loop A control system that functions without sensor feedback closed-loop A control system that functions with sensor feedback and a controller disturbances Unknown, unwanted effects that open-loop and closed-loop control

    systems are subjected to in the real world, modeled at the input level. model The set of ordinary differential equations and algebraic equations that

    represents the simplified dynamics of a real-world system. simulation Solving the model equations and plotting to predict and display the

    dynamic motion of the system. digital A data system that uses discrete values, such as computers. discrete Discontinuous values. analog A data system that uses continuous values, such as voltage-based sensors. continuous Non-discontinuous values. Laplace transform A mathematical transformation from the time domain to the frequency

    domain. input The external forcing function that drives a dynamic system. output The variable of interest in motion of a dynamic system. initial conditions The values of the output variable and its derivatives at t = 0. There must

    be n initial conditions given where n is the system order.

  • 4

    transfer function The Laplace transform of the output of a block divided by the Laplace transform of the block input, with zero initial conditions.

    characteristic polynomial The denominator polynomial of a transfer function, whose order is the

    system order. Also appears in ODE solutions. poles The roots of the transfer function denominator. The roots of the

    characteristic polynomial. zeros The roots of the transfer function numerator degrees of freedom dof the number of independent parameters required to fully specify the

    location of a device. The number of different ways something can move. dynamics The study of motion with regard to forces/torques. free-body diagram FBD, a diagram drawn out of context for each separate mass or inertia

    with all external and internal forces and moments shown to give context. cycle A repeating unit of motion. period T, time for one cycle, sec. cyclical frequency f, number of cycles per second, the inverse of time period, 1 / T, Hz. circular frequency 2 f , scalar measure of rotational rate, i.e. the magnitude of the

    angular velocity vector, rad/sec. natural frequency The rate at which an unforced, undamped dynamic system tends to

    vibrate, either cyclical frequency fn, or circular frequency n. spring Idealized massless mechanical element that provides the oscillatory

    motion in a dynamic system. dashpot Idealized massless mechanical element that provides the energy

    dissipation in a dynamic system. mass Idealized mechanical element that provides the inertia in a dynamic

    system. mass moment of inertia Idealized mechanical element that provides the rotational inertia in a

    dynamic system. damping A linear model for energy loss due to friction and other energy dissipaters,

    for either translational or rotational motion. Damping is provided by a virtual viscous dashpot (an automotive shock system is a real example).

    amplitude The maximum magnitude of a sinusoidal oscillation.

  • 5

    differential equation An equation in which the unknown appears with its time derivatives. initial conditions Given values at time t = 0 for the output and its time derivatives. There

    must be as many initial conditions as the order of the differential equation. homogeneous solution Transient solution due to initial conditions and the external input forcing

    function, yielding zero in the ODE. transient solution Dynamic motion that disappears given enough time. particular solution Steady-state solution due to the external input forcing function. There is

    also a transient solution due to the external input forcing function. steady-state solution Dynamic motion that does not disappear as time increases. forcing function The input actuation provided by an external source. damped frequency The rate at which an unforced, damped dynamic system tends to vibrate,

    either cyclical fd, or circular d. root locus A plot in the Re-Im plane demonstrating how the closed-loop poles move

    as a controller parameter K is varied from zero to infinity. frequency response The plots of system amplitude and phase angle vs. independent variable

    input frequency.

  • 6

    Linear System Definition A linear system is one in which all governing equations (differential, algebraic) are linear. Linear systems satisfy the principles of linear superposition and homogeneity. Let u(t) be the input and y(t) be the output. Further, ( ) ( )u t y t indicates a system yielding output y(t) given input u(t).

    1) linear superposition

    if 1 1( ) ( )u t y t and 2 2( ) ( )u t y t then 1 2 1 2( ) ( ) ( ) ( )u t u t y t y t

    2) homogeneity

    if ( ) ( )u t y t then ( ) ( )au t ay t

    where a is any constant. Examples linear ODEs

    ( ) ( ) ( )ay t by t u t 2( ) 2 ( ) ( ) ( )n ny t y t y t u t non-linear ODEs

    2 ( ) sin ( ) ( )ay t b y t u t 3 2( ) 2 ( ) cos ( ) ln ( )n ny t y t y t u t Almost all real-world systems are non-linear due to Coulomb friction, hysteresis, unmodeled dynamics, non-linear stiffness, large-angle dynamics, etc. However, many engineering systems have

    linear operating ranges, or equations may be piecewise linearized in various operating regions

    Model vs. actual system we use a mathematical model to design the controller, but in the end the controller will run with an actual system. The controller is a software program, a MATLAB/Simulink block or blocks, taking sensor feedback from the real world and automatically generating actuator commands to continuously improve the dynamic performance of the system. 1.4 MATLAB Introduction MATLAB is a general engineering analysis and simulation software. MATLAB stands for MATrix LABoratory. It was originally developed specifically for control systems simulation and design engineering, but it has grown over the years to cover many engineering and scientific fields. MATLAB is based on the C language, and its programming is vaguely C-like, but simpler. MATLAB is sold by Mathworks Inc. (mathworks.com) and Ohio University has a site license. For an extensive introduction to the MATLAB software, see Dr. Bobs MATLAB Primer:

    www.ohio.edu/people/williar4/html/PDF/MATLABPrimer.pdf

  • 7

    2. Linear System Simulation 2.1 Solution of Ordinary Differential Equations Simulation means solving linear constant-coefficient ordinary differential equations, subject to the given initial conditions (ICs). We must solve and plot the system response (output vs. time) given the input forcing function and the initial conditions. We will consider first- and second-order ODEs. The number of initial conditions must equal the ODE order. e.g. Solve 2 1 0( ) ( ) ( ) ( )a x t a x t a x t r t for x(t)

    Given the input forcing function r(t) and subject to the initial conditions 00

    (0)(0)

    x xx v

    .

    General Solution Methods

    Slow ME Way Laplace Transforms

    Slow ME Way total solution = homogeneous solution + particular solution

    transient response to ICs steady-state response to input 1. Homogeneous Solution transient response to initial conditions (0), (0)x x This method works for ODEs of any order it is demonstrated for the second-order ODE above.

    2 1 0( ) ( ) ( ) 0H H Ha x t a x t a x t

    Assume: ( ) stHx t Ae

    Substitute 2

    ( )

    ( )

    ( )

    stH

    stH

    stH

    x t Aex t sAex t s Ae

    into 2 1 0( ) ( ) ( ) 0H H Ha x t a x t a x t

    Calculate si the roots of the nth-order polynomial in s (called the system characteristic polynomial) The general homogeneous solution form must have n terms. For the second-order case:

    1 21 2( )

    s t s tHx t A e A e

    Substitute the specific si roots at this stage, but leave the Ai coefficients unknown for now (there are n of each of these, n = 2 in this example).

  • 8

    2. Particular Solution steady-state response to input forcing function r(t)

    2 1 0( ) ( ) ( ) ( )P P Pa x t a x t a x t r t Assume xP(t) according to the same form as the input forcing function r(t).

    Table of Particular Solution Forms

    r(t) xP(t)

    constant different constant

    t B1t + B2

    t2 B1t2 + B2t + B3

    cosD t 1 2cos sinB t B t sinD t 1 2cos sinB t B t

    etc. etc.

    Method of Undetermined Coefficients Determine the unknown coefficients Bi:

    Substitute ( ), ( ), ( )P P Px t x t x t into 2 1 0( ) ( ) ( ) ( )P P Pa x t a x t a x t r t

    and solve for the unknown coefficients Bi right away. 3. Total Solution

    ( ) ( ) ( ) ( )T H Px t x t x t x t Now determine the unknown homogeneous coefficients Ai using the initial conditions on xT(t).

    # of characteristic polynomial roots = # of initial conditions = ODE order = n

  • 9

    2.1.1 First-Order ODEs First-Order System Example 2 Same ck system and initial condition, but ( ) 5sin2f t t

    Solve ( ) 50 ( ) 5sin2x t x t t subject to x(0) = 0

    Solution

    505( ) 25sin 2 cos 21252 tx t e t t Equivalent alternate solution form

    505( ) 25.02sin 2 0.041252 tx t e t using sin( ) sin cos cos sina b a b a b

    The response x(t) starts at zero as specified by the initial condition. The transient solution goes to zero by about t = 0.10 sec. Steady-state solution is ( ) 25.02 sin 2 0.04ssx t t m. = 2 rad/s = 2f f = 1/ = 1/T T = sec

    0 1 2 3 4 5 6 7 8-0.1

    -0.08

    -0.06

    -0.04

    -0.02

    0

    0.02

    0.04

    0.06

    0.08

    0.1

    t (sec)

    -5/1252 cos(2 t)+125/1252 sin(2 t)+5/1252 exp(-50 t)

    x(t)

    (m)

  • 10

    Alternate form for particular solution (Example 2)

    Sum-of-angles formulae cos( ) cos cos sin sinsin( ) sin cos cos sin

    a b a b a ba b a b c a b

    25sin 2 cos2 sin(2 )

    sin 2 cos cos2 sint t C t

    C t t

    sin 2 25 coscos 2 1 sin

    t Ct C

    2 2 2 2 2cos sin 25 1C 626 25.02C

    sin 1cos 25

    1 1tan 0.0425

    rad

    25 sin 2 cos 2 25.02 sin 2 0.04t t t

    In general: 2 21 2C B B 1 21

    tan BB

    when 1 2( ) sin 2 cos 2sin 2

    Px t B t B tC t

  • 11

    A Final First-Order ODE example R, C series electrical circuit (voltage v(t) input, current i(t) output)

    Model (from KVL and electrical circuit element table) 1( ) ( ) ( )Ri t i t dt v tC

    substitute charge q(t) ( ) ( )

    ( ) ( )

    i t dt q t

    i t q t

    1( ) ( ) ( )Rq t q t v tC

    Given R = 50 and C = 0.2 mF, solve 50 ( ) 5000 ( ) 1q t q t subject to (0) 0q and a unit step voltage input v(t). Solution

    1001( ) 15000 tq t e 1001( ) ( ) 50 ti t q t e

    As expected from the circuit dynamics, the charge q(t) in the capacitor builds up to a constant given a constant voltage input.

    Also as expected, the capacitor current i(t) goes to zero at steady-state. The steady state charge value is qSS = 1/5000. The time constant is = RC = 0.01, so at 3 time constants (t = 0.03 sec) both the q(t) and i(t)

    values have approached 95% of their respective final values.

    v(t)

    R

    +-

    i(t) C

    0 0.01 0.02 0.03 0.04 0.05 0.060

    0.5

    1

    1.5

    2 x 10-4

    q(t)

    0 0.01 0.02 0.03 0.04 0.05 0.060

    0.005

    0.01

    0.015

    0.02

    i(t)

    t (sec)

  • 12

    First-Order System Examples c, k massless translational mechanical system

    force input f(t) and displacement output x(t)

    ( ) ( ) ( )cx t kx t f t m, c springless translational mechanical system

    force input f(t) and velocity output v(t)

    ( ) ( ) ( ) ( ) ( )mx t cx t mv t cv t f t cR, kR massless rotational mechanical system

    torque input (t) and angular displacement output (t)

    ( ) ( ) ( )R Rc t k t t J, cR springless rotational mechanical system

    DC servomotor, torque input (t) and angular velocity output (t)

    ( ) ( ) ( ) ( ) ( )R RJ t c t J t c t t L, R series electrical circuit

    voltage input v(t) and current output i(t)

    ( ) ( ) ( )di tL Ri t v tdt

    R, C series electrical circuit

    voltage input v(t) and current output i(t), or charge ( ) ( )q t i t dt 1 1( ) ( ) ( ) ( ) ( )Ri t i t dt Rq t q t v tC C

    The time constants for these 6 examples are 1

    R

    R R

    cc m J L RCk c k c R

    All first-order ODEs are solved in the same way as Example 1 (assuming a unit step input), all have the same type of time response graph, all share the same time constant behavior (after three time constants 3 the output response is within 95% of its final value).

    Some first-order system models are given in: www.ohio.edu/people/williar4/html/PDF/ModelTFAtlas.pdf.

    f(t)

    x(t)

    c

    k

    f(t)

    x(t)

    mc

    k

    (t)

    R

    (t)

    cR

    J

    (t) (t)

    cR

    v(t) L

    R

    +-

    i(t)

    v(t)

    R

    +-

    i(t) C

  • 13

    2.1.2 Second-Order ODEs Derivation of underdamped homogeneous solution form In this case we have complex conjugate characteristic polynomial roots 1,2s a bi . For this example assume 1,2 1 3s i as in the Section 2.1.2 ME 3012 NotesBook example.

    Eulers identity must be used cos sincos( ) sin( ) cos( ) sin( )

    i

    i

    e ie i i

    1 21 2

    ( 1 3 ) ( 1 3 )1 2

    3 31 2

    1 2

    ( )

    cos3 sin 3 cos3 sin3

    s t s tH

    i t i t

    t it it

    t

    x t Ae A eAe A e

    e Ae A e

    e A t i t A t i t

    where we used = 3t in Eulers identify. Simplifying by collecting (factoring) terms.

    1 2 1 2( ) cos 3 sin 3tHx t e A A t A A i t

    Let 1 1 2

    2 1 2

    B A AB A A i

    We can only have real solutions when starting with real ODE coefficients, so *1 2A A (these constants must be complex conjugates of each other).

    1

    2

    RE IM

    RE IM

    A A A iA A A i

    1

    2

    22

    RE

    IM

    B AB A

    Therefore 1 2( ) cos 3 sin 3tHx t e B t B t Bi are the real constant unknown homogeneous solution coefficients

    And the general underdamped homogeneous solution form given 1,2s a bi is:

    1 2( ) cos sinatHx t e B bt B bt That is, the real part of the poles is placed in the exponential and the imaginary part of the poles is placed as the circular frequency of the cos and sin functions.

  • 14

    Second-Order System Example 1 m = 1 kg, c = 7 Ns/m, k = 12 N/m

    Solve ( ) 7 ( ) 12 ( ) ( ) 3 ( )x t x t x t f t u t subject to (0) 0.10(0) 0.05 /

    x mx m s

    This system is overdamped

    Real distinct roots, relatively slower response, no overshoot

    This solution is left to the interested reader.

  • 15

    Second-Order System Example 2 m = 1 kg, c = 6 Ns/m, k = 9 N/m

    Solve ( ) 6 ( ) 9 ( ) ( ) 3 ( )x t x t x t f t u t Subject to

    (0) 0.10(0) 0.05 /

    x mx m s

    1. Homogeneous Solution ( ) 6 ( ) 9 ( ) 0H H Hx t x t x t

    Assume ( ) stHx t Ae 2( 6 9) 0sts s Ae Characteristic polynomial 2 26 9 ( 3) 0s s s

    1,2 3, 3s Real, repeated roots

    Homogeneous solution form 3 31 2( ) t tHx t A e A te 2. Particular Solution ( ) 6 ( ) 9 ( ) 3P P Px t x t x t

    ( )Px t B 0 6(0) 9 3B so ( ) 1/ 3Px t B 3. Total Solution

    3 31 2

    3 3 31 2 2

    ( ) ( ) ( ) 1/ 3

    ( ) 3 3

    t tH P

    t t t

    x t x t x t Ae A tex t Ae A e A te

    Now apply initial conditions

    1 2

    1 2

    (0) 0.10 (0) 0.33(0) 0.05 3

    x A Ax A A

    1

    2

    0.2330.65

    AA

    3( ) (0.233 0.65 ) 0.33tx t t e

    This system is critically-damped

    Real, repeated roots fastest response without overshoot Check solution

    Plug answer x(t) plus its two derivatives into the original ODE. Also check the initial conditions. Plot check transient and steady state solutions, plus total solution.

  • 16

    Second-Order System Example 2 Forced m-c-k System

    Model ( ) ( ) ( ) ( )mx t cx t kx t f t

    ( ) 6 ( ) 9 ( ) 3 ( )x t x t x t u t (0) 0.10(0) 0.05 /

    x mx m s

    2 26 9 ( 3) 0s s s

    Solution 31( ) (0.233 0.65 )3

    tx t t e

    Plot of x(t) vs. t

    The total solution x(t) starts at 0.1 m, ( )x t is non-zero, as specified by the initial conditions. Transient approaches zero after t = 2.5 sec Critically damped; 3 root goes to zero slightly faster alone than with t Steady-state value is xSS = 1/3 m.

    0 1 2 3 4

    -0.2

    -0.1

    0

    0.1

    0.2

    0.3

    0.4

    t (sec)

    x(t)

  • 17

    Second-Order System Example 4: Forced m-k System

    Model ( ) ( ) ( )mx t kx t f t (no damping)

    ( ) 9 ( ) 3 ( )x t x t u t (0) 0.10(0) 0.05 /

    x mx m s

    2 9 ( 3 )( 3 ) 0s s i s i

    Solution ( ) (7 30)cos3 (1 60)sin3 1 3x t t t

    Plot of x(t) vs. t

    x(t) starts at 0.1 m, ( )x t is non-zero, as specified by the initial conditions. Simple harmonic motion Undamped; zero viscous damping coefficient Transient solution oscillates forever about the particular solution 1/3 = 3 rad/s = 2f f = 3/2 = 1/T T = 2/3 = 2.09 sec

    This system is undamped

    Complex-conjugate roots with 0 real part, simple harmonic motion, no damping, theoretically never stops vibrating.

  • 18

    2.1.3 MATLAB Functions for ODEs In solving ODEs the slow ME way, we have to do the work manually, so MATLAB doesnt help all that much (with the exception of symbolic MATLAB, see dsolve below). We can find the roots of the characteristic equation; the remaining code below plots the results that were obtained manually.

    clc; clear; char = [1 2 10]; % Characteristic polynomial and roots s = roots(char); % Plot second-order system solution results Tee = input('Enter [initial, delta, and final times (sec)]: '); t0 = Tee(1); dt = Tee(2); tf = Tee(3); t=[t0:dt:tf]; x = -exp(-t).*(0.20*cos(3*t)+0.05*sin(3*t)) + 0.30; ss = 0.3*ones(size(t)); % Steady-state solution figure; plot(t,x,t,ss,':'); grid; set(gca,'FontSize',18); axis([t0 tf 0 0.4]); xlabel('time'); ylabel('X(t)');

    Other MATLAB ODE-related functions dsolve symbolic ODE solution (see below) ode45 numerical ODE solution using 4th/5th order Runge-Kutta method After we get into Laplace Transforms, we will learn other useful MATLAB functions for ODE solution. ODE solution via symbolic MATLAB function dsolve The MATLAB code below shows how to analytically solve first- and second-order ODEs (first-order ODE Example 1 and second-order ODE Example 3), using MATLAB function dsolve, display the analytical solution results to the screen, and then plot results using MATLAB function ezplot (which reverses the input data compared to most MATLAB plot commands).

    %---------------------------------------------------- % Analytical solution for ODEs using symbolic MATLAB % Dr. Bob, ME 3012 %---------------------------------------------------- clc; clear; x1 = dsolve('Dx+50*x=5','x(0)=0'); pretty(x1) figure; t1 = [0:0.001:0.16]; ezplot(x1,t1); grid; axis([0 0.16 0 0.105]); x2 = dsolve('D2x+2*Dx+10*x=3','Dx(0)=0.05','x(0)=0.10'); pretty(x2) figure; t2 = [0:0.01:6]; ezplot(x2,t2); grid; axis([0 6 0 0.4]);

  • 19

    2.2 The Laplace Transform Partial Laplace Transform Table

    f(t)

    F(s)

    1

    Dirac delta (t)

    1

    2 unit step u(t) 1s

    3 unit ramp r(t) = t 21s

    4 tn n

    sn!1

    5 e at 1

    ( )s a

    6 1 ate ( )a

    s s a

    7 1

    ( ) ( )

    at bte eab a a b b b a

    1( )( )s s a s b a b

    8 n att e 1!

    ( )nn

    s a

    9 sin t s2 2

    10 cost s

    s2 2

    11 e tat sin

    2 2( )s a

    12 e tat cos

    2 2( )s a

    s a

  • 20

    Partial Laplace Transform Table (continued)

    f(t)

    F(s)

    13 cos sinatb ae t t

    2 2( )s b

    s a

    14 2 2( )

    sin( )atb a

    e t

    1tanb a

    2 2( )s b

    s a

    15 2 sin1ntn

    de t

    ;

    21d n ; 0 1 2

    2 22n

    n ns s

    16 21 sin( )1

    nt

    de t

    ; 1cos ; 0 1 2

    2 2( 2 )n

    n ns s s

    17

    2 2 2 2

    1 sin( )ate t

    a a

    ;

    1tana

    2 2

    1[( ) ]s s a

    18

    2 2

    2 2 2 2

    1 ( ) sin( )atb b a e ta a

    1 1tan tanb a a

    2 2[( ) ]s b

    s s a

  • 21

    2.2.2 ODE Solution via Laplace Transforms This subsection presents an alternate solution for the first-order ODE problem from the ME 3012 NotesBook. Again, this ODE is solved using the Laplace Transform method but now, if we have a Laplace Transform table of sufficient detail, as on the preceding pages, we can skip the partial fraction expansion step and use the table directly. ODE Solution via Laplace Transforms Examples First-Order ck mechanical system Example 1

    Solve ( ) 50 ( ) 5x t x t for x(t), subject to x(0) = 0 and a step input of magnitude 5. We did this ODE solution via the slow ME way and the Laplace Transform method with partial fraction expansion. Take the Laplace transform of both sides (dont forget the initial condition but it is given as zero).

    5( ) (0) 50 ( )5( ) 50 ( )

    sX s x X ss

    sX s X ss

    Solve for the variable of interest, X(s), which is the Laplace transform of the answer x(t).

    5( 50) ( )

    5( )( 50)

    s X ss

    X ss s

    Up to this point the solution is identical to that in the ME 3012 NotesBook. But now we can skip the partial fraction expansion if we use the following Laplace Transform table entry.

    ( )( )

    aF ss s a

    ( ) 1atf t e

    We must algebraically modify X(s) so that the same constant a appears in the numerator and denominator, by multiplying by 1 (10/10).

    10 5 1 50( )10 ( 50) 10 ( 50)

    X ss s s s

    Taking the inverse Laplace transform of X(s) yields the solution x(t).

    1 1 150

    1 50 1 50( ) ( )10 ( 50) 10 ( 50)

    1( ) (1 )10

    t

    x t X ss s s s

    x t e

    This is the same solution obtained twice previously.

  • 22

    3. Transfer Functions and Block Diagrams 3.1 Transfer Functions Additional Transfer Function Example 4. R-L-C Parallel Electrical Circuit

    Model: ( ) 1 1( ) ( ) ( )dv tC v t v t dt i t

    dt R L

    input: current i(t) output: voltage v(t) Open-loop transfer function :

    2

    ( ) 1 1( ) ( ) ( )

    1 1 ( )( ) ( ) ( )

    1 1 ( ) ( )

    ( ) 1( ) 1 1 1 1( )

    dv tC v t v t dt i tdt R L

    V sCsV s V s I sR L s

    Cs V s I sR Ls

    V s sG sI s Cs Cs s

    R Ls R L

    Open-loop block diagram

    i(t) R L C v(t)+

    -

    i (t)L

  • 23

    3.2 Block Diagrams Method to define transfer functions in MATLAB

    Define polynomials via an array using square brackets with the numerical polynomial

    coefficients given in descending power of s. See denG below. Define the numerator and denominator polynomials num and den for your transfer function; then use:

    SysName = tf(num,den); % define transfer function in MATLAB to define the transfer function in MATLAB. You then use the name SysName in various MATLAB functions that require a transfer function as one of its inputs.

    Examples 21( )2 8

    G ss s

    1( )2C

    sG ss

    1( )3

    H ss

    numG = [1]; denG = [1 2 8]; sysG = tf(numG,denG);

    numGc = [1 1]; denGc = [1 2]; sysGc = tf(numGc,denGc);

    numH = [1]; denH = [1 3]; sysH = tf(numH,denH);

  • 24

    MATLAB to reduce block diagrams to one transfer function [num,den] = zp2tf(Z,P,K); % convert zero-pole to transfer function [Z,P,K] = tf2zp(num,den); % convert transfer function to zero-pole

    Z zeros P poles K scalar gain num,den transfer function numerator and denominator

    [num,den] = series(num1,den1,num2,den2); % series connection of two systems or [sys] = series(sys1,sys2); sysi = tf(numi,deni) % transfer function description of block i

    [sysT]=feedback(sys1,sys2,sign) % close the feedback loop determine T(s) sys1 = tf(num1,den1); % transfer function for GC(s) G(s) sys2 = tf(num2,den2); % transfer function H(s) sign: +1 for positive feedback, 1 for negative (the default)

    Make sure you can do each of these by hand! Methods to solve ODEs

    Slow ME way, Laplace Transforms MATLAB dsolve analytical MATLAB numerical solutions: impulse, step, lsim, ode45

    MATLAB functions to numerically solve ODEs impulse impulse response of continuous-time linear systems 1. impulse(SysName); % plots to screen 2. impulse(SysName,T); % plots to screen, user controls time T 3. [Y,X] = impulse(SysName); % saves to [Y,X] for plotting later 4. [Y,T,X] = impulse(SysName,T); % same as 3, user controls time T where: SysName=tf(num,den) name for transfer function-based system num,den transfer function numerator and denominator T = [t0:dt:tf]; evenly-spaced, user-supplied time array Y output X system state ( ,Y Y stored column-wise) step step response of continuous-time linear systems

    step(SysName); % same options and terms as impulse lsim simulation of continuous-time linear systems for any general given input lsim(SysName,U,T); plots to screen

    [Y,X] = lsim(SysName,U,T,X0); % saves to [Y,X] for plotting later U given input, same length as T X0 initial conditions

  • 25

    Simulink model and plots for the Example of Section 3.2

    Open-loop Closed-loop See the following pages for a Simulink tutorial to get you started.

    Step Ydes

    Step U

    StepResponses

    1s+3

    H

    s+1s+2

    Gc

    1s +2s+82

    G Open

    1s +2s+82

    G

    Ydes E U Closed Yact

    Yact

    Yact

    Ysens

    U Y Open

  • 26

    3.4 Feedback Four reasons for using feedback

    1. To modify the transient response of the system. We can change open-loop poles to closed-loop poles with more desirable behavior to ensure stability and modify the system transient performance.

    2. To reduce steady-state error in the system. 3. To decrease the sensitivity of the closed-loop system to variations in the open-loop plant transfer

    function. Sensitivity is like a derivative ( )( )

    T sG s

    .

    4. To reduce the effects of disturbances, unmodeled dynamics, uncertainties, nonlinearities,

    parameters changing with time, and noise. To increase system robustness.

    Feedback is not free. A closed-loop feedback system is more expensive and complex, and thus less reliable, than an open-loop system. Therefore, the engineer must determine if closed-loop feedback control is justified or if the open-loop system can perform adequately. There are a host of real-world dynamic systems which demand closed-loop feedback control.

  • 27

    3.5 Simulink Tutorial

    Simulink is the Graphical User Interface (GUI) for MATLAB. This section presents a brief tutorial on how to use simulink to create an open-loop block diagram. Then the model can easily be run, i.e. asking simulink to numerically solve the associated IVP ODE for you and plot the results vs. time.

    1. Start MATLAB and at the prompt type simulink (all lower case).

    2. If installed, the Simulink Library Browser will soon pop up. 3. Click on the new icon, identical to a MS Word new file icon. That is your space to work in. After

    creating a model it can be saved (using the save icon). 4. To build simulation models, you will be creating block diagrams just like we draw by hand. In

    general all blocks are double-clickable to change the values within. In general you can connect the ports on each block via arrows easily via clicking and dragging with the mouse. You can also double-click any arrow (these are the controls variables) to label what it is. Same with all block labels (simulink will give a default name that you can change).

    5. simulink uses EE lingo. Sources are inputs and sinks are outputs. If you click around in the

    Simulink Library Browser, you will see the possible sources, blocks, and sinks you have at your disposal.

    6. Now let us create a simple one-block transfer function and simulate it subject to a unit step input.

    The given open-loop transfer function is 21( )2 8

    G ss s

    .

    a. Click the new icon in the Simulink Library Browser to get a window to work in (untitled with the simulink logo).

    b. Double-click the Continuous button in the Simulink Library Browser to see what

    blocks are provided for continuous control systems. Grab and slide the Transfer Fcn block to your workspace. Double-click the block in your workspace and enter [1] in Numerator coefficients and [1 2 8] in Denominator coefficients and close by clicking OK. Simulink will update the transfer function in the block, both mathematically and visually.

    c. Go ahead and save your model on your flash drive as name.mdl (whatever name you

    want, as long as it is not a reserved MATLAB word).

    d. Click the Sources tab in the Simulink Library Browser to see what source blocks are provided. You will find a Step, Ramp, Since Wave, etc. (but no Dirac Delta see Dr. Bobs on-line ME 3012 NotesBook Supplement to see how to make that type on input in Simulink, two methods). Grab and slide the Step block to your workspace. Double-click the Step block in your workspace and ensure 1 is entered as the final value (for a unit step) and that 0 is the Initial value. Close by clicking OK.

  • 28

    e. Draw an arrow from the Step block to the Transfer Fcn block by using the mouse. Float the mouse near the Step port (> symbol) and you will get a large + mouse avatar. Click and drag to the input port of the Transfer Fcn block; when you see a double-plus, let go and the arrow will be connected.

    f. Click the Sinks tab in the Simulink Library Browser to see what sink blocks are

    provided. Grab and slide the Scope block to your workspace.

    g. Draw an arrow from the Transfer Fcn block to the Scope block by using the mouse, the same method as before.

    h. To run the model (solve the associated differential equation numerically and plot the

    output results vs. time automatically), simply push play (the solid black triangle button in your workspace window).

    i. After it runs, double-click on your Scope to display the results. Click the binoculars icon

    to zoom in automatically.

    j. When I perform these steps, there are two immediate problems: i. the plot does not start until t = 1 sec and ii. the plot is too choppy. These are easy to fix:

    i. Double-click the Step block and change the Start time to 0 from the default 1 sec,

    then click OK. Re-run and ensure the plot now starts at t = 0.

    ii. In your workspace window click Simulation -> Configuration Parameters -> Data Import/Export. Look for Refine output in the window and change the Refine factor from 1 to 10, then click OK. Re-run and ensure the plot is now acceptably smooth.

    k. Finally in this open-loop simulation example, it appears that 10 sec final time is a bit too

    much. Near the play button in your workspace is an unidentified number 10.0. This is the default final time. Change it to 8.0, re-run, and ensure the plot now ends at t = 8. If you reduce final time less than 8.0 you will lose some transient response detail.

    Your final model will look like this (be sure to be a control freak like Dr. Bob and line up all the

    arrows and blocks in a rectangular grid). I also renamed the blocks and labeled the variables.

    Open-loop simulation example Simulink model

    unit step time responseplot

    1

    s +2s+82

    OL system

    input u output y

  • 29

    Feel free to play around to your hearts content and see what you can learn. Simulink is fast, easy, and fun! But it is a bad black box on top of the black box of MATLAB.

    Another group of simulink blocks you may use a lot is under Math Operations in the Simulink Library Browser. In particular, we use the Sum (summing junction) and Gain (multiplication by a constant) a lot in controls.

    In addition I find the Mux (multiplexer) and Demux (demultiplexer) very useful, especially the

    Mux to combine two or more variables for plotting on a common scope. These are found under Signal Routing in the Simulink Library Browser.

    Assignment: update your above model by yourself to include negative unity feedback (sensor

    transfer H(s) = 1), with no specific controller (GC(s) = 1, just a straight line with no block). Plot both open- and closed-loop unit step responses and compare and discuss.

    Hint: put a summing junction between the Step input and the OL system transfer function.

    Double-click the sum to make the correct signs (i.e. + and -). Then pull an arrow down from the negative summing port, turn the corner without letting go. Then you will have to let go, but click immediately without moving the mouse and hover it over the output y line. When you get the double-plus, let go and you have just made a pickoff point, for the output y feedback.

  • 30

    4. Transient Response 4.1 Second-Order System Damping Conditions

    Here is the MATLAB program to create the figure for the example of Section 4.1, comparing the overdamped, critically-damped, underdamped, and undamped second-order system responses to a unit step input. %-------------------------------------------------------------------- % Over-, Critically, Under-, and Undamped cases using step function % Dr. Bob, ME 3012 %-------------------------------------------------------------------- clear; clc; num = [1]; denOVER = [1 6 4]; % Overdamped denCRIT = [1 4 4]; % Critically-damped denUNDR = [1 2 4]; % Underdamped denUN = [1 0 4]; % Undamped polesOVER = roots(denOVER); % Poles for each case polesCRIT = roots(denCRIT); polesUNDR = roots(denUNDR); polesUN = roots(denUN); OVER = tf(num,denOVER); CRIT = tf(num,denCRIT); UNDR = tf(num,denUNDR); UN = tf(num,denUN); t = [0:0.01:8]; [yOVER,xOVER] = step(OVER,t); % Unit step responses [yCRIT,xCRIT] = step(CRIT,t); [yUNDR,xUNDR] = step(UNDR,t); [yUN,xUN] = step(UN,t); figure; plot(t,yOVER,'r',t,yCRIT,'g',t,yUNDR,'b',t,yUN,'m'); % Plot unit step responses set(gca,'FontSize',18); grid; ylabel('\ity(t)'); xlabel('\itt (\itsec)'); legend('Over','Crit','Under','Un');

  • 31

    Over-, Critically-, Under-, and Un-damped Examples using impulse

    Solve

    ( ) 6 ( ) 4 ( ) ( )( ) 4 ( ) 4 ( ) ( )( ) 2 ( ) 4 ( ) ( )( ) 0 ( ) 4 ( ) ( )

    y t y t y t ty t y t y t ty t y t y t ty t y t y t t

    for y(t), all subject to zero initial conditions (0) 0(0) 0

    yy

    and an impulse input.

    For the impulse responses, solve the same ODEs as the step examples in the ME 3012 NotesBook, subject to zero initial conditions and impulse input (t). Note that though we specified zero initial conditions (0) 0y

    and (0) 0y , for the impulse responses only the y(0) initial condition can be satisfied, i.e. all (0)y initial velocities take their own value, different from zero as seen below. Impulse responses plot

    The impulse input final value is 0. Why are the slopes non-zero at t = 0? See Section 4.4 in this Supplement. The above figure was generated using the same MATLAB program as given above, but substituting MATLAB function impulse for step.

    0 1 2 3 4 5 6 7 8-0.5

    -0.4

    -0.3

    -0.2

    -0.1

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    y(t)

    t (sec)

    OverCritUnderUn

  • 32

    MATLAB Simulink MATLAB has a powerful graphical user interface (GUI) called Simulink. From the MATLAB command window type simulink and you can create and simulate any control system described by block diagrams and transfer functions. Look around to find the transfer function, step input, and scope (plot) output blocks. Simply drag and drop the desired block to the Simulink workspace. Double-click on any block to change its parameters. Connect blocks with lines using the mouse/cursor. Simply press the play button to run your model. Its fast, fun, and addicting! Make sure you can do the steps by hand, but you are free to use this tool for homework.

    For example, the Simulink diagram below recreates the unit step responses for the overdamped, critically-damped, underdamped, and undamped second-order system example of Section 4.1. All transfer functions are fed by the same Step input. The mux, or multiplexer, block is used to compare 4 results in one plot, in this case combining 4 scalar signals to one vector signal, to send to the Plots scope. The resulting plot is identical in form to that shown in the ME 3012 NotesBook, though the Simulink graphics do not look as nice.

    A Simulink tutorial is given in Section 3.5 of this ME 3012 NotesBook Supplement.

  • 33

    Impulse Input in Simulink One can simulate the impulse responses in Simulink also. Since there is no Impulse input block, we must create our own impulse input. There are three possible methods. 1. The Dirac Delta impulse input (t) should have infinite magnitude but infinitesimal duration. It is normalized in the sense that ( ) 1t , i.e. the area under the curve is 1. One way to approximate the impulse input (t) is to turn on a step input at t = 0 with a large magnitude M and then subtract from this step input another of equal magnitude M, starting at time t = 1/M sec, as shown in the figure below. I have had success with M = 1000 and 10000, among others. Be sure to scope the resulting impulse input to ensure it is what you intended.

    2. We know that ( )( ) du ttdt

    , where u(t) is the unit step input and (t) is the impulse input. This concept is implemented in the figure below. It appears that this approach may not work when starting at t = 0 (it does not generate (t) but gives zero instead). If you start the Simulink simulation at t = 1, it should work fine. Again, be sure to scope the resulting impulse input to ensure it is what you intended.

    Step dt

    Step

    Scope

    10

    s +s+102

    G(s)

    impulse input

    du/dt

    derivativeStep @ t=1

    Scope

    10

    s +s+102

    G(s)

    impulse input

  • 34

    3. Either of the previous two methods work fine. Here is a third method instead of using a discrete step input as in Method 1 on the previous page, use a steep ramp for a very short time, followed by a symmetric steep ramp with negative slope to send the input signal back to zero. Again the area under this steep triangular input must be 1.

    Let the final input value be a, the time to rise from 0 to a be called t1, and the final time when the input signal reaches back to zero be called t2 (by symmetry t2 = 2t1. This type of approximated Dirac delta input is constructed in Simulink as follows. Add three ramp inputs, the first starting at t = 0 with a steep positive slope of c = a / t1, the second starting at t = t1 with a negative slope of 2c, and the third starting at t = t2 with a positive slope of c (see the Simulink model shown below). For example, use a = 1000, t1 = 0.001 sec, c = 1,000,000, and t2 = 0.002 sec. Again, be sure to scope the resulting ramped-unramped Dirac delta approximation to ensure it is what you expected. The general equations for this case are summarized below:

    12 12

    1

    1

    a ct

    at

    ta

    tc

  • 35

    Other Inputs in Simulink Simulink provides step, ramp, sine inputs among many other built-in possibilities. This subsection discusses and presents some other inputs that can be built in Simulink. Ramped-step input The unit step input is very popular and common in the controls field. Actually it is a poor input signal in the real world because no dynamic system can change its value instantaneously to match what the unit step input is demanding. Instead, a ramped-step input may be better for real-world systems to follow. The ramped-step input signal starts at zero (not instantaneously starting at a constant value) and linearly changes, with constant slope, to a final constant value, which is held as long as the simulation proceeds. Let the final input value be a, and the time to rise from 0 to a be called t1. This general ramped-step input may be constructed in Simulink as follows. Add two ramp inputs, the first starting at t = 0 with a positive slope of c = a / t1, and the second starting at t = t1 with a negative slope of c (or, equivalently, subtract the second ramp with a positive slope as shown in the Simulink model below). The example shown assumes a = 3 and t1 = 2 sec. be sure to scope the resulting ramped-step to ensure it is what you expected.

    Scope

    Ramp @ t1

    Ramp

    ramped-step input

  • 36

    Step and ramped-step inputs work well for controlling position variables (either translational or rotational). They also work for controlling velocity when that is the output of interest. However, many projects may need to move positions based on velocity control. In these cases consider using a trapezoidal step input, which is similar to the ramped-step, but turns off rather than holding a constant value indefinitely. Trapezoidal-step input The trapezoidal-step input signal starts at zero, linearly changes with constant slope to a final constant value, which is held for a specified time. Then the input signal linearly decreases in a symmetric manner back to zero, which is held as long as the simulation proceeds. Let the final input value be a, the time to rise from 0 to a be called t1, the time to start the linear decrease back to 0 be called t2, and the final time when the input signal reaches back to zero be called t3 (by symmetry t3 t2 = t1. This general trapezoidal-step input is constructed in Simulink as follows. Add four ramp inputs, the first starting at t = 0 with a positive slope of c = a / t1, the second starting at t = t1 with a negative slope of c, the third starting at t = t2 with a negative slope of c, and finally the fourth starting at t = t3 with a positive slope of c (see the Simulink model shown below). The example shown assumes a = 1, t1 = 2, t2 = 6, and t3 = 8 sec. Again, be sure to scope the resulting ramped-step to ensure it is what you expected.

  • 37

    Trapezoidal Velocity Input, Associated Position Command The example trapezoidal-step velocity input is shown in magenta in the plot above. Integrating this desired signal yields the associated position command. Since the controlled velocity returns to zero, the associated position can be controlled to move from one displacement to another. This applies equally to translational or rotational velocity/position. Assuming the example trapezoid-step represents angular velocity (t), the associated final angular displacement F is:

    2 20 1 2 1 3 2

    20 1 1

    1 1( ) ( )2 22

    F

    F

    ct a t t c t t

    ct at

    where in the example above, intial angle 0 = 0 and by symmetry t1 = t3 t2. Further we chose

    2 1 12t t t (this can be changed by the user). Since the slope is c = a / t1, the above equation simplifies to:

    01 3

    Fta

    Using the above equation, one can specify the initial and final angles (or translational positions), plus the constant velocity term a, and solve for t1 and construct any desired trapezoidal-step velocity input like the example above.

  • 38

    4.2 Second-Order System Performance Specifications

    This section presents plots for the four performance specifications presented in the 3012 NotesBook, based on the analytical formulas for the underdamped case.

    Rise Time vs. for various n values

    Rise Time vs. n for various values

  • 39

    Peak Time vs. d

    Percent Overshoot vs.

  • 40

    Settling Time vs. n

  • 41

    Specifying Desired Poles for Critically-Damped or Overdamped Performance

    In the ME 3012 NotesBook, to specify good behavior for the closed-loop controller, all we have are underdamped performance specification equations. Many real-world controllers can benefit from critically-damped or overdamped performance specifications. This original work is presented below. For the critically-damped and overdamped cases, percent overshoot is zero and peak time is infinite. Generally settling time is more important than rise time so this work will focus only on settling time. We cannot use the underdamped equation for calculating 2% settling time for the critically-damped and overdamped specifications. However, the definition for settling time is identical (the time at which the critically-damped or overdamped response crosses the 98% line of the final value for a unit step response. Using MATLAB step and right-clicking on the resulting plot can easily calculate the settling time numerically this is the approach followed here. For the critically-damped case, s1 = s2 (both poles are negative, real, and identical). Tere are infinite overdamped cases; here we use s2 = 2s1 (both poles are negative and real). All poles must be negative for stability, but the plots below show positive s1 for convenience of viewing the data represents only negative poles.

    For various pole values in the critically-damped case the settling time is found numerically using MATLAB step and right-clicking in the plot (Characteristics Settling Time). The settling time tS vs. pole s1 plot is shown below. The same data was entered in Excel and the best exponential curve fits were found to be:

    Critically-Damped Overdamped

    11

    5.83( )St s s 2R 1 1

    1

    4.6( )St s s 2R 1

    It was found that including s1 values less than 1 made for worse curve fitting; therefore the curve fits reported above are only for 11 10s and the table below reports discrete settling time results for

    1 1s , for completeness. Again the overdamped case uses s2 = 2s1. The two R2 values indicate that these are perfect curve fits.

    s1 tS (critically-damped) tS (overdamped) 0.25 23.30 18.40 0.50 11.70 9.20 0.75 7.78 6.14

    The two plots below present settling time results for the critically-damped and overdamped cases, respectively. To use these results for specifying good behavior in controller design, one can specify the desired settling time, choose critically-damped or overdamped, and solve for s1 from the appropriate best curve fit equation above (or try to read the s1 value from the appropriate plot). Once s1 is known, use s2 = s1 for the critically-damped case and s2 = 2s1 for the overdamped case. If you desire a different type of overdamping, you can use trial-and-error.

  • 42

    For all design cases, be sure to evaluate the expected dynamic response over time for your desired behavior to ensure it agrees with what you specified (in terms of settling time and 0% overshoot).

    Settling Time vs. s1

    Critically-Damped s2 = s1 and Overdamped s2 = 2s1

    1 2 3 4 5 6 7 8 9 100

    1

    2

    3

    4

    5

    6

    s1

    t S (s

    ec)

    critically-dampedoverdamped

  • 43

    4.3 Open-Loop and Closed-Loop System Example Given the following open-loop system model ( ) 2 ( ) 4 ( ) 4 ( )y t y t y t u t

    subject to (0) 0, (0) 0y y and a unit step input.

    Open-Loop Behavior Open-loop transfer function and block diagram:

    2

    2 2 2

    4( )2 2 4

    n

    n n

    G ss s s s

    Open-loop characteristic polynomial OL(s), natural frequency n, dimensionless damping ratio , damped frequency d, and poles s1,2 (complex conjugate poles with negative real part, therefore this system is underdamped):

    2( ) 2 4OL s s s 2n 0.5 3d 1,2 1 3s i Open-Loop System Unit Step Response

    Open-loop performance specifications tR 0.84 s tP = 1.81 s PO = 16.30% tS 4.00 s

    Open-loop ySS use the final value theorem (FVT)

    2 20 0 0 0

    4 1 4 4lim ( ) lim ( ) lim ( ) ( ) lim lim 12 4 2 4 4OLSS t s s s s

    y y t sY s sG s U s ss s s s s

    0 1 2 3 4 5 60

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    yo(t

    )

    t (sec)

  • 44

    Closed-Loop Controller Evaluation Choose a simple controller ( ) 10CG s K Assume a perfect sensor, i.e. H(s) = 1. Control law ( ) ( ) ( ) ( )CU s G s E s KE s Closed-loop block diagram and transfer function:

    2 24 40( )

    2 4 4 2 44KT s

    s s K s s

    Closed-loop characteristic polynomial CL(s), natural frequency n, dimensionless damping ratio , damped frequency d, and poles s1,2 (complex conjugate poles with negative real part, therefore this closed-loop system is also underdamped):

    2( ) 2 44CL s s s 6.63n 0.15 6.56d 1,2 1 6.56s i Open- and Closed-Loop System Unit Step Responses

    Closed-loop performance specs Open-loop performance specs

    tR 0.14 s (in error) tR 0.84 s tP = 0.48 s tP = 1.81 s PO = 62.1% PO = 16.3% tS 4.02 s tS 4.00 s The MATLAB m-file to generate this plot is given later in this section. Closed-loop ySS use the final value theorem (FVT)

    2 20 0 0 0

    40 1 40 40lim ( ) lim ( ) lim ( ) ( ) lim lim 0.9092 44 2 44 44CLSS t s s s s

    y y t sY s sT s R s ss s s s s

    0 1 2 3 4 5 60

    0.5

    1

    1.5

    t (sec)

    y(t)

    Open-loopClosed-loop

  • 45

    Steady-state error Let us assume that the steady-state value ySS of the open-loop system is the desired output value. We calculate the steady-state error of the closed-loop system relative to the desired open-loop value.

    100%OL CLOL

    SS SSSS

    SS

    y ye

    y

    For the example

    40144 100% 9.1%

    1SSe

    Closed-loop steady-state error Open-loop steady-state error

    eSS = 9.1% eSS = 0% Summary Choosing a random simple controller made the step response worse than the original open-loop case! Controller design must be done properly or things can easily get worse. For ( ) 10CG s K , the closed-loop system is more underdamped than the open-loop system: the rise and peak times are much faster (not necessarily good for the dynamics of the system), the percent overshoot is much worse, the settling time turned out to be about the same, and a steady-state error was introduced. The steady-state error arose because the controller introduced a virtual spring, in addition to the existing spring in the open-loop system, making the closed-loop system stiffer, resulting with a smaller displacement given the same unit step input force. Simulink Simulation

    The MATLAB Simulink diagram below recreates the previous plot comparing the open- and closed-loop systems for the current example.

    Two new blocks are used, the circular summing junction and the triangular gain (representing the simple proportional controller). More complex controllers can be represented by transfer functions as we will see later. The feedback loop takes the closed-loop system output back to the summing junction. The mux block (two signals into one above) allows us to compare both results on one scope (Plots). Both open- and closed-loop simulations use the same Step input for a fair comparison (pickoff point). If we choose a final simulation time of 6 sec (entered via the time box on the simulation window menu), the Simulink plots are identical to that shown earlier.

  • 46

    Here is the MATLAB program to create the figure for the example of this section, comparing the open- and closed-loop system responses to a unit step input.

    %--------------------------------------------- % Open-loop/Closed-loop Example % Dr. Bob, ME 3012 %--------------------------------------------- clear; clc; % Open-loop unit step response numo = [4]; deno = [1 2 4]; SysO = tf(numo,deno); zeroso = roots(numo); poleso = roots(deno); [wno,zetao] = damp(deno); t = [0:0.01:6]; yo = step(SysO,t); % Open-loop unit step response % Closed-loop K = 10; % Simple proportional controller numc = [4*K]; denc = [1 2 4+4*K]; SysC = tf(numc,denc); zerosc = roots(numc); polesc = roots(denc); [wnc,zetac] = damp(denc); yc = step(SysC,t); % Closed-loop unit step response % Check hand-derivation of T(s)=[numc/denc] via MATLAB numgc = [K]; dengc = [1]; [numa,dena] = series(numgc,dengc,numo,deno); [numc2,denc2] = feedback(numa,dena,[1],[1]); TCheck = tf(numc2,denc2) % Display T(s) check results % Plot open- and closed-loop step responses figure; plot(t,yo,'r',t,yc,'g'); set(gca,'FontSize',18); legend('Open-loop','Closed-loop'); axis([0 6 0 1.5]); grid; ylabel('\ity(t)'); xlabel('\itt (\itsec)'); % Performance specs: open-loop wdo = wno(1)*sqrt(1-zetao(1)^2); % Damped natural frequency tro = (2.16*zetao(1) + 0.60)/wno(1) % Rise time tpo = pi/wdo % Peak time poo = 100*exp(-zetao(1)*pi/sqrt(1-zetao(1)^2)) % Percent overshoot tso = 4/(zetao(1)*wno(1)) % Settling time % Performance specs: closed-loop wdc = wnc(1)*sqrt(1-zetac(1)^2); % Damped natural frequency trc = (2.16*zetac(1) + 0.60)/wnc(1) % Percent overshoot tpc = pi/wdc(1) % Peak time poc = 100*exp(-zetac(1)*pi/sqrt(1-zetac(1)^2)) % Percent overshoot tsc = 4/(zetac(1)*wnc(1)) % Settling time % Right-click for performance specs: open- and closed-loop figure; step(SysO); grid; figure; step(SysC); grid;

  • 47

    4.4 First- and Second-Order Transient Response Characteristics The Cartesian representation of the 3x4 subplots (step responses) from the ME 3012 NotesBook Section 4.4 is for convenience only, since that is the way the MATLAB subplot works. For more accuracy, the underdamped cases c. should be represented using polar coordinates (for this example shown to scale below) rather than Cartesian coordinates.

    Recall for underdamped poles the polar representation is r = n and 1sin ; thus the two symmetric angles in the examples above are 5.7 and 30 .

    Also, remember all complex conjugates occur in pairs, as shown above (two poles generate one time response plot in all second-order cases, including the non-complex-conjugate cases).

    c1

    n

    n

    Im

    Re

    x

    x

    x

    xx

    x

    x

    x

    c1

    c2

    c2

    c3

    c3

    c4

    c4

    n

    n

  • 48

    We can also perform the example of Section 4.4 using the impulse function in place of the step function; this is shown below.

    Transient Response Characteristics vs. Re-Im-plane pole locations (impulse responses, generic second-order system, zero initial conditions)

    Figure key 5.0 n 2

    s i1 2 1 173, . c1. underdamped

    01. n 2 s i1 2 02 199, . .

    c2. underdamped

    0 n 2 s i1 2 2,

    d1. undamped

    01. n 2 s i1 2 0 2 199, . .

    e1. 0 5. n 1

    s i1 2 05 0866, . . c3. underdamped

    01. n 1 s i1 2 01 0995, . . c4. underdamped

    0 n 1 s i1 2,

    d2. undamped

    01. n 1 s i1 2 01 0 995, . .

    e2. 2 n 1

    s1 2 373 0 27, . , . a. overdamped

    1 n 1 s1 2 1,

    b. critically-damped

    0 n 0 s1 2 0,

    d3. special undamped

    1(-1.005) n 1( 0.99n )

    s1 2 1, (0.9,1.1) f. (g.)

    Note While cases f and g may look identical between the step (ME 3012 NotesBook) and impulse (this page) responses, they are different the impulse responses go to infinity faster than the step cases.

    0 5 10 15 20-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0 5 10 15 20-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0 5 10 15 20-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0 5 10 15 20-100

    -50

    0

    50

    100

    0 5 10 15 20-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0 5 10 15 20-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0 5 10 15 20-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0 5 10 15 20-10

    -5

    0

    5

    10

    0 5 10 15 20-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0 5 10 15 20-2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0 5 10 15 200

    5

    10

    15

    20

    0 5 10 15 200

    2

    4

    6

    8

    10

    12

    14

    16x 109

    fg

  • 49

    Here is the MATLAB program to create the figure for the example of Section 4.4, comparing the various second-order system transient responses to a unit step input, based on pole locations. To find the impulse responses of the previous page, simply substitute MATLAB function impulse for step. %--------------------------------------------------------------------- % Generate plots to display transient unit step response characteristics % given different dimensionless damping ratios and natural frequencies % for the generic second-order system Dr. Bob, ME 3012 %--------------------------------------------------------------------- clc; clear; figure; dt = 0.01; tf = 20; t = [0:dt:tf]; Xmin = 0; Xmax = tf; Ymin = 0; Ymax = 2; subplot(3,4,1); zeta = 0.5; wn = 2; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax Ymin Ymax]); r1 = roots(den); subplot(3,4,2); zeta = 0.1; wn = 2; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax Ymin Ymax]); r2 = roots(den); subplot(3,4,3); zeta = 0; wn = 2; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax Ymin Ymax]); r3 = roots(den); subplot(3,4,4); zeta = -0.1; wn = 2; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax -50 50]); r4 = roots(den); subplot(3,4,5); zeta = 0.5; wn = 1; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax Ymin Ymax]); r5 = roots(den); subplot(3,4,6); zeta = 0.1; wn = 1; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax Ymin Ymax]); r6 = roots(den); subplot(3,4,7); zeta = 0; wn = 1; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax Ymin Ymax]); r7 = roots(den); subplot(3,4,8); zeta = -0.1; wn = 1; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax -10 10]); r8 = roots(den); subplot(3,4,9); zeta = 2; wn = 1; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax Ymin Ymax]); r9 = roots(den); subplot(3,4,10); zeta = 1; wn = 1; num = [wn^2]; den = [1 2*zeta*wn wn^2]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax Ymin Ymax]); r10 = roots(den); subplot(3,4,11); zeta = 0; wn = 0; num = [1]; den = [1 0 0]; y = step(num,den,t); plot(t,y); axis([Xmin Xmax 0 200]); r11 = roots(den); subplot(3,4,12); zeta = -1; wn = 1; num = [wn^2]; den = [1 2*zeta*wn wn^2]; yf = step(num,den,t); zeta = -1.005; wn = sqrt(0.99); num = [wn^2]; den = [1 2*zeta*wn wn^2]; yg = step(num,den,t); plot(t,yf,'b',t,yg,'g'); legend('f','g'); axis([Xmin Xmax 0 16e09]);

  • 50

    For the impulse response transient characteristics plots presented two pages back, no initial conditions were specified in the MATLAB program, which means that MATLAB assumes zero initial conditions. We can see zero initial condition on position are achieved in all of the plots. However, none of these impulse response plots has a zero slope at t = 0, which means that the imulse response cannot allow zero velocity initial condition. Why? Let us address this issue via an example. Example analytical impulse response solution for the generic second-order system

    Solve 2 2( ) 2 ( ) ( ) ( )n n ny t y t y t t for y(t) given , n, and zero initial conditions:

    0

    0

    (0) 0(0) 0

    y yy v

    Here the Laplace Transform method will be used. The first step is to take the Laplace Transform of both sides of the ODE, including the zero initial conditions, and solving algebraically for the unknown in the Laplace domain, ( ) { ( )}Y s y t . 2 2

    2 2 2

    2 2 2

    2

    2 2

    ( ) 2 ( ) ( ) ( )

    ( ( ) (0) (0)) 2 ( ( ) (0)) ( ) (1)

    ( 2 ) ( )

    ( )2

    n n n

    n n n

    n n n

    n

    n n

    y t y t y t t

    s Y s sy y sY s y Y ss s Y s

    Y ss s

    Note that the system characteristic polynomial 2 22 n ns s appears when using the Laplace Transform method. For simplicity in solution, let us assume this system is overdamped, i.e. there are two negative, real, distinct poles (our impulse response conclusion will apply to all damping cases).

    2 2

    2 21 2

    ( )2 ( )( )

    n n

    n n

    Y ss s s s s s

    The Heaviside Partial Fraction expansion of Y(s) is:

    21 2

    1 2 1 2

    ( )( )( ) ( ) ( )

    n C CY ss s s s s s s s

    Solving for the residues C1 and C2:

    2 21 2 1 2 2 1

    1 2 1 2 1 2 1 2

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

    n nsC C C s s C s ss s s s s s s s s s s s s s s s

  • 51

    11 2

    0 21 2 2 1

    0

    n

    s C Cs C s C s

    2

    12 1

    2

    21 2

    n

    n

    Cs s

    Cs s

    This solution is always valid since due to the overdamped assumption, 1 2s s .

    To find the solution y(t) in the time domain, we must take the inverse Laplace Transform of Y(s).

    1 2

    1

    21

    1 2

    1 1 2

    1 2

    1 2

    ( ) ( )

    ( )( )( )

    ( )( ) ( )

    ( )

    n

    s t s t

    y t Y s

    y ts s s s

    C Cy ts s s s

    y t C e C e

    Checking the zero initial conditions from this solution, it is seen that the initial position is zero, but the the initial velocity is NOT zero:

    1 2(0) (0)1 2 1 2

    2 2 2 2

    2 1 1 2 2 1 2 1

    (0) (1) (1)

    0

    s s

    n n n n

    y C e C e C C

    s s s s s s s s

    1 2

    1 2

    1 1 2 2

    (0) (0)1 1 2 2 1 1 2 2

    2 2 2 2

    1 2 1 22 1 1 2 2 1 2 1

    22 1

    2 12

    ( )

    (0) (1) (1)

    ( )

    0

    s t s t

    s s

    n n n n

    n

    n

    y t s C e s C e

    y s C e s C e s C s C

    s s s ss s s s s s s s

    s ss s

    The impulse responses for all other damping cases similarly result in non-zero initial velocities

    (slopes of y(t) at t = 0).

  • 52

    4.5 System Type For a system transfer function expressed in the following zero-pole form (m zeros zj and n non-

    zero poles pi): 1 2

    1 2

    ( )( ) ( )( )( )( ) ( )

    mr

    n

    K s z s z s zG ss s p s p s p

    r is the System Type, i.e. r is the number of poles at s = 0. The System Type is the number of system integrators. This section presents transient response characteristics for sample Type 0, I, and II systems.

    Unit Step Responses (output vs. time, 0 ICs) for different System Types Type 0 Type I Type II

    1( )G ss

    21( )G s s 1( )

    ( 1)G s

    s

    1( )( 1)

    G ss s

    21( )

    ( 1)G s

    s s

    2

    10( )( 10)

    G ss s

    210( )

    ( 10)G s

    s s s 2 2

    10( )( 10)

    G ss s s

    Type I, II, and higher systems have no effective spring, so their transient responses go to infinity. The steady state results are constant, linear, and parabolic for Types 0, I, II, respectively. What is the damping condition of each example? The stability condition? The middle center example is typical of an electric motor model with input torque (t) and output angle (t). Distributed block diagram:

  • 53

    4.7 Term Example Open-Loop Transient Response

    Here is the MATLAB program to create the figure for the example of Section 4.7, presenting the Term Example open-loop transient responses for load shaft angle and load shaft angular velocity outputs given unit impulse, unit step, and unit ramp inputs. %------------------------------------------------------------------ % Term example - electromechanical system transient responses % Theta and Omega outputs for impulse, step, and ramp inputs % Dr. Bob ME 3012 %------------------------------------------------------------------ clc; clear; numt = [5]; dent = [1 11 1010 0]; % open-loop transfer function V to ThetaL Syst = tf(numt,dent); polet = roots(dent); numw = [5]; denw = [1 11 1010]; % open-loop transfer function V to OmegaL Sysw = tf(numw,denw); polew = roots(denw); t0 = 0; dt = 0.005; tf = 0.8; % evenly-spaced time array t = [t0:dt:tf]; figure; subplot(321); [y,x] = impulse(Syst,t); % impulse plot(t,y); grid; axis([0 0.8 0 0.008]); subplot(322); [y,x] = impulse(Sysw,t); plot(t,y); grid; axis([0 0.8 -0.1 0.15]); subplot(323); % step [y,x] = step(Syst,t); plot(t,y); grid; axis([0 0.8 0 0.004]); subplot(324); [y,x] = step(Sysw,t); plot(t,y); grid; axis([0 0.8 0 0.008]); subplot(325); [y,x] = lsim(Syst,t,t); % unit ramp input u(t) = t plot(t,y); grid; axis([0 0.8 0 0.0016]); subplot(326); [y,x] = lsim(Sysw,t,t); plot(t,y); grid; axis([0 0.8 0 0.004]);

  • 54

    Term Example Transient Response, Extended We can extend the Term Example transient responses example from ME 3012 NotesBook Section 4.7 for one more input (the unit parabola, 2( ) 2p t t ) and one more output (L(t), the angular acceleration of the load shaft). Figure key

    L(t) impulse L(t) impulse L(t) impulse L(t) unit step L(t) unit step L(t) unit step L(t) unit ramp L(t) unit ramp L(t) unit ramp L(t) unit parabola L(t) unit parabola L(t) unit parabola

    0 0.2 0.4 0.6 0.802

    46

    8x 10-3

    0 0.2 0.4 0.6 0.8-0.1

    0

    0.1

    0 0.2 0.4 0.6 0.8-5

    0

    5

    0 0.2 0.4 0.6 0.80

    2

    4x 10-3

    0 0.2 0.4 0.6 0.80

    24

    6

    8x 10-3

    0 0.2 0.4 0.6 0.8-0.1

    0

    0.1

    0 0.2 0.4 0.6 0.80

    0.5

    1

    1.5x 10-3

    0 0.2 0.4 0.6 0.80

    2

    4x 10-3

    0 0.2 0.4 0.6 0.802

    46

    8x 10-3

    0 0.2 0.4 0.6 0.80

    2

    4x 10-4

    0 0.2 0.4 0.6 0.80

    0.5

    1

    1.5x 10-3

    0 0.2 0.4 0.6 0.80

    2

    4x 10-3

  • 55

    Electrical vs. Mechanical Rise Time Usually the electrical system time constant L/R is small relative to the mechanical system time constant JE/cE. This means that when voltage vA(t) is applied to the armature circuit, the armature current iA(t) rises much faster than the motor shaft angular velocity M(t) does (see the figure below) when iA(t) is applied to generate motor torque M(t) . Here are the component first-order transfer functions and time constants for the armature circuit and rotational mechanical system dynamics.

    1( ) 1( )

    ( ) ( )A

    A B

    I sG sV s V s Ls R

    0.1L

    R 3 ( ) 1( ) ( )

    M

    M E E

    sG ss J s c

    1E

    E

    Jc

    armature current motor shaft angular velocity

    Therefore, the electromechanical system open-loop block diagram transfer function could be simplified as follows. For VA(s) input, L(s) output, the open-loop transfer function is:

    ( )

    1

    T

    T

    T B T B

    KK RG s

    Ls R Js C K K sn K KL s Js C snR R

    Set 0LR relative to E

    E

    JJc c since the mechanical system dominates.

    ( )

    T

    T B

    KRG s

    K KJs C snR

    The simplified VA(s) input, L(s) output transfer function is second-order and the simplified VA(s) input, L(s) output transfer function is first-order.

    ( )T

    T B

    KnG s

    JRs RC K K s

    ( )T

    T B

    KnG s

    JRs RC K K

    0 1 2 3 4 50

    0.2

    0.4

    0.6

    0.8

    1

    t (sec)

    Out

    put

  • 56

    5. Controller Design 5.1 Controller Design Introduction Controller Types 1. Proportional ( )CG s K Root locus method This is the simplest controller, but it only has one-dof (one gain).

    2. Lead controller ( )( )( )Cs aG s Ks b a d (by an order of magnitude)

    Name from frequency response Improves steady-state error but slows transient response. Rules of thumb

    Place the negative, real pole d near the Re-Im origin Place the negative, real zero c at about c = 10d

    4. Lead/Lag controller ( )( )( )( )( )Cs a s cG s Ks b s d

    This controller improves the steady-state error without reducing the desired n much. Also does not affect the desired .

    5. PID controller ( ) IC P DKG s K K ss

    Proportional, Integral, Derivative of error E(s) PID controllers are common industrial controllers since they are simple, effective, and robust to disturbances. PID characteristics:

    P reasonably good error tracking, slow rise, with steady-state error PD adds damping, better stability, steady-state error unchanged PI reduce steady-state error, slower rise time PID compromise, best considering all competing factors

    According to some controls references, the D term is not implementable because we cannot build physical systems with more zeros than poles (MATLAB tfchk generates an error when you enter the

  • 57

    PID transfer function over its common denominator). Also, when the system is subjected to a unit step input from rest, the D term differentiates the step and creates an impulse. However, Simulink and industrial controllers implement full PID controllers successfully. Control Law (for all controller types) The control law calculates what the actuator input to the plant should be in the s domain, based on the measured error (the difference between the desired and actual outputs) and the desired performance goals.

    ( ) ( ) ( ) ( ) ( ) ( ) ( )C CU s G s E s G s R s H s Y s

    Again, our controller design is in the s domain. Digital controller implementation, an important real-world issue so that a computer can perform the control given the controller design from the s domain, is beyond the scope of ME 3012. The above control law must be implemented at every control time step, so the actuator input u(t) is constantly calculated by the controller to achieve the goals. When the number of controller unknowns equals the order of the closed-loop system we will use parameter matching to design the controller (solve the unknown controller gains). If this condition is not met, we can use rules of thumb, trial and error, and the root-locus method to design the controller. MATLAB Functions for Controller Design

    conv multiply polynomial factors damp calculate the poles, n, and for each system mode feedback combine transfer functions in a feedback loop rlocus draw the root-locus plot for the system with a proportional controller rlocfind determine controller gain K values from a root-locus plot rltool trial-and-error controller design via the root-locus plot roots calculate the roots of a polynomial series combine transfer functions in series sgrid draw n, polar grid on the Re-Im pole plane tf2zp convert transfer function to zero-pole system description zp2tf convert zero-pole to transfer function system description

  • 58

    Second-order performance specifications revisited inequalities For controller design, how should we choose good behavior? One must specify good poles as an input to the controller design process. Thus far we have specified an exact desired percent overshoot (yielding an exact ) and an exact settling time (yielding an exact n knowing from PO), from which the desired behavior characteristic polynomial is 2 22 n ns s , from which the desired closed-loop poles can be found.

    A much more general and powerful method for specifying good controller behavior (desired closed-loop poles) is to specify inequalities for performance specifications rather than exact values. In this example we require 2Pt sec, 5%PO , and 4St , and the problem is to determine and show on the Re-Im plane acceptable regions for the closed-loop controller poles given these three simultaneous inequality constraints.

    a. From 2

    21

    Pdn

    t

    we have 2d rad/sec (by symmetry, also 2d rad/sec).

    b. From 21100 5%PO e

    we have 0.69 , or 43.6 (symmetric)

    c. From 4 4Sn

    t we have 1n , that is 1n

    Let us plot all three constraints on the Re-Im plane; we get three straight-line constraints, two of them symmetric about the Re axis. Then we shade the acceptable side of each constraint line.

  • 59

    Plot inequality constraints on Re-Im pole plane

    Acceptable range (cross-hatched) for three performance specification inequalities

    To satisfy the inequality requirements on the performance specifications, one may choose two symmetric underdamped complex-conjugate poles anywhere in the shaded regions. The peak time and percent overshoot specifications dominate and the settling time constraint is not active.

    d

    Im

    Re

    n

    d

  • 60

    ITAE Performance Index Alternate method for choosing good desired closed-loop poles. control swiftness of response change rise and peak time control error of response change % overshoot, settling time

    These are competing requirements. How should we choose the desired poles for the closed-loop system controller design? Try performance indices many cases have been solved to tell you the optimal poles given various performance measures (indices). Here we will only consider one, the integral of time multiplied by the absolute error (ITAE).

    0( )ITAE t e t dt

    Minimize ITAE to simultaneously optimize competing requirements. Minimum ITAE means less time and smaller error in balance. For first- through sixth-order systems, the following characteristic polynomials minimize ITAE. If we design the feedback controller to meet one of these specifications, the shaping of the dynamic transient response will be optimized according to ITAE. The engineer must set the value for n to suit the time nature of the desired closed-loop system. Note for all cases (except the first order system) some overshoot is required to optimize ITAE. We simulate with MATLAB to see this (using n = 3 rad/s for all plots below).

    Order Optimal Characteristic Polynomials 1 ns 2 2 21 .4 n ns s 3 3 2 2 31 .75 2 .15n n ns s s 4 4 3 2 2 3 42 .1 3 .4 2 .7n n n ns s s s 5 5 4 2 3 3 2 4 52.8 5.0 5.5 3.4n n n n ns s s s s 6 6 5 2 4 3 3 4 2 5 63 .25 6.6 8 .6 7 .45 3.95n n n n n ns s s s s s

    ITAE Desired Unit Step Responses

    0 1 2 3 40

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    t (sec)

    y(t)

    1st2nd3rd4th5th6th

  • 61

    5.2 Root-Locus Method Examples 2 Re-create these examples in MATLAB. For each, be sure to interpret what is happening in the root locus plot.

    2a. 2( )( 4)sG s

    s s

    2b. 2 3 21 1( )

    ( 2)( 4) ( 10 32 32)s sG s

    s s s s s s s

    2c. 21 1( )

    ( 2)( 3) ( 5 6)s sG s

    s s s s s s

    2d. 3 21( )

    ( 12 64 128)G s

    s s s s

    2e. 2

    2

    14 96( )( 14)

    s sG ss s

    2f. 2 2

    2 2

    ( 4 10004)( 12 90036)( )( 10)( 2 2501)( 6 22509)

    s s s sG ss s s s s

  • 62

    Example 3 Conditionally stable example (continued) The unit step responses for Root-Locus Example 3 from the ME 3012 NotesBook are shown

    below, as K increases. Clearly we need a method for determining K to yield a desirable closed-loop system.

    Conditionally-stable example, unit step responses as K increases from 0.

    K values legend 0 0.01 0.07

    0.40 1.03 1.96 2.73 3.20 6420

    Unstable for 0.001 0.160K (using rlocfind(Sys))

    0 1 2 3 4 5-1

    -0.5

    0

    0.5

    1Step Response

    Time (sec)

    Ampl

    itude

    0 1 2 3 4 5-5

    0

    5Step Response

    Time (sec)

    Ampl

    itude

    0 1 2 3 4 5-20

    -15

    -10

    -5

    0

    5

    10

    15

    20Step Response

    Time (sec)

    Ampl

    itude

    0 1 2 3 4 50

    0.5

    1

    1.5

    2Step Response

    Time (sec)

    Ampl

    itude

    0 1 2 3 4 50

    0.5

    1

    1.5

    2Step Response

    Time (sec)

    Ampl

    itude

    0 1 2 3 4 50

    0.5

    1

    1.5

    2Step Response

    Time (sec)

    Ampl

    itude

    0 1 2 3 4 50

    0.5

    1

    1.5

    2Step Response

    Time (sec)

    Ampl

    itude

    0 1 2 3 4 50

    0.5

    1

    1.5

    2Step Response

    Time (sec)

    Ampl

    itude

    0 1 2 3 4 50

    0.5

    1

    1.5

    2Step Response

    Time (sec)

    Ampl

    itude

  • 63

    Relate and n to the Re-Im poles plane Recall the underdamped generic second-order system poles are:

    21,2 1n n n ds i i ( 0 1 )

    Further recall the graphical representation of these underdamped s1,2 pole locations (derived earlier in the ME 3012 NotesBook, this is symmetric as shown below). We measure with the right hand from the positive vertical (by symmetry, measure with the left hand from the negative vertical).

    The radial distance is n and 1sin . We can use MATLAB to create n, grids on the root-locus plot. This sgrid result is shown above and is symmetric about the Re axis.

    dmp = [0:0.1:1]; om = [1:1:5]; sgrid(dmp,om); Also, we can add vertical lines to the left of zero for lines of constant settling time (i.e. constant n) and symmetric horizontal lines for lines of constant peak time (i.e. constant 21d n ). Put your root-locus plot on the same figure.

    hold on; rlocus(Sys); [K,poles] = rlocfind(Sys)

    Be sure the root-locus figure is active (if there are other MATLAB graphics figures on the screen). The MATLAB window gives you a cross-hair cursor with which to select a point on the root-locus plot. Choose a point where the root-locus plot intersects a desirable n, or other desirable pole specification. MATLAB responds with the K value and associated poles. For controller design, check out rltool, very powerful and cool! rltool has built-in grid tools for two of the generic second-order system performance specifications (settling time and percent overshoot), plus and n: right-click design requirements new.

    -5 0 5-5

    0

    5

    ReIm

  • 64

    5.8 Controller Design Example 2 unstable G(s) This example uses a similar open-loop transfer function as in Controller Design Example 1, but it is an unstable open-loop plant transfer function (negative damping term).

    2

    10( )10

    G ss s

    Step