Feedback Systems An Introduction for Scientists and Engineers Karl Johan Astr om Automatic Control LTH Lund University Control, Dynamical Systems and Computation University of California Santa Barbara Richard M. Murray Control and Dynamical Systems California Institute of Technology DRAFT v2.9a (8 January 2008) ' 2007 Karl Johan ? Astr¤ om and Richard M. Murray All rights reserved. This manuscript is for review purposes only and may not be reproduced, in whole or in part, without written consent from the authors.Contents Preface vii Chapter 1. Introduction 1 1.1 What Is Feedback? 1 1.2 What Is Control? 3 1.3 Feedback Examples 5 1.4 Feedback Properties 17 1.5 Simple Forms of Feedback 23 1.6 Further Reading 25 Exercises 26 Chapter 2. System Modeling 27 2.1 Modeling Concepts 27 2.2 State Space Models 34 2.3 Modeling Methodology 44 2.4 Modeling Examples 51 2.5 Further Reading 61 Exercises 62 Chapter 3. Examples 67 3.1 Cruise Control 67 3.2 Bicycle Dynamics 71 3.3 Operational Ampli er Circuits 73 3.4 Computing Systems and Networks 77 3.5 Atomic Force Microscopy 83 3.6 Drug Administration 87 3.7 Population Dynamics 91 Exercises 93 Chapter 4. Dynamic Behavior 97 4.1 Solving Di erential Equations 97 4.2 Qualitative Analysis 100 4.3 Stability 104 4.4 Lyapunov Stability Analysis 112iv CONTENTS 4.5 Parametric and Nonlocal Behavior 121 4.6 Further Reading 127 Exercises 128 Chapter 5. Linear Systems 133 5.1 Basic De nitions 133 5.2 The Matrix Exponential 138 5.3 Input/Output Response 147 5.4 Linearization 160 5.5 Further Reading 166 Exercises 166 Chapter 6. State Feedback 171 6.1 Reachability 171 6.2 Stabilization by State Feedback 179 6.3 State Feedback Design 187 6.4 Integral Action 199 6.5 Further Reading 202 Exercises 202 Chapter 7. Output Feedback 205 7.1 Observability 205 7.2 State Estimation 210 7.3 Control Using Estimated State 215 7.4 Kalman Filtering 219 7.5 A General Controller Structure 223 7.6 Further Reading 230 Exercises 230 Chapter 8. Transfer Functions 233 8.1 Frequency Domain Modeling 233 8.2 Derivation of the Transfer Function 235 8.3 Block Diagrams and Transfer Functions 246 8.4 The Bode Plot 254 8.5 Laplace Transforms 264 8.6 Further Reading 266 Exercises 266 Chapter 9. Frequency Domain Analysis 271 9.1 The Loop Transfer Function 271 9.2 The Nyquist Criterion 274 9.3 Stability Margins 282 9.4 Bode's Relations and Minimum Phase Systems 286 9.5 Generalized Notions of Gain and Phase 289CONTENTS v 9.6 Further Reading 294 Exercises 294 Chapter 10. PID Control 299 10.1 Basic Control Functions 299 10.2 Simple Controllers for Complex Systems 304 10.3 PID Tuning 308 10.4 Integrator Windup 312 10.5 Implementation 314 10.6 Further Reading 319 Exercises 319 Chapter 11. Frequency Domain Design 323 11.1 Sensitivity Functions 323 11.2 Feedforward Design 327 11.3 Performance Speci cations 330 11.4 Feedback Design via Loop Shaping 334 11.5 Fundamental Limitations 339 11.6 Design Example 348 11.7 Further Reading 351 Exercises 352 Chapter 12. Robust Performance 355 12.1 Modeling Uncertainty 355 12.2 Stability in the Presence of Uncertainty 360 12.3 Performance in the Presence of Uncertainty 366 12.4 Robust Pole Placement 369 12.5 Design for Robust Performance 377 12.6 Further Reading 382 Exercises 382 Bibliography 387 Index 397Preface This book provides an introduction to the basic principles and tools for the design and analysis of feedback systems. It is intended to serve a diverse audience of scientists and engineers who are interested in understanding and utilizing feedback in physical, biological, information and social systems. We have attempted to keep the mathematical prerequisites to a minimum while being careful not to sacri?ce rigor in the process. We have also attempted to make use of examples from a variety of disciplines, illustrating the generality of many of the tools while at the same time showing how they can be applied in speci?c application domains. A major goal of this book is to present a concise and insightful view of the current knowledge in feedback and control systems. The ?eld of control started by teaching everything that was known at the time and, as new knowledge was acquired, additional courses were developed to cover new techniques. A conse- quence of this evolution is that introductory courses have remained the same for many years, and it is often necessary to take many individual courses in order to obtain a good perspective on the ?eld. In developing this book, we have attempted to compactify the current knowledge by emphasizing fundamental concepts. We believe that it is important to understand why feedback is useful, to know the language and basic mathematics of control and to grasp the key paradigms that have been developed over the past half century. It is also important to be able to solve simple feedback problems using back-of-the-envelope techniques, to recog- nize fundamental limitations and dif?cult control problems and to have a feel for available design methods. This book was originally developed for use in an experimental course at Cal- tech involving students from a wide set of backgrounds. The course was offered to undergraduates at the junior and senior levels in traditional engineering disciplines, as well as ?rst- and second-year graduate students in engineering and science. This latter group included graduate students in biology, computer science and physics. Over the course of several years, the text has been classroom tested at Caltech and at Lund University, and the feedback from many students and colleagues has been incorporated to help improve the readability and accessibility of the material. Because of its intended audience, this book is organized in a slightly unusual fashion compared to many other books on feedback and control. In particular, we introduce a number of concepts in the text that are normally reserved for second- year courses on control and hence often not available to students who are not con- trol systems majors. This has been done at the expense of certain traditional top- ics, which we felt that the astute student could learn independently and are oftenviii PREFACE explored through the exercises. Examples of topics that we have included are non- linear dynamics, Lyapunov stability analysis, the matrix exponential, reachability and observability, and fundamental limits of performance and robustness. Topics that we have deemphasized include root locus techniques, lead/lag compensation and detailed rules for generating Bode and Nyquist plots by hand. Several features of the book are designed to facilitate its dual function as a basic engineering text and as an introduction for researchers in natural, information and social sciences. The bulk of the material is intended to be used regardless of the audience and covers the core principles and tools in the analysis and design of feedback systems. Advanced sections, marked by the “dangerous bend” symbol shown here, contain material that requires a slightly more technical background, of the sort that would be expected of senior undergraduates in engineering. A few sections are marked by two dangerous bend symbols and are intended for readers with more specialized backgrounds, identi?ed at the beginning of the section. To limit the length of the text, several standard results and extensions are given in the exercises, with appropriate hints toward their solutions. To further augment the printed material contained here, a companion web site has been developed: http://www.cds.caltech.edu/ ～ murray/amwiki The web site contains a database of frequently asked questions, supplemental ex- amples and exercises, and lecture material for courses based on this text. The mate- rial is organized by chapter and includes a summary of the major points in the text as well as links to external resources. The web site also contains the source code for many examples in the book, as well as utilities to implement the techniques described in the text. Most of the code was originally written using MATLAB M-?les but was also tested with LabView MathScript to ensure compatibility with both packages. Many ?les can also be run using other scripting languages such as Octave, SciLab, SysQuake and Xmath. The ?rst half of the book focuses almost exclusively on state space control sys- tems. We begin in Chapter 2 with a description of modeling of physical, biolog- ical and information systems using ordinary differential equations and difference equations. Chapter 3 presents a number of examples in some detail, primarily as a reference for problems that will be used throughout the text. Following this, Chap- ter 4 looks at the dynamic behavior of models, including de?nitions of stability and more complicated nonlinear behavior. We provide advanced sections in this chapter on Lyapunov stability analysis because we ?nd that it is useful in a broad array of applications and is frequently a topic that is not introduced until later in one’s studies. The remaining three chapters of the ?rst half of the book focus on linear sys- tems, beginning with a description of input/output behavior in Chapter 5. In Chap- ter 6, we formally introduce feedback systems by demonstrating how state space control laws can be designed. This is followed in Chapter 7 by material on output feedback and estimators. Chapters 6 and 7 introduce the key concepts of reacha-PREFACE ix bility and observability, which give tremendous insight into the choice of actuators and sensors, whether for engineered or natural systems. The second half of the book presents material that is often considered to be from the ?eld of “classical control.” This includes the transfer function, introduced in Chapter 8, which is a fundamental tool for understanding feedback systems. Using transfer functions, one can begin to analyze the stability of feedback systems using frequency domain analysis, including the ability to reason about the closed loop behavior of a system from its open loop characteristics. This is the subject of Chapter 9, which revolves around the Nyquist stability criterion. In Chapters 10 and 11, we again look at the design problem, focusing ?rst on proportional-integral-derivative (PID) controllers and then on the more general process of loop shaping. PID control is by far the most common design technique in control systems and a useful tool for any student. The chapter on frequency domain design introduces many of the ideas of modern control theory, including the sensitivity function. In Chapter 12, we combine the results from the second half of the book to analyze some of the fundamental trade-offs between robustness and performance. This is also a key chapter illustrating the power of the techniques that have been developed and serving as an introduction for more advanced studies. The book is designed for use in a 10- to 15-week course in feedback systems that provides many of the key concepts needed in a variety of disciplines. For a 10- week course, Chapters 1–2, 4–6 and 8–11 can each be covered in a week’s time, with the omission of some topics from the ?nal chapters. A more leisurely course, spread out over 14–15 weeks, could cover the entire book, with 2 weeks on mod- eling (Chapters 2 and 3)—particularly for students without much background in ordinary differential equations—and 2 weeks on robust performance (Chapter 12). The mathematical prerequisites for the book are modest and in keeping with our goal of providing an introduction that serves a broad audience. We assume familiarity with the basic tools of linear algebra, including matrices, vectors and eigenvalues. These are typically covered in a sophomore-level course on the sub- ject, and the textbooks by Apostol [Apo69], Arnold [Arn87] and Strang [Str88] can serve as good references. Similarly, we assume basic knowledge of differ- ential equations, including the concepts of homogeneous and particular solutions for linear ordinary differential equations in one variable. Apostol [Apo69] and Boyce and DiPrima [BD04] cover this material well. Finally, we also make use of complex numbers and functions and, in some of the advanced sections, more detailed concepts in complex variables that are typically covered in a junior-level engineering or physics course in mathematical methods. Apostol [Apo67] or Stew- art [Ste02] can be used for the basic material, with Ahlfors [Ahl66], Marsden and Hoffman [MH98] or Saff and Snider [SS02] being good references for the more advanced material. We have chosen not to include appendices summarizing these various topics since there are a number of good books available. One additional choice that we felt was important was the decision not to rely on a knowledge of Laplace transforms in the book. While their use is by far the most common approach to teaching feedback systems in engineering, many stu-x PREFACE dents in the natural and information sciences may lack the necessary mathematical background. Since Laplace transforms are not required in any essential way, we have included them only in an advanced section intended to tie things together for students with that background. Of course, we make tremendous use of trans- fer functions, which we introduce through the notion of response to exponential inputs, an approach we feel is more accessible to a broad array of scientists and engineers. For classes in which students have already had Laplace transforms, it should be quite natural to build on this background in the appropriate sections of the text. Acknowledgments The authors would like to thank the many people who helped during the prepa- ration of this book. The idea for writing this book came in part from a report on future directions in control [Mur03] to which Stephen Boyd, Roger Brockett, John Doyle and Gunter Stein were major contributors. Kristi Morgansen and Hideo Mabuchi helped teach early versions of the course at Caltech on which much of the text is based, and Steve Waydo served as the head TA for the course taught at Caltech in 2003–2004 and provided numerous comments and corrections. Char- lotta Johnsson and Anton Cervin taught from early versions of the manuscript in Lund in 2003–2007 and gave very useful feedback. Other colleagues and students who provided feedback and advice include John Carson, K. Mani Chandy, Michel Charpentier, Domitilla Del Vecchio, Kate Galloway, Per Hagander, Toivo Hen- ningsson Perby, Joseph Hellerstein, George Hines, Tore H¤ agglund, Cole Lepine, Anders Rantzer, Anders Robertsson Dawn Tilbury and Francisco Zabala. The re- viewers for Princeton University Press and Tom Robbins at NI Press also provided valuable comments that signi?cantly improved the organization, layout and focus of the book. Our editor, Vickie Kearn, was a great source of encouragement and help throughout the publishing process. Finally, we would like to thank Caltech, Lund University and the University of California at Santa Barbara for providing many resources, sti