Lecture Discrete dynamic systems

Similar documents
Laplace Transforms Chapter 3

Laplace Transforms. Chapter 3. Pierre Simon Laplace Born: 23 March 1749 in Beaumont-en-Auge, Normandy, France Died: 5 March 1827 in Paris, France

Need for transformation?

25. Chain Rule. Now, f is a function of t only. Expand by multiplication:

CHEE 319 Tutorial 3 Solutions. 1. Using partial fraction expansions, find the causal function f whose Laplace transform. F (s) F (s) = C 1 s + C 2

Lecture 2. Introduction to Systems (Lathi )

9.5 The Transfer Function

GATE EE Topic wise Questions SIGNALS & SYSTEMS

Chemical Engineering 436 Laplace Transforms (1)

20.6. Transfer Functions. Introduction. Prerequisites. Learning Outcomes

Honors Differential Equations

The z-transform Part 2

Z - Transform. It offers the techniques for digital filter design and frequency analysis of digital signals.

A.1 THE SAMPLED TIME DOMAIN AND THE Z TRANSFORM. 0 δ(t)dt = 1, (A.1) δ(t)dt =

Time Response Analysis (Part II)

Chapter 3 Convolution Representation

MathQuest: Differential Equations

Ch 6.2: Solution of Initial Value Problems

Introduction to Digital Control. Week Date Lecture Title

Course roadmap. ME451: Control Systems. Example of Laplace transform. Lecture 2 Laplace transform. Laplace transform

EE Homework 5 - Solutions

Lecture V: Linear difference and differential equations

SAMPLE EXAMINATION PAPER (with numerical answers)

Lecture 1 From Continuous-Time to Discrete-Time

LTI Systems (Continuous & Discrete) - Basics

EE Experiment 11 The Laplace Transform and Control System Characteristics

Stability. X(s) Y(s) = (s + 2) 2 (s 2) System has 2 poles: points where Y(s) -> at s = +2 and s = -2. Y(s) 8X(s) G 1 G 2

Professor Fearing EE C128 / ME C134 Problem Set 7 Solution Fall 2010 Jansen Sheng and Wenjie Chen, UC Berkeley

Lecture 5: Linear Systems. Transfer functions. Frequency Domain Analysis. Basic Control Design.

Methods for analysis and control of. Lecture 6: Introduction to digital control

Analysis and Design of Control Systems in the Time Domain

Module 4 : Laplace and Z Transform Problem Set 4

E2.5 Signals & Linear Systems. Tutorial Sheet 1 Introduction to Signals & Systems (Lectures 1 & 2)

INTRODUCTION TO TRANSFER FUNCTIONS

Lecture 7: Laplace Transform and Its Applications Dr.-Ing. Sudchai Boonto

MA 201, Mathematics III, July-November 2018, Laplace Transform (Contd.)

Control Systems. Frequency domain analysis. L. Lanari

Digital Control System Models. M. Sami Fadali Professor of Electrical Engineering University of Nevada

2.161 Signal Processing: Continuous and Discrete Fall 2008

JUST THE MATHS UNIT NUMBER LAPLACE TRANSFORMS 3 (Differential equations) A.J.Hobson

Chapter 1 Fundamental Concepts

MODELING OF CONTROL SYSTEMS

Recursive, Infinite Impulse Response (IIR) Digital Filters:

MATHEMATICAL MODELING OF CONTROL SYSTEMS

ENGIN 211, Engineering Math. Laplace Transforms

Basic Procedures for Common Problems

Use: Analysis of systems, simple convolution, shorthand for e jw, stability. Motivation easier to write. Or X(z) = Z {x(n)}

Course Background. Loosely speaking, control is the process of getting something to do what you want it to do (or not do, as the case may be).

Chapter 2: Time-Domain Representations of Linear Time-Invariant Systems. Chih-Wei Liu

Fourier Transform 4: z-transform (part 2) & Introduction to 2D Fourier Analysis

Chain Rule. MATH 311, Calculus III. J. Robert Buchanan. Spring Department of Mathematics

V. IIR Digital Filters

z-transforms Definition of the z-transform Chapter

LTI system response. Daniele Carnevale. Dipartimento di Ing. Civile ed Ing. Informatica (DICII), University of Rome Tor Vergata

