LABORATORY OF AUTOMATION SYSTEMS Analytical design of digital controllers

Similar documents
Pole-Placement Design A Polynomial Approach

Module 6: Deadbeat Response Design Lecture Note 1

DIGITAL CONTROLLER DESIGN

CONTROL OF DIGITAL SYSTEMS

Digital Control Systems

Pole placement control: state space and polynomial approaches Lecture 3

Chapter 13 Digital Control

AC&ST AUTOMATIC CONTROL AND SYSTEM THEORY SYSTEMS AND MODELS. Claudio Melchiorri

DESIGN USING TRANSFORMATION TECHNIQUE CLASSICAL METHOD

Control of Electromechanical Systems

Control Systems I Lecture 10: System Specifications

EE451/551: Digital Control. Chapter 3: Modeling of Digital Control Systems

Automatic Control 2. Loop shaping. Prof. Alberto Bemporad. University of Trento. Academic year

Time Response Analysis (Part II)

INTRODUCTION TO DIGITAL CONTROL

Optimal Polynomial Control for Discrete-Time Systems

AN INTRODUCTION TO THE CONTROL THEORY

Classify a transfer function to see which order or ramp it can follow and with which expected error.

EECE 460 : Control System Design

Chapter 2. Classical Control System Design. Dutch Institute of Systems and Control

Dr Ian R. Manchester

Discrete-time Controllers

Introduction. Performance and Robustness (Chapter 1) Advanced Control Systems Spring / 31

Chapter 15 - Solved Problems

Systems Analysis and Control

Signal sampling techniques for data acquisition in process control Laan, Marten Derk van der

EE402 - Discrete Time Systems Spring Lecture 10

Distributed Real-Time Control Systems

Bangladesh University of Engineering and Technology. EEE 402: Control System I Laboratory

Analysis of SISO Control Loops

Automatique. A. Hably 1. Commande d un robot mobile. Automatique. A.Hably. Digital implementation

SAMPLE SOLUTION TO EXAM in MAS501 Control Systems 2 Autumn 2015

Lecture 13: Internal Model Principle and Repetitive Control

EEE 184: Introduction to feedback systems

Linear State Feedback Controller Design

Notes for ECE-320. Winter by R. Throne

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

6.1 Sketch the z-domain root locus and find the critical gain for the following systems K., the closed-loop characteristic equation is K + z 0.

Digital Control & Digital Filters. Lectures 13 & 14

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

1 x(k +1)=(Φ LH) x(k) = T 1 x 2 (k) x1 (0) 1 T x 2(0) T x 1 (0) x 2 (0) x(1) = x(2) = x(3) =

Control System Design

Control Systems. Root Locus & Pole Assignment. L. Lanari

Compensator Design to Improve Transient Performance Using Root Locus

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

Poles and Zeros in z-plane

MEM 355 Performance Enhancement of Dynamical Systems

Chapter 7 - Solved Problems

It is common to think and write in time domain. creating the mathematical description of the. Continuous systems- using Laplace or s-

Outline. Classical Control. Lecture 1

Lecture 2 OKAN UNIVERSITY FACULTY OF ENGINEERING AND ARCHITECTURE

Dr Ian R. Manchester Dr Ian R. Manchester AMME 3500 : Review

Need for transformation?

Intro to Frequency Domain Design

Recursive, Infinite Impulse Response (IIR) Digital Filters:

Problem Set 4 Solutions 1

Raktim Bhattacharya. . AERO 422: Active Controls for Aerospace Vehicles. Basic Feedback Analysis & Design

Raktim Bhattacharya. . AERO 422: Active Controls for Aerospace Vehicles. Dynamic Response

Control Systems I. Lecture 7: Feedback and the Root Locus method. Readings: Jacopo Tani. Institute for Dynamic Systems and Control D-MAVT ETH Zürich

26 Feedback Example: The Inverted Pendulum

Step input, ramp input, parabolic input and impulse input signals. 2. What is the initial slope of a step response of a first order system?

10/8/2015. Control Design. Pole-placement by state-space methods. Process to be controlled. State controller

Discrete Systems. Step response and pole locations. Mark Cannon. Hilary Term Lecture

ELEG 305: Digital Signal Processing

Lecture 04: Discrete Frequency Domain Analysis (z-transform)

Digital Signal Processing

Theory of Linear Systems Exercises. Luigi Palopoli and Daniele Fontanelli

MAS107 Control Theory Exam Solutions 2008

21.4. Engineering Applications of z-transforms. Introduction. Prerequisites. Learning Outcomes

