approach Dynamic response Summary

Basics of Automation and Control I

Lecture 3: Transfer function and dynamic response analysis

Paweł Malczyk

Division of Theory of Machines and Robots Institute of Aeronautics and Applied Mechanics Faculty of and Aeronautical Engineering Warsaw University of Technology

October 17, 2019

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 1 / 31 Transfer function approach Dynamic response Summary Outline

1 Transfer function approach

2 Dynamic response

3 Summary

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 2 / 31 Transfer function approach Dynamic response Summary Transfer function approach

1 Transfer function approach SISO system Definition Poles and zeros Transfer function for multivariable system Properties

2 Dynamic response

3 Summary

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 3 / 31 Transfer function approach Dynamic response Summary SISO system

Fig. 1: Block diagram of a single input single output (SISO) system Consider the continuous, linear time-invariant (LTI) system defined by linear constant coefficient ordinary differential equation (LCCODE): dny dn−1y + − + ··· + ˙ + = an n an 1 n−1 a1y a0y dt dt (1) dmu dm−1u = b + b − + ··· + b u˙ + b u m dtm m 1 dtm−1 1 0 initial conditions y(0), y˙(0),..., y(n−1)(0), and u(0),..., u(m−1)(0) given, u(t) – input , y(t) – output signal, ai – real constants for i = 1, ··· , n, and bj – real constants for j = 1, ··· , m. . How do I find the LCCODE (1)? . How do I find the coefficients ai and bj?

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 4 / 31 Transfer function approach Dynamic response Summary Definition

 Definition 1 (Transfer function) The transfer function G(s) of a linear, time- invariant differential equation system is defined as the ratio of the of the output Y(s) (response function) to the Laplace transform of the input U(s) (driving Fig. 2: Block diagram of a single input single output (SISO) system function) under the assumption that all initial conditions are zero. Let us transform Eq. (1):  n n−1 a s + a − s + ··· + a s + a Y(s) = n n 1 1 0  m m−1 (2) = bms + bm−1s + ··· + b1s + b0 U(s) then P − m k ( ) m + − m 1 + ··· + + Y s bms bm 1s b1s b0 Pk=0 bks G(s) = = − = n (3) n − n 1 ··· k U(s) ans + an 1s + + a1s + a0 k=0 aks  Comment 1 For causal systems m ≤ n (proper transfer functions).

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 5 / 31 Transfer function approach Dynamic response Summary Poles and zeros

 Definition 2 (Characteristic equation) The characteristic equation of a system is defined as the equation obtained by setting the characteristic polynomial of a transfer function G(s) in Eq. (3) to zero, i.e.: n n−1 N(s) = ans + an−1s + ··· + a1s + a0 = 0 (4)  Definition 3 (Pole) The roots of the characteristic equation N(s) = 0 are called poles of a transfer function G(s).  Definition 4 (Zero) m m−1 The roots of the polynomial M(s) = bms +bm−1s +···+b1s+b0 are called zeros of a transfer function G(s).

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 6 / 31 Transfer function approach Dynamic response Summary Transfer function for multivariable system

Fig. 3: Block diagram of a multiple input multiple output (MIMO) system  Definition 5 (Transfer function for MIMO systems) th th The transfer function between the j input uj(t) (j = 1, 2, ··· , p) and the i output yi(t) (i = 1, 2, ··· , q) is defined as

Yi(s) Gij(s) = (5) Uj(s)

with Uk(s) = 0 for k = 1, 2, ··· , p, k ≠ j under the assumption that all initial conditions are zero. When all the p inputs are in action, the ith output transform is written

Yi(s) = Gi1(s)U1(s) + Gi2(s)U2(s) + ··· + Gip(s)Up(s) (6)

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 7 / 31 Transfer function approach Dynamic response Summary Transfer

It is convenient to express Eq. (6) in matrix-vector form: Y(s) = G(s)U(s) (7) where     U (s) Y (s)  1   1   U2(s)   Y2(s)  U(s) =  ···  , Y(s) =  ···  (8)