Digital Control & Digital Filters. Lectures 21 & 22

Solving Differential Equations Using MATLAB

Control Systems. Laplace domain analysis

Unit 2: Modeling in the Frequency Domain Part 2: The Laplace Transform. The Laplace Transform. The need for Laplace

The Method of Laplace Transforms.

Control Systems II. ETH, MAVT, IDSC, Lecture 4 17/03/2017. G. Ducard

APPLICATIONS FOR ROBOTICS

Time Response of Systems

CH.6 Laplace Transform

Module 4. Related web links and videos. 1. FT and ZT

Notice the minus sign on the adder: it indicates that the lower input is subtracted rather than added.

SAMPLE SOLUTION TO EXAM in MAS501 Control Systems 2 Autumn 2015

Chapter 2: Problem Solutions

Review Problems for Exam 2

Laplace Transform Theory - 1

Noise - irrelevant data; variability in a quantity that has no meaning or significance. In most cases this is modeled as a random variable.

Ma 221 Final Exam Solutions 5/14/13

e st f (t) dt = e st tf(t) dt = L {t f(t)} s

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATIONS 2010

Laplace Transforms and use in Automatic Control

UNIT - III PART A. 2. Mention any two techniques for digitizing the transfer function of an analog filter?

( ) ( = ) = ( ) ( ) ( )

Bayesian controller versus traditional controllers 1

Introduction & Laplace Transforms Lectures 1 & 2

Question: Total. Points:

f(t)e st dt. (4.1) Note that the integral defining the Laplace transform converges for s s 0 provided f(t) Ke s 0t for some constant K.

Chapter 1 Fundamental Concepts

ELEG 305: Digital Signal Processing

Laplace Transform Problems

Control Systems I. Lecture 6: Poles and Zeros. Readings: Emilio Frazzoli. Institute for Dynamic Systems and Control D-MAVT ETH Zürich

E : Lecture 1 Introduction

Task 1 (24%): PID-control, the SIMC method

One-Sided Laplace Transform and Differential Equations

Chapter 31. The Laplace Transform The Laplace Transform. The Laplace transform of the function f(t) is defined. e st f(t) dt, L[f(t)] =

Analog LTI system Digital LTI system

EECE 460 : Control System Design

DESIGN OF CMOS ANALOG INTEGRATED CIRCUITS

CMPT 889: Lecture 5 Filters

Predator - Prey Model Trajectories and the nonlinear conservation law

21-256: Partial differentiation

Transform Solutions to LTI Systems Part 3

Lecture 3 January 23

MA 441 Advanced Engineering Mathematics I Assignments - Spring 2014

Digital Filters. Linearity and Time Invariance. Linear Time-Invariant (LTI) Filters: CMPT 889: Lecture 5 Filters

LABORATORY INSTRUCTION MANUAL CONTROL SYSTEM I LAB EE 593

Lecture 19 IIR Filters

Transcription:

Chapter 3 Low-level io Lecture 3.4 Discrete dynamic systems Lecture 3.4 Discrete dynamic systems Suppose that we wish to implement an embedded computer system that behaves analogously to a continuous linear single-input-single-output (SISO) dynamic system. The input and output for the continuous system are continuous functions of time. The corresponding input and output for the embedded system are data, sampled with period T, that form two discrete-time sequences as shown in Figure 3.4. A continuous system can be described by a linear, constant-coefficient differential equation: d n y α n dt n + α d n 1 y n 1 dt n 1 +... + α dy 1 dt + α y = d m x = β m dt m + β d m 1 x m 1 dt m 1 +... + β 1 where α k and β k are constants. The equivalent transfer function is T(s) = Y(s) X(s) dx dt + β x (3.1) = β ms m + β m 1 s m 1 + + β 1 s 1 + β α n s n + α n 1 s n 1 + + α 1 s 1 +α (3.2) The corresponding discrete system is described by a difference equation that operates on the sequence of input values to produce the output sequence y(n). The difference equation has the form difference equation y(n) + a 1 y(n 1) +... + a N y(n N) = = b + b 1 x(n 1) +... + b M x(n M) (3.3) for n =, 1, 2,..., where is a sequence of periodically digitized values of the analog input signal, y(n) is a sequence of values that determine the output signal, and a k for k =, 1,..., N and b k for k =, 1,..., M are constants. This equation can also be written in summation form: N M a k y(n k) = b k x(n k) (3.4) k= k= or, solving this for the current output sample y(n), [ y(n) = 1 M ] N b k x(n k) a k y(n k) k= k=1 (3.5) 19 3 August 218, 18:46:13 3.4 1

