+ All Categories
Home > Documents > Digital Control~Tqw~ Darksiderg

Digital Control~Tqw~ Darksiderg

Date post: 08-Aug-2018
Category:
Upload: naveen-kamat
View: 215 times
Download: 1 times
Share this document with a friend

of 554

Transcript
  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    1/553

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    2/553

    Digital Control

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    3/553

    Digital Control

    Kannan M. MoudgalyaIndian Institute of Technology, Bombay

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    4/553

    Copyright c 2007 John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester,West Sussex PO19 8SQ, England

    Telephone (+44) 1243 779777

    Email (for orders and customer service enquiries): [email protected] our Home Page on www.wiley.com

    All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system ortransmitted in any form or by any means, electronic, mechanical, photocopying, recording,scanning or otherwise, except under the terms of the Copyright, Designs and Patents Act 1988 orunder the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court

    Road, London W1T 4LP, UK, without the permission in writing of the Publisher. Requests to thePublisher should be addressed to the Permissions Department, John Wiley & Sons Ltd, TheAtrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England, or emailed [email protected], or faxed to (+44) 1243 770620.

    Designations used by companies to distinguish their products are often claimed as trademarks. Allbrand names and product names used in this book are trade names, service marks, trademarks orregistered trademarks of their respective owners. The Publisher is not associated with any productor vendor mentioned in this book.

    This publication is designed to provide accurate and authoritative information in regard to thesubject matter covered. It is sold on the understanding that the Publisher is not engaged inrendering professional services. If professional advice or other expert assistance is required, theservices of a competent professional should be sought.

    Other Wiley Editorial Offices

    John Wiley & Sons Inc., 111 River Street, Hoboken, NJ 07030, USA

    Jossey-Bass, 989 Market Street, San Francisco, CA 94103-1741, USAWiley-VCH Verlag GmbH, Boschstr. 12, D-69469 Weinheim, Germany

    John Wiley & Sons Australia Ltd, 42 McDougall Street, Milton, Queensland 4064, Australia

    John Wiley & Sons (Asia) Pte Ltd, 2 Clementi Loop #02-01, Jin Xing Distripark, Singapore 129809

    John Wiley & Sons Canada Ltd, 6045 Freemont Blvd, Mississauga, ONT, Canada L5R 4J3

    Wiley also publishes its books in a variety of electronic formats. Some content that appears in printmay not be available in electronic books.

    Anniversary Logo Design: Richard J. Pacifico

    Library of Congress Cataloging-in-Publication Data

    Moudgalya, Kannan M.Digital control / Kannan M. Moudgalya.

    p. cm.

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    5/553

    To my parents

    Muthu Meenakshi

    Kuppu Subramanian

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    6/553

    Contents

    Preface xv

    Acknowledgements xvii

    List of Matlab Code xix

    List of Acronyms xxiii

    1 Introduction 1

    2 Modelling of Sampled Data Systems 5

    2.1 Sampled Data System . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    2.2 Models of Continuous Time Systems . . . . . . . . . . . . . . . . . . 7

    2.2.1 Magnetically Suspended Ball . . . . . . . . . . . . . . . . . . 7

    2.2.2 DC Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    2.2.3 Inverted Pendulum Positioning System . . . . . . . . . . . . . 11

    2.2.4 Liquid Flow Systems . . . . . . . . . . . . . . . . . . . . . . . 13

    2.2.5 van de Vusse Reactor . . . . . . . . . . . . . . . . . . . . . . 13

    2.3 Naturally Occurring Discrete Time Systems . . . . . . . . . . . . . . 14

    2.3.1 IBM Lotus Domino Server . . . . . . . . . . . . . . . . . . . . 15

    2.3.2 Supply Chain Control . . . . . . . . . . . . . . . . . . . . . . 15

    bl h C

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    7/553

    viii Contents

    I Digital Signal Processing 33

    3 Linear System 353.1 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    3.1.1 Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

    3.1.2 Time Invariance . . . . . . . . . . . . . . . . . . . . . . . . . 393.1.3 Causality and Initial Rest . . . . . . . . . . . . . . . . . . . . 41

    3.2 Basic Discrete Time Signals . . . . . . . . . . . . . . . . . . . . . . . 43

    3.3 InputOutput Convolution Models . . . . . . . . . . . . . . . . . . . 44

    3.3.1 InputOutput Linearity . . . . . . . . . . . . . . . . . . . . . 453.3.2 Impulse Response Models . . . . . . . . . . . . . . . . . . . . 473.3.3 Properties of Convolution . . . . . . . . . . . . . . . . . . . . 49

    3.3.4 Step Response Models . . . . . . . . . . . . . . . . . . . . . . 513.3.5 Impulse Response of Causal Systems . . . . . . . . . . . . . . 53

    3.3.6 Parametric and Nonparametric Models . . . . . . . . . . . . . 543.3.7 BIBO Stability of LTI Systems . . . . . . . . . . . . . . . . . 54

    3.4 State Space Models Revisited . . . . . . . . . . . . . . . . . . . . . . 563.5 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

    4 Z-Transform 61

    4.1 Motivation and Definition of Z-Transform . . . . . . . . . . . . . . . 61

    4.1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614.1.2 Absolute Convergence . . . . . . . . . . . . . . . . . . . . . . 624.1.3 Definition of Z-Transform . . . . . . . . . . . . . . . . . . . . 65

    4.1.4 Region of Convergence . . . . . . . . . . . . . . . . . . . . . . 654.1.5 Properties of Region of Convergence . . . . . . . . . . . . . . 68

    4.2 Z-Transform Theorems and Examples . . . . . . . . . . . . . . . . . 70

    4.2.1 Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    4.2.2 Shifting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734.2.3 Effect of Damping . . . . . . . . . . . . . . . . . . . . . . . . 754.2.4 Initial Value Theorem for Causal Signals . . . . . . . . . . . . 75

    4.2.5 Final Value Theorem for Causal Signals . . . . . . . . . . . . 754.2.6 Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    8/553

    Contents ix

    5 Frequency Domain Analysis 113

    5.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

    5.1.1 Oscillatory Nature of System Response . . . . . . . . . . . . 1135.1.2 Continuous and Discrete Time Sinusoidal Signals . . . . . . . 1155.1.3 Sampling of Continuous Time Signals . . . . . . . . . . . . . 118

    5.2 Fourier Series and Fourier Transforms . . . . . . . . . . . . . . . . . 1205.2.1 Fourier Series for Continuous Time Periodic Signals . . . . . 1205.2.2 Fourier Transform of Continuous Time Aperiodic Signals . . 1215.2.3 Frequency Response . . . . . . . . . . . . . . . . . . . . . . . 124

    5.2.4 Fourier Transform of Discrete Time Aperiodic Signals . . . . 1255.2.5 Convergence Conditions for Fourier Transform . . . . . . . . 1265.2.6 Fourier Transform of Real Discrete Time Signals . . . . . . . 1265.2.7 Parsevals Theorem . . . . . . . . . . . . . . . . . . . . . . . . 130

    5.3 Sampling and Reconstruction . . . . . . . . . . . . . . . . . . . . . . 1315.3.1 Sampling of Analog Signals . . . . . . . . . . . . . . . . . . . 1325.3.2 Reconstruction of Analog Signal from Samples . . . . . . . . 134

    5.3.3 Frequency Domain Perspective of Zero Order Hold . . . . . . 1375.4 Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

    5.4.1 PoleZero Location Based Filter Design . . . . . . . . . . . . 1405.4.2 Classification of Filters by Phase . . . . . . . . . . . . . . . . 144

    5.5 Discrete Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . 1475.6 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1495.7 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

    II Identification 157

    6 Identification 159

    6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1606.2 Least Squares Estimation . . . . . . . . . . . . . . . . . . . . . . . . 161

    6.2.1 Linear Model for Least Squares Estimation . . . . . . . . . . 1626.2.2 Least Squares Problem: Formulation and Solution . . . . . . 1626.3 Covariance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

    6.3.1 Covariance in Stationary, Ergodic Processes . . . . . . . . . . 1666.3.2 White Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1696 3 3 Detection of Periodicity Through ACF 172

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    9/553

    x Contents

    6.6.1 One Step Ahead Prediction Error Model . . . . . . . . . . . . 1976.6.2 Finite Impulse Response Model . . . . . . . . . . . . . . . . . 199

    6.6.3 Auto Regressive, Exogeneous (ARX) Input, Model . . . . . . 2006.6.4 Auto Regressive Moving Average, Exogeneous (ARMAX)

    Input, Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 2046.6.5 Auto Regressive Integrated Moving Average, Exogeneous

    (ARIMAX) Input, Model . . . . . . . . . . . . . . . . . . . . 2076.6.6 Output Error Model . . . . . . . . . . . . . . . . . . . . . . . 2086.6.7 BoxJenkins Model . . . . . . . . . . . . . . . . . . . . . . . . 209

    6.6.8 Case Study: Drifting Noise Model . . . . . . . . . . . . . . . 2116.7 Revisiting Least Squares Estimation . . . . . . . . . . . . . . . . . . 217

    6.7.1 Statistical Properties of Least Squares Estimate . . . . . . . . 2176.7.2 Recursive Least Squares . . . . . . . . . . . . . . . . . . . . . 220

    6.8 Weight Selection for Iterative Calculations . . . . . . . . . . . . . . . 2226.9 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2256.10 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

    III Transfer Function Approach to Controller Design 241

    7 Structures and Specifications 243

    7.1 Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2437.1.1 Feed Forward Controller . . . . . . . . . . . . . . . . . . . . . 243

    7.1.2 One Degree of Freedom Feedback Controller . . . . . . . . . . 2447.1.3 Two Degrees of Freedom Feedback Controller . . . . . . . . . 2457.2 Proportional Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

    7.2.1 Nyquist Plot for Control Design . . . . . . . . . . . . . . . . 2487.2.2 Stability Margins . . . . . . . . . . . . . . . . . . . . . . . . . 252

    7.3 Other Popular Controllers . . . . . . . . . . . . . . . . . . . . . . . . 2547.3.1 LeadLag Controller . . . . . . . . . . . . . . . . . . . . . . . 254

    7.3.2 Proportional, Integral, Derivative Controller . . . . . . . . . . 2607.4 Internal Stability and Realizability . . . . . . . . . . . . . . . . . . . 2637.4.1 Forbid Unstable PoleZero Cancellation . . . . . . . . . . . . 2647.4.2 Internal Stability . . . . . . . . . . . . . . . . . . . . . . . . . 2667.4.3 Internal Stability Ensures Controller Realizability . . . . . . 2697 4 4 Closed Loop Delay Specification and Realizability 269

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    10/553

    Contents xi

    7.8.2 Aryabhattas Identity . . . . . . . . . . . . . . . . . . . . . . 2907.8.3 Algorithm to Solve Aryabhattas Identity . . . . . . . . . . . 291

    7.9 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2967.10 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299

    8 Proportional, Integral, Derivative Controllers 301

    8.1 Sampling Revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3018.2 Discretization Techniques . . . . . . . . . . . . . . . . . . . . . . . . 302

    8.2.1 Area Based Approximation . . . . . . . . . . . . . . . . . . . 302

    8.2.2 Step Response Equivalence Approximation . . . . . . . . . . 3038.3 Discretization of PID Controllers . . . . . . . . . . . . . . . . . . . . 307

    8.3.1 Basic Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 3088.3.2 ZieglerNichols Method of Tuning . . . . . . . . . . . . . . . 3088.3.3 2-DOF Controller with Integral Action at Steady State . . . 3098.3.4 Bumpless PID Controller with Tc = Sc . . . . . . . . . . . . . 3128.3.5 PID Controller with Filtering and Tc = Sc . . . . . . . . . . . 313

    8.3.6 2-DOF PID Controller with Tc = Sc(1) . . . . . . . . . . . . 3168.3.7 2-DOF PID Controller with Tc(1) = Sc(1) . . . . . . . . . . . 320

    8.4 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3218.5 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

    9 Pole Placement Controllers 327

    9.1 Dead-Beat and Dahlin Control . . . . . . . . . . . . . . . . . . . . . 327

    9.2 Pole Placement Controller with Performance Specifications . . . . . 3289.3 Implementation of Unstable Controllers . . . . . . . . . . . . . . . . 3359.4 Internal Model Principle for Robustness . . . . . . . . . . . . . . . . 3379.5 Redefining Good and Bad Polynomials . . . . . . . . . . . . . . . . . 3439.6 Comparing 1-DOF and 2-DOF Controllers . . . . . . . . . . . . . . . 3519.7 Anti Windup Controller . . . . . . . . . . . . . . . . . . . . . . . . . 3549.8 PID Tuning Through Pole Placement Control . . . . . . . . . . . . . 3619.9 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3679.10 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379

    10 Special Cases of Pole Placement Control 381

    10.1 Smith Predictor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    11/553

    xii Contents

    11.1.5 ARIX Prediction Error Model . . . . . . . . . . . . . . . . . . 41011.1.6 ARIMAX Prediction Error Model . . . . . . . . . . . . . . . 411

    11.2 Minimum Variance Controller . . . . . . . . . . . . . . . . . . . . . . 41211.2.1 Minimum Variance Controller for ARMAX Systems . . . . . 41211.2.2 Expression for Sum of Squares . . . . . . . . . . . . . . . . . 41511.2.3 Control Law for Nonminimum Phase Systems . . . . . . . . . 41611.2.4 Minimum Variance Controller for ARIMAX Systems . . . . . 418

    11.3 Generalized Minimum Variance Controller . . . . . . . . . . . . . . . 42011.3.1 GMVC for ARMAX Model . . . . . . . . . . . . . . . . . . . 420

    11.3.2 GMVC for ARIMAX Model . . . . . . . . . . . . . . . . . . . 42211.3.3 PID Tuning Through GMVC . . . . . . . . . . . . . . . . . . 424

    11.4 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42811.5 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435

    12 Model Predictive Control 437

    12.1 Generalized Predictive Control . . . . . . . . . . . . . . . . . . . . . 437

    12.1.1 GPC for ARIX Model . . . . . . . . . . . . . . . . . . . . . . 43712.1.2 ARIMAX Model . . . . . . . . . . . . . . . . . . . . . . . . . 444

    12.2 Steady State Weighted Generalized Predictive Control (-GPC) . . . 44812.2.1 Model Derivation . . . . . . . . . . . . . . . . . . . . . . . . . 44812.2.2 Optimization of Objective Function . . . . . . . . . . . . . . 45012.2.3 Predictive PID, Tuned with -GPC . . . . . . . . . . . . . . 452

    12.3 Dynamic Matrix Control . . . . . . . . . . . . . . . . . . . . . . . . . 454

    12.4 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45612.5 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462

    13 Linear Quadratic Gaussian Control 463

    13.1 Spectral Factorization . . . . . . . . . . . . . . . . . . . . . . . . . . 46313.2 Controller Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46713.3 Simplified LQG Control Design . . . . . . . . . . . . . . . . . . . . . 475

    13.4 Introduction to Performance Analysis of Controllers . . . . . . . . . 47713.5 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48113.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485

    IV State Space Approach to Controller Design 487

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    12/553

    Contents xiii

    14.4.2 Solution to Optimal Control Problem . . . . . . . . . . . . . 50914.4.3 Infinite Horizon Solution to LQR Design . . . . . . . . . . . . 512

    14.5 Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51314.6 Matlab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51614.7 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518

    Appendix A Supplementary Material 521

    A.1 Mathematical Relations . . . . . . . . . . . . . . . . . . . . . . . . . 521A.1.1 Differentiation of a Quadratic Form . . . . . . . . . . . . . . 521

    A.1.2 Diagonalization of Square Matrices . . . . . . . . . . . . . . . 523A.2 Installation and Use of Software . . . . . . . . . . . . . . . . . . . . . 524A.3 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529

    References 531

    Index 535

    Index of Matlab Code 541

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    13/553

    Preface

    This book has evolved over a period of several years of teaching the coursesDigital Control and Modelling and System Identification at IIT Bombay. Severalundergraduate and postgraduate students, some without a good analog control back-ground, have successfully completed these courses. Several working professionals, somewith a long gap in their education, have also gone through these courses successfully.

    This material has also been used in the year 2004 to teach the course IntermediateProcess Control at the University of Alberta. There were students with a gap in theireducation, as they had enrolled in the academiaindustry co-op programme.

    Keeping the above mentioned requirement to cater for different kinds of students,we have designed this book to teach digital control from scratch. Apart from a fewelementary concepts on calculus and differential equations, not much background isrequired to understand this book. In particular, the reader need not have a good

    analog control background to understand most of the topics presented. As a result,this book is suitable also for students whose domain of interest is made up of onlydiscrete time systems, such as the field of computing systems.

    In order to make the book self-contained, we have presented the topic of digitalsignal processing in reasonable detail. This is because most students, except those inelectrical engineering, do not take a course in this important topic, exposure to whichis useful in understanding the control design techniques presented in this book.

    Because we focus on discrete time techniques, it is possible to present someadvanced topics as well. For example, this approach allows us to present the importanttopic of system identification in some detail. Indeed, it is possible to use the materialpresented in this book to teach a first course in identification. Although the topic ofidentification is useful in all areas, it may be the only way to obtain realistic models

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    14/553

    xvi Preface

    This book is useful also for students who may have a good analog controlbackground. Comparison of the concepts presented in this book with those from

    analog control will only help strengthen these ideas. These students, as well as industryprofessionals, will find the coverage on PID controllers useful.Working exclusively with discrete time domain has its own shortcomings. The

    most glaring one amongst them is the antialiasing filter, which is generally designedusing continuous time techniques. Addressing this requirement through discretetime techniques may require fast sampling rates. We do not discuss the effects ofquantization errors in this book. Nevertheless, because these are generally modelled

    with the help of random noise, the material developed in this book should help addressthese problems.A first course on control can be taught using this book, especially in disciplines

    that deal with only discrete time models. It may also be used to teach a second courseon control. Because it is more or less self-contained, this book could be useful to peoplewho have had a break in their studies, such as practising professionals. It follows thata course using the book may also be useful for students who may not have taken a

    good analog control course.A first course on identification may be taught using this book. The first six chapterscould form the basis of a digital signal processing course. Finally, using the materialpresented in this book on identification and control, it is possible to formulate anadaptive control course.

    We have provided an extensive set of Matlab1 routines to explain the variousideas presented in this book. The heart of the routines is a solver for Aryabhattas

    identity [39], which is also known as the Diophantine equation [59]. We haveimplemented the algorithm of [8] in Matlab to solve this polynomial equation. Wehave used the notation in [27] to represent polynomials in this book. We also makeuse of some basic routines from this reference.

    An extensive index of Matlab routines is given to help locate the programs. Thebuiltin functions, including the routines of Matlab toolboxes, appear at the beginningof this index, with the routines developed for this book appearing at the end. Most

    of the latter are listed in the book, at the end of every chapter. A few routines,although freely downloadable, are not listed in the book, owing to space constraints.Appendix A.2 explains the procedure for downloading and installing the software. Werecommend that the reader traces through the calculations using the Matlab debugger.

    The website http://www.moudgalya.org/dc/ provides much useful materiall t d t thi b k All M tl b di d i thi b k il bl t thi

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    15/553

    Acknowledgements

    This book has evolved over a period of several years of teaching the courses CL 692,Digital Control and CL 625, Modelling and System Identification at IIT Bombay,through class room instruction, as well as through the distance mode of education.Partial funding to write this book has been provided by the curriculum developmentprogramme at IIT Bombay. I would first like to acknowledge the freedom and supportgiven by the education system at IIT Bombay to be the main factors that helped meconceive this project.

    Many colleagues from IIT Bombay and other universities have given a lot ofinput in shaping this work. Notable amongst them are Preeti Rao, Arun Tangirala,K. P. Madhavan, A. Subramanyam, S. Sabnis, S. Narayana Iyer, Eric Ostertag andInderpreet Arora.

    I want to thank Sirish Shah for giving me an opportunity to spend one year atUniversity of Alberta and work on this book. He also constantly urged me to developMatlab based programs to explain the concepts. I wrote a large fraction of the Matlab

    codes reported in this work during my stay in Edmonton. I also want to thank Sirishfor funding my visit to Taiwan to present an IEEE conference paper [41] that explainsthe approach followed in this work. I would like to thank Fraser Forbes for giving mean opportunity to teach the course CHE 576, Intermediate Process Control at UoAusing the approach followed in this book. I also want to thank the researchers at UoAfor giving several useful suggestions. Notable amongst them are Vinay Kariwala andHari Raghavan. The input that I received at UoA helped sharpen the presentation.

    I would like to especially mention the help that I received from Arun Tangirala

    in writing the material on identification. The many discussions that I had with himon this topic, at UoA as well as at IIT Bombay and at IIT Madras, helped clear mydoubts in this subject. Arun has also been kind enough to let me use some examplesthat he has developed.

    I would also like to thank Huibert Kwakernaak for his permission to use some of

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    16/553

    List of Matlab Code

    2.1 Model of inverted pendulum, presented in Sec. 2.2.3 . . . . . . . . 302.2 Matrix exponential . . . . . . . . . . . . . . . . . . . . . . . . . . . 302.3 ZOH equivalent state space system . . . . . . . . . . . . . . . . . . 30

    3.1 Energy of a signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

    3.2 Convolution of two sequences . . . . . . . . . . . . . . . . . . . . . 57

    4.1 To produce an1(n), discussed in Sec. 4.1.2 . . . . . . . . . . . . . . 1054.2 To produce (a)n1(n 1), discussed in Sec. 4.1.2 . . . . . . . . . 1054.3 To produce polezero plots . . . . . . . . . . . . . . . . . . . . . . . 1064.4 Discrete transfer function of a continuous ss system . . . . . . . . . 1064.5 Computation of residues, useful for calculations in Sec. 4.4.2 . . . . 106

    4.6 Partial fraction expansion for Example 4.24 on page 94 . . . . . . . 1064.7 Partial fraction expansion for Example 4.26 on page 97 . . . . . . . 1074.8 Partial fraction expansion for Example 4.27 on page 98 . . . . . . . 1074.9 Partial fraction expansion for Example 4.29 on page 99 . . . . . . . 1084.10 Partial fraction expansion for Example 4.30 on page 100 . . . . . . 1084.11 Long division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

    5.1 Sinusoidal plots for increasing frequency, shown in Fig. 5.4 . . . . . 1495.2 Bode plots for Example 5.7 . . . . . . . . . . . . . . . . . . . . . . 1495.3 Bode plot of the moving average filter . . . . . . . . . . . . . . . . 1505.4 To produce Bode plot of differencing filter . . . . . . . . . . . . . . 1505.5 Bode plots of minimum and nonminimum phase filters. . . . . . . . 150

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    17/553

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    18/553

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    19/553

    Chapter 2

    Modelling of Sampled DataSystems

    In this chapter, we present an overview of feedback control systems, consisting of amix of analog and digital systems. We will refer to analog systems as continuous timesystems and present a few examples. One way of connecting analog and digital systemsis through sampling of the former or, equivalently, through discretization of continuoustime systems. We will summarize analog to digital conversion and digital to analogconversion, through which the signals become compatible with the systems under

    consideration. We also present models of naturally occurring discrete time systems.We conclude this chapter with a brief discussion on different approaches to controllerdesign and its validation.

    2.1 Sampled Data System

    There are many reasons why we use controllers. Some of these are: to stabilize unstableplants, to improve the performance of plants and to remove the effect of disturbances.There are two major types of controllers feed forward and feedback. We will discussthese in more detail in Chapter 7. For the current discussion, we will consider thefeedback control structure, a schematic of which is given in Fig. 1.1.

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    20/553

    6 2. Modelling of Sampled Data Systems

    For example, knowing the current state and the future inputs to the system, one cancompletely specify the future states and the future outputs of the system.

    The input to the system can consist of two types of variables: disturbance variableand manipulated or control variable. The former is one over which we have no control.These are typically external to a system. The manipulated or control variables helpmake the system behave the way we want. The values of these variables are calculatedby the controller.

    Typically, one does not measure all the states, but only a smaller number ofvariables, which could be functions of states. We use the symbol y to refer to the

    measured vector and call it the output. Eq. 2.1b is known as the output equation.Here, C and D are constant matrices.

    The plant could also be a discrete time system. Examples of these are computingand supply chain systems. These systems are modelled using the variables availableat specific time instants only:

    x(n + 1) = Ax(n) + Bu(n) (2.2a)

    y(n) = Cx(n) + Du(n) (2.2b)

    As in the continuous time case, x, u and y refer to state, input to and output fromthe plant, respectively.

    In the figure, Gc denotes the controller. We will restrict Gc to a digital controller,that is, a control algorithm implemented in a digital device. Examples of a digitaldevice are personal computers, printers and calculators. Digital devices work with

    quantized data only. For example, a calculator can represent numbers only to a certainprecision. This is because all the required information has to be represented with thehelp of a finite number of bits only.

    There are many advantages in using digital controllers. Digital controllers arerobust and flexible. It is possible to implement any complicated algorithm using digitaldevices. Because of the low prices of digital components, it is possible to achieve asophisticated amount of automation without too much expenditure. In summary,

    digital controllers provide sophisticated yet rugged performance at affordable prices.Design of digital controllers is easier than that of analog controllers. The reason isthat the analysis of difference equations is easier than that of differential equations.

    If the plant is naturally described by a discrete time model, design of the digitalcontroller is straightforward. In case the plant is described by a continuous time

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    21/553

    2.2. Models of Continuous Time Systems 7

    +

    g

    R L

    V

    M

    hi

    Figure 2.1: Magnetically suspended steel ball. The current through the coil creates amagnetic force, which counter balances the force due to gravity.

    which is also known as the manipulated variable or the plant input. Finally, v denotesthe disturbance variable.

    The connections indicated in the diagram are not straightforward. The reason isthat the controller Gc is a digital device that can understand only digital signals,represented through a string of binary numbers. The plant, on the other hand, couldbe a continuous time system described by a system of differential equations. Howdoes one make these two, different, types of systems understand each other? We willanswer this question in Sec. 2.5.

    The next question is how does a digital device communicate the control action to

    be implemented to the plant? The answer is not obvious because the digital devicescan work with numbers defined at discrete points in time only, whereas the plant couldbe a continuous time system described by variables that are defined at every instantof time. We will address this issue in Sec. 2.4. Once these questions are answered, wewill be able to develop a unified view of all the devices present in the control structureof Fig. 1.1. In the next section, we present models of a few popular continuous timesystems.

    2.2 Models of Continuous Time Systems1

    In this section, we will present the models of a magnetically suspended ball, a DC

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    22/553

    8 2. Modelling of Sampled Data Systems

    can be written as

    M

    d2h

    dt2 = M g Ki2

    h (2.3)

    where K is the proportionality constant. The voltage balance in the circuit can bewritten as

    V = Ldi

    dt+ Ri (2.4)

    Suppose that the current i is such that the ball is stationary at a chosen distance hs.We would like to derive a linear model that relates a deviation in h to a deviationin i. Let the force balance corresponding to the stationary point be modelled as

    Md2hsdt2

    = M g Ki2s

    hs= 0 (2.5)

    Subtracting Eq. 2.5 from Eq. 2.3, we obtain

    Md2h

    dt2= K

    i2

    h i

    2s

    hs

    (2.6)

    Linearizing the right-hand side about the stationary point, we obtain

    i2

    h=

    i2shs

    + 2ih

    (is ,hs )

    i i2h2

    (is ,hs )

    h

    =i2shs

    + 2ishs

    i i2s

    h2sh

    Substituting in Eq. 2.6, we obtain

    Md2h

    dt2= K

    i2sh2s

    + 2ishs

    i i2s

    h2sh i

    2s

    h

    Simplifying, we obtain

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    23/553

    2.2. Models of Continuous Time Systems 9

    We define the state variables as follows:

    x1

    = hx2

    = h

    x3= i

    u= V

    (2.10)

    From the definition of x1 and x2, we obtain

    dx1dt

    = x2

    Eq. 2.7 becomes

    dx2dt =

    K

    M

    i2sh2s x1 2

    K

    M

    ishs x3

    Eq. 2.9 becomes

    dx3dt

    = RL

    x3 +1

    Lu

    Combining these equations, we arrive at

    d

    dt

    x1x2

    x3

    =

    0 1 0KM

    i2s

    h2s

    0 2 KM ishs0 0 RL

    x1x2

    x3

    +

    00

    1L

    u (2.11)

    The following are typical values of the parameters:

    M Mass of ball 0.05 kgL Inductance 0.01 HR Resistance 1 K Coefficient 0.0001

    A l ti d t it 9 81 / 2

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    24/553

    10 2. Modelling of Sampled Data Systems

    Let us now see by how much we should change the voltage if we want to move theball by 1%. As this displacement is small, we expect the linear model to hold. Letthe variables corresponding to the new position be indicated by a prime. The newdistance is,

    hs = 0.0101

    From Eq. 2.5, we obtain

    i2s =M ghs

    K

    =0.05 9.81 0.0101

    0.0001is = 7.039

    i = is is = 0.035AV = Ri = 0.035V

    (2.13)

    In other words, we have to increase the voltage by 0.035 V to maintain the ball atthe new stationary point, given by hs = 0.0101 m.

    We have converted a second order ordinary differential equation (ODE) into a setof two first order ODEs. This procedure can be used to convert higher order ODEsas well into systems of first order.

    2.2.2 DC Motor

    A DC motor is a popular rotary actuator in control systems. On application of an

    electrical voltage, the rotor rotates, as per the following Newtons law of motion:J

    b = + K

    bV (2.14)

    where and J are the angular position and the moment of inertia of the shaft,respectively. V, b and K are the voltage, damping factor and a constant, respectively.The initial angular position and the angular velocity may be taken to be zero. Suppose

    that in an implementation, we have

    K

    b= 1 (2.15)

    If we define

    M f C S

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    25/553

    2.2. Models of Continuous Time Systems 11

    mg

    Carriage

    Pendulum

    mg

    Pivot s

    VL

    H

    Figure 2.2: Inverted pendulum

    2.2.3 Inverted Pendulum Positioning System

    The next example is concerned with the positioning of a pendulum in an inverted

    position in a carriage. The pivot of the pendulum is mounted on a carriage, seeFig. 2.2. Although the natural position of the pendulum is to point downwards fromthe pivot, we are interested in positioning the pendulum upwards. This is proposedto be achieved by moving the carriage in a horizontal direction. The carriage is drivenby a small motor that at time t exerts a force (t) on the carriage. This force is theinput variable to the system.

    We define s(t), (t), m, L, J and M, respectively, as displacement of pivot at

    time t, angular rotation of pivot at time t, mass of pendulum, distance of pivot fromthe centre of gravity (CG) of the pendulum, moment of inertia about CG and massof carriage. Let H(t) and V(t) denote the horizontal and vertical reaction forces at t.

    The horizontal and vertical force balances and the angular momentum balance onthe pendulum are given, respectively, by

    md2

    dt2[s(t) + L sin (t)] = H(t)

    md2

    dt2[L cos (t)] = V(t) mg

    Jd2(t)

    dt2= LV(t)sin (t) LH(t)cos (t)

    12 2 M d lli f S l d D t S t

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    26/553

    12 2. Modelling of Sampled Data Systems

    where

    =mgL(M + m)

    , =

    mL

    , =

    m2L2g

    , =

    J + mL2

    = (J + mL2)(M + m) m2L2

    The control effort in the above equation is in terms of horizontal force, which is notmeasured. We will now show how it can be represented in terms of the measurablevariable, voltage. The expression for applied voltage E is given as

    E = ImRm + KmKgg = ImRm + KmKgs

    r

    where E, Im, Km, Kg, g and r are voltage applied to motor in volts, current in motorin amperes, back EMF constant in V s/rad, gear ratio in motor gear box, motor outputangular velocity in rad/s and radius of motor pinion that meshes with the track in m.

    The torque generated by the motor is given by T = KmKgIm, which is transmittedas a force to the carriage through the pinion by = T /r. Substituting the expression

    for T and then for Im from the voltage equation, we obtain

    =KkKgRmr

    E K2mK

    2g

    Rmr2s

    As s = s, we can write this as = 1E 2s. With = , Eq. 2.18 becomes

    ddt

    x1

    x2x3x4

    = 0 0 1 0

    0 0 0 10 2 00 2 0

    x1

    x2x3x4

    + 0

    011

    E

    With the following values,

    Km = 0.00767 V s/rad

    Kg = 3.7Rm = 2.6

    r = 0.00635 m

    M = 0.522 kg

    2 2 M d l f C ntin Tim S t m 13

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    27/553

    2.2. Models of Continuous Time Systems 13

    h(t)

    Qo

    A

    Qi

    Figure 2.3: Liquid flow system

    2.2.4 Liquid Flow Systems

    We frequently come across flow systems in everyday life. We present a model of these

    in this section. Let a liquid flow into a tank of uniform cross-sectional area A at aflow rate of Qi(t). Let the output flow rate be Qo(t). Let the height of the liquid inthe tank be h(t). Let us assume that the density is constant in the tank. A schematicof this system is given in Fig. 2.3. The mass balance for this system is

    Adh(t)

    dt= Qi(t) Qo(t) (2.20)

    Suppose that the outflow rate is proportional to the square root of height in the tank,that is, Qo(t) = k

    h(t). Then the linearized model of this system about the operating

    point (Qis, hs) can be derived as

    dh(t)

    dt= k

    2A

    hsh(t) +

    1

    AQi(t) (2.21)

    where

    h(t)= h(t) hs

    Qi(t)= Qi(t) Qis

    (2.22)

    14 2 Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    28/553

    14 2. Modelling of Sampled Data Systems

    that describe how the reactant A is converted into a desired product B and undesiredchemicals C and D. In order to understand how the concentration of B varies withtime, we need to study the following mass balance equations:

    dCAdt

    =F

    V(CAf CA) k1CA k3C2A

    dCBdt

    = FV

    CB + k1CA k2CB(2.25)

    Here, CAf denotes the concentration of A in the feed. CA and CB denote theconcentration of A and B in the reactor, respectively. All of these have the units ofgmol/l. F denotes the flow rate and V denotes the volume in the reactor. We definedeviation variables

    x =

    x1x2

    =

    CA CAsCB CBs

    m =F

    V Fs

    V

    d = CAf CAfs

    (2.26)

    where x, m and d, respectively, refer to state, manipulated and disturbance variables.CAf CAfs is termed the disturbance variable, because variations in it cannot beavoided. On the other hand, the deleterious consequences due to this variation canbe countered by adjusting m hence the name, manipulated variable. Linearizingabout the operating point defined by CAs = 3 gmol/l, CBs = 1.117 gmol/l and

    Fs/V = 0.5714 min1, we obtain the following state space model:

    x = F x + G1m + G2d (2.27)

    where

    F = 2.4048 00.8833

    2.2381 , G1 =

    7

    1.117 , G2 =

    0.57140 (2.28)

    An objective of developing this model is to explore the possibility of regulating theconcentration ofB, namely CB , by manipulating the flow rate F, despite the variations

    in CAf. If we define u =

    m dT

    , Eq. 2.27 gets reduced to the standard form given

    by Eq. 2.1a with G =

    G1 G2

    . We will refer to this system as the van de Vusse

    2 3 Naturally Occurring Discrete Time Systems 15

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    29/553

    2.3. Naturally Occurring Discrete Time Systems 15

    2.3.1 IBM Lotus Domino Server

    IBM Lotus Domino server is an email server. In this discussion, we will abbreviate it

    as simply the server. Clients may be considered as the conduits through which the endusers access the server. Clients access the database of emails maintained by the serverthrough Remote Procedure Calls (RPCs). The number of RPCs, denoted as RIS, hasto be controlled. If the number of RIS becomes large, the server will be overloaded,with a consequent degradation of performance. RIS should not be made small either.If RIS is less than what can be handled, the server is not being used optimally.

    Unfortunately, it is not possible to regulate RIS directly. Although RIS is closely

    related to the number of users, the correspondence could be off at times, becausesome users could just be idling. Regulation of RIS may be achieved by limiting themaximum number of users (MaxUsers) who can simultaneously use the system.

    Based on experience in operating the server, it is possible to come up with anoptimal RIS to achieve acceptable performance. If the actual RIS is smaller than thereference value of RIS, MaxUsers may be increased and vice versa.

    It is difficult to come up with an exact analytical model that relates MaxUsers

    and the actual RIS in the server. This is because the server could have different typesof administrative loads, such as memory swapping and garbage collection at differenttimes. Moreover, it is difficult to predict how many users will idle at a given time.

    A possible way to arrive at a model is through identification, which consists of thefollowing steps: experimentation, data collection and curve fitting, to be explainedin detail in Chapter 6. Hellerstein et al. [22] report an experiment in which theparameter MaxUsers is varied about the operating level of MaxUsers = 165 and

    the corresponding variation of RIS about the operating level of RIS = 135. Defining

    x(k) = RIS(k) RISu(k) = MaxUsers(k) MaxUsers (2.29)

    and carrying out an identification exercise, they arrive at the following relationship:

    x(k + 1) = 0.43x(k) + 0.47u(k) (2.30)

    which is in the form of Eq. 2.2a. Discrete time models are a natural choice in the fieldof computing systems.

    16 2. Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    30/553

    16 2. Modelling of Sampled Data Systems

    The functions of the production ordering and inventory management systeminclude demand forecasting, customer order fulfilment, production ordering (deter-mining the production release quantities), and the production process. The forecasteddemand FD of the products is based on first order exponential smoothing of thecustomer sales rate SALES, with a smoothing constant and a sampling interval :

    FD(n) = FD(n 1) + (SALES(n 1) FD(n 1)) (2.31)

    The sampling interval or the integration time step is said to correspond to the

    frequency at which the information is updated within the system. The inventory level(INV) accumulates the difference in the production rate (PRATE) and the sales rate:

    INV(n) = INV(n 1) + (PRATE(n) SALES(n)) (2.32)

    The term production release refers to the quantity ordered for production. The workin process (WIP) level accumulates the difference in the production release (PREL)

    and production rate (PRATE):

    WIP(n) = WIP(n 1) + (PREL(n) PRATE(n)) (2.33)

    The production release quantities (PREL) are determined using the ordering rule inEq. 2.33, based upon the forecasted demand, the difference between the desired level

    of WIP and the current WIP level, and the difference between the desired level ofinventory and the current inventory level:

    PREL(n) = FD(n 1) + (L FD(n 1) WIP(n 1))+ (FD(n 1) INV(n 1)) (2.34)

    where is the fractional adjustment rate for WIP and it describes how much of the

    discrepancy between the desired and current levels of WIP are to be added to theproduction release order. Similarly, is the fractional adjustment rate for inventoryand it describes how much of the discrepancy between the desired and current levelsof inventory are to be added to the production release order. These variables are tobe chosen so as to achieve a good performance. This topic is discussed in more detail

    2.4. Establishing Connections 17

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    31/553

    g

    data

    A/DConverter

    data quantized

    Figure 2.4: Analog to digital converter

    2.4 Establishing Connections

    In this section, we will discuss the issues in connecting up the feedback loop as given

    in Fig. 1.1 on page 1. As mentioned earlier, the connections are not straightforward,because the plant may be a continuous time system, while the controller is digital.2

    Digital systems can understand only binary numbers. They can also produce onlybinary numbers, at discrete time intervals, synchronized by a clock. The real lifesystems, on the other hand, could be continuous with their properties specified byvariables that are defined at all times. In this section, we explain how these two typesof devices communicate with each other.

    2.4.1 Continuous Time to Digital Systems A/D Converter

    We will first look at the transformation to be carried out on the signal from the plant,before it can be communicated to the digital device: it has to be quantized for thedigital device to understand it.

    For example, suppose that the variable y in Fig. 1.1 denotes a voltage in the rangeof 0 to 1 volt. This could be the conditioned signal that comes from a thermocouple,used in a room temperature control problem. Suppose also that we use a digital devicewith four bits to process this information. Because there are four bits, it can representsixteen distinct numbers, 0000 to 1111, with each binary digit taking either zero orone. The resolution we can achieve is 1/15 volt, because, sixteen levels enclose fifteenintervals. The continuous variable y that lies in the range of 0 to 1 volt is known asthe analog variable.

    Representation of an analog value using binary numbers is known as analog todigital conversion. The circuit that is used for this purpose is known as an analogto digital converter, abbreviated as A/D converter. It reads the analog variable at atime instant, known as sampling, and calculates its binary equivalent, see Fig. 2.4.

    Thi l l i b d i l i i f

    18 2. Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    32/553

    g p y

    time

    Actual andQuantized

    Data

    Sampled

    time

    Data

    Quantized

    Figure 2.5: Sampling, quantization of analog signals

    A/D

    Converter

    digitalanalog

    signal signal

    Figure 2.6: Quantization

    The left diagram in Fig. 2.5 illustrates the fact that the A/D converter takes acontinuous function of real values, known as an analog signal, and produces a sequenceof quantized values. The data seen by the digital device for this example are given inthe right diagram of the same figure. In view of the above discussion, Fig. 2.4 can beredrawn as in Fig. 2.6.

    The error in quantization varies inversely with the number of bits used. The fallinghardware prices have ensured that even low cost devices have large numbers of bitswith small quantization errors. As a result, it is reasonable to assume that no majordifficulties arise because of quantization.

    It should be pointed out that the time required for A/D conversion usually depends

    on the value of the analog signal itself. Nevertheless, the A/D converters are designedso as to sample the analog signal at equal intervals, with the requirement that theinterval is at least as large as the maximum conversion time required. Most A/Dconverters sample analog signals at equal time intervals only. This is referred to asuniform sampling. The digital processing devices that are connected to the output of

    2.4. Establishing Connections 19

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    33/553

    DiscreteSignals 0 01 1 0 01 100000000001111111111 0000011111 0000000011111111 000111

    DiscreteZOH

    Signals

    Figure 2.7: Zero order hold

    We have talked about the procedure to follow to make the continuous time devices,such as the plant in Fig. 1.1 on page 1, communicate with digital devices. We willnow present the issues in the reverse communication now the digital devices wantto communicate to continuous time devices.

    2.4.2 Digital to Continuous Time Systems D/A ConverterThe outputs from the digital devices are also digital signals and they are availableonly at regular intervals. A typical signal is presented in the left hand diagram ofFig. 2.7.

    The real world that has to deal with the digital device may be analog in nature. Forexample, suppose that the controller, through binary numbers, indicates the desiredposition of a valve position. The valve, being a continuous time device, can only

    understand analog values. This is where the digital to analog converter, abbreviatedas D/A converter, comes in. It converts the binary vector into a decimal number.

    There is one more issue to be resolved. The valve cannot work with the numbersarriving intermittently. It should know the value of the signal during the period thatseparates two samples. The most popular way to do this is to hold the value constantuntil the next sampling instant, which results in a staircase approximation, as shown inthe right diagram of Fig. 2.7. Because a constant value is a polynomial of zero degree,this is known as the zero order hold (ZOH) scheme. Although more complicated typesof hold operations are possible, the ZOH is most widely used and it is usually sufficient.The ZOH operation usually comes bundled as a part of the D/A converter. In therest of this book, we will use only ZOH.

    We have talked about the procedure to convert the signals so that they are suitable

    20 2. Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    34/553

    x(n + 1) = Ax(n) + Bu(n). Such equations also arise in naturally occurring discretetime systems, as we have seen in Sec. 2.3.

    Although the states contain all the information about a system, it may not bepossible to measure all of them, unfortunately. We give below two reasons:

    1. It may be very expensive to provide the necessary instruments. For example,consider a distillation column with 50 trays. Suppose the temperature in eachtray is the state variable. It may be expensive to provide 50 thermocouples.Moreover the column may not have the provision to insert 50 thermocouples.Usually, however, a limited number of openings, say in the top and the bottom

    tray, will be available for thermocouple insertions.

    2. There may not be any sensors, to measure some of the states. Suppose forinstance the rate of change of viscosity is a state vector. There is no sensor thatcan measure this state directly.

    Because of these reasons, only a subset of the state vector is usually measured.Sometimes a function of states also may be measured. The following example

    illustrates this idea.

    Example 2.1 Consider a system in which there are two immiscible liquids.

    Suppose the height of the two liquids forms the state vector. Construct the output

    equation for the following two cases:

    1. Only the level of the second fluid is measured.

    2. Only the sum of two levels is measured.

    Let x1 and x2 denote the heights of liquids 1 and 2, respectively. We obtain

    x =

    x1x2

    Let y denote the measured variable. When the level of the second fluid is measured,

    we obtain

    y =

    0 1 x1

    x2

    = x2

    2.5. Discretization of Continuous Time Systems 21

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    35/553

    2.5 Discretization of Continuous Time Systems

    Recall that the objective of this chapter is to establish connections between

    the building blocks of Fig. 1.1 and to study them in a uniform framework.We demonstrated that A/D and D/A converters can be used to establish connections.The models of the plant and the controller are quite different from each other, though.The former is often made up of differential equations with continuous time variables.The latter, on the other hand, can understand only the transitions between thesampling intervals. If the controller has to take meaningful control decisions, it betterunderstand how the plant works. One way to do this is to transform the continuous

    time plant model into a discrete time model that relates the parameters of the systemat the sampling intervals. Through this mechanism, we can bring the plant and thecontroller models to a uniform framework. It is then possible to design the controllaw. This section is devoted to the discretization of continuous time models.

    2.5.1 Solution to the State Space Equation

    In this section, we will discuss how to discretize a continuous time model of the formEq. 2.1a on page 5, reproduced here for convenience,

    x(t) = F x(t) + Gu(t) (2.36)

    One of the popular methods of discretization is to solve the system and chooseappropriate time values, as we will explain shortly. With this objective in mind,we define the exponential of a square matrix. Through its derivative, we construct

    an integrating factor, using which we obtain an explicit solution to the state spaceequation.

    The exponential of a square matrix F, namely eFt, is defined as follows:

    eFt= I+ F t +

    1

    2!F2t2 + (2.37)

    We will present an example to illustrate this idea.

    Example 2.2 Determine the exponential of the matrix F for the DC motorsystem, defined in Sec. 2.2.2, with J/b = 1.

    It is given that1 0

    22 2. Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    36/553

    Carrying out a term by term summation, we obtain

    eFt

    =1 t + t

    2/2

    t3/3! +

    0

    t t2/2 + t3/3! 1 = et 0

    1 et 1There are many ways to calculate a matrix exponential. Matlab calculates it using

    a numerically stable procedure. M 2.2 shows how this calculation is done for t = 1.We obtain

    eF = 0.3679 00.6321 1

    We also need the concept of derivative of the exponential of a matrix. Differen-tiating both sides of Eq. 2.37, we obtain

    d

    dt

    eFt

    =

    d

    dt

    I+ F t +

    1

    2! F2

    t2

    +

    1

    3! F3

    t3

    + = 0 + F +

    1

    2!F22t +

    1

    3!F33t2 +

    = F + F2t +1

    2!F3t2 +

    = (I+ F t +1

    2!

    F2t2 +

    )F = eFtF

    Note that we could have factored F on the left-hand side as well. Thus, we obtain

    d

    dt(eFt) = F eFt = eFtF (2.38)

    Now consider solving the state space equation of Eq. 2.36. First we rewrite it as

    follows:x(t) F x(t) = Gu(t)

    Premultiply both sides by eFt to obtain

    2.5. Discretization of Continuous Time Systems 23

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    37/553

    Premultiplying both sides by eFt, we obtain

    x(t) = eF(tt0)

    x(t0) +tt0 e

    F(t)

    Gu()d (2.39)

    This is the solution to the state space equation, given in Eq. 2.36.

    2.5.2 Zero Order Hold Equivalent of the State Space Equation

    We will now make an assumption that all inputs to analog devices that describe

    continuous processes are outputs of a ZOH device. This assumption allows us todevelop a systematic theory of systems consisting of both analog and digital devices.If the sampling rate is sufficiently high, this assumption poses no major problemseven when the staircase approximation is used for smoothly varying analog signals.

    The easiest way to study both analog and digital devices in a single framework isto observe their behaviour at sampling instants only. Let us denote by tn and tn+1two successive sampling instants. Let us substitute tn and tn+1, respectively, for t0

    and t in Eq. 2.39. We obtain

    x(tn+1) = eF(tn+1tn )x(tn) +

    tn+1tn

    eF(tn+1)Gu()d (2.40)

    We will next make the ZOH assumption, that is, assume that u is held constant in asampling interval, as in Fig. 2.7:

    u() = u(tn), tn < tn+1 (2.41)

    We will also assume that we use uniform sampling intervals, Ts, defined by

    Ts= tn+1 tn, n (2.42)

    We obtain

    x(tn+1) = eFTs x(tn) +

    tn+1tn

    eF(tn+1)Gd

    u(tn).

    We define

    24 2. Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    38/553

    Because the sampling period is constant, we dont have to explicitly state the presenceofTs. It is sufficient to use only the sampling number, namely n and n + 1. We obtain

    x(n + 1) = Ax(n) + Bu(n) (2.45)

    This is known as the ZOH equivalent of the continuous time state space model, givenby Eq. 2.36. We observe the following:

    1. There is no approximation in discretization, so long as u(t) is kept constantduring one interval. Thus both discrete and continuous time models predict

    identical behaviour at the sampling instants.

    2. Consider the case of F being a scalar. As it is defined as the exponential ofa real number, A cannot be negative. Thus the ZOH equivalent of continuousmodels will give rise to positive A.

    3. There could be systems with A(n) negative,3 for example, when we useplant data for identification, the topic of discussion in Chapter 6. Because ofthe previous observation, such systems cannot be represented by the usualcontinuous time state space models. As a result, the discrete time modelequations given above can accommodate a larger class of systems.

    4. The discrete time model derived above cannot explain what happens betweensampling instants. If the sampling interval is sufficiently small and if there are nohidden oscillations,4 it is possible to make a reasonable guess of what happens

    between the samples.

    5. By a change of variable, the expression for B(n) can be written as

    B(n)=

    Ts0

    eFtdt

    G (2.46)

    see Problem 2.4. As a result, B(n) also is a constant matrix.

    We now illustrate this idea with an example.

    Example 2 3 Calculate the ZOH equivalent of the DC motor presented in

    2.5. Discretization of Continuous Time Systems 25

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    39/553

    A and B matrices are calculated next. Using Eq. 2.43 and Eq. 2.46, with Ts = 1,we obtain

    A = eFTs =

    e1 0

    1 e1 1

    =

    0.3679 00.6321 1

    B =

    10

    eFd G

    =

    1

    0

    e 0

    1 e 1

    d

    10

    =

    e 0 + e

    10

    10

    =

    e + e

    1

    0

    =

    e1 + 11 + e1 1

    =

    0.63210.3679

    M 2.3 shows how to carry out the above calculation in Matlab.

    Now we will present another approach to find the ZOH equivalent of continuoustime systems. In this, we will first diagonalize the system matrix F.

    Example 2.4 Using the diagonalization procedure of Appendix A.1.2, deter-

    mine the ZOH equivalent model of the antenna control system described in

    Sec. 2.2.2, with J/b = 10 and Ts = 0.2 s.

    The system has a state space model

    x = F x + Gu

    y = Cx

    with

    F =0.1 0

    1 0

    , G =

    0.10

    , C =

    0 1

    and x1(0) = 0, x2(0) = 0. It is easy to verify that the eigenvalues of F are givenby = 0 and 0 1 The corresponding eigenvectors are given by

    26 2. Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    40/553

    where

    e

    Ts

    =1 0

    0 e0.1Ts

    and hence

    A =

    0 11 10

    1 00 e0.1Ts

    10 11 0

    =

    e0.1Ts 0

    10

    1 e0.1Ts 1

    Using the procedure described in Example 2.3, we obtain

    B =

    1 e0.1Ts

    Ts + 10(e0.1Ts1)

    When we use a sampling interval of 0.2 s, i.e., Ts = 0.2 s, we obtain

    A = 0.9802 0

    0.19801 1

    , B = 0.01980

    0.001987

    2.5.3 Approximate Method of Discretization

    The method presented in the previous section is not the only one available to discretizecontinuous time models. In this section, we present a simple method of discretization.More methods will be discussed in Sec. 8.2.

    If we replace the derivative of x with a rectangular approximation, Eq. 2.36becomes

    x(n + 1) x(n)Ts

    = F x(n) + Gu(n)

    from which it follows that

    x(n + 1) = (I+ F Ts)x(n) + TsGu(n) (2.47)

    2.5. Discretization of Continuous Time Systems 27

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    41/553

    D

    u(t)

    u(t

    D)

    tn tn+1

    Figure 2.8: Original and time shifted versions of a signal

    2.5.4 Discretization of Systems with DelayOften, changes in the input u do not affect the state immediately. Suppose that thecontrol effort u is the flow rate of some liquid. If a long pipe were to separate thecontrol valve and the place where the liquid enters the plant, it would take some timefor any change in the flow rate to be felt by the plant.

    Oil and process industries have plants of extremely large orders. These are often

    sluggish systems. It is conventional to approximate these systems with low ordermodels and a dead time [33], also known as time delay. If a system has a large timedelay or dead time, it will take a long time to respond to any stimulus.

    Suppose that any change in u is felt at the plant only after D time units, asexpressed by the following state space equation:

    x(t) = F x(t) + Gu(t D), 0 D < Ts (2.48)

    This can be graphically illustrated as in Fig. 2.8 where u(t) and u(t D) are drawn.The solution to this equation is identical to Eq. 2.40, but for the delay D in u. Weobtain

    x(t +1) = eF(tn+1tn )x(t ) +

    tn+1eF(tn+1)Gu( D)d (2 49)

    28 2. Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    42/553

    where the symbol= has to be read as defined as. The above expressions for B1 and

    B0 can be simplified to arrive at the following relations, see Problem 2.5:

    B1 = eF(TsD)

    D

    0

    eFtGdt (2.50a)

    B0 =

    TsD0

    eFtGdt (2.50b)

    Substituting the above expressions in Eq. 2.49 and making use of Eq. 2.42 andEq. 2.43, we obtain

    x(n + 1) = Ax(n) + B1u(n 1) + B0u(n) (2.51)

    which can be written using an augmented state vector:x(n + 1)

    u(n)

    =

    A B10 0

    x(n)

    u(n 1)

    +

    B0I

    u(n) (2.52)

    where, as before, A is given by Eq. 2.43 and I is an identity matrix of the same sizeas u. If we define the vector (x(n), u(n 1)) as an augmented state at the samplinginstant n, Eq. 2.52 is reduced to the standard state space model of the form Eq. 2.45.

    Recall that the concept of state has been introduced to remember the effects ofthe past. The presence of time delay requires us to remember the previous controleffort as well. What better place to store this information than the state? We presentan example below.

    Example 2.5 Discretize the state space equation

    x(t) = 1

    x(t) +1

    u(t D) (2.53)

    where and D are constants and the delay is less than one sampling period, i.e.,D < Ts.

    Using Eq. 2.50a,

    B1 = e(TsD)/

    D0

    et/1

    dt = e(TsD)/

    1 eD/

    (2.54a)

    2.6. Approaches to Controller Design and Testing 29

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    43/553

    What do we do when the delay is greater than the sampling time, i.e., D > Ts?A procedure to deal with this situation is given in Problem 2.5.

    We have so far discussed how to discretize the state equation only. What aboutdiscretization of the output equation, discussed in detail in Sec. 2.4.3? At the samplinginstant, the relation for y is unchanged, provided we synchronize the sampling ofy(t)with that of x(t) and u(t). Thus, it is possible to arrive at the discrete time statespace model, given by Eq. 2.2 on page 6. The discrete time state equation also arisesnaturally, see Sec. 2.3. In these systems also, it is difficult to measure all the states;the reasons are same as that for continuous time systems. Thus, once again, we arriveat Eq. 2.2.

    2.6 Approaches to Controller Design and Testing

    In this chapter, we have discussed in detail how to connect the blocks given in Fig. 1.1.If the plant G denotes a discrete time model, the blocks can be directly connected.

    If, on the other hand, the plant is described through a continuous time model, wediscretize it, as explained in Sec. 2.5, and use it. In this case, the signals also have tobe converted, as explained above.

    There are two broad categories of control design techniques. The first one is basedon a transfer function approach. In this approach, one gets an algebraic relationbetween the input u and the output y with the help of the Z-transform, knownas the transfer function, to be explained in Sec. 4.3. The control design techniquebased on transfer functions is known as the transfer function approach. The transferfunction methods are easy to explain and implement. We present several control designtechniques that use this approach.

    The second category of control design methods uses the state space models directly.This method is useful, especially when one has to deal with several input variables u.In Chapter 14, we present a few state space model based control techniques as well.

    Validation of the controller is an important issue, especially in hybrid systems thatconsist of a continuous time plant and a digital controller. What is the guarantee thatwe did not lose information while discretizing the plant? What is the guarantee thatthe plant behaves properly in between the sampling instants? The minimum rate atwhich we have to sample a system is given by Shannons sampling theorem, to be

    30 2. Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    44/553

    2.7 Matlab Code

    Matlab Code 2.1 Model of inverted pendulum, presented in Sec. 2.2.3. This code

    is available at HOME/ss/matlab/pend model.m5

    1 Km = 0 . 0 0 7 6 7; Kg = 3 . 7 ; Rm = 2 . 6 ; r = 0 . 0 0 6 3 5;2 M = 0 . 5 22 ; m = 0 . 2 31 ; g = 9 . 8 1 ; L = 0 . 3 05 ; J = 0 ;3

    4 D1 = ( J+mL 2 ) (M+m)m2L 2 ;5 a l ph a = mgL(M+m) /D1 ;6 beta

    = mL/D1;7 gamma = m2gL2/D1;8 de lt a = (J+mL2)/D1;9 alpha1 = KmKg/Rm/ r ;10 al pha 2 = Km2Kg2/Rm/r 2;11

    12 A = zeros ( 4 ) ; A( 1 , 3 ) = 1 ; A( 2 , 4 ) = 1 ;13

    A( 3 , 2 ) = gamma; A( 3 , 3 ) = alpha2 d e l t a ;14 A( 4 , 2 ) = a l ph a ; A( 4 , 3 ) = a l ph a 2beta ;15 B = zeros ( 4 , 1 ) ; B ( 3 ) = a l ph a 1 d e l t a ; B( 4 ) = alpha1 beta ;

    Matlab Code 2.2 Exponential of the matrix presented in Example 2.2 on page 21.Available at HOME/chap2/matlab/mat exp.m

    1 F = [

    1 0 ;1 0 ] ;2 expm(F)

    Matlab Code 2.3 ZOH equivalent state space system, as discussed in Example 2.2on page 21. Available at HOME/chap2/matlab/ZOH1.m

    1 F = [1 0 ; 1 0 ] ; G = [ 1 ; 0 ] ;2 C = [ 0 1 ] ; D = 0 ; Ts=1;3 s y s = s s ( F , G, C , D) ;4 s y s d = c 2d ( s y s , Ts , z o h )

    2.8. Problems 31

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    45/553

    Qi(t)

    Q(t) = x(t)h(t)

    h(t)

    Figure 2.9: Water flow in a tank

    2.8 Problems

    2.1. It is desired to model the flow of water into and out of a tank of uniform cross-section, see Fig. 2.9. The inflow rate Qi(t) need not be steady. The opening of

    the outflow valve can be adjusted so as to reduce the variations in the outflow.The outflow rate Q(t) is a multiple of the height of water in the tank and avariable x(t) that is a function of valve opening, i.e.,

    Q(t) = x(t)h(t) (2.55)

    Derive a linearized model of this system in deviation variables.

    2.2. Repeat Problem 2.1 with the difference that the outflow now is proportional tosquare root of the height of water in the tank:

    Q(t) = x(t)

    h(t) (2.56)

    2.3. The motion of a unit mass in an inverse square law force field is governed by apair of second order equations

    32 2. Modelling of Sampled Data Systems

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    46/553

    000111r u2

    u1

    Figure 2.10: Satellite in a circular orbit

    where 32 = K. This means that circular orbits are possible. Define x1 =r , x2 = drdt , x3 = ( t), x4 = (ddt ) and write down the linearizeddifferential equations which describe the resulting motion for small deviationsfrom a circular orbit. Show that the F and G matrices are given by

    F =

    0 1 0 03w2 0 0 2w

    0 0 0 10 2w 0 0

    , G =

    0 01 00 00 1

    2.4. Derive Eq. 2.46 on page 24. Also, show that B can be written as B = A1TsG,with A1 given by A = I+ F TsA1, where A is given by Eq. 2.43.

    2.5. This problem is concerned with discretization of time delay systems, addressedin Sec. 2.5.4.

    (a) Derive the expressions for B0 and B1, derived in Eq. 2.50.

    (b) Derive the ZOH equivalent discrete time state space model for d = 2.

    (c) Is there any relation between the matrices B0 and B1 that we derived ford = 1 and those for d = 2?

    (d) Can you repeat the above two questions for a general integer d > 0?

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    47/553

    Part I

    Digital Signal Processing

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    48/553

    Chapter 3

    Linear System

    The approach followed in this book is to design linear controllers using linearmodels. We also have to ensure that the controllers are realizable, or equivalently,

    implementable. We need the concept of causality for this purpose. In this chapter, wepresent the concepts of linearity, causality, as well as time invariance and stability.

    We will be concerned with discrete time signals that are defined at discrete timeinstants, from to . An example of such a sequence is given by

    {u(n)} = {. . . , u(2), u(1), u(0), u(1), u(2), . . .} (3.1)where u(i) on the right-hand side of the equation denotes the scalar value of u taken

    at time instant i. For example, u(1), u(0) refer to the values of u taken at timeinstants of 1 and 0. In general, we will denote such a sequence u as {u(n)} withdouble braces. We will denote the value of the sequence u taken at time instant n asu(n). When there is no confusion, we will drop the braces, even when talking aboutsequences.

    We work with finite energy signals in this book. The energy of a discrete timesignal

    {u(n)

    }is defined as

    Eu =

    n=

    |u(n)|2 (3.2)

    where, u can be complex. In case of real signals, the energy is the sum of the squares of

    36 3. Linear System

    3 1 1 Li it

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    49/553

    3.1.1 Linearity

    Linear systems are easier to understand compared to nonlinear systems. Often,

    controllers designed with the assumption of the underlying process being linear aresufficient. In view of this observation, the concept of linearity, to be discussed in thissection, becomes extremely important.

    Let us first recall the definition of linearity of functions. A function f(x) is said tobe linear if

    f(x1 + x2) = f(x1) + f(x2) (3.3)

    where and are arbitrary scalars. For example, f1(x) = 2x is linear, but f2(x) =sin x is nonlinear. We now ask the question, is

    f3(x) = 2x + 3 (3.4)

    linear? Let us see whether Eq. 3.3 is satisfied with = = 1. The left-hand sidebecomes

    f3(x1 + x2) = 2(x1 + x2) + 3

    while the right-hand side is

    f3(x1) + f3(x2) = (2x1 + 3) + (2x2 + 3) = 2(x1 + x2) + 6

    We see that the two sides are unequal. Because Eq. 3.3 has to be satisfied for all and

    in order that the function be linear, we see that f3 is not linear. Thus, addressingfunctions of the form of Eq. 3.4 as linear should at best be considered as colloquial.The presence of the nonzero constant in Eq. 3.4 is the reason why f3 is nonlinear.Thus, we arrive at the following necessary condition for linearity:

    f(0) = 0 (3.5)

    Now we will present the concept of a linear system. Consider a system at the statex(n0) at time instant n0. Suppose that we apply an input sequence of the form Eq. 3.1,starting at time n0, i.e.,

    {u(n)} = {u(n0), u(n0 + 1), u(n0 + 2), . . .}, n n0

    3.1. Basic Concepts 37

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    50/553

    {y(n)}

    {x(n)}{u(n)}

    x(n0)

    Figure 3.1: Diagrammatic representation of a system

    1. x(n), n > n0, the future states

    2. y(n), n > n0, the future outputs

    Iffn and gn are linear functions ofx(n0) and {u(n)}, n n0, the system is said to belinear. In other words, a linear combination of (x(n0), {u(n)}) should give the samecombination of (x(n), y(n)) for all future n. In other words, suppose that under theaction of fn, we obtain the following two mappings:

    x1(n0){u1(n)} fn {x1(n)} (3.6a)x2(n0){u2(n)}

    fn {x2(n)} (3.6b)

    If the system is linear, a linear combination of the left-hand sides should give thesame combination of the right-hand sides:

    x1(n0){u1(n)}

    +

    x2(n0){u2(n)}

    fn {x1(n)} + {x2(n)} (3.6c)

    where, as before, and are arbitrary scalars. The output function gn should alsosatisfy this property. That is, under the condition

    x1(n0){u1(n)} gn {y1(n)} (3.7a)x2(n0){u2(n)}

    gn {y2(n)} (3.7b)

    38 3. Linear System

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    51/553

    {u1(n)} {x1(n)}

    x1(n0) {y1(n)}

    {u2(n)} {x2(n)}

    x2(n0) {y2(n)}

    {u1(n)} + {u2(n)}

    x1(n0)+ x2(n0)

    {x1(n)} + {x2(n)}

    {y1(n)} + {y2(n)}

    Figure 3.2: Linearity of a system defined

    We will first show that Eq. 3.8 is linear. Let us suppose that the future states for

    (x1(n0), {u1(n)}) and (x2(n0), {u2(n)}) are {x1(n)} and {x2(n)}, respectively.In particular, at the time instant n0 + 1, we obtain the following relations:

    x1(n0 + 1) = A(n0)x1(n0) + B(n0)u1(n0)

    x2(n0 + 1) = A(n0)x2(n0) + B(n0)u2(n0)

    Now, suppose that we use a linear combination of (xi(n0), {ui(n)}), i = 1, 2, asthe starting point. At n0 + 1, we obtain the following relation:

    x(n0 + 1) = A(n0)(x1(n0) + x2(n0)) + B(n0)(u1(n0) + u2(n0))

    Note that we have used the same linear combination for both the input sequence

    and the initial state. This can be written as

    x(n0 + 1) = (A(n0)x1(n0) + B(n0)u1(n0))

    + (A(n0)x2(n0) + B(n0)u2(n0))

    This is nothing but x1(n0 + 1) + x2(n0 + 1). That is, a linear combination of(xi(n0), {ui(n)}), i = 1, 2, has given rise to the next state also being of the samecombination. Thus, the linearity offn is verified for n = n0 + 1. By induction, this

    b h t b t Th f f i li I i il

    3.1. Basic Concepts 39

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    52/553

    {u(n)} {x1(n)}

    0 {yu(n)}

    0 {x2(n)}

    x(n0) {yx(n)}

    yu: Due to only input yx: Due to only initial state

    {yu(n)} + {yx(n)}x(n0){u(n)

    } {x1(n)

    }+

    {x2(n)

    }

    Figure 3.3: Output (y) is the sum of output due to input (yu) and output due toinitial state (yx)

    The superposition principle allows us to study the system with zero and nonzerovalues of the initial state. In particular, we have the following important property:In a linear system, the output y(n) is the sum of output with zero input and outputwith zero initial state. Suppose that under the action of the function gn, (x(n0), {0})is mapped to {yx(n)}.1 Also, (0, {u(n)}) gets mapped to {yu(n)}. Pictorially, this canbe seen as follows:

    x(n0){0}

    gn {yx(n)}0

    {u(n)}

    gn {yu(n)}

    Using the property of linearity given by Eq. 3.7c, with = = 1, we obtain

    x(n0){u(n)}

    =

    x(n0){0}

    +

    0{u(n)}

    gn yx(n) + yu(n)

    This superposition property can be summarized by the following equation:

    40 3. Linear System

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    53/553

    n0

    {x1(n)}

    {y1(n)}

    {u1(n)} = { , , . . .}

    x0

    n0 k0{x2(n)}

    {y2(n)}

    {u2(n)} = { , , . . .}

    x0

    Figure 3.4: Time invariance of linear systems. Identical input sequence u is appliedat n = n0 (left) and at n = n0 k0 (right).

    same sequence of numbers is used, because these start at two different time instants,they will be represented by two different functions, u2 and u1, respectively. We have

    {u2(n)} = {u1(n k0)}Let the state and output corresponding to u2 evolve, respectively, as {x2(n)} and{y2(n)}, n n0 k0, i.e., as given in Eq. 3.6b and Eq. 3.7b, respectively. This isillustrated in Fig. 3.4. Now if x2(n) and y2(n) are time shifted versions of x1(n) andy1(n), i.e.,

    x2(n) = x1(n k0)y2(n) = y1(n k0)

    for all n n0 and for all k0, then the system is said to be time invariant. In this case,we can replace fn by f and gn by g. That is, fn and gn are not functions of time.

    Example 3.3 It is easy to verify that the system described by

    x(n + 1) = Ax(n) + Bu(n)

    y(n) = Cx(n) + Du(n)

    where A, B, C and D are constants, is a time invariant system.

    Now we will give an example of a system that does not satisfy the time invarianceproperty.

    Example 3.4 Determine whether the system described by

    3.1. Basic Concepts 41

    But, from Eq. 3.11, we obtain

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    54/553

    ut, o q 3 , e obta

    y1(n

    k) = (n

    k)u1(n

    k)

    We see that y2(n) = y1(n k), even though u2(n) = u1(n k). Hence, thesystem is not time invariant.

    3.1.3 Causality and Initial RestWe will now discuss the important topic of causality. A system is causal if its outputdepends only on the current and the past inputs. As a result, if two inputs that areidentical up to some time are applied to a causal system, the corresponding outputswill also be identical up to that time. Such a system is known as nonanticipative as itdoes not anticipate the future values of the input. In contrast, systems whose outputdepends on future inputs are known as noncausal. An example of such a system has

    the following inputoutput mapping: y(n) = u(n + 1).Noncausal systems cannot be implemented, because no physical system can predict

    the future. In view of this, we have to ensure that our designs produce causal systems.In turns out that improper specification of initial conditions can result in the loss ofcausality. One way to achieve causality is through initial conditions that correspondto the system being at rest, also known as initial rest. A system that is initially atrest will have all its past inputs and outputs zero. Equivalently, the initial state of

    the system is zero. We illustrate these ideas in the following example [47].

    Example 3.5 Solve the system

    y(k) ay(k 1) = u(k) (3.12)for initial conditions given at different time instances.

    We will first consider giving an initial condition to determine the solution. Multiplyboth sides of Eq. 3.12 by ak and sum the result from N + 1 to n, with N < n.The left-hand side is

    +y(N + 1)

    +y(N + 2)

    + + y(n 1) + y(n)

    42 3. Linear System

    N nm

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    55/553

    N nm

    Figure 3.5: Specifying condition at a finite point, as discussed in Example 3.5

    This shows that the output y(n) depends on y(N) and the values of the inputbetween the interval N and n, see Fig. 3.5. If we use the initial condition,limN a

    Ny(N) = 0, we obtain

    y(n) =

    nk=

    anku(k) (3.14)

    Eq. 3.13 suggests that the output y(m) could depend on u(N) even when m < N.To see this, we carry out the following calculation. Multiplying both sides of

    Eq. 3.12 by 1/ak and summing the result from m + 1 to N, the left-hand sidebecomes

    +y(m + 1)

    am+1+

    y(m + 2)

    am+2+ + y(N 1)

    aN1+

    y(N)

    aN

    y(m)am

    y(m + 1)am+1

    y(m + 2)am+2

    y(N 1)aN1

    Summing, we obtain

    y(m)am

    +y(N)

    aN=

    Nk=m+1

    u(k)

    ak

    Solving this, we obtain

    y(m) = amNy(N) N

    k=m+1

    amku(k) (3.15)

    This shows that the output y(m) depends on y(N) and the values of the inputb t th i t l d N Fi 3 5 W th t th l f i ifi d

    3.2. Basic Discrete Time Signals 43

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    56/553

    1

    1

    Figure 3.6: Unit step (left) and unit impulse (right) signals

    The first solution is to choose N to be . In this case, there is no question ofeven worrying about what happens before N. On the flip side, we will have toremember all the input values applied from onwards.

    The second solution to this problem is to choose N to be finite, but let all valuesofu in the interval (, N) be zero. If the system is I/O LTI, the output y willalso be zero during this interval. This condition is known as initial rest. Thus,the condition of initial rest helps achieve causality.

    We generally prefer the second solution. A way to accommodate nonzero initialconditions is explained in Sec. 3.4. The meaning of a nonzero initial condition isexplained in Sec. 4.3.3. Although we can assign any finite value to it, we generally

    choose N to be zero.If noncausal systems cannot be implemented, why should we study them? Whileidentifying a plant from inputoutput data, we need the concept of past inputs (seeSec. 6.3.5), which calls for a general framework that can accommodate noncausalsystems as well.

    3.2 Basic Discrete Time SignalsIn this section, we will discuss a few discrete time signals that we will encountermany times, their use and the relation between them. A unit step sequence {1(n)} ={. . . , 1(2), 1(1), 1(0), 1(1), 1(2), . . .} is now defined:

    44 3. Linear System

    Thus {(n)} = {. . . , 0, 0, 1, 0, 0, . . .}, where 1 appears at the location corresponding

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    57/553

    to n = 0. The right-hand side of Fig. 3.6 shows the unit impulse signal. We will oftenrefer to it simply as an impulse sequence.

    It is easy to verify the following relation between unit step and unit impulse signals:

    {(n)} = {1(n)} {1(n 1)} (3.19)Note that {1(n)} and {1(n 1)} are unit steps that start at n = 0 and n = 1,respectively.

    We will now present an important property of impulse sequences: it is possibleto represent arbitrary sequences as linear combinations of impulse sequences. Let us

    consider an arbitrary sequence {u(n)}, defined in Eq. 3.1 on page 35, reproduced herefor convenience:

    {u(n)} = {. . . , u(2), u(1), u(0), u(1), u(2), . . .}

    Writing this as a sum of an infinite number of sequences, each with only one nonzeroterm, we obtain

    {u(n)} = + {. . . , 0, 0, u(2), 0, 0, 0, 0, 0, . . .}+ {. . . , 0, 0, 0, u(1), 0, 0, 0, 0, . . .} + {. . . , 0, 0, 0, 0, u(0), 0, 0, 0, . . .}+ {. . . , 0, 0, 0, 0, 0, u(1), 0, 0, . . .} + {. . . , 0, 0, 0, 0, 0, 0, u(2), 0, . . .} +

    where the summation sign indicates component wise addition. The first term on theright-hand side can be written as u(2){(n + 2)}, because the nonzero term occursat n = 2. Note that this is a product of a scalar, u(2), and a shifted impulsesequence, {(n + 2)}. Similarly, all other terms can also be written as products of ascalar and a shifted sequence. We arrive at

    {u(n)} = + u(2){(n + 2)} + u(1){(n + 1)}+ u(0){(n)} + u(1){(n 1)} + u(2){(n 2)} +

    Thus the sequences {(n + 2)}, {(n 1)}, etc., can be thought of as unit vectorsand u(2), u(1), etc., can be thought of as components along these directions. Theabove equation can be written as

    3.3. InputOutput Convolution Models 45

    3.3.1 InputOutput Linearity

  • 8/22/2019 Digital Control~Tqw~ Darksiderg

    58/553

    There are times when we would be interested in systems that are linear from an input-ou


Recommended