Up(s) Yq(s) are the transformed p×1 input vector and the transformed q×1 output vector, whereas   G (s) G (s) ··· G (s)  11 12 1p   G21(s) G22(s) ··· G2p(s)  G(s) = (9)  . . ··· .  Gq1(s) Gq2(s) ··· Gqp(s) is the q × p transfer-function matrix.

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 8 / 31 Transfer function approach Dynamic response Summary Transfer functions of physical systems

Electrical network transfer functions V(s) Component Voltage-current Voltage-charge G(s) = I(s) Z t 1 1 1 v(t) = C i(τ)dτ v(t) = C q(t) Cs 0

dq(t) v(t) = Ri(t) v(t) = R dt R

di(t) d2q(t) v(t) = L dt v(t) = L dt2 Ls

Mechanical system transfer functions F(s) Component -velocity Force-displacement G(s) = X(s) Z t f(t) = k v(τ)dτ f(t) = kx(t) k 0

dx(t) f(t) = bv(t) f(t) = b dt bs

2 dv(t) d x(t) 2 f(t) = m dt f(t) = m dt2 ms

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 9 / 31 Transfer function approach Dynamic response Summary Analogies between electrical and mechanical systems

Electrical network transfer functions Mechanical system transfer functions V(s) F(s) Component Voltage-current Voltage-charge G(s) = I(s) Component Force-velocity Force-displacement G(s) = X(s) Z Z t t 1 1 1 v(t) = C i(τ)dτ v(t) = C q(t) Cs f(t) = k v(τ)dτ f(t) = kx(t) k 0 0

dq(t) dx(t) v(t) = Ri(t) v(t) = R dt R f(t) = bv(t) f(t) = b dt bs

2 2 di(t) d q(t) ( ) = dv(t) ( ) = d x(t) 2 v(t) = L dt v(t) = L dt2 Ls f t m dt f t m dt2 ms

The equations of motion and the behavior of systems involving various physical media are found to be analogous. Force is analogous to voltage, and velocity to current. Velocity is analogous to voltage, and force to current. Different analogies exist.

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 10 / 31 Transfer function approach Dynamic response Summary Example

 Example 1 Consider the mechanical system (Fig. 4). We assume that the system is linear. The external force u(t) is the input signal, and the displacement y(t) of the mass is the output. The displacement y(t) is measured from the equilibrium position in the absence of external force. Write the equations of motion and find the transfer function for the system. The equations of motion for the system are as follows m¨y + by˙ + ky = u

The Laplace transform of the eq. (y(0) = 0, y˙(0) = 0): Fig. 4: Mechanical ms2Y(s) + bsY(s) + kY(s) = U(s) system Y(s) 1 G(s) = = Transfer function U(s) ms2 + bs + k  Comment 2 The characteristic eq. N(s) = ms2 + bs + k has two poles.  Comment 3 The transfer function conveys useful information: Y(s) ≈ 1 G(s) = U(s) k for small s (spring drive by a force) Y(s) ≈ 1 G(s) = U(s) ms2 for large s (mass driven by a force)

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 11 / 31 Transfer function approach Dynamic response Summary Properties of a transfer function

1 The transfer function of a system is a mathematical model of that system, in that it is an operational method of expressing the differential equation that relates the output variable to the input variable. 2 The transfer function is a property of a system itself, unrelated to the magnitude and nature of the input or driving function. 3 The transfer function includes the units necessary to relate the input to the output; however, it does not provide any information concerning the physical structure of the system. 4 If the transfer function of a system is known, the output or response can be studied for various forms of inputs with a view toward understanding the nature of the system. 5 If the transfer function of a system is unknown, it may be established experimentally by introducing known inputs and studying the output of the system (identification).

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 12 / 31 Transfer function approach Dynamic response Summary Dynamic response

1 Transfer function approach

2 Dynamic response Time response Unit Response by Unit step response Transient and steady state response Total response – example Example of a heat-flow model

3 Summary

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 13 / 31 Transfer function approach Dynamic response Summary Time response

 Definition 6 (Time response) The time response represents how the state and output of a dynamic system with nonzero initial conditions changes in time when subjected to a particular input.