Chapter 3 Low-level io Lecture 3.4 Discrete dynamic systems x(t) y(t) Input t Continuous System Output t x(nt) T y(nt) 1T 2T 3T 4T 5T 6T Input t Discrete System 1T 2T 3T 4T 5T 6T Output t y(n) 1 2 3 4 5 6 n Sequences 1 2 3 4 5 6 n Figure 3.4: continuous systems, discrete systems, and sequences. Notice that the most recent output value y(n) depends on previous values of y and on the previous and current values of the input x. This equation can also be written in summation form: N M a k y(n k) = b k x(n k) (3.6) k= k= or, solving for the current output sample y(n), ( y(n) = 1 M b k x(n k) k= ) N a k y(n k) k=1 (3.7) Notice that the most recent output value, y(n) depends on previous values of y, and on the previous and current value of the input x. The relationship between the constants a k and b k in the difference equation and the corresponding differential equation are described in the following. 11 3 August 218, 18:46:13 3.4 2

Chapter 3 Low-level io Lecture 3.4 Discrete dynamic systems 3.4.1 The z-transform In the analysis of continuous systems, we use the Laplace transform, defined by L (f(t)) = f(t)e st dt (3.8) which leads directly to the familiar property that the Laplace transform of the derivative of a function f(t) (with zero initial conditions) is s times the transform of the function F(s) L(f(t)): ( ) df(t) L = sf(s), (3.9) dt which enables us to find easily the transfer function of a linear continuous system, given its differential equation. For discrete systems a very similar procedure is available. The z- z-transform transform F(z) Z (f(n)) of a sequence f(n), with complex variable z (analogous to s), is defined by 3 Z (f(n)) = f(n)z n. (3.1) n= This leads directly to a property analogous to (3.9) for discrete systems: the z-transform of a function delayed by one sample period is z 1 times the transform of the function F(z): Z (f(n 1)) = z 1 F(z), (3.11) We can easily find the transfer function of a discrete system given its difference equation. For example, the z-transform of the second order difference equation y(n) + a 1 y(n 1) + a 2 y(n 2) = = b + b 1 x(n 1) + b 2 x(n 2) (3.12) is determined by successively applying (3.11) to arrive at ( 1 + a1 z 1 + a 2 z 2) Y(z) = ( b + b 1 z 1 + b 2 z 2) X(z). (3.13) 3 There are many more uses for z-transforms. For more details, see?. 111 3 August 218, 18:46:13 3.4 3

Chapter 3 Low-level io Lecture 3.4 Discrete dynamic systems Rearranging, the discrete transfer function is Tustin s method Y(z) X(z) = b + b 1 z 1 + b 2 z 2 1 + a 1 z 1 + a 2 z 2 (3.14) Notice that the transfer function (3.14) and the difference equation (3.12), can be derived from each other by inspection. Notice also that the transfer function of a discrete system is the ratio of two polynomials in z, just as the transfer function of a continuous system is the ratio of two polynomials in s. There are several ways to derive an approximate discrete model from a corresponding continuous model. We will use a popular technique called Tustin s method that approximates a continuous function of time by straight lines connecting the sampled points (i.e. trapezoidal integration). The discrete transfer function is found from the continuous transfer function using Tustin s method by making the following substitution: s = 2 ( ) 1 z 1 T 1 + z 1 (3.15) and rewriting the transfer function in the form of equation (3.14). Here, T is the sample period. 3.4.2 Example Consider a continuous first order system described by the transfer function: Y(s) X(s) = 1, where τ is the time constant. (3.16) τs + 1 We want to find the corresponding discrete-time transfer function and difference equation. Substituting Equation 3.15 into the transfer function, we have: where α is a constant: from which the difference equation can be inferred (see Equations 3.12 to 3.14 above): 112 3 August 218, 18:46:13 3.4 4

