System Design Through MATLAB Control Toolbox And SIMULINK

Transcription

System Design through MATLAB Control Toolbox and SIMULINK

SpringerLondonBerlinHeidelbergNew YorkBarcelonaHong KongMilanParisSingaporeTokyo

Krishna Singh and Gayatri AgnihotriSystem Design throughMATLAS@, Control Toolboxand SIMULINK iSpringer

Krishna K. Singh, BE, MtechElectrical Engineering Department, S.V. Government Polytechnic, Shamla Hills, Bhopal (MP),PIN 462002, IndiaGayatri Agnihotri, BE, Mtech, PhDElectrical Engineering Department, M.A. College ofTechnology, Bhopal (MP),PIN 462007, IndiaISBN-13: 978-1-85233-337-9e-ISBN-13: 978-1-4471-0697-5DOl: 10.1007/978-1-4471-0697-5ISBN 978-1-85233-337-9 Springer-Verlag London Berlin HeidelbergBritish Library Cataloguing in Publication DataSingh, Krishna KumariSystem Design through MATLAB control toolbox and SIMULINK1. MATLAB (Computer fIle) 2. SIMULINK (Computer fIle)3. Control toolbox (Computer fIle) 4. Systems design5. Automatic control - Computer simulationI. Title II. Agnihotri, Gayatri629.8'312'0285'5369ISBN 978-1-85233-337-9Library of Congress Cataloging-in-Publication DataSingh, Krishna Kumari, 1969System Design through MATLAB control toolbox and SIMULINK 1 Krishna KumariSingh and Gayatri Agnihotri.p.cm.ISBN 978-1-85233-337-9 (alk. paper)1. System design. 2. MATLAB. 3. SIMULINK. I. Agnihotri, Gayatri, 1947- II. Title.QA76.9.S88 S5673 2000003.'.85'OI1353042-dc2100-044675Apart from any fair dealing for the purposes of research or private study, or criticism or review, as permitted underthe Copyright, Designs and Patents Act 1988, this publication may only be reproduced, stored or transmitted, in anyform or by any means, with the prior permission in writing of the publishers, or in the case of reprographicreproduction in accordance with the terms of licences issued by the Copyright Licensing Agency. Enquiriesconcerning reproduction outside those terms should be sent to the publishers. Springer-Verlag London Limited 2001Reprint ofthe orginal edtition 200 1MATLAB and SIMULlNK are registered trademarks of The MathWorks Inc., http://www.mathworks.comThe use of registered names, trademarks, etc. in this publication does not imply, even in the absence of a specificstatement, that such names are exempt from the relevant laws and regulations and therefore free for general use.The publisher makes no representation, express or implied, with regard to the accuracy of the information containedin this book and cannot accept any legal responsibility or liability for any errors or omissions that may be made.Typesetting: Camera ready by authors69/3830-543210 Printed on acid-free paper SPIN 10770940

Dedicated to God Almighty who not only endowed me with a caring Mother and blessed me witha number of wonderful Teachers, who groomed me together, but also the one whose ControlSystem has always intrigued me.----- Krishna K. SinghDedicated to Prof P.S. Satsangi, Director, Dayalbagh Educational Institute, Agra, India, whohas not only been my supervisor for Ph.D. at l.l. T., Delhi, India in 1984, but also the person whoinstilled in me the capabilities for writing a book like this.----- Gayatri Agnihotri

ForewordMATLAB has been a strong software for high-performance, numerical computations andvisualisations. The fact that it provides an interactive environment with large number of built-infunctions for technical computations, graphics and animations makes it an excellent tool for avery large variety of subjects starting from Linear Algebra computations, Data Analysis, SignalProcessing, Optimisation, Numerical Solution of ODE's, Quadrature etc. and extending uptoNeural Network and Fuzzy Logic. In association with SIMULINK and Control Toolbox, itprovides the scientific community with a powerful tool for the design, analysis and responsestudy of Systems.Going through the manuscript of this book has been a pleasant experience. The fact that intheir maiden attempt, the authors have been able to introduce the intricate and subtle points ofthe subject in a very simple and interactive manner speaks in itself for their deep insight into thesubject. Their approach towards introducing new concepts has been gradual and the inclusion ofexamples and exercises within the chapters will make the reader more and more confident ashe/she progresses through the book. I hope that the book will serve the purpose of its readers andmake them expert in using MATLAS , Control Toolbox and SIMULINK in design and analysis ofSystems.The book is eminently suitable for both as a textbook and reference book for the students ofthese novel computational tools.Prof. P.B. Sharma,Vice-Chancellor,Rajiv Gandhi Proudyogiki Vishwavidyalaya,(University of Technology of Madhya Pradesh)Bhopal, India19th May 2000