H(s) = s. a 2. H eq (z) = z z. G(s) a 2. G(s) A B. s 2 s(s + a) 2 s(s a) G(s) 1 a 1 a. } = (z s 1)( z. e ) ) (z. (z 1)(z e at )(z e at )

EE480.3 Digital Control Systems. Part 2. z-transform

Radar Dish. Armature controlled dc motor. Inside. θ r input. Outside. θ D output. θ m. Gearbox. Control Transmitter. Control. θ D.

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

FREQUENCY-RESPONSE DESIGN

Systems Analysis and Control

Systems Analysis and Control

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

Introduction to Feedback Control

Exam. 135 minutes + 15 minutes reading time

D(s) G(s) A control system design definition

Systems Analysis and Control

GATE EE Topic wise Questions SIGNALS & SYSTEMS

Introduction to Root Locus. What is root locus?

Control of Single-Input Single-Output Systems

Lecture: Sampling. Automatic Control 2. Sampling. Prof. Alberto Bemporad. University of Trento. Academic year

EEE 188: Digital Control Systems

# FIR. [ ] = b k. # [ ]x[ n " k] [ ] = h k. x[ n] = Ae j" e j# ˆ n Complex exponential input. [ ]Ae j" e j ˆ. ˆ )Ae j# e j ˆ. y n. y n.

DIGITAL CONTROL OF POWER CONVERTERS. 3 Digital controller design

ECSE 4962 Control Systems Design. A Brief Tutorial on Control Design

MEM 355 Performance Enhancement of Dynamical Systems

Data Based Design of 3Term Controllers. Data Based Design of 3 Term Controllers p. 1/10

Why do we need a model?

STABILITY ANALYSIS TECHNIQUES

Singular Value Decomposition Analysis

Stability of CL System

STABILITY ANALYSIS. Asystemmaybe stable, neutrallyormarginallystable, or unstable. This can be illustrated using cones: Stable Neutral Unstable

Robust Fractional Control An overview of the research activity carried on at the University of Brescia

Controls Problems for Qualifying Exam - Spring 2014

Digital Control: Summary # 7

ROBUST DIGITAL CONTROL USING POLE PLACEMENT WITH SENSITIVITY FUNCTION SHAPING METHOD

Transcription:

LABORATORY OF AUTOMATION SYSTEMS Analytical design of digital controllers Claudio Melchiorri Dipartimento di Ingegneria dell Energia Elettrica e dell Informazione (DEI) Università di Bologna email: claudio.melchiorri@unibo.it C. Melchiorri (DEI) LAS - AnDes 1 / 98

Analytical design of digital controllers 1 Poles and zeros assignment Introduction The Diophantine equation Design procedure Dealing with noise Control of an electromechanical system 2 Simplified techniques for analytical design Deadbeat design Simplified deadbeat design Dahlin design Specifications on the control variable 3 Appendix Note on the implementation of a digital controller Choice of the sampling period C. Melchiorri (DEI) LAS - AnDes 2 / 98

Poles and zeros assignment Introduction Poles and zeros assignment Let us assume to have the following block scheme: v G p (z) v(k) u(k) T Contr. H (s) T G p (s) y y(k) T G p (z) = Y(z) U(z) = B(z) A(z) where B(z) and A(z) have no common factors and have degree m and n respectively, with n m Controller: R(z)U(z) = T(z)V(z) S(z)Y(z) C. Melchiorri (DEI) LAS - AnDes 3 / 98

Poles and zeros assignment Introduction Poles and zeros assignment d 1 d 2 v T u B x y R A controller S R Closed loop system: Specification: Design equation: where Y(z) V(z) = BT AR +BS G m (z) = B m(z) A m (z) B T AR +BS = B m A m degree(a m ) degree(b m ) degree(a) degree(b) C. Melchiorri (DEI) LAS - AnDes 4 / 98

Poles and zeros assignment Introduction Poles and zeros assignment Note that the control action combines a feedforward term H ff (z) = T(z) R(z) and a feedback term Moreover, causality implies that H fb (z) = S(z) R(z) degree(r) degree(t), degree(r) degree(s) In practice, common choices are degree(r) = degree(t) = degree(s) or degree(r) = 1+degree(T) = 1+degree(S) C. Melchiorri (DEI) LAS - AnDes 5 / 98

Poles and zeros assignment Introduction Poles and zeros assignment Considering an internal stable dynamics A (z) (observer dynamics) we could define as reference transfer function G m (z) = A (z)b m (z) A (z)a m (z) Notice that the polynomial A (z) has no effects of the input/output relationship Y(z)/V(z), but has influence of the functions Y(z)/D 1 (z), and Y(z)/D 2 (z). Moreover, in order to have small errors for low-frequency disturbances, the closed-loop gain B(z) S(z) must be high for ω. A(z) R(z) z=e jωt Therefore, we can use integral actions and define: R(z) = (z 1) q R 1 (z) Design problem: compute the polynomials R, S and T. C. Melchiorri (DEI) LAS - AnDes 6 / 98

Poles and zeros assignment Introduction Poles and zeros assignment From the design equation: BT AR +BS = B m A m it follows that the cancellation among roots of B (zeros of the system) and roots of AR +BS (i.e. poles of the closed loop system) must be limited to stable terms: B = B + B where { B + stable zeros B unstable zeros B m = B B m Unstable (or non minimum phase) zeros have module > 1 ( z > 1). C. Melchiorri (DEI) LAS - AnDes 7 / 98

Poles and zeros assignment Introduction Poles and zeros assignment The presence of non minimum phase zeros in G p (z) may depend also on the choice of the sampling period T. In fact, for T [ ] [ 1 e Ts 1 e Ts G p (z) = Z G(s) Z s s ] 1 s k being k = n m the difference between the order of the denominator and numerator of G(s). For k 3 we always have unstable zeros. As a matter of fact, for k = 3 (and for T ) G p (z) T3 z 1 (1+4z 1 +z 2 ) 3! (1 z 1 ) 3 with a zero in z = 3.73. C. Melchiorri (DEI) LAS - AnDes 8 / 98

Poles and zeros assignment Example Poles and zeros assignment Example. Consider the two transfer functions G 1 (s) = 1 s 3 +2s 2 +2s +1 p 1 = 1 p 2 =.5.866i p 3 =.5+.866i G 2 (s) = 1 s 2 +2s +1 { p1 = 1 p 2 = 1 1.4 G 1(s) G 2(s) 1.2 1.2 1 1.8.8.6.6.4.4.2.2 2 4 6 8 1 12 Time (s) 2 4 6 8 1 12 Time (s) C. Melchiorri (DEI) LAS - AnDes 9 / 98

Poles and zeros assignment Example Poles and zeros assignment With T = 2.5s we obtain G 1(z) =.6438z 2 +.5911z +.5285 z 3 +.2387z 2 +.5575z.6738 Poles in: p 1 =.164.2374 i p 2 =.164+.2374 i p 3 =.821 Zeros in: { z1 =.8178 z 2 =.14 G 2(z) =.7127z +.1299 z 2.1642z +.6738 Poles in: { p1 =.821 p 2 =.821 Zeros in: { z1 =.1822 C. Melchiorri (DEI) LAS - AnDes 1 / 98

Poles and zeros assignment Example Poles and zeros assignment G(s) vs G(z), T = 2.5 s G(s) vs G(z), T = 2.5 s 1.2 1.2 1 1.8.8.6.6.4.4.2.2 2 4 6 8 1 12 14 16 Time (s) 2 4 6 8 1 12 14 16 Time (s) 1.8.6.4.2.5π/T.6π/T.4π/T Poles Zeros.7π/T.1.3π/T.2.3.8π/T.4.2π/T.5.6.7.9π/T.8.1π/T.9 1π/T 1π/T Magnitude (db) 2 4 6 8 1 12 Bode Diagram 1.8.6.4.2.5π/T.6π/T.4π/T Poles Zeros.7π/T.1.3π/T.2.3.8π/T.4.2π/T.5.6.7.9π/T.8.1π/T.9 1π/T 1π/T Magnitude (db) 1 2 3 4 5 6 7 8 Bode Diagram.2.4.6.9π/T.8π/T.1π/T.2π/T Phase (deg) 45 9 135 18.2.4.6.9π/T.8π/T.1π/T.2π/T Phase (deg) 45 9.8 1.7π/T.3π/T.6π/T.4π/T.5π/T 1.5.5 1 225 27 1 2 1 1 1 1 1 1 2 Frequency (rad/s).8 1.7π/T.3π/T.6π/T.4π/T.5π/T 1.5.5 1 135 18 1 2 1 1 1 1 1 1 2 Frequency (rad/s) G 1(z) =.6438z 2 +.5911z+.5285 z 3 +.2387z 2 +.5575z.6738 G 2(z) =.7127z+.1299 z 2.1642z+.6738 C. Melchiorri (DEI) LAS - AnDes 11 / 98

Poles and zeros assignment Example Poles and zeros assignment With T = 1.s we obtain G 1(z) =.9861z2 +.233z +.3628 z 3 1.154z 2 +.657z.1353 Poles in: p 1 =.3929.462 i p 2 =.3929+.462 i p 3 =.3679 Zeros in: { z1 = 2.1951 z 2 =.1676 G 2(z) =.2642z +.1353 z 2.7358z +.1353 Poles in: { p1 =.3679 p 2 =.3679 Zeros in: { z1 =.5122 C. Melchiorri (DEI) LAS - AnDes 12 / 98

Poles and zeros assignment Example Poles and zeros assignment G(s) vs G(z), T = 1 s G(s) vs G(z), T = 1 s 1.2 1.2 1 1.8.8.6.6.4.4.2.2 2 4 6 8 1 12 14 16 Time (s) 2 4 6 8 1 12 14 16 Time (s) Poles Zeros 1.6π/T.5π/T.4π/T.7π/T.1.3π/T.2.3.8π/T.4.2π/T.5.5.6.7.9π/T.8.1π/T.9 1π/T 1π/T.9π/T.1π/T.5.8π/T.2π/T.7π/T.3π/T.6π/T.4π/T.5π/T 1 2 1.5 1.5.5 1 Phase (deg) Magnitude (db) Bode Diagram 2 4 6 8 1 12 9 18 27 36 1 2 1 1 1 1 1 1 2 Frequency (rad/s) 1.8.6.4.2.2.4.6.8 1.5π/T.6π/T.4π/T Poles Zeros.7π/T.1.3π/T.2.3.8π/T.4.2π/T.5.6.7.9π/T.8.1π/T.9 1π/T 1π/T.9π/T.1π/T.8π/T.2π/T.7π/T.3π/T Magnitude (db) Phase (deg) Bode Diagram 1 2 3 4 5 6 7 8 45 9 135 18.6π/T.5π/T.4π/T 225 1 2 1 1 1 1 1 1 2 1.5.5 1 Frequency (rad/s) G 1(z) =.9861z2 +.233z+.3628 z 3 1.154z 2 +.657z.1353 G 2(z) =.2642z+.1353 z 2.7358z+.1353 C. Melchiorri (DEI) LAS - AnDes 13 / 98

Poles and zeros assignment Example Poles and zeros assignment With T =.1s we obtain G 1(z) =.1585z2 +.629z +.1434 z 3 2.8z 2 +2.62z.8187 Poles in: p 1 =.9477.823 i p 2 =.9477+.823 i p 3 =.948 Zeros in: { z1 = 3.549 z 2 =.255 G 2(z) =.4679z +.4377 z 2 1.81z +.8187 Poles in: { p1 =.948 p 2 =.948 Zeros in: { z1 =.9355 Note that z 3.73 for T. C. Melchiorri (DEI) LAS - AnDes 14 / 98

Poles and zeros assignment Example Poles and zeros assignment G(s) vs G(z), T =.1 s G(s) vs G(z), T =.1 s 1.2 1.2 1 1.8.8.6.6.4.4.2.2 2 4 6 8 1 12 14 16 Time (s) 2 4 6 8 1 12 14 16 Time (s) 1.5 1.5.5 1 1.5.6π/T.5π/T.4π/T.7π/T.3π/T.2.1.3.8π/T.4.5.2π/T.6.7.9π/T.8.1π/T.9 1π/T 1π/T.9π/T.8π/T.7π/T.3π/T.6π/T.5π/T.4π/T Poles Zeros.1π/T.2π/T 3.5 3 2.5 2 1.5 1.5.5 1 Magnitude (db) Phase (deg) 2 4 6 8 1 12 9 18 27 Bode Diagram 36 1 2 1 1 1 1 1 1 2 Frequency (rad/s) 1.8.6.4.2.2.4.6.8 1.5π/T.6π/T.4π/T Poles Zeros.7π/T.1.3π/T.2.3.8π/T.4.2π/T.5.6.7.9π/T.8.1π/T.9 1π/T 1π/T.9π/T.1π/T.8π/T.2π/T.7π/T.3π/T Phase (deg) Magnitude (db) Bode Diagram 2 4 6 8 1 45 9 135 18 225.6π/T.5π/T.4π/T 27 1 2 1 1 1 1 1 1 2 1.5.5 1 Frequency (rad/s) G 1(z) =.1585z2 +.629z+.1434 z 3 2.8z 2 +2.62z.8187 G 2(z) =.4679z+.4377 z 2 1.81z+.8187 C. Melchiorri (DEI) LAS - AnDes 15 / 98

Poles and zeros assignment Poles and zeros assignment The stable factor B + in B = B + B can be canceled by choosing R = B + R. Rewriting the design equation as: BT AR +BS = B + B T B + (AR +B S) = B m A m = B B m A m that is T AR +B S = B m A m and considering also the observer dynamics A, the two design equations became AR +B S = A A m T = A B m C. Melchiorri (DEI) LAS - AnDes 16 / 98

Poles and zeros assignment Poles and zeros assignment The characteristic equation of the feedback loop is AR +BS = B + A A m and therefore the poles are - the stable zeros of the plant (B + ) - the poles imposed by the design specification (A m ) - the poles of the observer dynamics (A ) C. Melchiorri (DEI) LAS - AnDes 17 / 98

Poles and zeros assignment The Diophantine equation The Diophantine equation The first design equation is in the form (Diophantine equation) AX +BY = C Necessary and sufficient condition for the existence of a solution (X,Y) is that the maximum common divider of A and B is a factor of C. Note that this condition is satisfied if A and B do not have common factors, as assumed here. Given a solution (X,Y ), then infinite solutions exist (Q arbitrary polynomial): Example 3x +4y = 7 X = X +QB Y = Y QA with x, y integer numbers A particular solution is x = y = 1, while the general solution is (n integer): { x = x +4n y = y 3n C. Melchiorri (DEI) LAS - AnDes 18 / 98

Poles and zeros assignment The Diophantine equation The Diophantine equation It is possible to show that a unique solution exists if the additional condition is assigned degree(x) < degree(b) or (the following will be used in the pole/zero assignment problem) degree(y) < degree(a) The solution of the Diophantine equation can be computed by solving a linear system. Given A(z) = z n +a 1 z n 1 +a 2 z n 2 + +a n B(z) = b z m +b 1 z m 1 +b 2 z m 2 + +b m C(z) = c z p +c 1 z p 1 +c 2 z p 2 + +c p Assuming degree(y) = n 1, then degree(x) = p n, and Y(z) = y z n 1 +y 1 z n 2 + +y n 1 X(z) = x z p n +x 1 z p n 1 + +x p n C. Melchiorri (DEI) LAS - AnDes 19 / 98

Poles and zeros assignment The Diophantine equation The Diophantine equation A note on the degrees of the polynomials in AX +BY = C (AR +BS = A m ). from s = deg(y) deg(a) = n, s = n 1 from H fb (z) = S(z)/R(z) s = deg(s) deg(r) = deg(x) = r r n 1 p = deg(c) = max {(deg(a)+deg(x)),(deg(b)+deg(y))} p max{(n+n 1),(m+n 1)} = 2n 1 In conclusion, a possible choice for the degrees of the polynomials X,Y, (S,R) and C is deg(x) = deg(r) = n 1 deg(y) = deg(s) = n 1 deg(c) = p = 2n 1 If a polynomial A is considered in C, the above relationships must be modified accordingly. C. Melchiorri (DEI) LAS - AnDes 2 / 98

Poles and zeros assignment The Diophantine equation The Diophantine equation By equating in AX +BY = C the terms of the same order, a square system of order p +1 (p +1 equations in p +1 unknowns) is obtained, given by 1...... a 1 1...... b...... a 2 a 1... b1 b............ 1......... a n... a1 b m... b a n... bm........................ a n... b m x x 1... x p n y y 1... y n 1 = c c 1 c 2... c p 2 c p 1 c p Note that from the first row we get immediately x = c! C. Melchiorri (DEI) LAS - AnDes 21 / 98

Poles and zeros assignment The Diophantine equation The Diophantine equation Since form the first equation we have x = c, we obtain a square system of order p (Sylvester matrix) 1... b... a 1 1...... b1 b...... a 2 a 1... b2 b 1............ 1......... b a n... a1 b m... b1 a n... bm........................ a n... b m x 1... x p n y y 1... y n 1 = c 1 c a 1 c 2 c a 2... c n c a n c n+1... c p In our case, we assign in order to have a unique solution: degree(s) = degree(a) 1 for causality: degree(a m ) degree(b m ) degree(a) degree(b) degree(a ) 2degree(A) degree(a m ) degree(b + ) 1 C. Melchiorri (DEI) LAS - AnDes 22 / 98

Poles and zeros assignment The Diophantine equation The Diophantine equation - Example Given the three polynomials A(z) = z 4 +a 1 z 3 +a 2 z 2 +a 3 z +a 4 (n = 4) B(z) = b z 3 +b 1 z 2 +b 2 z +b 3 (m = 3) C(z) = c z 7 +c 1 z 6 +c 2 z 5 +c 3 z 4 +c 4 z 3 +c 5 z 2 +c 6 z +c 7 (p = 7) Note that the highest order coefficients of C could be null, giving p < 7; we can nevertheless frame the problem in the most useful dimension. Recalling that AX +BY = C, and that the condition degree(y) < degree(a) must hold, we have that Therefore: degree(y) = n 1 = 3, degree(x) = p n = 3 Y/X proper! Y(z) = y z 3 +y 1 z 2 +y 2 z +y 3, X(z) = x z 3 +x 1 z 2 +x 2 z +x 3 where the coefficients x i,y i, i =,...4 must be computed. C. Melchiorri (DEI) LAS - AnDes 23 / 98

Poles and zeros assignment The Diophantine equation The Diophantine equation - Example From AX +BY = C, we have p +1 = 8 equations in the p +1 = 8 unknown coefficients x i,y i, i =,...4: degree 7 x = c degree 6 a 1 x +x 1 +b y = c 1 degree 5 a 2 x +a 1 x 1 +x 2 +b 1 y +b y 1 = c 2 degree 4 a 3 x +a 2 x 1 +a 1 x 2 +x 3 +b 2 y +b 1 y 1 +b y 2 = c 3 degree 3 a 4 x +a 3 x 1 +a 2 x 2 +a 1 x 3 +b 3 y +b 2 y 1 +b 1 y 2 +b y 3 = c 4 degree 2 a 4 x 1 +a 3 x 2 +a 2 x 3 +b 3 y 1 +b 2 y 2 +b 1 y 3 = c 5 degree 1 a 4 x 2 +a 3 x 3 +b 3 y 2 +b 2 y 3 = c 6 degree a 4 x 3 +b 3 y 3 = c 7 1 a 1 1 b a 2 a 1 1 b 1 b a 3 a 2 a 1 1 b 2 b 1 b a 4 a 3 a 2 a 1 b 3 b 2 b 1 b a 4 a 3 a 2 b 3 b 2 b 1 a 4 a 3 b 3 b 2 a 4 b 3 with a unique solution if A and B are co-prime. x x 1 x 2 x 3 y y 1 y 2 y 3 = C. Melchiorri (DEI) LAS - AnDes 24 / 98 c c 1 c 2 c 3 c 4 c 5 c 6 c 7

Poles and zeros assignment Design procedure Poles and zeros assignment: Design procedure 1. Inputs: G p = B/A, A, and G m = B m /A m 2. Decompose B = B B + B m = B B m where B + is monic 3. Solve (z 1) q AR 1 +B S = A A m with degree(s) = degree(a)+q 1 degree(r 1)=degree(A )+degree(a m ) degree(a) q 4. Write the control law Ru = T v S y with R = B + R, T = B ma, R = (z 1) q R 1 C. Melchiorri (DEI) LAS - AnDes 25 / 98

Poles and zeros assignment Design procedure Poles and zeros assignment: Design procedure In real applications, the design choice G m = B m /A m is usually made by imposing only few important properties for the closed loop system (e.g. bandwidth, overshoot, dominant poles,...). Let us assume where G m (z) = B m(z) A m (z) = Q(1) B (1) B (z) z k Q(z) 1 B are the non minimum phase zeros of the process 2 we may choose (i) Q(z) = z 2 +p 1 z +p 2, imposing dominant poles with natural frequency ω n and damping coefficient δ, with p 1 = 2e δωnt cos(ω n T 1 δ 2 ) p 2 = e 2δωnT or (ii) Q(z) = z a, with a = e T/τ, to avoid overshoots. 3 z k is the (approximated) time delay and the neglected dynamics of the open loop transfer function G p (z) 4 the two values Q(1) and B (1) make the static gain of G m equal to 1. C. Melchiorri (DEI) LAS - AnDes 26 / 98

Poles and zeros assignment Design procedure Poles and zeros assignment: Example Example: G p (s) = 1 s(s +1) [ 1 e st G p (z) = Z s ] 1 = s(s +1) K(z b) (z 1)(z a) where: a = e T, K = a+t 1, b = 1 T(1 a) K The desired overall transfer function is G m (z) = z(1+p 1 +p 2 ) z 2 +p 1 z +p 2 G p (z) has a zero in z = b, not present in G m (z), therefore Note that b <. B = B + B, B + = z b, B = K C. Melchiorri (DEI) LAS - AnDes 27 / 98

Poles and zeros assignment Design procedure Poles and zeros assignment: Example The following conditions must hold: - B m = B m K = z(1+p 1 +p 2 ) K - degree(a ), and we choose A = 1 - degree(r ) = degree(a )+degree(a m ) degree(a) = - degree(s) = degree(a) 1 = 1 Therefore The design equation is from which R = r, S = (s z +s 1 ) (z 1)(z a)r +K (s z +s 1 ) = z 2 +p 1 z +p 2 r = 1, s = 1+a+p 1, s 1 = p 2 a K K moreover T(z) = A B m = z(1+p 1 +p 2 ) = t z K C. Melchiorri (DEI) LAS - AnDes 28 / 98

Poles and zeros assignment Design procedure Poles and zeros assignment: Example The control law Ru = Tv Sy is: u(k) = bu(k 1)+t v(k) s y(k) s 1 y(k 1) 1.2 y(t) v(t) 3 u(k) Output y(t) and control variable u(k) for δ =.6, ω n = 1.2 and T =.2 Note the ringing effect on u(k). -3 (secondi) 1 C. Melchiorri (DEI) LAS - AnDes 29 / 98

Poles and zeros assignment Design procedure Poles and zeros assignment: Example 1.2 y(t) v(t) 3 u(k) Output y(t) and control variable u(k) for δ =.6, ω n = 1.2 and T =.8 Note the ringing effect on u(k). -3 (secondi) 1 C. Melchiorri (DEI) LAS - AnDes 3 / 98

Poles and zeros assignment Design procedure Poles and zeros assignment: Example The ringing effect is due to the zero cancelation (the zero z = b is negative). In order to eliminate this effect, G m (z) is modified as follows G m (z) = 1+p 1 +p 2 1 b z b z 2 +p 1 z +p 2 from which: B + = 1, B = K(z b) Since B m = 1+p 1 +p 2 K(1 b) degree(a ) 2degree(A) degree(a m ) degree(b + ) 1 = 1 we choose A (z) = z. Moreover: degree(r) = degree(a m )+degree(a ) degree(a m ) = 1 degree(s) = degree(a) 1 = 1 C. Melchiorri (DEI) LAS - AnDes 31 / 98

Poles and zeros assignment Design procedure Poles and zeros assignment: Example The design equation is (z 1)(z a)(z +r 1 )+K(z b)(s z +s 1 ) = z 3 +p 1 z 2 +p 2 z from which r 1 = b+ b(b2 +p 1 b +p 2 ) (b 1)(b a) K(1 b)(s +s 1 ) = 1+p 1 +p 2 We get K(a b)(s a+s 1 ) = a 3 +p 1 a 2 +p 2 a s = α 1 α 2 1 a α 1 = 1+p 1 +p 2 K(1 b) s 1 = α 2 α 1 a 1 a α 2 = a3 +p 1 a 2 +p 2 a K(a b) Since: T(z) = A B m = z1+p 1 +p 2 = t z, the resulting control law is: k(1 b) u(k) = r 1 u(k 1)+t v(k) s y(k) s 1 y(k 1) C. Melchiorri (DEI) LAS - AnDes 32 / 98

Poles and zeros assignment Design procedure Poles and zeros assignment: Example With δ =.6, ω n = 1.2 and T =.2 we get 1.2 y(t) v(t) 1.5 u(k) -.5 (secondi) 1 C. Melchiorri (DEI) LAS - AnDes 33 / 98

Poles and zeros assignment Dealing with noise Poles and zeros assignment: Dealing with noise d 1 d 2 v T u B x y R A controller S R x = = T B R A 1+ S B R A TB RA+BS v + B v + A 1+ S R B A S B d 1 R A 1+ S R RB RA+BS d 1 B A d 2 SB RA+BS d 2 C. Melchiorri (DEI) LAS - AnDes 34 / 98

Poles and zeros assignment Dealing with noise Poles and zeros assignment: Dealing with noise By assigning: H fb = S R feedback gain we obtain H a = B A S R loop gain x = B m A m v + H a 1+H a 1 H fb d 1 H a 1+H a d 2 By substituting (recall that AR +BS = B + A A m, B = B + B ) we have: x = A B m A A m v + R B B + A A m d 1 S B B + A A m d 2 = B m A m v + RB A A m d 1 SB A A m d 2 A appears only in the terms related to d 1 and d 2 (not to v). C. Melchiorri (DEI) LAS - AnDes 35 / 98

Poles and zeros assignment Dealing with noise Poles and zeros assignment: Example Effect of A on the rejection of external disturbances. Consider d 2 =, and consider the transfer function and G p (z) = B(z) A(z) =.1 z 1 G m (z) = B m(z) A m (z) =.2 z.8 If A = 1, it is possible to show that the control equation u(k) = 2[v(k) y(k)] = 2e(k) complies with the given design constraint. In this case, it results (d 2 = ) x =.2 z.8 v +.1 z.8 d 1 = G m (z)v +G d (z)d 1 Since G d (1) =.5, the variable x is heavily affected by a constant disturbance d 1. C. Melchiorri (DEI) LAS - AnDes 36 / 98

Poles and zeros assignment Dealing with noise Poles and zeros assignment: Example Bode diagram of G d (e jωt ) when A = 1 Gd(e^jwT) (db) -1-2 -3 1-3 1-2 1-1 1 1 1 wt In order to decrease the influence of d 1 on x, assign A (z) = z a, a 1 Therefore, the design equation (AR +BS = A A m ) results: (z 1)(z +r 1 )+.1(s z +s 1 ) = (z a)(z.8) from which (second order polynomial 2 equations) 1+r 1 +.1s = a.8, r 1 +.1s 1 =.8a C. Melchiorri (DEI) LAS - AnDes 37 / 98

Poles and zeros assignment Dealing with noise Poles and zeros assignment: Example Two equations in three unknowns: there is a degree of freedom, that can be used to assign R(1) = (that is an integral action). We obtain: r 1 = 1 s = 12 1a s 1 = 8a 1 and therefore the closed loop system becomes x =.2 z.8 v +.1(z 1) (z a)(z.8) d 1 a=1 Gd(e^jwT) (db) -1-2 a=.98 a=.9 a=.6 a= -3 1-3 1-2 1-1 1 1 1 wt C. Melchiorri (DEI) LAS - AnDes 38 / 98

Poles and zeros assignment Dealing with noise Poles and zeros assignment: Example 1.5 1.5 Process output for a = [:.1:1] 1 y(t).5 1 1 2 3 4 5 6 7 8 9 1 1.5.5 1 y(t) y(t).5 1 2 3 4 5 6 7 8 9 1 time (s) 1 2 3 4 5 6 7 8 9 1 time (s) Output of the process when: (above) a = 1, and then G d (1) = 1 (below) a =, and then G d (1) = Reference: unit step Disturbance: unit step at t = 5 s Output of the process for a [,1] C. Melchiorri (DEI) LAS - AnDes 39 / 98

Poles and zeros assignment Control of an electromechanical system Poles and zeros assignment: electromechanical system I C Motor ω 1 k ω 2 ω 1 ω 1 1 J 1 s J 1 d J 2 ω 2 k s d 1 J 2 s ω 2 C C i C e C 2 = With: J 1 = 1/9, J 2 = 1, k = 1, d =.1 the transfer function ω 2 (s)/c(s) results: ω 2 (s) C(s) = Gp(s) =.9(s +1) s[(s +.5) 2 +.9987 2 ] C. Melchiorri (DEI) LAS - AnDes 4 / 98

Poles and zeros assignment Control of an electromechanical system Poles and zeros assignment: electromechanical system The conjugated pair of poles is characterised by δ =.5 and ω n = 1 rad/s Specifications: the closed loop system must present a couple of dominant poles with natural frequency ω m =.5 rad/s and damping coefficient δ m =.7 Assume: T =.5s Let us consider an anti-aliasing filter (ω f = 2 rad/s) ω 2 f G f (s) = s 2 +1.4ω f s +ωf 2 The model of the overall system (sample & hold, anti-aliasing filter and plant) results [ ] 1 e st G p (z) = Z G f (s)g p (s) = B(z) s A(z) =.142(z.233)(z +.2234) (z 2.755z +.2466)(z 1) (z +1.342)(z +12.13) (z 2 1.712z +.9512) C. Melchiorri (DEI) LAS - AnDes 41 / 98

Poles and zeros assignment Control of an electromechanical system Poles and zeros assignment: electromechanical system Since the natural frequency ω n = 1 rad/s is close to the desired closed-loop frequency ω m =.5 rad/s, it is advisable to consider in the characteristic polynomial of the system a damping effect introduced e.g. by a second order polynomial A n. For the sake of simplicity, this effect can be obtained directly by the anti-aliasing filter. With B + = 1, the design equation is AR +BS = A m A n A From the Diophantine equations, it follows that A n must be a divider of S A m is chosen of order 5, with other three poles in z = A has degree 2, and is chosen as z 2 C. Melchiorri (DEI) LAS - AnDes 42 / 98

Poles and zeros assignment Control of an electromechanical system Poles and zeros assignment: electromechanical system Summarizing: A = A n (z 1)(z 2 1.712z +.9512) = A n A 1 R = z 4 +r 1 z 3 +r 2 z 2 +r 3 z +r 4 B =.142(z.233)(z +.2234)(z + 1.342)(z + 12.13) S = A n (s z 2 +s 1 z +s 2 ) = A n S 1 A m = (z 2 1.6522z +.747)z 3 = A m z 3 A n = (z 2.755z +.2466) A = z 2 The design equations become A 1 R +BS 1 = A m z 5, T = A m(1) B(1) A na The solution is R =.2316+.9793z +.6328z 2 +1.398z 3 +z 4 S = 45.15 214.8z +453.3z 2 419.3z 3 +14.5z 4 T = 2.429z 2 7.393z 3 +9.856z 4 C. Melchiorri (DEI) LAS - AnDes 43 / 98

Poles and zeros assignment Control of an electromechanical system Poles and zeros assignment: electromechanical system With a step input and impulsive disturbance d 1 applied at t = 25 s one obtains: 2 y(t) v(t) 1 u(t) -1 (secondi) 5 C. Melchiorri (DEI) LAS - AnDes 44 / 98

Simplified techniques for analytical design Deadbeat design Design according to the deadbeat method Design according to the deadbeat method C. Melchiorri (DEI) LAS - AnDes 45 / 98

Simplified techniques for analytical design Deadbeat design Design according to the deadbeat method In this case, the controller has a single degree of freedom, that is U(z) E(z) = S(z) R(z) = D(z) v(t) e(t) e(k) u(k) u(t) y(t) D(z) H (s) G p (s) T The deadbeat design specifies some desired properties of the output signal if the input reference is a classical function (as e.g. a step, a ramp, a parabola,...). Typical deadbeat specifications, in case of step references, are a) the output must reach its final value in the minimum possible time b) the steady state error must be zero c) no oscillations must be present between samples C. Melchiorri (DEI) LAS - AnDes 46 / 98

Simplified techniques for analytical design Deadbeat design Design according to the deadbeat method To satisfy the deadbeat specifications we impose that is: G m (z) = a z N +a 1 z N 1 + +a N z N G m (z) = a +a 1 z 1 + +a N z N = Y(z) V(z) with N n, n degree of the denominator of G p (z) From one obtains D(z)G p (z) 1+D(z)G p (z) = G m(z) D(z) = G m (z) G p (z)[1 G m (z)] C. Melchiorri (DEI) LAS - AnDes 47 / 98

Simplified techniques for analytical design Deadbeat design Design according to the deadbeat method Note that with the choice G m (z) = a +a 1 z 1 + +a N z N = Y(z) V(z) if the reference signal is a step (i.e. V(z) = 1/(1 z 1 )) we have Y(z) = ( a +a 1 z 1 + +a N z N) 1 (1 z 1 ) that is Y(z)(1 z 1 ) = ( a +a 1 z 1 + +a N z N) 1 y(k) y(k 1) = a k y(k) y(k 1) = k =,...,N k > N C. Melchiorri (DEI) LAS - AnDes 48 / 98

Simplified techniques for analytical design Deadbeat design Design according to the deadbeat method From y(k) = y(k 1)+a k we have: y() = a y(1) = y()+a 1. 1.8 y(n) = y(n 1)+a N y(n + 1) = y(n). As a consequence: y(k), y(t).6.4.2 y(k) =.2 +.2z 1 +.2z 3 +.2z 4 +.2z 5 y(k) = k i= ai, k N y(k) = N i= ai, k > N 1 2 3 4 5 6 7 8 time C. Melchiorri (DEI) LAS - AnDes 49 / 98

Simplified techniques for analytical design Deadbeat design Design according to the deadbeat method There are some conditions to be satisfied: Causality conditions: 1. D(z) = S(z)/R(z) with positive relative degree (degree(s) < degree(r)) 2. If G p(z) has a factor z k, G m(z) must have a factor z h with h k Stability conditions: From D(z) = G m(z) G p(z)[1 G m(z)] 1. All unstable poles of G p(z) must be zeros of [1 G m(z)] 2. All unstable zeros of G p(z) must also be zeros of G m(z) We refer to set-point signals described by V(z) = P(z) (1 z 1 ) q+1 - if P(z) = 1, q = we have the unitary step - if P(z) = Tz 1, q = 1 we have the unitary ramp - if P(z) = 1 2 T2 z 1 (1+z 1 ), q = 2 we have the parabola v(t) = 1 2 t2 C. Melchiorri (DEI) LAS - AnDes 5 / 98

Simplified techniques for analytical design Deadbeat design Design according to the deadbeat method Since E(z) = V(z) Y(z) = V(z)[1 G m (z)] = P(z)[1 G m(z)] (1 z 1 ) q+1 the error goes to zero in finite time and remains null if 1 G m (z) = (1 z 1 ) q+1 N(z) where N(z) is a proper polynomial to be assigned. As a matter of fact, in this case we have E(z) = P(z)N(z) = e +e 1 z 1 +...+e h z h Therefore E(z) is given by a finite number of terms in z 1, and e(k) goes to zero in a finite number (h+1) of sampling periods. Hence the controller is given by D(z) = G m (z) G p (z)(1 z 1 ) q+1 N(z) C. Melchiorri (DEI) LAS - AnDes 51 / 98

Simplified techniques for analytical design Deadbeat design Design according to the deadbeat method If G p (s) is stable, in order to avoid oscillations between samples ( ripple phenomenon), we ask for t nt y(t) = costant for step input ẏ(t) = costant for ramp input ÿ(t) = costant for parabola input These requirements must be translated in conditions on the control input. For example, in case of step input, the control action u(t) must be constant in steady state (null if G p has an integral action). Comments: - The design depends on the reference signal (if the reference signal is not the expected one, the overall performance may be quite different) - Possible ringing effect on the control input, in particular if T is small C. Melchiorri (DEI) LAS - AnDes 52 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 1 v(t) e(t) e(k) u(k) u(t) y(t) D(z) H (s) G p (s) T 1 G p (s) = s(s +1) Design the controller D(z) so that the closed-loop system has a deadbeat step response. We choose T =.8 s. Therefore [ ] 1 e st 1 K(z b) G p (z) = Z = s s(s +1) (z 1)(z a) = K(1 bz 1 )z 1 (1 z 1 )(1 az 1 ) =.2493(1+.7669z 1 )z 1 (1 z 1 )(1.4493z 1 ) C. Melchiorri (DEI) LAS - AnDes 53 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 1 Since G p (z) has a delay z 1 and n = 2, for G m (z) we choose a =, N = 2 G m (z) = a 1 z 1 +a 2 z 2 Since the input is a step, q = and therefore: 1 G m (z) = (1 z 1 )N(z) Note that with this choice we obtain also the cancellation of the pole of G p (z) in z = 1. Also, note that N(z) must be a polynomial with degree equal to 1. To avoid ripple we impose y(t) = const for t 2T, that in turns imply u(t) = const for t 2T, i.e. U(z) = b +b 1 z 1 +b c (z 2 +z 3 +...) where b c = since G p (s) has an integral action (the output of the process is constant with a null input). C. Melchiorri (DEI) LAS - AnDes 54 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 1 Therefore Moreover U(z) = b +b 1 z 1 U(z) = Y(z) Y(z) V(z) = G p (z) V(z) G p (z) = G m(z) V(z) G p (z) 1 (1 z 1 )(1.4493z 1 ) = G m (z) (1 z 1 ).2493(1+.7669z 1 )z 1 (1.4493z 1 ) = G m (z).2493(1+.7669z 1 )z 1 = G m(z) 4.1(1.4493z 1 ) (1+.7669z 1 )z 1 By equating the two previous expressions of U(z): U(z) = b +b 1 z 1 = G m (z) 4.1(1.4493z 1 ) (1+.7669z 1 )z 1 G m (z) = (1+.7669z 1 )z 1 G 1 U(z) = 4.1(1.4493z 1 ) G 1 where G 1 = cost C. Melchiorri (DEI) LAS - AnDes 55 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 1 From we obtain 1 G m (z) = 1 a 1 z 1 a 2 z 2 = (1 z 1 )N(z) N(z) = 1+(1 a 1 )z 1 1 a 1 a 2 = By equating the above relations (G m(z) = (1+.7669z 1 )z 1 G 1 = a 1z 1 +a 2z 2 ), one obtains G 1 = a 1, a 2.7669a 1 = Finally: a 1 =.566, a 2 =.434 G m (z) =.566z 1 +.434z 2 N(z) = 1+.434z 1 D(z) = G m (z) G p (z)(1 z 1 )N(z) = 2.27 1.2z 1 1+.434z 1 C. Melchiorri (DEI) LAS - AnDes 56 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 1 1.4 1.2 1 y(t).8.6.4.2 1.8 1 2 3 4 5 6 7 8 3 y(k), y(t).6 2.4 u(k) 1.2 1 2 1 2 3 4 5 6 7 8 time (s) 1 2 3 4 5 6 7 8 time C. Melchiorri (DEI) LAS - AnDes 57 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 1 In case the plant has an unmodelled dynamics, i.e., the step response is 1.2 G p (s) = 1 s(s +1)(s +1) y(t) v(t) 2.27 u(t) -1.2 (secondi) 8 C. Melchiorri (DEI) LAS - AnDes 58 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 1 The response to a ramp for the nominal system is 8 y(t) v(t) 1.816 u(t) (secondi) 8 Note a steady state error corresponding to a k v =.872 In this case, let assume that a specification on the velocity error constant is assigned, i.e. k v = k v (additional constraint). C. Melchiorri (DEI) LAS - AnDes 59 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 1 We need additional degrees of freedom in G m (z), so we assign N 3. With N = 3 G m (z) = a 1 z 1 +a 2 z 2 +a 3 z 3 Moreover [ 1 z 1 k v = lim z 1 T ] [ 1 z 1 D(z)G p (z) = lim z 1 T Since we want to assign G m (1) = 1, we have N(1) = 1 T k v We can obtain no ripple on the output for t 3T by imposing U(z) = b +b 1 z 1 +b 2 z 2 ] G m (z) (1 z 1 = 1 G m (1) )N(z) T N(1) = k v The design procedure is the same as before, by considering that now it is better to assume G 1 as a first order polynomial in z 1, and not as a constant. C. Melchiorri (DEI) LAS - AnDes 6 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 2 Given G p (s) = e 5s 1s +1 Design D(z) so that the closed loop system has a deadbeat response to a step input. [ With T = 5 s 1 e st e 5s ] G p (z) = Z s 1s +1 [ = z 1 (1 z 1 )Z.3935z 2 = 1.665z 1 Since G p (z) has the time delay z 2, we assume G m (z) = a 2 z 2 1 s(1s +1) that also satisfies N n. It is not necessary to impose pole/zero cancelation conditions. C. Melchiorri (DEI) LAS - AnDes 61 / 98 ]

Simplified techniques for analytical design Deadbeat design Deadbeat: example 2 In order to avoid the ripple, we impose the condition U(z) = b +b 1 z 1 +b c (z 2 +z 3 +...) where b c = cost since G p (s) does not present an integral action. We have: U(z) = Y(z) G p (z) = Y(z) V(z) V(z) G p (z) = G m(z) V(z) G p (z) Then a 2 = 1 and N(z) = 1+z 1 1 1.665z 1 = G m (z) 1 z 1.3935z 2 = G m (z) 2.541(1.665z 1 ) (1 z 1 )z 2 1 G m (z) = 1 a 2 z 2 = (1 z 1 )N(z) C. Melchiorri (DEI) LAS - AnDes 62 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 2 The controller results D(z) = 1.2 G m (z) G p (z)(1 z 1 )N(z) = 2.5413(1.665z 1 ) (1 z 1 )(1+z 1 ) y(t) v(t) 2.542 u(t) (secondi) 5 C. Melchiorri (DEI) LAS - AnDes 63 / 98

Simplified techniques for analytical design Deadbeat design Deadbeat: example 2 If the real process has a time delay different from the considered one, e.g. the following result is obtained 1.2 G p (s) = e 4s 1s +1 y(t) v(t) 2.542 u(t) (secondi) 5 C. Melchiorri (DEI) LAS - AnDes 64 / 98

Simplified techniques for analytical design Simplified deadbeat design Simplified deadbeat design v(t) e(t) e(k) u(k) u(t) y(t) D(z) H (s) G p (s) T A simplified, although very common, design procedure can be adopted. Let us assume that 1 we consider step inputs only 2 G p (z) is stable and minimum phase (no zeros or poles outside the unit circle) it is therefore possible to cancel the system dynamics 3 a simplified specification is G m (z) = z k, with k larger or equal to the intrinsic delay of G p (z) (i.e. the difference n m between the order of the denominator and numerator) Under these assumptions, the controller D(z) has a very simple expression: D(z) = 1 G p (z) z k 1 z k C. Melchiorri (DEI) LAS - AnDes 65 / 98

Simplified techniques for analytical design Simplified deadbeat design Simplified deadbeat design: example Let us consider 1 G p (s) = (.5s +1)(s +1) 2 (2s +1) Two simplified models can be considered: G 1 (s) = e 1.46s 3.34s +1 1 G 2 (s) = e.78s 4s 2 +3.6s +1 G(s) G1(s) 1 G(s) G2(s) (secondi) 2 C. Melchiorri (DEI) LAS - AnDes 66 / 98

Simplified techniques for analytical design Simplified deadbeat design Simplified deadbeat design: example Assuming a zero-order hold, T = 5s, and using the modified 1 Z-transform (with m = 1 1.46 5 =.78) we have [ 1 e st e 1.46s ] G p1 (z) T=5 = Z s 3.34s +1 [ ] = (1 z 1 1 )Z m s(3.34s +1) = z 1 (.6535+.1227z 1 ) 1.2238z 1 =.6535(z +.1877) z(z.2238) and for the second model (still with T = 5s) G p2 (z) =.6634(z +.434)(z +.3712) z[(z.4877) 2 +.934 2 ] 1 It is an extension of the standard Z-transform, to incorporate delays that are not multiples of the sampling time. C. Melchiorri (DEI) LAS - AnDes 67 / 98

Simplified techniques for analytical design Simplified deadbeat design Simplified deadbeat design: example Discretizing G 1 (s) with T = 1s (m = 1.46 =.54) we have [ G p1 (z) T=1 = z 1 (1 z 1 e.46s ] )Z s(3.34s +1) = z 2 (.1493+.195z 1 ) 1.7413z 1 =.1493(z +.7334) z 2 (z.7413) and (G 2 (s) with T = 1s) G p2 (z) =.5664(z +.347)(z +2.26) z[(z.6225) 2 +.1379 2 ] C. Melchiorri (DEI) LAS - AnDes 68 / 98

Simplified techniques for analytical design Simplified deadbeat design Simplified deadbeat design: example Comparison of the step response of G p (s), G p1 (z) and G p2 (z) 1 G1(s) HG1, T=5 HG1, T=1 1 G2(s) HG2, T=5 HG2, T=1 (secondi) 2 C. Melchiorri (DEI) LAS - AnDes 69 / 98

Simplified techniques for analytical design Simplified deadbeat design Simplified deadbeat design: example Choosing G p1 (z) with T = 5s, one obtains the controller: D(z) = 1.2238z 1 (.6535+.1227z 1 )(1 z 1 ) = U(z) E(z) that, applied to the real system G p (s), gives the following results 1.5 y(t) v(t) 2 u(t) The response is different from the expected one: the model considered for the design is an approximation of the true dynamics! (secondi) 4 C. Melchiorri (DEI) LAS - AnDes 7 / 98

Simplified techniques for analytical design Simplified deadbeat design Simplified deadbeat design: example By choosing G p1 (z) with T = 1s, there is a time-delay of 2 samples (z 2 ) and the minimum requirement is Y(z) V(z) = z 2 D(z) = 1 G p (z) z 2 1 z 2 = 1.7413z 1 (.1493+.195z 1 )(1 z 2 ) 1.5 y(t) v(t) 1 u(t) Note the ringing effect! It is due to the pole in z = 1. -1 (secondi) 4 C. Melchiorri (DEI) LAS - AnDes 71 / 98

Simplified techniques for analytical design Simplified deadbeat design Simplified deadbeat design: example In order to reduce the ringing effect, it is necessary to eliminate the critical pole in z = 1, compensating then the static gain. 1.5 y(t) v(t) 1 u(t) -1 (secondi) 4 C. Melchiorri (DEI) LAS - AnDes 72 / 98

Simplified techniques for analytical design Simplified deadbeat design Deadbeat: Simplified deadbeat design: example Let us consider the second model G p2(z) with T = 1s, and G m(z) = z 1. We obtain 4 D p2(z) T=1 = 176.6z[(z.6255)2 +.1378 2 ] (z 1)(z +.347)(z +2.27) y(t) v(t) -4 9999 u(t) -9999 (secondi) 4 C. Melchiorri (DEI) LAS - AnDes 73 / 98

Simplified techniques for analytical design Simplified deadbeat design Deadbeat: Simplified deadbeat design: example Let us consider the second model G p2(z) with T = 5s, and G m(z) = z 1. We obtain 1.5 D p2(z) T=5 = 1.57z[(z.4877)2 +.9343 3 ] (z 1)(z +.434)(z +.3712) y(t) v(t) 2 u(t) (secondi) 4 C. Melchiorri (DEI) LAS - AnDes 74 / 98

Simplified techniques for analytical design Dahlin design Dahlin Design according to the Dahlin approach C. Melchiorri (DEI) LAS - AnDes 75 / 98

Simplified techniques for analytical design Dahlin design Dahlin The Dahlin controller is designed with the specification that the behaviour of the closed loop system is the same as the step response of a first order system with delay: Y(s) = e θs 1 λs +1 s, that is, in the discrete time domain, Y(z) = Considering a step input V(z) = (1 e T/λ )z N 1 (1 z 1 )(1 e T/λ z 1 ) 1 1 z 1 from which we obtain the controller λ is a proper design parameter {N = floor(θ/t) } 2 Y(z) V(z) = (1 e T/λ )z N 1 = G 1 e T/λ z 1 m (z) D(z) = 1 G m (z) G p (z) 1 G m (z) = 1 (1 e T/λ )z N 1 G p (z) 1 e T/λ z 1 (1 e T/λ )z N 1 2 floor(x) rounds the elements of X to the nearest integers towards minus infinity. C. Melchiorri (DEI) LAS - AnDes 76 / 98

Simplified techniques for analytical design Dahlin design Dahlin: example Let us consider the transfer function of the previous example: G p (s) = 1 (.5s +1)(s +1) 2 (2s +1) If T = 1, λ = 2, we substitute in the previous expression of D(z) the function G p (z) = G p1 (z) T=1 : Therefore: D(z) λ=2 = G p1 (z) T=1 =.149(z +.733) z 2 (z.741).392z 2 (1.68z 1.392z 2 ) z 2 (1.741z 1 ) (.149+.11z 1 ) = 2.63 (1.741z 1 ) (1 z 1 )(1+.392z 1 )(1+.738z 1 ) C. Melchiorri (DEI) LAS - AnDes 77 / 98

Simplified techniques for analytical design Dahlin design Dahlin: example Comparison of the three cases λ = 1, λ = 2 e λ = 5 1.2 y1(t) y2(t) y5(t) 3 u2(t) (secondi) 4 Note the ringing effect, mainly due to the pole in z =.738. C. Melchiorri (DEI) LAS - AnDes 78 / 98

Simplified techniques for analytical design Dahlin design Dahlin: example If the pole is eliminated, and the static gain of D(z) modified accordingly, 1+.738z 1 z=1 = 1.738 ( 2.62/1.738= 1.513), we have 1.2 D(z) = 1.513 (1.741z 1 ) (1 z 1 )(1+.392z 1 ) y(t) 3 u(t) (secondi) 4 C. Melchiorri (DEI) LAS - AnDes 79 / 98

Simplified techniques for analytical design Specifications on the control variable Specifications on the control variable Specifications on the control variable C. Melchiorri (DEI) LAS - AnDes 8 / 98

Simplified techniques for analytical design Specifications on the control variable Specifications on the control variable Let us assume to have a step reference V(z) = 1 1 z 1 It is desired that in general the input/output variables of the process have (in discrete time) the following behaviour Y(z) = y 1 z 1 +y 2 z 2 +...+y N z N +z N 1 +... U(z) = u +u 1 z 1 +...+u N z N +u f (z N 1 + ) being u f is the reciprocal of the static gain of the process. For example: Y(z) = y 1 z 1 +z 2 +z 3 + U(z) = u +u 1 z 1 +u f z 2 +u f z 3 + in this case, in two sampling periods the steady state is reached. C. Melchiorri (DEI) LAS - AnDes 81 / 98

Simplified techniques for analytical design Specifications on the control variable Specifications on the control variable Typical profiles assigned by the specifications 1 y 1 u T 2T 3T 4T Y(z) = y 1z 1 +z 2 +z 3 + U(z) = u +u 1z 1 +u f z 2 +u f z 3 + u f u 1 T 2T 3T 4T C. Melchiorri (DEI) LAS - AnDes 82 / 98

Simplified techniques for analytical design Specifications on the control variable Specifications on the control variable Let s consider the previous expression for Y(z), U(z). Then Y(z)/V(z) results Y(z) V(z) = (1 z 1 )(y 1 z 1 +z 2 + ) = y }{{} 1 z 1 +(1 y 1 ) z 2 = P(z) }{{} p 1 p 2 while U(z)/V(z) is with U(z) V(z) p i = 1 i = (1 z 1 )(u +u 1 z 1 +u f z 2 + ) = u }{{} +(u 1 u ) z 1 +(u f u 1 ) z 2 = Q(z) }{{}}{{} q q 1 q i = u f i q 2 C. Melchiorri (DEI) LAS - AnDes 83 / 98

Simplified techniques for analytical design Specifications on the control variable Specifications on the control variable The discrete time transfer function G p (z) results Then, the controller is G p (z) = Y(z) U(z) = Y(z) V(z) V(z) U(z) = P(z) Q(z) D(z) = 1 G p (z) Y(z)/V(z) 1 Y(z)/V(z) = Q(z) P(z) P(z) 1 P(z) = Q(z) 1 P(z) C. Melchiorri (DEI) LAS - AnDes 84 / 98

Simplified techniques for analytical design Specifications on the control variable Specifications on the control variable: example Let us consider again the previous 4-th order system G p (s) = 1 (.5s +1)(s +1) 2 (2s +1) with the discrete-time model G p1 (z) T=1. After normalisation, i.e. imposing i p i = 1, i q i = u f, we have G p1 (z) = z 2 (.1493+.195z 1 ) 1.7413z 1 = z 2 (.577+.423z 1 ) 3.86 2.86z 1 = P(z) Q(z) The controller D(z) results D(z) = 3.86 2.86z 1 1 z 2 (.577+.423z 1 ) C. Melchiorri (DEI) LAS - AnDes 85 / 98

Simplified techniques for analytical design Specifications on the control variable Specifications on the control variable: example Simulation results 1.3 y(t) v(t) 3.86 u(t) (secondi) 4 C. Melchiorri (DEI) LAS - AnDes 86 / 98

Simplified techniques for analytical design Specifications on the control variable Design for disturbance compensation N(s) D(z) H(s) G p (s) Y(s) We have: therefore, the controller is Y(z) = NG(z) 1+D(z)G p (z) D(z) = NG(z) Y(z) G p (z) Y(z) The design procedure is the following: 1) a model of the disturbance is assigned, e.g. a step disturbance 2) the desired profile for the output variable Y(z) is assigned 3) the controller D(z) is computed C. Melchiorri (DEI) LAS - AnDes 87 / 98

Simplified techniques for analytical design Specifications on the control variable Design for disturbance compensation The time instant in which the disturbance is applied is not known. Therefore, it is convenient to assume the worst case. Assuming a process with time delay θ: - the worst case is when the disturbance is applied θ sec before the sampling instant n(t) y(t) T θ T 2T 2T+θ - if the disturbance is not synchronised with the sampling, we are not in the worst case n(t) T+2θ y(t) θ T T + θ 2T C. Melchiorri (DEI) LAS - AnDes 88 / 98

Simplified techniques for analytical design Specifications on the control variable Design for disturbance compensation: example For the sake of simplicity, assume θ = T G p (s) = e T s therefore G p (z) = (1 b)z 2 1 bz 1 [ ] e T s NG(z) = Z = (1+τ s)s 1+τ s b = e T/τ (1 b)z 2 (1 z 1 )(1 bz 1 ) Constraints on the output variable y() =, y(t) =, y(2t) = 1 b, y(3t) = 1 b 2 y(nt) = if n > 3 1 b 1 b 2 T 2T 3T 4T C. Melchiorri (DEI) LAS - AnDes 89 / 98

Simplified techniques for analytical design Specifications on the control variable Design for disturbance compensation: example We obtain and then the controller is D(z) = Y(z) = (1 b)z 2 +(1 b 2 )z 3 1+b +b2 1 b 1 b(1+b)z 1 1+b +b 2 (1 z 1 )(1+(1+b)z 1 ) Notice the unstable pole in in z = (1+b), which could generate the ringing effect. C. Melchiorri (DEI) LAS - AnDes 9 / 98

Appendix Note on the implementation of a digital controller Implementation of a digital controller Appendix: Note on the implementation of a digital controller Choice of the sampling period C. Melchiorri (DEI) LAS - AnDes 91 / 98

Appendix Note on the implementation of a digital controller Implementation of a digital controller v(t) e(t) e(k) u(k) u(t) y(t) 1 D(z) H (s) Gp(s) G p(s) = s(s +1) T T =.8 s [ 1 e st G p (z) = Z s ] 1 = s(s +1) =.2493(1+.7669z 1 )z 1 (1 z 1 )(1.4493z 1 ) K(z b) (z 1)(z a) = K(1 bz 1 )z 1 (1 z 1 )(1 az 1 ) Deadbeat controller: D(z) = 2.27 1.2z 1 1+.434z 1 C. Melchiorri (DEI) LAS - AnDes 92 / 98

Appendix Note on the implementation of a digital controller Implementation of a digital controller 1.2 y(t) v(t) 2.27 u(t) -1.2 (secondi) 8 C. Melchiorri (DEI) LAS - AnDes 93 / 98

Appendix Note on the implementation of a digital controller Implementation of a digital controller Deadbeat controller: Therefore D(z) = 2.27 1.2z 1 1+.434z 1 = U(z) E(z) U(z)(1+.434z 1 ) = E(z)(2.27 1.2z 1 ) or (z 1 is a time delay of a sample period) u(k)+.434u(k 1) = 2.27e(k) 1.2e(k 1) Finally, the control action should be implemented with the following difference equation u(k) =.434u(k 1)+2.27e(k) 1.2e(k 1) C. Melchiorri (DEI) LAS - AnDes 94 / 98

Appendix Note on the implementation of a digital controller Implementation of a digital controller global ek1, yk1, n, n1, d1... n = 2.27; n1 = 1.2; d1 =.434;... while true, end [yk, vk] = AcquireData(); [uk] = ComputeControl(yk, vk); [error] = OutputControl(uk); % wait interrut function [uk] = ComputeControl(yk, vk); end ek = vk - yk; uk = - d1 * uk1 + n * ek - n1 * ek1; ek1 = ek; uk1 = uk C. Melchiorri (DEI) LAS - AnDes 95 / 98

Appendix Choice of the sampling period Choice of the sampling period The choice of a proper sampling period T is fundamental for any digital control system. and is the tradeoff among several factors related on one side to the cost and on the other to the degradation of performance. cost degradation Performance (control quality) refer to: - disturbante rejection; - set-point tracking; - control energy; - delay and stability; - robustness wrt varying parameter; T The (computational) cost refer to - exploitation of the computational power; - AD/DA conversion speed; - computational speed; - numerical precision (data storage). C. Melchiorri (DEI) LAS - AnDes 96 / 98

Appendix Choice of the sampling period Choice of the sampling period 1) Loss of information: ω s > 2ω b where ω b is the closed-loop bandwidth (usually ω b > ω c, the bandwidth of the process). 2) Smoot dynamics and low time-delays: 6 < ω s ω b < 2 3) Compensation of disturbances: ω s > 2ω r where ω r is the highest disturbance frequency that should be compensated (to compensate for disturbances, these must be known, as the process). 4) Effects of anti-aliasing filters: the transfer function of the process to be considered in the control design becomes: G p (z) = Z[G p(s)g f (s)] where G f (jω) represents the filter, with a bandwidth given by a frequency ω p such that ω p /ω b = 2. Therefore ω s ω b 2 C. Melchiorri (DEI) LAS - AnDes 97 / 98

Appendix Choice of the sampling period Choice of the sampling period Other practical rules often used in practice are: a) T τ dom 1 where τ dom is the dominant time constant of the open-loop system. Note that this condition must be accurately verified, since the open loop bandwidth must be significantly different from the closed loop one. b) c) T θ 4 where θ is the process time-delay. As in the previous point, this condition must be verified also for the closed-loop system. T < T a 1, ω s > 1ω n where T a is the settling time and ω n the natural frequency of the open loop system, that is in this case characterised by a (dominant) pair of complex conjugated poles. C. Melchiorri (DEI) LAS - AnDes 98 / 98