Fig. 5: Time response Standard . Dirac impulse function u(t) = δ(t) Unit-step function u(t) = 1(t) Unit-ramp function u(t) = t · 1(t) 1 2 · Parabolic signal u(t) = 2 t 1(t).

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 14 / 31 Transfer function approach Dynamic response Summary Unit impulse response

 Definition 7 (Unit impulse response) The unit impulse response of a SISO system is the output y(t) of the system when the input is Dirac generalized function δ(t) and all initial conditions are zero. The unit impulse function is defined as  ∞ for t = 0 δ(t) = lim δ∆(t) = (10) ∆→0 0 for t ≠ 0

1 Fig. 6: Dirac impulse function where δ∆(t) = ∆ for 0 < t < ∆ and δ∆(t) = 0 otherwise. Z ∞ The following property holds: δ(t)dt = 1. −∞ The unit impulse response is given by −1 ya(t) = L [G(s) · 1] ≡ g(t) (11) since L[δ(t)] = 1.

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 15 / 31 Transfer function approach Dynamic response Summary Response by convolution

Any input signal can be represented by a sum of weighted, shifted impulses. Z X∞ t u(t) = lim u(k∆)δ∆(t − k∆)∆ = u(τ)δ(t − τ)dτ (12) ∆→0 k=0 0 We refer to (12) as the sifting property.

Fig. 7: Staircase approximations to a continuous-time signal

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 16 / 31 Transfer function approach Dynamic response Summary Response by convolution

The response of LTI system can represented by a sum of weighted, shifted impulse responses. Input signal Output signal

Fig. 8: LTI response by convolution

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 17 / 31 Transfer function approach Dynamic response Summary Response by convolution

If the unit impulse response g(t) is given then the total response of LTI is given by convolution integral. Z Z t t y(t) = u(τ)g(t − τ)dτ = g(τ)u(t − τ)dτ (13) 0 0  Comment 4 The relation (13) is also referred to as the superposition integral. It represents the general form of the response of a LTI system in continuous time.  Comment 5 Note that (13) is commutative: y(t) = u(t) ∗ g(t) = g(t) ∗ u(t)

where ∗ indicates convolution.  Comment 6 Laplace transform turns convolution into multiplication: Y(s) = L[y(t)] = L[g(t)∗u(t)] = G(s)U(s) Fig. 9: Impulse response and transfer function

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 18 / 31 Transfer function approach Dynamic response Summary Impulse response

 Example 2 Find the impulse response for the system in Fig. 10. Ns N Transfer function (m = 1kg, b = 2 m , k = 5 m ) 1 1 G(s) = = ms2 + bs + k s2 + 2s + 5 By using (11), we get:

− − 1 2 1 − g(t) = L 1[G(s)] = L 1[ · ] = e t sin (2t)1(t) 2 (s + 1)2 + 22 2 Fig. 10: Mechanical system b=2Ns/m, k=5N/m m=1kg, k=5N/m m=1kg, b=2Ns/m 0.35 0.35 0.35 0.3 0.3 0.3 0.25 0.25 0.25 0.2 0.2 0.2 0.15 0.15 0.15 0.1 0.1 0.1 0.05 0.05 0.05 0 0 0

-0.05 -0.05 -0.05

Impulse Response g(t) Response Impulse g(t) Response Impulse Impulse Response g(t) Response Impulse -0.1 -0.1 -0.1 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 Time (sec) Time (sec) Time (sec)  Comment 7 Modal analysis is the study of the dynamic properties of mechanical systems in the time and domain.

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 19 / 31 Transfer function approach Dynamic response Summary Unit step response

 Definition 8 (Unit step response) The unit step response of a SISO system is the output y(t) of the system when the input u(t) = 1(t) and all initial conditions are zero. The unit step function is defined∗ as  1 for t ≥ 0 u(t) = 1(t) = (14) 0 for t < 0 L 1 where [1(t)] = s .  Comment 8 Z t Fig. 11: Unit step (Heaviside) function d1(t) Note that δ(t) = dt , then 1(t) = δ(τ)dτ. 0   Z t −1 −1 1 Step response: yS(t) = L [G(s)U(s)] = L G(s) · = g(τ)dτ (15) s 0 n 1 for t > 0 1(t) = 1 for t = 0 . * Different definitions of the Heaviside function exist, e.g.: 2 0 for t < 0

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 20 / 31 Transfer function approach Dynamic response Summary Unit-step response

 Example 3 Find the unit-step response for the Ns N system in Fig. 12 (m = 1kg, b = 2 m , k = 5 m ). 1 1 Transfer function G(s) = ms2+bs+k = s2+2s+5 .