PrefaceMATLAB , developed by The MathWorks Inc. is fast gaining popularity in the area of simulationof systems for scientific computation. With the addition of various Toolboxes and SIMULINK ,MATLAB proves to be a strong and indispensable tool for several specialised simulations.The target groups of this book are: undergraduate students of electrical, electronics, mechanical, mechatronics, robotics andaerospace engineering undergoing their final semester of project work;postgraduate students for whom MATLAB forms an integral part of the syllabus or whodecide to take up simulation of Control System engineering problems as their dissertationwork;research scholars for whom MATLAB along with Toolboxes and SIMULINK is anindispensable tool for simulation;people from research institutes and industries who wish to learn the tricks of simulatingControl System problems using MATLAB platform for their routine and/or developmentwork.Text presented in this book uses very simple language and explains the main and basicfeatures of MATLAB Control System Toolbox and SIMULINK required for simulation ofSystems under Windows environment.The course covered by this book has been divided into nine chapters. Starting from formationof models in Chapter 1, the subject has been evolved through Chapter 9, which deals with sometypical and complex applications. Illustrative examples, with gradual increase in the difficultylevel on 12.5% grey background throughout the lesson along with practice problems in eachchapter in deep 25% grey Practice Test box is a salient feature of this book. Problem given at theend of each chapter as an exercise not only intend to reinforce learning but also aim at helpingthe student evolve concepts required for simulating real life Control System problems. The textpresented in this book uses a language that gives the reader a feel of personal touch close to theclass room situation.The illustrations/diagrams presented in the book have been converted to greyscale. On thewaveforms legends have been provided depicting colors (e.g., Y for yellow, C for cyan, G forgreen, M for magenta and so on . ) to make things more clear. And so, the reader does notactually ever miss the colors.

xPrefaceIn addition, examples covered in the book that includes live simulations of various systems,are also provided at the web-site of Springer-Verlag at ftp: I Iftp.springer.co.uk withan aim to help reader not only save time but also learn with ease.The authors feel that this book will not only serve the purpose of consolidating basicconcepts of System Engineering into the mind of the readers but also help them in getting startedtowards using MATLAB , Control Systems Toolbox and SIMULINK with minimum effort andmaximum amount of ease.Constructive suggestions for improvement are what the authors seek from the readers of thisbook and expect them to flow in freely.So, Happy Reading and Simulations . !

AcknowledgementsFirst of all we wish to express our thanks to The MathWorks Inc. for all the information andsupport they provided during the writing of this book. Without the help of 'The Book Program'available on their web-site, at http://www.rnathworks.com. made especially for thewriters aspiring to write on MATLAB related topics, this book would have been a dream for usof distant future.We also express our gratitude towards our Alma Mater, M. A. College of Technology,Bhopal, for providing all possible facilities that has gone into the making of this book. Weacknowledge the efforts of Prof. R.P. Singh and Prof. A.K. Tiwari, Heads of Electronics andComputer Engineering Departments respectively, from this very Regional College ofEngineering, and thank them from the bottom our hearts.Our special thanks also goes to Dr. S.C.P. Singh, Educational Psychologist, whoseconsultancy we seeked time and again. His advice and direction proved to be of immense helpespecially while planning the difficulty level of the material incorporated in this book.From the day that our mind conceived the idea of writing this book, Mr. Surendra Sinh, ourfriend has been our source of constant help and inspiration whatsoever. Despite hisoverwhelming responsibilities and busy schedule, he always somehow managed to find time forgoing through the manuscripts, correcting them and suggesting improvements. Simple words ofthanks are just not sufficient to express our feelings of gratitude towards him.In addition, we would like to thank our friends and colleagues - Prof. Vaishali Sohoni andProf. Umesh Kumar Soni, Lecturers, Electrical Engineering, S.V. Government, Bhopal, for theirconstant help and constructive criticism. Our acknowledgement would be incomplete if we donot express our gratitude towards Prof. K.c. Verma, Principal, of the same Institution, for hisguidance and encouragement.Can we ever forget the contributions of Mr. Pankaj Singh and Mr. Nikesh Samaiya, ouryoung friends who are always bubbling with energy and have wonderful head full of brilliantideas. many of which have found place in this text.Lastly. if it were not for the support and infinite patience of our family members. this bookwould have remained an uncherished dream.We thank everyone. directly and indirectly involved in the making of this book.