Chapter 3 Low-level io Lecture 3.4 Discrete dynamic systems Notice again that the current value of the output y(n) depends on the previous output, y(n 1), and on the current and previous inputs, and x(n 1). Notice also that the coefficients depend on the time constant τ in the original continuous system and on the sample period T. During each sample period, the value of the current value of the input is measured and the current value of the output y(n) is computed. Suppose that the time constant τ = 2, the sample period T = 1, and that the input is a unit step ( = 1 for all n), and the initial condition y() =. Then, from our solution for y(n), and we can compute the output sequence: y(n) =.6y(n 1) +.4 (3.17) Figure 3.5 shows plots of the input and output sequences. The dotted line is the exact solution y(t/t) of the original continuous differential equation. As you can see, in this example, Tustin s method is very close to the exact solution at the sample points. 3.4.3 The biquad cascade Although we could implement Equation 6.3 as shown, the sensitivity of the output to the coefficients leads to numerical inaccuracies as the order of the system N becomes large. We will solve this problem by breaking the Nth order system it into a series of n s second-order systems. The technique is called a biquad cascade and is illustrated in Figure 3.6. biquad cascade 113 3 August 218, 18:46:13 3.4 5

Chapter 3 Low-level io Lecture 3.4 Discrete dynamic systems 1.2 1.8.6.4.2 y(n) 1.2 1.8.6.4.2 2 4 6 8 1 12 n 2 4 6 8 1 12 n Figure 3.5 Input x(nt) Nth Order System Output y(nt) Input x(nt)... 2nd 2nd 2nd 2nd Order Order Order Order 1 2 n s -1 n s Output y(nt) Figure 3.6: a biquad cascade. 114 3 August 218, 18:46:13 3.4 6

Chapter 3 Low-level io Lecture 3.4 Discrete dynamic systems Notice that the output of each second-order section (biquad) 4 is the input to the subsequent section. Each biquad implements the same second-order difference equation, but with different coefficients, inputs, and outputs. For example, the current output y i (n) from the ith section would be: y i (n) = 1 i ( bi x i (n) + b 1i x i (n 1) + b 2i x i (n 2) + a 1i y i (n 1) a 2i y i (n 2) ). (3.18) Of course, a first or second order transfer function would require only one biquad. Depending on the value of N, some of the coefficients of at least one biquad may be zero. We will implement a function to handle any value of N. There are a variety of algorithms for breaking a transfer function into biquadric sections. Matlab s Signal Processing Toolbox contains a function tf2sos (transfer function to second order sections) for this purpose. 3.4.4 Discrete-time controllers For reference, Table 3.4 contains Tustin equivalents for some common continuous-time controllers. The Matlab Control Toolbox contains a function c2d that computes the Tustin equivalent discrete system sysd from the continuous system sys, as follows. sysd = c2d(sys, T, 'tustin') 4 Biquad is short for biquadratic. The biquad transfer function has second-order polynomials in both numerator and denominator. 115 3 August 218, 18:46:13 3.4 1

Chapter 3 Low-level io Lecture 3.4 Discrete dynamic systems Table 3.4: Tustin equivalents for common continuous-time controllers. Usage of z is contextual, meaning a zero in continuous transfer functions and meaning the z-transform z in discrete transfer functions. phase lag/lead PI PID continuous discrete differential equation k s + z s + p k b + b 1 z 1 + a 1 z ( 1 ) dy dx dt + py = k dt + zx K p + K i s b + b 1 z 1 + a 1 z 1 K p + K i s + K ds b + b 1 z 1 + b 2 z 2 + a 1 z 1 + a 2 z 2 t t y = K p x + K i x dt y = K p x + K i x dt + K d dx dt difference equation y(n) = a 1 y(n 1) + b + b 1 x(n 1) y(n) = a 1 y(n 1) + b + b 1 x(n 1) y(n) = a 1 y(n 1) a 2 y(n 2) + b + b 1 x(n 1) + b 2 x(n 2) 1 1 1 a 1 (pt 2)/(pT + 2) 1 a 2 1 b k(zt + 2)/(pT + 2) K p + K i T/2 K p + K i T/2 + 2K d /T b 1 k(zt 2)/(pT + 2) K p + K i T/2 K i T 4K d /T b 2 K p + K i T/2 + 2K d /T 116 3 August 218, 18:46:13 3.4 2