Digital Control Digital Control KannanM.Moudgalya © 2007JohnWiley&Sons,Ltd. ISBN: 978-0-470-03143-8 Digital Control Kannan M. Moudgalya Indian Institute of Technology, Bombay John Wiley & Sons, Ltd 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): cs-books@wiley.co.uk Visit our Home Page on www.wiley.com All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted 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 or under 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 the Publisher should be addressed to the Permissions Department, John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England, or emailed to permreq@wiley.co.uk, or faxed to (+44) 1243 770620. Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The Publisher is not associated with any product or vendor mentioned in this book. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold on the understanding that the Publisher is not engaged in rendering professional services. If professional advice or other expert assistance is required, the services 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, USA Wiley-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 print may 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. Includes bibliographical references and index. ISBN 978-0-470-03143-8 (cloth) 1. Digital control systems. I. Title. TJ223.M53M689 2007 629.8’9–dc22 2007024694 British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library ISBN 978-0-470-03143-8 (HB) ISBN 978-0-470-03144-5 (PB) Typeset by the author using L A T E X software. Printed and bound in Great Britain by Antony Rowe Ltd, Chippenham, Wiltshire This book is printed on acid-free paper responsibly manufactured from sustainable forestry in which at least two trees are planted for each one used for paper production. To my parents Muthu Meenakshi Kuppu Subramanian 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 SampledDataSystem 5 2.2 ModelsofContinuousTimeSystems 7 2.2.1 Magnetically Suspended Ball . . . . . . . . . . . . . . . . . . 7 2.2.2 DCMotor . 10 2.2.3 Inverted Pendulum Positioning System . . . . . . . . . . . . . 11 2.2.4 LiquidFlowSystems . 13 2.2.5 vandeVusseReactor 13 2.3 NaturallyOccurringDiscreteTimeSystems 14 2.3.1 IBMLotusDominoServer 15 2.3.2 Supply Chain Control . . . . . . . . . . . . . . . . . . . . . . 15 2.4 EstablishingConnections 17 2.4.1 Continuous Time to Digital Systems – A/D Converter . . . . 17 2.4.2 Digital to Continuous Time Systems – D/A Converter . . . . 19 2.4.3 Input–Output View of Plant Models . . . . . . . . . . . . . . 19 2.5 Discretization of Continuous Time Systems . . . . . . . . . . . . . . 21 2.5.1 Solution to the State Space Equation . . . . . . . . . . . . . . 21 2.5.2 Zero Order Hold Equivalent of the State Space Equation . . . 23 2.5.3 Approximate Method of Discretization . . . . . . . . . . . . . 26 2.5.4 DiscretizationofSystemswithDelay 27 2.6 Approaches to Controller Design and Testing . . . . . . . . . . . . . 29 2.7 MatlabCode . 30 2.8 Problems . 31 viii Contents I Digital Signal Processing 33 3LinearSystem 35 3.1 BasicConcepts 35 3.1.1 Linearity . 36 3.1.2 TimeInvariance . 39 3.1.3 CausalityandInitialRest 41 3.2 BasicDiscreteTimeSignals . 43 3.3 Input–Output Convolution Models . . . . . . . . . . . . . . . . . . . 44 3.3.1 Input–Output Linearity . . . . . . . . . . . . . . . . . . . . . 45 3.3.2 ImpulseResponseModels 47 3.3.3 PropertiesofConvolution 49 3.3.4 StepResponseModels 51 3.3.5 Impulse Response of Causal Systems . . . . . . . . . . . . . . 53 3.3.6 ParametricandNonparametricModels . 54 3.3.7 BIBO Stability of LTI Systems . . . . . . . . . . . . . . . . . 54 3.4 StateSpaceModelsRevisited 56 3.5 MatlabCode . 57 3.6 Problems . 58 4 Z-Transform 61 4.1 Motivation and Definition of Z-Transform . . . . . . . . . . . . . . . 61 4.1.1 Motivation 61 4.1.2 AbsoluteConvergence 62 4.1.3 Definition of Z-Transform . . . . . . . . . . . . . . . . . . . . 65 4.1.4 RegionofConvergence 65 4.1.5 PropertiesofRegionofConvergence 68 4.2 Z-TransformTheoremsandExamples . 70 4.2.1 Linearity . 71 4.2.2 Shifting 73 4.2.3 EffectofDamping 75 4.2.4 Initial Value Theorem for Causal Signals . . . . . . . . . . . . 75 4.2.5 Final Value Theorem for Causal Signals . . . . . . . . . . . . 75 4.2.6 Convolution 77 4.2.7 Differentiation 79 4.2.8 Z-Transform of Folded or Time Reversed Functions . . . . . . 81 4.3 TransferFunction . 82 4.3.1 GainofaTransferFunction . 83 4.3.2 Transfer Function of Connected Systems . . . . . . . . . . . . 83 4.3.3 Z-Transform of Discrete Time State Space Systems . . . . . . 85 4.3.4 Jury’s Stability Rule . . . . . . . . . . . . . . . . . . . . . . . 87 4.4 InverseofZ-Transform 89 4.4.1 Contour Integration . . . . . . . . . . . . . . . . . . . . . . . 90 4.4.2 Partial Fraction Expansion . . . . . . . . . . . . . . . . . . . 94 4.4.3 Realization 103 4.5 MatlabCode . 105 4.6 Problems . 109 Contents ix 5 Frequency Domain Analysis 113 5.1 Basics . 113 5.1.1 Oscillatory Nature of System Response . . . . . . . . . . . . 113 5.1.2 Continuous and Discrete Time Sinusoidal Signals . . . . . . . 115 5.1.3 Sampling of Continuous Time Signals . . . . . . . . . . . . . 118 5.2 Fourier Series and Fourier Transforms . . . . . . . . . . . . . . . . . 120 5.2.1 Fourier Series for Continuous Time Periodic Signals . . . . . 120 5.2.2 Fourier Transform of Continuous Time Aperiodic Signals . . 121 5.2.3 FrequencyResponse . 124 5.2.4 Fourier Transform of Discrete Time Aperiodic Signals . . . . 125 5.2.5 Convergence Conditions for Fourier Transform . . . . . . . . 126 5.2.6 Fourier Transform of Real Discrete Time Signals . . . . . . . 126 5.2.7 Parseval’sTheorem 130 5.3 SamplingandReconstruction 131 5.3.1 SamplingofAnalogSignals . 132 5.3.2 Reconstruction of Analog Signal from Samples . . . . . . . . 134 5.3.3 Frequency Domain Perspective of Zero Order Hold . . . . . . 137 5.4 Filtering 139 5.4.1 Pole–Zero Location Based Filter Design . . . . . . . . . . . . 140 5.4.2 Classification of Filters by Phase . . . . . . . . . . . . . . . . 144 5.5 Discrete Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . 147 5.6 MatlabCode . 149 5.7 Problems . 151 II Identification 157 6 Identification 159 6.1 Introduction 160 6.2 LeastSquaresEstimation 161 6.2.1 Linear Model for Least Squares Estimation . . . . . . . . . . 162 6.2.2 Least Squares Problem: Formulation and Solution . . . . . . 162 6.3 Covariance 165 6.3.1 Covariance in Stationary, Ergodic Processes . . . . . . . . . . 166 6.3.2 WhiteNoise 169 6.3.3 Detection of Periodicity Through ACF . . . . . . . . . . . . . 172 6.3.4 Detection of Transmission Delays Using ACF . . . . . . . . . 173 6.3.5 Covariance of Zero Mean Processes Through Convolution . . 175 6.4 ARMAProcesses . 177 6.4.1 MixedNotation 177 6.4.2 WhatisanARMAProcess? . 178 6.4.3 MovingAverageProcesses 179 6.4.4 IsUniqueEstimationPossible? . 183 6.4.5 AutoRegressiveProcesses 186 6.4.6 Auto Regressive Moving Average Processes . . . . . . . . . . 190 6.5 NonparametricModels 192 6.5.1 Covariance Between Signals of LTI Systems . . . . . . . . . . 192 6.5.2 Frequency Response of LTI Systems Excited by White Noise 195 6.6 PredictionErrorModels . 196 x Contents 6.6.1 One Step Ahead PredictionErrorModel 197 6.6.2 Finite Impulse Response Model . . . . . . . . . . . . . . . . . 199 6.6.3 Auto Regressive, Exogeneous (ARX) Input, Model . . . . . . 200 6.6.4 Auto Regressive Moving Average, Exogeneous (ARMAX) Input, Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 6.6.5 Auto Regressive Integrated Moving Average, Exogeneous (ARIMAX) Input, Model . . . . . . . . . . . . . . . . . . . . 207 6.6.6 OutputErrorModel . 208 6.6.7 Box–JenkinsModel 209 6.6.8 Case Study: Drifting Noise Model . . . . . . . . . . . . . . . 211 6.7 Revisiting Least Squares Estimation . . . . . . . . . . . . . . . . . . 217 6.7.1 Statistical Properties of Least Squares Estimate . . . . . . . . 217 6.7.2 RecursiveLeastSquares . 220 6.8 Weight Selection for Iterative Calculations . . . . . . . . . . . . . . . 222 6.9 MatlabCode . 225 6.10Problems . 237 III Transfer Function Approach to Controller Design 241 7 Structures and Specifications 243 7.1 ControlStructures 243 7.1.1 FeedForwardController . 243 7.1.2 One Degree of Freedom Feedback Controller . . . . . . . . . . 244 7.1.3 Two Degrees of Freedom Feedback Controller . . . . . . . . . 245 7.2 ProportionalControl . 247 7.2.1 NyquistPlotforControlDesign 248 7.2.2 Stability Margins . . . . . . . . . . . . . . . . . . . . . . . . . 252 7.3 OtherPopularControllers 254 7.3.1 Lead–LagController . 254 7.3.2 Proportional, Integral, Derivative Controller . . . . . . . . . . 260 7.4 Internal Stability and Realizability . . . . . . . . . . . . . . . . . . . 263 7.4.1 Forbid Unstable Pole–Zero Cancellation . . . . . . . . . . . . 264 7.4.2 Internal Stability . . . . . . . . . . . . . . . . . . . . . . . . . 266 7.4.3 Internal Stability Ensures Controller Realizability . . . . . . 269 7.4.4 Closed Loop Delay Specification and Realizability . . . . . . 269 7.5 Internal Model Principle and System Type . . . . . . . . . . . . . . . 270 7.5.1 InternalModelPrinciple . 270 7.5.2 SystemType . 273 7.6 IntroductiontoLimitsofPerformance . 277 7.6.1 TimeDomainLimits . 277 7.6.2 Sensitivity Functions . . . . . . . . . . . . . . . . . . . . . . . 281 7.6.3 FrequencyDomainLimits 282 7.7 WellBehavedSignals . 284 7.7.1 SmallRiseTimeinResponse 285 7.7.2 SmallOvershootinResponse 286 7.7.3 Large Decay Ratio . . . . . . . . . . . . . . . . . . . . . . . . 287 7.8 SolvingAryabhatta’sIdentity 288 7.8.1 Euclid’s Algorithm for GCD of Two Polynomials . . . . . . . 288 Contents xi 7.8.2 Aryabhatta’sIdentity 290 7.8.3 Algorithm to Solve Aryabhatta’s Identity . . . . . . . . . . . 291 7.9 MatlabCode . 296 7.10Problems . 299 8 Proportional, Integral, Derivative Controllers 301 8.1 SamplingRevisited 301 8.2 DiscretizationTechniques 302 8.2.1 Area Based Approximation . . . . . . . . . . . . . . . . . . . 302 8.2.2 Step Response Equivalence Approximation . . . . . . . . . . 303 8.3 Discretization of PID Controllers . . . . . . . . . . . . . . . . . . . . 307 8.3.1 BasicDesign . 308 8.3.2 Ziegler–Nichols Method of Tuning . . . . . . . . . . . . . . . 308 8.3.3 2-DOF Controller with Integral Action at Steady State . . . 309 8.3.4 Bumpless PID Controller with T c = S c . 312 8.3.5 PID Controller with Filtering and T c = S c . 313 8.3.6 2-DOF PID Controller with T c = S c (1) 316 8.3.7 2-DOF PID Controller with T c (1) = S c (1) . 320 8.4 MatlabCode . 321 8.5 Problems . 322 9 Pole Placement Controllers 327 9.1 Dead-Beat and Dahlin Control . . . . . . . . . . . . . . . . . . . . . 327 9.2 Pole Placement Controller with Performance Specifications . . . . . 328 9.3 ImplementationofUnstableControllers 335 9.4 Internal Model Principle for Robustness . . . . . . . . . . . . . . . . 337 9.5 RedefiningGoodandBadPolynomials . 343 9.6 Comparing 1-DOF and 2-DOF Controllers . . . . . . . . . . . . . . . 351 9.7 Anti Windup Controller . . . . . . . . . . . . . . . . . . . . . . . . . 354 9.8 PID Tuning Through Pole Placement Control . . . . . . . . . . . . . 361 9.9 MatlabCode . 367 9.10Problems . 379 10 Special Cases of Pole Placement Control 381 10.1SmithPredictor 381 10.2InternalModelControl 385 10.2.1 IMC Design for Stable Plants . . . . . . . . . . . . . . . . . . 388 10.2.2 IMC in Conventional Form for Stable Plants . . . . . . . . . 393 10.2.3 PIDTuningThroughIMC . 396 10.3MatlabCode . 397 10.4Problems . 401 11 Minimum Variance Control 403 11.1 j-StepAheadPredictionErrorModel . 403 11.1.1 Control Objective for ARMAX Systems . . . . . . . . . . . . 403 11.1.2 Prediction Error Model Through Noise Splitting . . . . . . . 404 11.1.3 Interpretation of the Prediction Error Model . . . . . . . . . 406 11.1.4 Splitting Noise into Past and Future Terms . . . . . . . . . . 407 . Digital Control Digital Control KannanM .Moudgalya © 2007JohnWiley&Sons,Ltd. ISBN: 97 8-0 -4 7 0-0 31 4 3- 8 Digital Control Kannan M. Moudgalya. 431 11.9 Minimum variance control for nonminimum phase systems . . . . . 431 11.10 Minimum variance control for nonminimum phase example of Example11.6