Table of ContentsIntroduction0.1 What are MATLAB , Control System Toolbox and SIMULINK ? . xix0.2 The MATLAB Family . xix0.3 Who Should Read this Book? . xix0.4 What is Required to Do the Simulations . xxi0.5 Which Version is Covered? . xxi0.6 What is not Covered . xxi0.7 How the Book is Organized . xxii0.8 Accessory Material Available via the Internet. . xxii0.9 How to Use this Book . xxiii0.10 Conventions Used in this Book . xxiii0.11 A Word of Caution . xxiv0.12 Before You Start . xxiv1. System Representation and Modeling . l1.1 Properties of the Models . 11.1.1 Generic Properties . 41.1.2 Model-specific Properties . 41.2 Creating a Model. . 71.2.1 ZerolPoleiGain (zpk) Model . 71.2.2 Transfer Function (tf) Model . 211.2.3 State Space (ss) Model . 341.2.3.1 Standard State Space Model . 351.2.3.2 Descriptor State Space Model . 411.2.4 Frequency Response Data (frd) Model . 441.2.5 Generation of Random Stable Models . 48Exercise for Chapter 1' . 522. Model Manipulation . 572.1 The Precedence Rule and the Law of Property Inheritance . 572.1.1 The Precedence Rule . 572.1.2 The Law of Property Inheritance . 602.2 Arithmetic Operations on Models . 60

xiv Table of Contents2.2.1 Addition and Subtraction . 602.2.2 Multiplication . 682.2.3 Inversion . 742.2.4 Right Divide . 772.2.5 Left Divide . 782.2.6 Transposition. 802.2.7 Pertransposition. 822.2.8 Power ofMode1. . 852.2.9 Stacking . 882.3 Interconnection of Models . 892.3.1 Concatenation . 902.3.2 Append . 912.3.3 Augstate . 942.3.4 Connect . 952.3.5 Feedback . 982.3.6 Linear Fractional Transformation (1ft) Connection . 1012.3.7 Parallel and Series Connection. 1042.4 The Linear Time Invariant (LTI) Subsystem . 1042.4.1 Obtaining a Subsystem. 1042.4.2 Modifying a System/Subsystem . 1072.4.3 Subsystem Manipulations . 108Exercise for Chapter 2 . 1103. Getting Information from the Models . 1133.1 Model-specific Information . 1133.1.1 ZerolPolelGain Mode1. . 1133.1.2 Transfer Function Model . 1163.1.3 State Space Mode1. . 1183.1.4 Frequency Response Data Mode1. . 1203.2 Direct Property Referencing Method of Getting Information . 1223.3 The 'get' Function . 1243.4 Information about Model Dimensions and Characteristics . 1263.5 Conversion of Models . 1303.5.1 Automatic Conversion . ;. 1313.5.2 Conversion by Specifying . 1313.5.3 ContinuouslDiscrete Conversions . 1333.6 A Few Words on Model Properties Again . 1353.6.1 Overruling the Precedence Rule and the Law of Property Inheritance . 1353.6.2 SettingIModifying the LTI Properties . 1373.6.3 More on Time Delays . 1383.6.3.1 Mapping Discrete-time Delays to Poles at the Origin . 1393.6.3.2 Pade Approximation of Time Delays . 1403.6.3.3 Computing Time Delays of LTI Models . 143Exercise for Chapter 3 . 1454. Model Analysis . 1474.1 Model Dynamics of Control System . 1474.1.1 System Poles . 147