−1 −1 −1 1 1 yS(t) = L [Y(s)] = L [G(s)U(s)] = L [ · ] =  s2 + 2s + 5 s 1 − 1 = ... = 1 − (e t(cos (2t) + sin (2t)) 5 2 Fig. 12: Mechanical system m=1kg, b=2Ns/m, k=5N/m 0.35 Step-response testing: 0.3 0.25 Apply unit-step and record yS(t). 0.2 0.15 The impulse response is 0.1 dyS(t) Response 0.05 g(t) = 0 dt -0.05 -0.1 Now, you can predict output for 0 1 2 3 4 5 6 7 8 9 10 Time (sec) any input signal. Fig. 13: Impulse and unit-step response

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 21 / 31 Transfer function approach Dynamic response Summary Transient and steady state response

Fig. 14: Transient and steady-state response The total response of an LTI system consists of two components:

y(t) = ytr(t) + yss(t) (16)

transient response ytr(t) – free response (homogeneous or zero input) depends on the initial conditions. It is that part of the total response which approaches zero as t → ∞.

steady state response yss(t) – forced (inhomogeneous or non-zero input) response depends on the system input. It is that part of the total response that (usually) does not go to zero as t → ∞ and the effects of transients are no longer important.

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 22 / 31 Transfer function approach Dynamic response Summary Transient and steady-state response

LTI model in terms of an ODE (cp. Eq. (1)): Xn Xm Xn h i Xm h i (k) (k) (k) (k) aky = bku → akL y = bkL u (17) k=0 k=0 k=0 k=0 The Laplace transform of a derivative:   Xk−1   Xk−1 − − − − L y(k) = skY(s) − sjy(k j 1)(0), L u(k) = skU(s) − sju(k j 1)(0) j=0 j=0 The total response: ! Xn Xk−1 Xm Xk−1 1 − − − − Y(s) = G(s)U(s) + a sjy(k j 1)(0) + b sju(k j 1)(0) (18) | {z } N(s) k k k=0 j=0 k=0 j=0 =Yss(s) | {z }

=Ytr(s)  Comment 9 The total response of an LTIsystem is a sum of steady-state Yss(s) and transient Ytr(s) component.

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 23 / 31 Transfer function approach Dynamic response Summary Total response – example

 Homework 1 Find the total reponse of a mechanical system shown in Fig. 4, Ns N ˙ m where m = 1kg, b = 2 m , k = 5 m , u(t) = 3N, y(0) = 0.2m, y(0) = 0 s . Transient res. y(0) = 0.2m u(t) = 0N

Steady-state res. y(0) = 0m u(t) = 3N

Total res. y(0) = 0.2m u(t) = 3N

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 24 / 31 Transfer function approach Dynamic response Summary Example of a heat-flow model

 Example 4 Consider a thermocouple, i.e. a temperature-measuring device that consists of two conductors that contact each other at one spherical measurement junction. Assume that the thermocouple measures the temperature of the incoming air.

1 Formulate a mathematical model and find the transfer function of the system assuming that the input signal u(t) is the change in the air temperature and the output signal y(t) is the change in the spherical junction temperature. 2 Find the temperature of the spherical junction due to the pulse function u(t) = u0[1(t) − 1(t − τ)] for a). τ = 2 s, b). τ = 30 s. 3 Find the temperature of the spherical junction due to the impulse signals u(t) = aδ(t) for a). a = τu0, τ = 2 s, Fig. 15: Temperature measuring device b). a = τu0, τ = 30 s. (thermocouple) · −3 J 2r = 1.5 10 m – diameter of the spherical junction, c = 448 kgK – specific · 3 kg heat of the junction material, ρ = 8.9 10 m3 – density of the junction material, W h = 50 m2K – heat transfer coefficient.

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 25 / 31 Transfer function approach Dynamic response Summary Example of a heat-flow model

 Comment 10 The heat entering the thermocouple during dt seconds is dQ = hA(u − y) · dt, where dQ is the heat (in Joules). This heat is stored in the spot of the thermo-, thereby raising its temperature by dy. The heat-balance equation for the system is dQ = hA(u − y) · dt = mc · dy