Table of Contentsxv4.1.2 System Zeros . 1494.1.3 Low-frequency or DC Gain . 1504.1.4 Pole-zero Map . 1514.1.5 H2 and L. Norms . 1534.1.6 Covariance of Response to White Noise . 1544.1.7 Natural Frequency and Damping ofLTI Model Poles . 1554.1.8 Sorting Eigenvalues . 1574.2 Time Response Analysis of Control Systems . 1594.2.1 Response of a Model to Standard Signals . 1594.2.2 Response of a Model to Arbitrary Periodic Signals . 1614.2.3 The Unit Step Function . 1644.3 Frequency Response Analysis of Control Systems . 1654.3.1 Obtaining Frequency Response Plots . 1664.3.2 Getting Information from the Plots . 1754.3.2.1 Evaluating Frequency Response over a Frequency Range . 1764.3.2.2 Evaluating Frequency Response at a Particular Frequency . 1774.3.2.3 Evaluating Gain Margin, Phase Margin, Crossover Frequencies andJudging Stability . 1774.4 State Space Analysis of Control Systems . 1804.4.1 Eigenvalues and Eigenvectors . 1804.4.2 Initial Condition Response of ss Model . 1814.4.3 Canonical State Space Realization . 1834.4.4 Controlability and Observability . 1854.4.5 Controlability and Observability Gramians . 1864.4.6 Balancing of ss Model. . 1884.4.6.1 Using Diagonal Similarity . 1884.4.6.2 Using Gramian-based Balancing of State Space Realizations . 1884.4.7 State Reduction of ss Model . 1904.4.7.1 The modred Function . 1904.4.7.2 The minreal Function . 1934.4.7.3 The sminreal Function . 194Exercise for Chapter 4 . 1965. The Control System Toolbox's GUIs . 1995.1 The LTI Viewer . 1995.1.1 Initializing the LTI Viewer . 2005.1.2 More about the ltiview Function . 2015.1.3 The LTI Viewer Environment. . 2015.1.4 The Bottom Command Bar . 2085.1.5 The Right Click Menus . 2095.1.6 More about Clicking on the Plots . 2135.1.7 A Few Words on the LTI Arrays Response Plots . 2145.1. 7.1 The Model Selector for L TI Arrays Window . 2155.2 The Root Locus Design GUI. . 2235.2.1 Initializing the Root Locus Design GUI . 2235.2.2 The Root Locus Design GUI Environment. . 2245.2.3 Using Root Locus Design GUI . 236Exercise for Chapter 5 . 252

xvi Table of Contents6. Control System Design through SIMULINK . 2536.1 System Representation/Modeling . 2546.1.1 Modeling Using SIMULINK Library . 2546.1.2 Modeling Using Control System Toolbox Library . 2546.2 Model Manipulation . 2556.2.1 Arithmetic Operations on Models . 2566.2.2 Interconnection of Models . 2576.3 Model Analysis . 2606.4 The SIMULINK LTI Viewer . 2606.4.1 Invoking and Using the SIMULINK LTI Viewer . 2606.5 A Few Words of Caution . 265Exercise for Chapter 6 . 2707. Design of Compensators for Systems . 2717.1 Classical Methods for Design . 2717.1.1 Obtaining Root Locus Plot for a Model. . 2717.1.2 Selecting Feedback Gain from Root Locus Plot . 2747.1.3 Designing Compensator Using Root Locus Technique . 2767.2 Solution of Lyapunov's Equation and Stability . 2777.3 Modern Methods for Design . 2807.3.1 Design of State Feedback Controller . 2807.3.1.1 For SISO Models . 2817.3.1.2 For MIMO Models . 2837.3.2 Design of State Estimator/Observer . 2857.3.3 Design of State Regulator . 2967.4 Design of Optimal Compensators . 3017.4.1 Riccati Equations . 3017.4.1.1 Solution of Continuous-time Algebraic Riccati Equations . 3017.4.1.2 Solution of Discrete-time Algebraic Riccati Equations . 3067.4.2 Design of Kalman State Estimator . 3117.4.2.1 Kalman Estimator for Continuous-lDiscrete-time Models . 3117.4.2.2 Discrete Kalman State Estimator for Continuous-time Models . 3157.4.3 Design of Linear Quadratic State Feedback Regulator . 3197.4.3.1 Linear Quadratic State Feedback Regulator for Continuous Models . 3197.4.3.2 Linear Quadratic State Feedback Regulator for Discrete Models . 3227.4.3.3 Linear Quadratic State Feedback Regulator with Output Weighting . 3247.4.3.4 Discrete Linear Quadratic State Feedback Regulator for ContinuousModel. . 3267.4.4 Design of Linear Quadratic Gaussian Regulator . 328Exercise for Chapter 7 . 3358. Some Simple Applications . 3378.1 Which Method to Choose . 3378.2 Electrical Systems . 3388.2.1 Purely Resistive Circuit . 3398.2.2 Purely Inductive Circuit . 3418.2.3 Purely Capacitive Circuit . 3438.2.4 Series RL Circuit. . 346

Table of Contents xvii8.2.4.1 Simulation from the MATLAB Window . 3478.2.4.1 Simulation from the SIMULINK Window . 3478.2.5 Output Characteristics of a PNP Transistor (Linear Portion in CommonEmitter Configuration) . '" .

System Design through MATLAB control toolbox and SIMULINK 1. MATLAB (Computer fIle) 2. SIMULINK 3. Control toolbox (Computer fIle) 4. Systems design 5. Automatic control - Computer simulation I. Title II. Agnihotri, Gayatri 629.8'312'0285'5369 ISBN 978-1-85233-337-9 Library of Congress Cataloging-in-Publication Data Singh, Krishna Kumari, 1969-