2 4 3 A = 4πr – cross-sectional area of the ball, m = ρ 3 πr – mass of the ball. The above may be rewritten as dQ dy q = = hA(u − y) = mc dt dt and, finally dy T + y = u (19) dt ρ 4 πr3c mc 3 ρ rc ≈ where T = hA = h4πr2 = h 3 20sec.

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 26 / 31 Transfer function approach Dynamic response Summary Example of a heat-flow model

Let us find the transfer function for the system by transforming Eq. (19). Y(s) 1 Y(s)(Ts + 1) = U(s), ⇒ G(s) = = (20) U(s) Ts + 1 The Laplace transform of the pulse input signal is

1 − u(t) = u [1(t) − 1(t − τ)] ⇒ U(s) = u (1 − e τs) 0 0 s The Laplace transform of the output signal is   −τs 1 u − u 1 e Y(s) = · 0 (1 − e τs) = 0 − + 1 1 Fig. 16: Pulse input signal Ts 1 s T s(s + T ) s(s + T ) Let us find the (steady-state) response as y(t) = L−1[Y(s)].  Homework 2 Find the (transient) response of the heat-flow system due to the non-zero junction temperature y|t=0 = u0 at initial time instant, when u(t) = 0.

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 27 / 31 Transfer function approach Dynamic response Summary Example of a heat-flow model

The response of the system for the pulse signal is − −1 − t − t τ yA(t) = L [Y(s)] = u0[(1 − e T )1(t) − (1 − e T )1(t − τ)] (21) The Laplace transform of the impulse signal is

u(t) = aδ(t) ⇒ U(s) = L[aδ(t)] = a

The Laplace transform of the output signal is 1 a 1 Y(s) = · a = + 1 Ts 1 T s + T Fig. 17: Impuls Diraca Impulse response

−1 a − t y (t) = L [Y(s)] = e T 1(t) (22) B T

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 28 / 31 Transfer function approach Dynamic response Summary Example of a heat-flow model

Fig. 18: a) Pulse response yA(t) and impulse response yB(t) for τ = 2 b) Pulse response yA(t) and impulse response yB(t) for τ = 30  Comment 11 If the system time constant T >> τ then the pulse response can be Z ∞ approximated by the impulse response of the same integral u(t)dt. −∞

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 29 / 31 Transfer function approach Dynamic response Summary Review questions

1 Define the transfer function and discuss the properties of this function. 2 Give the definition of the poles and zeros of a transfer function. 3 Provide the voltage-current transfer functions for electrical systems such as capacitors, resistors and inductors. 4 Provide the force-displacement transfer functions for mechanical systems such as springs, dampers and masses. 5 What are the properties of a transfer function? 6 What kind of test signals do we use in controls? 7 Define the transient and steady-state response of a system. 8 Discuss the sifting property. 9 What is convolution? How do we exploit convolution to calculate the response of a system? 10 How do we calculate a unit-step response and a unit-ramp response when we have an impulse response? 11 How do we model a thermocouple? 12 How do we approximate an impulse response of a system by using pulse response?

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 30 / 31 Transfer function approach Dynamic response Summary Summary

1 Transfer function approach

2 Dynamic response

3 Summary

© Paweł Malczyk. Basics of Automation and Control I Lecture 3: Transfer function and dynamic response analysis 31 / 31