Control Systems: Classical, Neural, and Fuzzy

October 30, 2017 | Author: Anonymous | Category: N/A
Share Embed


Short Description

traditional control theory, while at the same time, putting newer trends in neural ......

Description

.

Control Systems: Classical, Neural, and Fuzzy

Oregon Graduate Institute Lecture Notes - 1998

Eric A. Wan

1

.

Preface This material corresponds to the consolidated lecture summaries and handouts for Control Systems: Classical, Neural, and Fuzzy. The class was motivated from a desire to educate students interested in neural and fuzzy control. Often students and practitioners studying these subjects lack the fundamentals. This class attempts to provide both a foundation and appreciation for traditional control theory, while at the same time, putting newer trends in neural and fuzzy control into perspective. Yes, this really is only a one quarter class (though not everything was covered each term). Clearly, the material could be better covered over two quarters and is also not meant as a substitute for more formal courses in control theory. The lecture summaries are just that. They are often terse on explanation and are not a substitute for attending lectures or reading the supplemental material. Many of the summaries were initially formatted in LaTeX by student1 \scribes" who would try to decipher my handwritten notes after a lecture. Subsequent years I would try to make minor corrections. Included gures are often copied directly from other sources (without permission). Thus, these notes are not for general distribution. This is the rst draft of a working document - beware of typos!

Eric A. Wan

B. John, M. Kumashikar, Y. Liao, A. Nelson, M. Sa ell, R. Sharma, T. Srinivasan, S. Tibrewala, X. Tu, S. Vuuren 1

i

Contents

Preface Class Information Sheet

I Introduction 0.1 0.2 0.3 0.4

Basic Structure . . . . . . . . . Classical Control . . . . . . . . State-Space Control . . . . . . Advanced Topics . . . . . . . . 0.4.1 Dynamic programming . 0.4.2 Adaptive Control . . . . 0.4.3 Robust Control / H1 . 0.5 History of Feedback Control . .

i ix . . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

1 1 1 2 3 3 4 4 5

1 Neural Control

6

2 Fuzzy Logic

9

1.0.1 Reinforcement Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 History of Neural Networks and Neural Control . . . . . . . . . . . . . . . . . . . . .

7 9

2.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2 Fuzzy Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.3 Summary Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

II Basic Feedback Principles

12

1 Dynamic Systems - \Equations of Motion" 2 Linearization

12 19

2.1 Feedback Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.2 Small Signal Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3 Basic Concepts

3.1 Laplace Transforms . . . . . . . . . . . . . . . . 3.1.1 Basic Properties of Laplace Transforms 3.2 Poles and Zeros . . . . . . . . . . . . . . . . . 3.3 Second Order Systems . . . . . . . . . . . . . . 3.3.1 Step Response . . . . . . . . . . . . . . 3.4 Additional Poles and Zeros . . . . . . . . . . . 3.5 Basic Feedback . . . . . . . . . . . . . . . . . . 3.6 Sensitivity . . . . . . . . . . . . . . . . . . . . . 3.7 Generic System Tradeo s . . . . . . . . . . . . 3.8 Types of Control - PID . . . . . . . . . . . . . 3.9 Steady State Error and Tracking . . . . . . . .

4 Appendix - Laplace Transform Tables

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

20

20 20 21 22 23 25 26 28 30 31 33

35 ii

III Classical Control - Root Locus

38

1 The Root Locus Design Method

38

1.1 1.2 1.3 1.4 1.5 1.6

Introduction . . . . . . . . . . . . . . . . . . De nition of Root Locus . . . . . . . . . . . Construction Steps for Sketching Root Loci Illustrative Root Loci . . . . . . . . . . . . Some Root Loci Construction Aspects . . . Summary . . . . . . . . . . . . . . . . . . .

2 Root Locus - Compensation

2.1 Lead Compensation . . . . . . 2.1.1 Zero and Pole Selection 2.2 Lag Compensation . . . . . . . 2.2.1 Illustration . . . . . . . 2.3 The "Stick on a Cart" example 2.4 Extensions . . . . . . . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

38 38 39 44 45 46

46

47 48 48 48 49 51

IV Frequency Design Methods

52

1 Frequency Response 2 Bode Plots

52 52

2.1 Stability Margins . . . . . . . . . . . . . . . . . 2.2 Compensation . . . . . . . . . . . . . . . . . . . 2.2.1 Bode's Gain-Phase Relationship . . . . 2.2.2 Closed-loop frequency response . . . . . 2.3 Proportional Compensation . . . . . . . . . . . 2.3.1 Proportional/Di erential Compensation 2.3.2 Lead compensation . . . . . . . . . . . . 2.3.3 Proportional/Integral Compensation . . 2.3.4 Lag Compensation . . . . . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

56 58 58 59 60 63 64 66 67

3 Nyquist Diagrams

68

V Digital Classical Control

76

1 Discrete Control - Z-transform

76

2 Root Locus control design

82

3.0.5 Nyquist Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 3.1 Stability Margins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

1.1 Continuous to Discrete Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 1.2 ZOH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 1.3 Z-plane and dynamic response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 2.1 Comments - Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 iii

3 Frequency Design Methods

84

4 Z-Transfrom Tables

85

VI State-Space Control

87

3.1 Compensator design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 3.2 Direct Method (Ragazzini 1958) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

1 State-Space Representation 1.1 1.2 1.3 1.4 1.5

1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14

De nition . . . . . . . . . . . . . . . . . . . . . . . Continuous-time . . . . . . . . . . . . . . . . . . . Linear Time Invariant Systems . . . . . . . . . . . "Units" of F in physical terms . . . . . . . . . . . . Discrete-Time . . . . . . . . . . . . . . . . . . . . . 1.5.1 Example 2 - "analog computers" . . . . . . State Space Vs. Classical Approach . . . . . . . . Linear Systems we won't study . . . . . . . . . . . Linearization . . . . . . . . . . . . . . . . . . . . . State-transformation . . . . . . . . . . . . . . . . . Transfer Function . . . . . . . . . . . . . . . . . . . 1.10.1 Continuous System . . . . . . . . . . . . . . 1.10.2 Discrete System . . . . . . . . . . . . . . . Example - what transfer function don't tell us. . . Time-domain Solutions . . . . . . . . . . . . . . . . Poles and Zeros from the State-Space Description . Discrete-Systems . . . . . . . . . . . . . . . . . . . 1.14.1 Transfer Function . . . . . . . . . . . . . . 1.14.2 Relation between Continuous and Discrete .

2 Controllability and Observability 2.1 2.2 2.3 2.4

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

Controller canonical form . . . . . . . . . . . . . . . . . Duality of the controller and observer canonical forms . Transformation of state space forms . . . . . . . . . . . Discrete controllability or reachability . . . . . . . . . . 2.4.1 Controllability to the origin for discrete systems 2.5 Observability . . . . . . . . . . . . . . . . . . . . . . . . 2.6 Things we won't prove . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

87

. 87 . 88 . 88 . 88 . 88 . 89 . 89 . 90 . 91 . 92 . 92 . 92 . 93 . 94 . 95 . 98 . 100 . 100 . 100

101

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. 101 . 102 . 102 . 106 . 107 . 107 . 108

3.1 Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Reference Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Selection of Pole Locations . . . . . . . . . . . . . . . . . . . . . 3.3.1 Method 1 : Dominant second-order poles . . . . . . . . . 3.3.2 Step Response Using State Feedback . . . . . . . . . . . . 3.3.3 Gain/Phase Margin . . . . . . . . . . . . . . . . . . . . . 3.3.4 Method 2 : Prototype Design . . . . . . . . . . . . . . . . 3.3.5 Method 3 : Optimal Control and Symmetric Root Locus .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. 110 . 112 . 114 . 114 . 115 . 117 . 119 . 119

iv

. . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . .

3 Feedback control

. . . . . . .

. . . . . . . . . . . . . . . . . . .

109

3.4 Discrete Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

4 Estimator and Compensator Design

4.1 Estimators . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Selection of Estimator poles e . . . . . . . 4.2 Compensators: Estimators plus Feedback Control . 4.2.1 Equivalent feedback compensation . . . . . 4.2.2 Bode/root locus . . . . . . . . . . . . . . . 4.2.3 Alternate reference input methods . . . . . 4.3 Discrete Estimators . . . . . . . . . . . . . . . . . . 4.3.1 Predictive Estimator . . . . . . . . . . . . . 4.3.2 Current estimator . . . . . . . . . . . . . . 4.4 Miscellaneous Topics . . . . . . . . . . . . . . . . . 4.4.1 Reduced order estimator . . . . . . . . . . . 4.4.2 Integral control . . . . . . . . . . . . . . . . 4.4.3 Internal model principle . . . . . . . . . . . 4.4.4 Polynomial methods . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

134

. 134 . 135 . 136 . 138 . 138 . 146 . 147 . 147 . 147 . 148 . 148 . 148 . 149 . 149

5 Kalman 6 Appendix 1 - State-SpaceControl 7 Appendix - Canonical Forms

150 151 153

VII Advanced Topics in Control

157

1 Calculus of Variations - Optimal Control

1.1 Basic Optimization . . . . . . . . . . . . . . . . 1.1.1 Optimization without constraints . . . . 1.1.2 Optimization with equality constraints . 1.1.3 Numerical Optimization . . . . . . . . . 1.2 Euler-Lagrange and Optimal control . . . . . . 1.2.1 Optimization over time . . . . . . . . . 1.2.2 Miscellaneous items . . . . . . . . . . . 1.3 Linear system / ARE . . . . . . . . . . . . . . 1.3.1 Another Example . . . . . . . . . . . . . 1.4 Symmetric root locus . . . . . . . . . . . . . . . 1.4.1 Discrete case . . . . . . . . . . . . . . . 1.4.2 Predictive control . . . . . . . . . . . . . 1.4.3 Other applied problems . . . . . . . . .

. . . . . . . . . . . . .

2 Dynamic Programming (DP) - Optimal Control 2.1 Bellman . . . . . . . 2.2 Examples: . . . . . . 2.2.1 Routing . . . 2.2.2 City Walk . . 2.3 General Formulation 2.4 LQ Cost . . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

v

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

157

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. 157 . 157 . 157 . 159 . 159 . 159 . 161 . 161 . 162 . 162 . 163 . 164 . 165

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. 167 . 168 . 168 . 168 . 168 . 169

167

2.5 Hamilton-Jacobi-Bellman (HJB) Equations . . . . . . . . . . . . . . . . . . . . . . . 170 2.5.1 Example: LQR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 2.5.2 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

3 Introduction to Stability Theory

3.1 Comments on Non-Linear Control . . . . . . . . . . . 3.1.1 Design Methods . . . . . . . . . . . . . . . . . 3.1.2 Analysis Methods . . . . . . . . . . . . . . . . 3.2 Describing Functions . . . . . . . . . . . . . . . . . . . 3.3 Equivalent gains and the Circle Theorem . . . . . . . 3.4 Lyapunovs Direct Method . . . . . . . . . . . . . . . . 3.4.1 Example . . . . . . . . . . . . . . . . . . . . . . 3.4.2 Lyapunovs Direct Method for a Linear System 3.4.3 Comments . . . . . . . . . . . . . . . . . . . . . 3.5 Lyapunovs Indirect Method . . . . . . . . . . . . . . . 3.5.1 Example: Pendulum . . . . . . . . . . . . . . . 3.6 Other concepts worth mentioning . . . . . . . . . . . .

4 Stable Adaptive Control

4.1 Direct Versus Indirect Control . . . . . . . . . 4.2 Self-Tuning Regulators . . . . . . . . . . . . . 4.3 Model Reference Adaptive Control (MRAC) . 4.3.1 A General MRAC . . . . . . . . . . .

5 Robust Control

5.1 MIMO systems . . . . . . . . . . . . . . . . 5.2 Robust Stability . . . . . . . . . . . . . . . 5.2.1 Small gain theorem (linear version) . 5.2.2 Modeling Uncertainty . . . . . . . . 5.2.3 Multiplicative Error . . . . . . . . . 5.3 2-port formulation for control problems . . 5.4 H1 control . . . . . . . . . . . . . . . . . . 5.5 Other Terminology . . . . . . . . . . . . . .

. . . . . . . .

173

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. 173 . 173 . 173 . 173 . 175 . 178 . 180 . 181 . 181 . 182 . 182 . 183

183

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. 183 . 184 . 185 . 187

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. 190 . 191 . 191 . 192 . 193 . 195 . 196 . 199

189

VIII Neural Control

200

1 Heuristic Neural Control

200

1.1 1.2 1.3 1.4

Expert emulator . . . . . . . . . . . . . Open loop / inverse control . . . . . . . Feedback control - ignoring the feedback Examples . . . . . . . . . . . . . . . . . 1.4.1 Electric Arc furnace control . . . 1.4.2 Steel rolling mill . . . . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

2 Euler-Lagrange Formulation of Backpropagation

vi

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. 200 . 201 . 205 . 205 . 205 . 209

213

3 Neural Feedback Control

3.1 Recurrent neural networks . . . . . . . . . . . . . . . . . . 3.1.1 Real Time Recurrent Learning (RTRL) . . . . . . 3.1.2 Dynamic BP . . . . . . . . . . . . . . . . . . . . . 3.2 BPTT - Back Propagation through Time . . . . . . . . . 3.2.1 Derivation by Lagrange Multipliers . . . . . . . . . 3.2.2 Diagrammatic Derivation of Gradient Algorithms: 3.2.3 How do RTRL & BPTT Relate . . . . . . . . . .

. . . . . . .

. . . . . . .

214

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. 215 . 215 . 216 . 217 . 218 . 219 . 219

4.1 Summary of methods for desired response . . . . . . . . . . . . 4.1.1 Video demos of Broom balancing and Truck backing . . 4.1.2 Other Misc. Topics . . . . . . . . . . . . . . . . . . . . . 4.1.3 Direct Stable Adaptive Control . . . . . . . . . . . . . . 4.1.4 Comments on Controllability / Observability / Stability

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. 220 . 222 . 229 . 229 . 229

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. 234 . 234 . 235 . 238 . 240 . 241 . 242 . 243 . 243 . 243

4 Training networks for Feedback Control

5 Reinforcement Learning

5.1 Temporal Credit Assignment . . . . . . . . . 5.1.1 Adaptive Critic (Actor - Critic) . . . . 5.1.2 TD algorithm . . . . . . . . . . . . . . 5.2 Broom Balancing using Adaptive Critic . . . 5.3 Dynamic Programming Perspective . . . . . . 5.3.1 Heuristic DP (HDP) . . . . . . . . . . 5.4 Q-Learning . . . . . . . . . . . . . . . . . . . 5.5 Model Dependant Variations . . . . . . . . . 5.6 Relating BPTT and Reinforcement Learning 5.7 LQR and Reinforcement Learning . . . . . .

6 Reinforcement Learning II

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

6.1 Review . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Immediate RL . . . . . . . . . . . . . . . . . . . . . 6.2.1 Finite Action Set . . . . . . . . . . . . . . . . 6.2.2 Continuous Actions . . . . . . . . . . . . . . 6.3 Delayed RL . . . . . . . . . . . . . . . . . . . . . . . 6.3.1 Finite States and Action Sets . . . . . . . . . 6.4 Methods of Estimating V  (and Q ) . . . . . . . . . 6.4.1 n-Step Truncated Return . . . . . . . . . . . 6.4.2 Corrected n-Step Truncated Return . . . . . 6.4.3 Which is Better: Corrected or Uncorrected? 6.4.4 Temporal Di erence Methods . . . . . . . . . 6.5 Relating Delayed-RL to DP Methods . . . . . . . . . 6.6 Value Iteration Methods . . . . . . . . . . . . . . . . 6.6.1 Policy Iteration Methods . . . . . . . . . . . 6.6.2 Continuous Action Spaces . . . . . . . . . . .

7 Selected References on Neural Control 8 Videos vii

. . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

219

230

244

. 244 . 244 . 244 . 245 . 246 . 246 . 247 . 247 . 247 . 247 . 248 . 249 . 249 . 250 . 251

251 252

IX Fuzzy Logic & Control

253

1 2 3 4

253 253 254 255

Fuzzy Systems - Overview Sample Commercial Applications Regular Set Theory Fuzzy Logic 4.1 4.2 4.3 4.4 4.5 4.6

De nitions . . . . . Properties . . . . . Fuzzy Relations . . Boolean Functions Other De nitions . Hedges . . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

5 Fuzzy Systems 5.1 5.2 5.3 5.4 5.5

A simple example of process control. . . . . . Some Strategies for Defuzzi cation . . . . . . Variations on Inference . . . . . . . . . . . . . 7 Rules for the Broom Balancer . . . . . . . . Summary Comments on Basic Fuzzy Systems

6 Adaptive Fuzzy Systems

6.1 Fuzzy Clustering . . . . . . . . . . . . . . . 6.1.1 Fuzzy logic viewed as a mapping . . 6.1.2 Adaptive Product Space Clustering . 6.2 Additive Model with weights (Kosko) . . . 6.3 Example Ad-Hoc Adaptive Fuzzy . . . . . . 6.4 Neuro-Fuzzy Systems . . . . . . . . . . . . . 6.4.1 Example: Sugene Fuzzy Model . . . 6.4.2 Another Simple Example . . . . . .

7 Neural & Fuzzy 7.1 7.2 7.3 7.4 7.5

NN as design Tool . . . . . . . . . NN for pre-processing . . . . . . . NN corrective type . . . . . . . . . NN for post-processing . . . . . . . Fuzzy Control and NN system ID .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . .

. 255 . 256 . 257 . 257 . 258 . 258

259

. 260 . 262 . 262 . 264 . 264

265

. 265 . 265 . 266 . 266 . 267 . 267 . 268 . 269

269

. 270 . 270 . 271 . 271 . 271

8 Fuzzy Control Examples

272

9 Appendix - Fuzziness vs Randomness

275

8.1 Intelligent Cruise Control with Fuzzy Logic . . . . . . . . . . . . . . . . . . . . . . . 272 8.2 Fuzzy Logic Anti-Lock Brake System for a Limited Range Coecient of Friction Surface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

viii

X Exercises and Simulator

277

HW 1 - Continuous Classical Control HW 2 - Digital Classical Control HW 3 - State-Space HW 4 - Double Pendulum Simulator - Linear SS Control Midterm Double Pendulum Simulator - Neural Control Double Pendulum Simulator Documents

277 277 277 277 277 277 277

0.1 System description for double pendulum on a cart . . . . . . . . . . . . . . . . . . . 278 0.2 MATLAB les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280

ix

ECE553 - Control Systems: Classical, Neural, and Fuzzy Applications of modern control systems range from advanced aircraft, to processes control in integrated circuit manufacturing, to fuzzy washing machines. The aim of this class is to integrate di erent trends in control theory. Background and perspective is provided in the rst half of the class through review of basic classical techniques in feedback control (root locus, bode, etc.) as well as state-space approaches (linear quadratic regulators, Kalman estimators, and introduction to optimal control). We then turn to more recent movements at the forefront control technology. Arti cial neural network control is presented with emphasis on nonlinear dynamics, backpropagation-through-time, model reference control, and reinforcement learning. Finally, we cover fuzzy logic and fuzzy systems as a simple heuristic based, yet often e ective, alternative for many control problems. Instructor: Eric A. Wan Room 581, Phone (503) 690-1164, Internet: [email protected].

Web Page:

http://www.ece.ogi.edu/~ericwan/ECE553/

Grading:

Homework-45%, Midterm-25%, Project-30%

Prerequisites:

Digital signal processing, statistics, MATLAB programming.

Required Text: 1. E. Wan. Control Systems: Classical, Neural, and Fuzzy, OGI Lecture Notes.

Recommended Texts: (General Control)

1. G. Franklin, J. Powell, M. Workman. Digital Control of Dynamic Systems, 2nd ed. AddisonWesley, 1990. 2. G. Franklin, J. Powell, A. Emami-Naeini. Feedback Control of Dynamic Systems, 3rd ed. Addison-Wesley, 1994. 3. B. Friedland. Control Systems Design: An introduction to state-space methods, McGraw-Hill, 1986 4. C. Phillips, H. Nagle, Digital Control System analysis and design. Prentice-Hall, 1984. 5. B. Shahian, M. Hassul. Control Systems Design Using MATLAB. Prentice Hall, 1993. 6. T. Kailath. Linear Systems. Prentice Hall, 1980 (Optimal Control) 1. A. E. Bryson, Jr., Y. Ho. Applied optimal control : optimization, estimation, and control. Hemisphere Pub. Corp, 1975. x

2. M. Edorardo. Optimal, Predictive, and Adaptive Control. Englewood Cli s, NJ, Prentice Hall, 1995. 3. D. Kirk, Optimal Control Theory: An Introduction. Prentice Hall, 1970. (Adaptive Control) 1. K. S. Narendra, A. M. Annaswamy. Stable adaptive systems. Prentice Hall, 1989. 2. G. Goodwin, K Sin, Adaptive Filtering, Prediction, and Control, Prentice-Hall, 1984. 3. S. Sastry, M. Bodson. Adaptive Control, Stability, Convergence, and Robustness. Prentice Hall, 1989. 4. K. J. Astrhom, B. Wittenmark. Adaptive Control. Addison-Wesley, 1989. (Robust / H1 Control) 1. J. C. Doyle, B. A. Francis, A. R. Feedback control theory, Macmillan Pub. Co., 1992. 2. M. Green, D. Limebeer, Linear Robust Control, Prentice Hall, 1995. (Neural and Fuzzy Control) 1. Handbook of intelligent control : fuzzy, neural, and adaptive approaches, edited by David A. White, Donald A. Sofge, Van Nostrand Reinhold, 1992. (Strongly recommended but not required.) 2. Neural Networks for Control, edited by W.T Miller, R. Sutton, P. Werbos. MIT Press, 1991. 3. Reinforcement Learning, R. Sutton, A. Barto, MIT Press, 1998. 4. Neuro-dynamic programming, Dimitri P. Bertsekas and John N. Tsitsiklis, Athena Scienti c, Belmont, 1997. 5. Neurocontrol: Towards An Industry Control Methodology, Tomaas Hrycej, Wiley 1997. 6. B. Kosko, Neural Networks and Fuzzy Systems, Prentice Hall, 1992. 7. Essentials of Fuzzy Modeling and Control, R. Yager, D. Filev, John Wiley and Sons, 1994. 8. E. Cox, The Fuzzy Systems Handbook: A Practitioner's Guide to Building, Using, and Maintaining Fuzzy Systems, Academic Press, 1994. 9. Fuzzy Logic Technology & Applications, edited by F.J. Marks II, IEEE Press, 1994. 10. F. M. McNeill and E. Thro. Fuzzy Logic: A practical approach, Academic Press, 1994. 11. Fuzzy Sets and Applications, edited by R.R. Yager, John Wiley and Sons, New York, 1987.

xi

Tentative Schedule  Week 1 { Introduction, Basic Feedback Principles  Week 2 { Bode Plots, Root Locus, Discrete Systems  Week 3 { State Space Methods, Pole Placement, Controllability and Observability  Week 4 { Optimal Control and LQR, Kalman lters and LQG  Week 5 { Dynamic Programming, Adaptive Control or Intro to Robust Control  Week 6 { Neural Networks, Neural Control Basics  Week 7 { Backpropagation-through-time, Real-time-recurrent learning, Relations to optimal con   

trol Week 8 { Reinforcement Learning, Case studies Week 9 { Fuzzy Logic, Fuzzy Control Week 10 { Neural-Fuzzy, Other Finals Week { Class Presentations

xii

Part I

Introduction What is "control"? Make x do y.

Manual control: human-machine interface, e.g., driving a car. Automatic control (our interest): machine-machine interface (thermostat, moon landing, satellites, aircraft control, robotics control, disk drives, process control, bioreactors).

0.1 Basic Structure Feedback control:

This is the basic structure that we will be using. In the digital domain, we must add D/A and A/D converters:

where ZOH (zero-order hold) is associated with the D/A converter, i.e., the value of the input held constant until the next value is available.

0.2 Classical Control

What is "classical" control? From one perspective, it is any type of control that is non-neural or nonfuzzy. More conventionally, it is control based on the use of transfer functions, G(s) (continuous) or G(z ) (discrete) to represent linear di erential equations.

1

If G(z ) = b(z )=a(z ), then the roots of a(z ) (referred to as poles) and the roots of b(z ) (referred to as zeros), determine the open-loop dynamics. The closed-loop dynamic response of the system is:

y = DG r 1 + DG

(1)

What is the controller, D(z )? Examples:  k - (proportional control)  ks - (di erential control)  k/s - (integral control)  PID (combination of above)  lead/lag Classical Techniques:  Root locus  Nyquist  Bode plots

0.3 State-Space Control

State-space, or "modern", control returns to the use of di erential equations:

x_ = Ax + bu y = Hx

(2) (3)

Any linear set of linear di erential equations can be put in this standard form were x is a state-vector. Control law: given x, control u = ;kx + r

2

In large part, state-space control design involves nding the control law k. Common methods include: 1) selecting a desired set of closed loop pole location or 2) optimal control, which involves the solution of some cost function. For example, the solution of the LQR (linear quadratic regulator) problem is expressed as the solution of k which minimizes

Z1

;1

(xT Qx + uT Rudt

and addresses the optimal trade-o between tracking performance and control e ort. We can also address issues of:  controllability  observability  stability  MIMO How to nd the state x? Build an estimator:

with noise (stochastic), we will look at Kalman estimators which yields the LQG (Linear Quadratic Gaussian)

0.4 Advanced Topics

0.4.1 Dynamic programming

Used to solve for general control law u which minimizes some cost function. This may be used, for example, to solve the LQR problem, or some nonlinear u = f (x) where the system to be controlled is nonlinear. Also used for learning trajectory control (terminal control). Type classes of control problems: a) Regulators ( xed point control) or tracking. 3

b) Terminal control is concerned with getting from point a to point b. Examples: a robotics manipulator, path-planning, etc. Terminal control is often used in conjunction with regulator control, where we rst plan an optimal path and then use other techniques to track that path. Variations: a) Model predictive control: This is similar to LQR (in nite Rhorizon) but you use a nite horizon and resolve using dynamic programming at each time step: tN (u2 + Qy 2)dt. Also called receding horizon problem. Popular in process control. 0

b) Time-optimal control: Getting from point a to point b in minimum time. e.g. solving the optimal trajectory for an airplane to get to a desired location. It is not a steady ascent. The optimal is to climb to a intermediary elevation, level o , and then swoop to the desired height. c) Bang-bang control: With control constraints, time-optimal control may lead to bang-bang control (hard on / hard o ).

0.4.2 Adaptive Control Adaptive control may be used when the system to be controlled is changing with time. May also be used with nonlinear system when we still want to use linear controllers (for di erent regimes). In it's basic form, adaptive control is simply gain scheduling: switch in pre-determined control parameters. Methods include: self-tuning regulators and model reference control

0.4.3 Robust Control / H1

Robust control deals with the ability of a system to work under uncertainty and encompasses advanced mathematical methods for dealing with the same. More formally, it minimizes the maximum singular value of the discrepancies between the closed-loop transfer function matrix and the desired 4

loop shape subject to a closed-loop stability constraint. It is a return to transfer function methods for MIMO systems while still utilizing state-space techniques.

0.5 History of Feedback Control

 Antiquity - Water clocks, level control for wine making etc. (which have now become modern

ush toilets)  1624, Drebble - Incubator (The sensor consisted of a riser lled with alcohol and mercury. A the re heats up the box, the alcohol expands and the riser oats up lowering the damper on the ue.)

 1728, Watt - Flyball governor

 1868, Maxwell - Flyball stability analysis (di erential equations ! linearization ! roots of

\characteristic equation" need be negative). 2nd and 3rd order systems.  1877, Routh - General test for stability of higher order polynomials.  1890, Lyapunov - Stability of non-linear di erential equations (introduced to state-space control in 1958)  1910, Sperry - Gyroscope and autopilot control 5

 1927, Black - Feedback ampli er, Bush - Di erential analyzer (necessary for long distance           

telephone communications) 1932, Nyquist stability Criterion 1938, Bode - Frequency response methods. 1936 - PID control methods 1942, Wiener - Optimal lter design (control plus stochastic processes) 1947 - Sampled data systems 1948, Evans - Root locus (developed for guidance control of aircraft) 1957, Bellman - Dynamic Programming 1960, Kalman - Optimal Estimation 1960, State-space or \modern" control (this was motivated from work on satellite control, and was a return to ODE's) 1960's - MIMO state-space control, adaptive control 1980's - Zames, Doyle - Robust Control

1 Neural Control Neural control (as well as fuzzy control) was developed in part as a reaction by practitioners to the perceived excessive mathematical intensity and formalism of "classical" control. Although neural control techniques have been inappropriately used in the past, the eld of neural control is now starting to mature.

Early systems: open loop: C  P ;1

6

Feedback control with neural networks:

 Train by back-propagation-through-time (BPTT) or real-time-recurrent-learning (RTRL).  May have similar objectives and cost functions (as in LQR, minimum-time, model-reference,

etc.) as classical control, but solution are iterative and approximate.  "Approximately optimal control" - optimal control techniques and strategies constrained to be approximate by nature of training and network architectural constraints.  Often little regard for "dynamics" - few theoretical results regarding stability, controllability, etc.

Some advantages:  MIMO = SISO  Can handle non-linear systems  Generates good results in many problems

1.0.1 Reinforcement Learning

A related area of neural network control is reinforcement learning ("approximate dynamic programming") Dynamic programming allows us to do a stepwise cost-minimization in order to solve a more complicated trajectory optimization. Bellman Optimality Condition: An optimal policy has the property that whatever the initial state and the initial decision are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the rst decision.

7

Short-term, or step-wise, maximization of J  leads to long term maximization of u(k). (Unfortunately, problems grows exponentially with number of variables).

To minimize some utility function along entire path (to nd control u(k)), need only minimize individual segments:  J (xk;1) = min uk [r(xk ; uk ) + J (xk )]

In general, dynamic programming problems can be extremely dicult to solve. In reinforcement learning, an adaptive critic is used to get an approximation of J  .

(These methods are more complicated that other neural control strategies, are hard to train, have many unresolved issues, but o er great promise for future performance.) 8

1.1 History of Neural Networks and Neural Control    

     

1943, McCoulloch & Pitts - Model of arti cial neuron 1949, Hebb - simple learning rule 1957, Rosenblatt - Perceptron 1957, Bellman - Dynamic Programming (origins of reinforcement learning, 1960 - Samuel's learning checker game) 1959, Widrow & Ho - LMS and Adalines (1960 - \Broom Balancer" control) 1967-1982 \Dark Ages" 1983 Barto, Anderson, Sutton - Adaptive Heuristic Critics 1986 Rumelhart, McClelland, et al. - Backpropagation (1974 - Werbos, 1982 - Parker) 1989 Nguyen, Werbos, Jordan, etc. - Backpropagation-Through-Time for control 1990's Increased sophistication, applications, some theory, relation to \classical" control recognized.

2 Fuzzy Logic 2.1 History    

1965, L. Zadeh - Fuzzy Sets 1974, Mamdani & Assilan - Steam engine control using fuzzy logic, other examples. 1980's Explosion of applications from Japan (fuzzy washing machines). 1990's Adaptive Fuzzy Logic, Neural-Fuzzy, etc.

9

2.2 Fuzzy Control

1. 2. 3. 4.

No regard for dynamic, stability, mathematical modeling Simple to design Combines heuristic "linguistic" rule-based knowledge with smooth control Elegant "gain scheduling" and interpolation

Fuzzy logic makes use of "membership functions" which introduce an element of ambiguity, e.g., the "degree" to which we may consider zero to be zero.

Because of its use of intuitive rules, fuzzy logic can be used appropriately in a wide range of control problems where mathematical precision is not important, but it is also often misused. Newer methods try to incorporate ideas from neural networks to adapt the fuzzy systems (neural-fuzzy).

10

2.3 Summary Comments

Classical (and state-space) control is a mature eld that utilizes rigorous mathematics and exact modeling to exercise precise control over the dynamic response of a system. Neural control overlaps much with classical control. It is less precise in its formulation yet may yield better performance for certain applications. Fuzzy control is less rigorous, but is a simple approach which generates adequate results for many problems. There is a place and appropriate use for all three methods.

11

Part II

Basic Feedback Principles This handout brie y describes some fundamental concepts in Feedback Control.

1 Dynamic Systems - \Equations of Motion" Where do system equations come from?

 Mechanical Systems

12

 Rotational Systems T = I

(Torque) = = (moment of inertia)  (angular acceleration)

{ Satellite

{ Pendulum

13

{ \Stick on cart" / Inverted Pendulum (linearized equations)

14

{ Boeing Aircraft

15

 Electrical Circuits

16

 Electro-mechanical

 Heat Flow

17

 Incompressible Fluid Flow

 Bio-reactor

18

2 Linearization Consider the pendulum system shown.

θ

(mg)sinθ

 = ml2 + mgl sin 

(4)

Two methods are typically used in the linear approximation of non-linear systems.

2.1 Feedback Linearization

 = mgl sin  + u

(5)

then,

ml2  = u

Linear always! This method of linearization is used in Robotics for manipulator control.

2.2 Small Signal Linearization

 =  ; sin  form = g = l = 1:  is a function of  and  ; f (; ) . Using a Taylors Expansion, @f @f f (; ) = f (0; 0) + @ 0;0  + @  + : : : higher order terms 0;0 f (0; 0) = 0 at equilibrium point. So, and for an inverted pendulum

(6)

(7) (8)

 = 0 + (; cos )j0;0  +  = ; +   = 0 + (; cos )j0;  +  =  + 

These linearized system models should then be tested on the original system to check the acceptability of the approximation. Linearization does not always work, as can be seen from systems below. Consider the following function y_1 = y13 versus y_2 = ;y23 , 19

y 1

y 2

t y 2

y 1

Linearizing both systems yields y_i = 0. However, this is not correct since it would imply that both systems have similar responses.

3 Basic Concepts

3.1 Laplace Transforms F (s) =

Z1 0

f (t) e;st dt

(9)

The inverse is usually computed by factorization and transformation to the time domain.

L[ f(t) ] (t)

f(t) 1

1(t)

1 1s s12 s+a 1 (s+a)2 a s2 +a2 s s2 +a2 s+a (s+a)2 +b2

t

e;at te;at sin at cos at

e;at cos at

Table 1: Some Standard Laplace Transforms

3.1.1 Basic Properties of Laplace Transforms Convolution Z1 y (t) = h(t) ? u(t) =

;1

h( ) u(t ;  )dt

Y (s) = H (s) U (s) 20

(10) (11)

Derivatives y_ $ sY (s) ; y (0)

(12)

y(n) + an;1 y (n;1) + : : : + a1y_ + a0y = bmum + bm;1um;1 + : : : + b0u

(13)

m m;1 Y (s) = bmssn ++a bm;s1ns;1 + +: : :: :+: +a b0 U (s)

(14)

Y (s) = H (s) = b(s) U (s) a(s)

(15)

n;1

for y (0) = 0.

0

H(s) - Transfer Function

Example: A two mass system represented by two second order coupled equations:

x + mb (x_ ; y_ ) + mk (x ; y ) = mU 1

1

1

y + mb (y_ ; x_ ) + mk (y ; x) = 0 2

2

s2X (s) + mb (s X (s) ; s Y (s)) + mk (X (s) ; Y (s)) = Um(s) 1

1

1

s2 Y (s) + mb (s Y (s) ; X (s)) + mk (Y (s) ; X (s)) = 0 2

2

After some algebra we nd that, UY ((ss)) = (m s +b s + k)(mb s+ +k b s + k) ; (b + k) 1

2

2

2

3.2 Poles and Zeros Consider the system,

H (s) = s2 2+s 3+s 1+ 2 b(s) = 2 (s + 21 ) ! zero : ;21 a(s) = (s + 1) (s + 2) ! poles : ; 1; ;2

21

2

x

x o

H (s) = s;+11 + s +3 2 ; h(t) = ;e;t + e;2t The response can be empirically estimated by an inspection of the pole-zero locations. For stability, poles have to be in the Left half of the s-Plane (LHP). Control is achieved by manipulating the pole-zero locations.

3.3 Second Order Systems !n2 H (s) = s2 + 2! s + !2 n

n

 = damping ratio !n = natural frequency

q

s = ; ; j!d;  = !n ; !d = !n 1 ;  2

damping = 0 ! oscillation = 1 ! smooth damping to nal level  1 ! some oscillation; can realize faster response 22

(16)

3.3.1 Step Response

Step Response = Hs(s)

y (t) = 1 ; e;t(cos !d t + ! sin !d t) d

(18)

Rise time : tr  1:8

(19)

Overshoot : Mp  1 ; 0:6 ; 0    0:6

(20)

!n

Typical values are :

(17)

ts = 4:6

M = 0:16 for  = 0:5 M = 0:4 for  = 0:707

23

(21)

24

Design Speci cations For speci ed tr , Mp and ts

!n  1t:8

(22)

  0:6 (1 ; Mp)

(23)

  4t:6

(24)

r

s

Pole Locations for a given σ

for a given damping ξ

for a given frequencyω

3.4 Additional Poles and Zeros H1(s) = (s + 1)(2 s + 2) = s +2 1 ; s +2 2 s + 1:1) = 0:18 + 1:64 H2 (s) = 1:1(2(s + 1)(s + 2) s + 1 s + 2 Here, a zero has been added near one of the poles. The 1.1 factor in the denominator adjusts the DC gain, as can be seen from the Final Value Theorem : lim y (t) = slim !0 sY (s)

t!1

(25)

Note, the zero at -1.1 almost cancels the in uence of the Pole at -1. As s ! 0, the DC gain is higher by a factor of 1.1, hence the factor in the denominator above.

 As Zero approaches origin ! increased overshoot.  Zero in RHP results in non-minimum phase system and a direction reversal in the time response.  Poles dominated by those nearest the origin.  Poles / Zeros can "cancel" in LHP relative to step response, but may still a ect initial conditions.

25

(zs+1)/(s^2+s+1) 3.5

3

2.5

Amplitude

2

1.5

1

0.5

0

−0.5 0

2

4

6 8 Time (secs)

10

12

14

1/(ps+1)(s^2+s+1) 1.2

1

Amplitude

0.8

0.6

0.4

0.2

0 0

5

10

15

Time (secs)

3.5 Basic Feedback r

e

+

H(s)

k

y

-

E (s) = R(s) ; Y (s)

(26)

Y (s) = k H (s) E (s)

(27)

Y (s) = k H (s) (R(s) ; Y (s))

(28)

(1 + kH (s))Y (s) = kH (s)R(s)

(29)

Y (s) = kH (s) ; E (s) = 1 R(s) 1 + kH (s) R(s) 1 + kH (s)

(30)

26

(s) ! ; kH (s) ! 1 (31) With k large, 1 +kHkH (s) kH (s) We need to consider the system dynamics. Large k may make the system unstable. Example: 1 s(s + 2) The closed loop characteristic equation:

s2 + 2s + k = 0

x

x

0.5 0 0

0.4

0.6

0.8 1 1.2 1.4 Time (secs) proportional feedback, k =1

4

6 8 Time (secs) proportional feedback, k =10

1.6

1.8

2

1

Amplitude

Example 2:

0.2

0.5

Amplitude

Amplitude

Amplitude

step response 1

0 0

2

10

12

14

2 1 0 0

0.5

1

1.5

0.5

1

1.5

2

2.5 3 3.5 Time (secs) proportional feedback, k =100

4

4.5

5

4

4.5

5

2 1 0 0

2

2.5 3 Time (secs)

3.5

1 H (s) = s [ (s + 4) 2 + 16 ]

The closed loop characteristic equation:

s [ (s + 4)2 + 16 ] + k = 0 x x x

.

27

0.02 0 0

0.1

0.2

0.3

0.4

0.5 0.6 0.7 Time (secs) proportional feedback, k =1

0.8

0.9

1

20

40

60

80

100 120 140 Time (secs) proportional feedback, k =100

160

180

200

0.5

1

1.5

2 2.5 3 3.5 Time (secs) proportional feedback, k =275

4

4.5

5

0.05

0.1

0.15

0.4

0.45

0.5

1 0.5

Amplitude

Amplitude

Amplitude

Amplitude

step response 0.04

0 0

2 1 0 0

2 1 0 0

0.2

3.6 Sensitivity SXY =4

0.25 0.3 Time (secs)

@Y Y @X X

0.35

@Y =X Y @X

(32)

SXY is the \sensitivity of Y with respect to X ". Denotes relative changes in Y to relative changes in X (s) H (s) = 1 +kGkG (33) (s) @H = 1 ! 0 ; jKGj large SKH = K (34) H @K 1 + KG

Thus we see that feedback reduces the parameter sensitivity. Example: Motor Ω

ko

r

1/ko

Shaft Speed

s+1

By Final Value Theorem, the nal state is = 1. But, suppose we are o with the plant gain

ko ! ko + k0, then,

output = k1 (k0 + k0 ) =  + 1 0 Thus, a 10% error in k0 ) 10% error in Speed control. ko + -

k

s+1

28

(35)

k sk+1 0

1 + skk+10

= s + 1kk+0 kk

(36)

0

0 Final values = 1 +kkkk 0

(37)

Set k2 = 1 +kkkk0 0

ko

r + -

k2

k

Sensitivity for k0 ! k0 + k0

s+1



0) Final value = k2 1 +k (kk(0k+ +kk 0 0)

2 k2 4

3 5

1



1 + k(k +1 k ) 1 1;x 1+x     0) ; 1 k2 1 ; k(k +1 k ) = 1 +kkkk0 k2 k(kk(0k+ +kk 0 0 0 0 0) = 1 + 1 +1kk  0 for k large ! reduced sensitivity. 0

(38) (39)

0

(40) (41) (42)

Example:

 Integral Control ko

r + -

k/s

kk0 s (s+1) k k0 + 1 s s+1

s+1

= s (s +k1)k0+ k k

0

Final value 29

(43)

  lim 0 s ! 0 s 1s s(s +kk 1) + kk0 = 1

(44)

0 Steady State Error - Always !

 Proportional Control faster x proportional

Increasing k, increases speed of response.

 Integral Control slower response overshoot x

x

Slower response, but more oscillations.

3.7 Generic System Tradeo s ω r

e

+

µ D

+

y G

+ γ

For example:

Error

D(s) = +k ; Proportional Control G ;DG Y (s) = 1 +DG DG R(s) + 1 + DG (s) + 1 + DG ;(s)

(45)

E (s) = 1 +1DG R(s) + 1 +;G

(s) + ;1 ;(s) DG 1 + DG

(46)

 Disturbance rejection

jDGj  1 30

 Good tracking ; E small

jDGj  1

 Noise Immunity

jDGj

small

3.8 Types of Control - PID  Proportional  Integral

D(s) = k ; u(k) = ke(t):

(47)

Zt D(s) = T1 ks ; u(t) = Tk e(t)dt

(48)

D(s) = k TD s

(49)

i

i 0

) Zero steady state error ( may slow down dynamics)  Derivative

! increases damping and improves stability. Example: M damping

G(s) = s2 +1 as = s (s 1+ a)

x

x

31

With derivative Pole-Zero Cancellation x

x Closed loop pole trapped here

But what about initial conditions ? (y) + a (y_ ) = u(t)

s2 Y (s) + s y (0) + a s Y (s) + a y(0) = U (s) Y (s) = s(ss++aa) y(0) + s (Us (+s)a) (s+a)Yo

r

e

+

ks

+

-

or Yo/s

1 ____ s(s+a)

+

y

Relative to initial value,

Y (s) =

y(0) s 1 + s+k a

y(0) lim y (t) = slim s s t!1 !0 1 + s+k a

! 1y+(0)k 6= 0 a

Thus, the e ect due to initial conditions is not negligible.  PID - Proportional - Integral - Derivative Control

kP + kD s + ksI Parameters are often tuned using " Ziegler - Nichols PID tuning" 32

r

+

e

y D

G

-

Figure 1:

3.9 Steady State Error and Tracking

The reference input to a control system is often of the form: k r(t) = kt ! 1(t)

(50)

R(s) = sk1+1

(51) In most cases, the reference input will not be a constant but can be approximated as a linear function of time for a time span long enough for the system to reach steady state. The error at this point of time is called the steady-state error. The type of input to the system depends on the value of k, as follows:  k=0 implies a step input (position)  k=1 implies a ramp input (velocity)  k=2 implies a parabolic input (acceleration) The steady state error of a feedback control system is de ned as:

e1 =4 tlim !1 e(t)

(52)

e1 = slim !0 sE (s)

(53)

where E(s) is the Laplace transform of the error signal and is de ned as: E (s) = 1 + D(1s)G(s) R(s) (54) (55) E (s) = 1 + D(1s)G(s) sk1+1  1 1 e1 = slim (56) !0 sk 1 + D(s)G(s) = 0; 1; or a constant Thus, the steady state error depends on the reference input and the loop transfer function.

System Type The system type is de ned as the order k for which e1 is a constant. This also equals number of open loop poles at the origin. Example: 33

(1 + 0:5s) is of type 1 D(s)G(s) = s(1k+ s)(1 + 2s)

(57)

D(s)G(s) = sk3 is of type 3

(58)

Steady-state error of system with a step-function input (k=0)  Type 0 system: 1 1 == e1 = 1 + DG (0) 1+K

(59)

p

where Kp is called the closed loop DC gain or the step-error constant and is de ned as:

Kp = slim !0 D(s)G(s)

(60)

e1 = 0

(61)

 Type 1 or higher system: (i.e., DG(0) = 1, due to pole at origin)

Steady-state error of system with a ramp-function input (k=1)  Type 0 system: e1 = 1

 Type 1 system:

(62)

1 1 == 1 e1 = slim = lim !0 s[1 + DG(s)] s!0 sDG(0) K

v

where, Kv is called the velocity constant.  Type 2 or higher system:

e1 = 0

34

(63)

(64)

4 Appendix - Laplace Transform Tables

35

36

37

Part III

Classical Control - Root Locus

1 The Root Locus Design Method 1.1 Introduction

 The poles of the closed-loop transfer function are the roots of the characteristic equation,    

which determine the stability of the system. Studying the behavior of the roots of the characteristic equation will reveal stability and dynamics of the system, keeping in mind that the transient behavior of the system is also governed by the zeros of the closed-loop transfer function. An important study in linear control systems is the investigation of the trajectories of the roots of the characteristic equation-or, simply, the root loci -when a certain system parameter varies. The root locus is a plot of the closed-loop pole locations in the s-plane (or z-plane). It provides an insightful method for understanding how changes in the gain of the system feedback in uence the closed loop pole locations. r

+

e KD(s)

G(s)

y

-

Figure 2:

1.2 De nition of Root Locus

The root locus is de ned as a plot of the solution of: 1 + kD(s)G(s) = 0 We can think of D(s)G(s) as having the following form: D(s)G(s) = ab((ss)) Then with feedback, kD(s)G(s) = kb(s) 1 + kD(s)G(s) a(s) + kb(s)

 The zeros of the open loop system do not move. 38

(65) (66) (67)

 The poles move as a function of k. The root locus of D(s)G(s) may also be de ned as the locus of points in the s-plane where the phase of D(s)G(s) is 180o . This is seen by noting that 1 + kD(s)G(s) = 0 if kD(s)G(s) = ;1, which implies that the phase of D(s)G(s) = 180o. At any point on the s-plane, 6 G = 6 due to zeros ; 6 due to poles

(68)

Example:

For example, consider the open-loop transfer function: s+1 s[((s + 2)2 + 4)(s + 5)] The pole-zero plot is shown below:

   

Assign a test point so = ;1 + 2j . Draw vectors directing from the poles and zeros to the point so . If so is indeed a point on the root locus, then equation 68 must equal ;180o. 6 G = 1 ; (1 + 2 + 3 + 4 )

1.3 Construction Steps for Sketching Root Loci

 Step #1: Mark the poles and zeros of the open-loop transfer function.  Step #2: Plot the root locus due to poles on the real axis. { The root locus lies to the left of the odd number of real poles and real zeros. { A single pole or a single zero on the real axis introduces a phase shift of 180o and since the left half of the s-plane is taken, the phase shift becomes negative. 39

{ Further, a second pole or a second zero on the real axis will introduce an additional

phase shift of 180o , making the overall phase-shift equal to 360o. Hence, the region is chosen accordingly. { Here are a few illustrations: 180o X

O

O

X

X

X

 Step #3: Plot the asymptotes of the root loci. { Asymptotes give the behavior of the root loci as k ! 1. { For 1k G(s) = 0, as k ! 1, G(s) must approach 0. Typically, this should happen at the

zeros of G(s), but, it could also take place if there are more poles than zeros. We know that b(s) has order m and a(s) has order n; i.e., let: b(s) = sm + b1sm;1 + ::::: (69) a(s) sn + a1 sn;1 + ::::: So, if n > m then as s ! 1, G(s) ! 0. That is, as s becomes large, the poles and zeros approx. cancel each other. Thus

1 + kG(s)  1 + k (s ; 1)n;m

= pni ;; mzi

(70) (71)

where, pi = poles, zi = zeros, and is the centroid.

{ There are n ; m asymptotes, where n is the number of zeros and m is the number of poles, and since 6 G(s) = 180o, we have:

(n ; m)l = 180o + (l)360o

(72)

For instance, n ; m = 3 ) l = 60o ; 180o; 300o.

{ The s give the angle where the asymptotes actually go to. Note that the angle of departure may be di erent and will be looked into shortly. 40

{ The asymptotes of the root loci intersect on the real axis at and this point of inter-

section is called the centroid. Hence, in other words, the asymptotes are centered at . { The following gures a few typical cases involving asymptotes (which have the same appearance as multiple roots):

 Step #4: Compute the angles of departure and the angles of arrival of the root loci. (optional-just use MATLAB) { The angle of departure or arrival of a root locus at a pole or zero denotes the angle of

the tangent to the locus near the point. { The root locus begins at poles and goes either to zeros or to 1, along the radial asymptotic lines. { To compute the angle of departure, take a test point so very near the pole and compute the angle of G(so ), using equation 72. This gives the angle of departure dep of the asymptote. Also, dep =  i ; i ; 180o ; 360ol (73) where, i = sum of the angles to the remaining poles and  i = sum of the angles to all the zeros. { For a multiple pole of order q:

qdep =  i ; i ; 180o ; 360ol

(74)

In this case, there will be q branches of the locus, that depart from that multiple pole. 41

{ The same process is used for the angle of arrival arr : q arr = i ;  i + 180o + 360ol

(75) where, i = sum of angles to all poles,  i = sum of all angles to remaining zeros, and q is the order of the zero at the point of arrival.

 Step #5: Determine the intersection of the root loci with the imaginary axis. (optional) { The points where the root loci intersect the imaginary axis of the s-plane (s = jw), and the corresponding values of k, may be determined by means of the Routh-Hurwitz criterion. { A root of the characteristic equation in the RHP implies that the closed-loop system is unstable, as tested by the R-H criterion. { Using the R-H criterion, we can locate those values of K , for which an incremental change will cause the number of roots in the RHP to change. Such values correspond to a root locus crossing the imaginary axis.

 Step #6: Determine the breakaway points or the saddle points on the root loci. (optional) { Breakaway points or saddle points on the root loci of an equation correspond to multipleorder roots of the equation.

Figure 3:

{ Figure 3(a) illustrates a case in which two branches of the root loci meet at the breakaway point on the real axis and then depart from the axis in opposite directions. In this case, the breakaway point represents a double root of the equation, when the value of K is assigned the value corresponding to the point. 42

{ Figure 3(b) shows another common situation when two complex-conjugate root loci ap{ { { {

proach the real axis, meet at the breakaway point and then depart in opposite directions along the real axis. In general, a breakaway point may involve more than two root loci. Figure 3(c) illustrates such a situation when the breakaway point represents a fourthorder root. A root locus diagram can have more than one saddle point. They need not always be on the real axis and due to conjugate symmetry of root loci, the saddle points not on the real axis must be in complex-conjugate pairs. All breakaway points must satisfy the following equations: dG(s)D(s) = 0 (76)

ds 1 + KG(s)D(s) = 0

(77) { The angles at which the root loci arrive or depart from a saddle point depends on the number of loci that are involved at the point. For example, the root loci shown in Figures 3(a) and 3(b) all arrive and break away at 180o apart, whereas in Figure 3(c), the four root loci arrive and depart with angles 90o apart. { In general, n root loci arrive or leave a breakaway point at 180=n degrees apart. { The following gure shows some typical situations involving saddle points.

43

1.4 Illustrative Root Loci  More examples:

order 2 O

X

X

O

X

X X

O X

X

X

O X

order 2 O

X

Figure 4:

 A MATLAB example:

+ 3)(s + 1  j 3) G(s) = s(s + 1)((ss + 2)3(s + 4)(s + 5  2j )

44

(78)

Figure 5:

1.5 Some Root Loci Construction Aspects

From the standpoint of designing a control system, it is often useful to learn the e ects on the root loci when poles and zeros of D(s)G(s) are added or moved around in the s-plane. Mentioned below are a few brief properties pertaining to the above.

E ects of Adding Poles and Zeros to D(s)G(s)  Addition of Poles: In general, adding a pole to the function D(s)G(s) in the left half of the s-plane has the e ect of pushing the root loci toward the right-half plane.

 Addition of Zeros: Adding left-half plane zeros to the function D(s)G(s) generally has the e ect of moving and bending the root loci toward the left-half s-plane.

Calculation of gain k from the root locus Once the root loci have been constructed, the values of k at any point on the loci can be determined. We know that 1 + kG(s) = 0 kG(s) = ;1 (79) 45

k = ; G1(s)

(80)

k = jG1(s)j

(81)

distance from so to zeros Graphically, k = distance from s to poles o

(82)

1.6 Summary

 The Root Locus technique presents a graphical method of investigating the roots of the

characteristic equation of a linear time-invariant system when one or more parameters vary.  The steps of construction listed above should be adequate for making a reasonably adequate plot of the root-locus diagram.  The characteristic-equation roots give exact indication on the absolute stability of the system. The zeros of the closed-loop transfer function also govern the dynamic performance of the system.

2 Root Locus - Compensation If the process dynamics are of such a nature that a satisfactory design cannot be obtained by a gain adjustment alone, then some modi cation of compensation of the process dynamics is indicated. Two common methods for dynamic compensation are lead and lag compensation.  Compensation with a transfer function of the form + zi D(s) = ss + (83) pi is called lead compensation if zi < pi and lag compensation if zi > pi .  Compensation is typically placed in series with the plant in the feedforward path as shown in the following gure:

Figure 6:

 It can also be placed in the feedback path and in that location, has the same e ect on the overall system poles.

46

2.1 Lead Compensation     

Lead compensation approximates PD control. It acts mainly to lower the rise time. It decreases the transient overshoot, hence improving the system damping. It raises the bandwidth. It has the e ect of moving the locus to the left. Illustration: consider a second-order system with transfer function

KG(s) = s(sK+ 1)

(84)

G(s) has the root locus shown by the solid line in gure 7. Let D(s) = s + 2. The root locus produced by D(s)G(s) is shown by the dashed line. This adds a zero at s = ;2. The modi ed locus is hence the circle.

Figure 7:

 The e ect of the zero is to move the root locus to the left, improving stability.  Also, by adding the zero, we can move the locus to a position having closed-loop roots and damping ratio   0:5  We have "compensated" then dynamics by using D(s) = s + 2.  The trouble with choosing D(s) based on only a zero is that the physical realization would

contain a di erentiator that would greatly amplify the high-frequency noise present from the sensor signal. Furthermore, it is impossible to build a pure di erentiator.  Try adding a pole at a high frequency, say at s = ;20, to give: 2 D(s) = ss++20 (85) The following gure shows the resulting root loci when p = 10 and p = 20. 47

Figure 8:

2.1.1 Zero and Pole Selection  Selecting exact values of zi and pi is done by trial and error.  In general, the zero is placed in the neighborhood of the closed-loop control frequency !n .  The pole is located at 3 to 20 times the value of the zero location.  If the pole is too close to the zero, then the root locus moves back too far towards its uncompensated shape and the zero is not successful in doing its job.  If the pole were too far to the left, then high-frequency noise ampli cation would result.

2.2 Lag Compensation

After obtaining satisfactory dynamic performance, perhaps by using one or more lead compensators, the low-frequency gain of the system may be found to be low. This indicates an integration at nearzero frequencies, and is achieved by lag compensation.  Lag compensation approximates PI control.  A pole is placed near s = 0 (low frequency). But, usually a zero is included near the pole, so that the pole-zero pair, called a dipole does not signi cantly interfere with the dynamic response of the overall system.  Choose D(s) = ss++pz ; z > p, where the values of z and p are small (e.g., z = 0:1 and p = 0:01).  Since z > p, the phase is negative, corresponding to a phase lag.  It improves the steady-state error by increasing the low-frequency gain.  Lag compensation however decreases the stability.

2.2.1 Illustration Again, consider the transfer function, as in equation 84.  Include the lead compensation D1(s) = (s + 2)=(s + 20) that produced the locus as in gure .  Raise the gain until the closed-loop roots correspond to a damping ratio of  = 0:707. At this point, the root-locus gain is found to be 31. 48

 The velocity constant is thus Kv = lims!0 sKDG = (31=10) = 3:1  Now, add a lag compensation of: 1 D2(s) = ss++00::01

(86)

This increases the velocity constant by about 10 (since z=p = 10) and keeps the values of both z and p very small so that D2(s) would have very little e ect on the dynamics of the system. The resulting root locus is as shown in Figure 9.

Figure 9:

 The very small circle near the origin is a result of the lag compensation.  A closed-loop root remains very near the lag compensation zero at ;:1, which will correspond

to a very slow decaying transient, which has a small magnitude because the zero will almost cancel the pole in the transfer function. However, the decay is so slow that this term may seriously in uence the settling time.  It is thus important to place the lag pole-zero combination at as high a frequency as possible without causing major shifts in the dominant root locations.  The transfer function from a plant noise to the system error will not have the zero, and thus, disturbance transients can be very long in duration in a system with lag compensation.

2.3 The "Stick on a Cart" example O

m

u

After normalization, we have:

 ;  = u 49

(87)

) s2(s) ; (s) = U (s)

(88)

(s) 1 U (s) = s2 ; 1

(89)

This results in the following model of the system: The root locus diagram is shown below. The u

θ

1/(s^2 - 1)

Figure 10:

X -1

X 1

Figure 11: above gure indicates an unstable system, irrespective of the gain.

 With lead compensation. u

+

e

1 2 s -1

s+α s+β

θ

-

X

O

X

50

X

 The root loci of the lead-compensated system are now in the LHP, which indicates a stable

system.  A slight variation may result in a system as shown below, which may be more satisfactory. This system may tend to be slower than the one considered above, but may have better damping.

X

X

2.4 Extensions

O

X

Extensions to Root Locus include time-delays, zero-degree loci, nonlinear functions, etc...

51

Part IV

Frequency Design Methods 1 Frequency Response Most of this information is covered in the Chapter 5 of the Franklin text. Frequency domain methods remain popular in spite of other design methods such as root locus, state space, and optimal control. They can also provide a good design in the face of plant uncertainty in the model. We start with an open-loop transfer function Y (s) = G(s) ! G(jw) U (s) Assume u(t) = sin(wt) For a liner system, y(t) = A sin(wt + ) The magnitude is given by A = jG(jw)j = jG(s)js=jw And the phase by ImG(jw) = 6 G(jw)  = arctan Re G(jw)

(90) (91) (92) (93) (94)

2 Bode Plots We refer to two plots when we talk about Bode plots  Magnitude plot - log10 magnitude vs. log10 w  Phase plot - phase vs. log10 w Given a transfer function in s s + z2)(: : :) KG(s) = K ((ss ++ pz1)( 1)(s + p2)(: : :) then there is a corresponding frequency response in jw 1 + 1)(jw2 + 1)(: : :) KG(jw) = K 0 (jw (jw)n(jwa + 1)(: : :) The magnitude plot then shows log10 KG(jw) = log10 K 0 + log10 jjw1 + 1j + : : : ; n log10 jjwj ; log10 jjwa + 1j ; : : : The phase plot shows 6 KG(jw) = 6 K + 6 (jw1 + 1) + : : : ; n90o ; 6 (jwa + 1) ; : : : There are three di erent terms to deal with in the previous equations: 52

(95) (96) (97) (98)

 K (jw)n  (jw + 1)1  (( wjwn )2 + 2 wjwn + 1)2

1. K (jw)n log10 K j(jw)nj = log10 K + n log10 jjwj (99) This term adds a line with slope n through (1,1) on the magnitude plot, and adds a phase of n  90 to the phase plot. (see gure)

2. (jw + 1)1 When w  1 then the term looks like 1. When w  1 the term looks like jw . This term adds a line with slope 0 for w < 1 and a line with slope 1 for w < 1 to the magnitude plot, and adds 90o of phase when w > 1 to the phase plot. (see gures)

3. (( wjwn )2 + 2 wjwn + 1)2 This term adds overshoot in the plots. (see gures)

53

54

See gures for sample Bode plots for the transfer function s + 0:5) (100) G(s) = s(2000( s + 10)(s + 50) Note that the command BODE in Matlab will create Bode plots given a transfer function.

55

Bode Diagrams

20 0

Phase (deg); Magnitude (dB)

−20 −40 −60

−50

−100

−150

−2

10

−1

10

0

1

10

10

2

10

3

10

Frequency (rad/sec)

2.1 Stability Margins

We can look at the open-loop frequency response to determine the closed-loop stability characteristics. The root locus plots jKG(s)j = 1 and 6 G(s) = 180o. There are two measures that are used to denote the stability characteristics of a system. They are the gain margin (GM) and the phase margin (PM). The gain margin is de ned to be the distance between jKG(jw)j and the magnitude = 1 line on the Bode magnitude plot at the frequency that satis es 6 KG(jw) = ;180o . See gures for examples showing how to determine the GM from the Bode plots. The GM can also be determined from a root locus plot as K j at s = jw (101) GM = jK j at jcurrent design point The phase margin is de ned as the amount by which the phase of G(jw) exceeds ;180o at the frequency that satis es jKG(jw)j = 1.

The damping ratio can be approximated from the PM as   PM (102) 100 See gures for examples showing how to determine the PM from the Bode plots. Also, there is a graph showing the relationship between the PM and the overshoot fraction, Mp . Note that if both the GM and the PM are positive, then the system is stable. The command MARGIN in Matlab will display and calculate the gain and phase margins given a transfer function.

56

57

2.2 Compensation

2.2.1 Bode's Gain-Phase Relationship

When designing controllers using Bode plots we should be aware of the Bode gain-phase relationship. That is, for any stable, minimum phase system, the phase of G(jw) is uniquely determined by the magnitude of G(jw) (see above). A fair approximation is 6 G(jw)  n  90o

(103)

where n is the slope of the curve of the magnitude plot. As previously noted, we desire 6 G(jw) > ;80o at jKG(jw)j = 1 so a rule of thumb is to adjust the magnitude response so that the slope at crossover (jKG(jw)j = 1) is approximately -1, which should give a nice phase margin. Consider the system

G(s) = s12

(104)

D(s) = K (TD s + 1)

(105)

Clearly the slope at crossover = -2. We can use a PD controller and pick a suitable K andTD = w1 to cause the slope at crossover to be -1. Figures below contain plots of the open-loop and the compensated open-loop Bode plots. 1

58

2.2.2 Closed-loop frequency response For the open-loop system, we will typically have

jG(jw)j  1 for w  wc , jG(jw)j  1 for w  wc

(106) (107)

where wc is the crossover frequency. We can then approximate the closed-loop frequency response by G(jw) ( 1 for w  w (108) jF j = 1 + G(jw)  jGj for w  wc c For w = wc , jF j depends on the phase margin. Figure 5.44 shows the relationship of jF j on the PM for several di erent values for the PM. For a PM of 90o, jF (jwc)j = :7071. Also, if the PM = 90o then bandwidth is equal to wc . There is a tradeo between PM and bandwidth.

59

2.3 Proportional Compensation

60

61

Bode Diagrams Gm=6.0206 dB (at 1 rad/sec), Pm=21.386 deg. (at 0.68233 rad/sec) 40 20

Phase (deg); Magnitude (dB)

0 −20 −40 −60

−100

−150

−200

−250 −1

0

10

10 Frequency (rad/sec)

62

2.3.1 Proportional/Di erential Compensation

A PD controller has the form

D(s) = K (TD s + 1)

(109) and can be used to add phase lead at all frequencies above the breakpoint. If no change in gain of low-frequency asymptote, PD compensation will increase crossover frequency and speed of response. Increasing frequency-response magnitude at the higher frequencies will increase sensitivity to noise. The gures below show the e ect of a PD controller on the frequency response. D(s) = K (TDs + 1)

63

2.3.2 Lead compensation

A lead controller has the form

Ts + 1 D(s) = K Ts +1

where is less than 1. The maximum phase lead then occurs at w = p1

T

(110) (111)

Lead compensation adds phase lead at a frequency band between the two breakpoints, which are usually selected to bracket the crossover frequency. If no change in gain of low-frequency asymptote, lead compensation will increase the crossover frequency and speed of response over the uncompensated system. If gain of low-frequency asymptote is reduced in order not to increase crossover frequency, the steady-state errors of the system will increase. Lead compensation acts approximately like a PD compensator, but with less high frequency ampli cation.

64

An example of lead control is given in the gures. Given an open-loop transfer function G(s) = s(s 1+ 1) (112)

design a lead controller that has a steady-state error of less than 10% to a ramp input. Also the system is to have and overshoot (Mp ) of less than 25%. The steady-state error is given by   1 R(s) (113) e(1) = slim s !0 1 + D(s)G(s) where R(s) = s1 for a unit ramp, which reduces to 2

8 9 < = 1 1 e(1) = slim 1 ] ; = D(0) !0 : s + D(s)[ (s+1)

(114)

so we can pick a K = 10. Also, using the relationship between PM and Mp we can see that we need a PM of 45o to meet the overshoot requirement. We then experiment to nd T and and it turns out that the desired compensation is s D(s) = 10 (( 2s ))++11 (115) 10

65

2.3.3 Proportional/Integral Compensation A PI controller has the form K

D(s) = s s + T1 I



(116)

PI control increases frequency-response magnitude at frequencies below the breakpoint thereby decreasing steady-state errors. It also contributes phase lag below the breakpoint, which must be kept at a low enough frequency so that it does not degrade stability excessively. Figures shows how PI compensation will e ect the frequency response.

66

2.3.4 Lag Compensation A lag controller has the form

Ts + 1 D(s) = K Ts +1

(117)

where is greater than 1. Lag compensation increases frequency-response magnitude at frequencies below the two breakpoints thereby decreasing steady-state errors. With suitable adjustments in loop gain, it can alternatively be used to decrease the frequency-response magnitude at frequencies above the two breakpoints so that the crossover occurs at a frequency that yields an acceptable phase margin. It also contributes phase lag between the two breakpoints, which must be kept at low enough frequencies so that the phase decrease does not degrade stability excessively. Figures show the e ect of lag compensation on frequency response.

67

Question: Does increasing gain > 1 or < 1 at 180o cause stability or instability?

Answer: Usually instability, but in some cases the opposite holds. Use root locus or Nyquist methods to see.

3 Nyquist Diagrams A Nyquist plot refers to a plot of the magnitude vs. phase, and can be useful when Bode plots are ambiguous with regard to stability. A Nyquist plot results from evaluating some transfer function H (s) for values of s de ned by some contour (see gures). If there are any poles or zeros inside the contour then the Nyquist plot will encircle the origin one or more times. The closed-loop transfer function has the form Y = KG(s) (118) R 1 + KG(S ) The closed-loop response is evaluated by looking at 1 + KG(S ) = 0

(119)

which is simply the open-loop response, KG(s), shifted to the right by 1. Thus 1+ KG(S ) encircles the origin i KG(s) encircles ;1. We can de ne the contour to be the entire RHP (see gures). If there are any encirclements while evaluating our transfer function, we know that the system is unstable. 68

A clockwise encirclement of -1 indicates the presence of a zero in the RHP while a counterclockwise encirclement of -1 indicate a pole in the RHP. The net # of clockwise encirclements is N =Z ;P (120) Alternatively, in order to determine whether an encirclement is due to a pole or zero we can write (s) (121) 1 + KG(s) = 1 + K ab((ss)) = a(s) a+(sKb ) So the poles of 1 + KG(s) are also the poles of G(s). Since the number of RHP poles of G(s) are known, we will assume that an encirclement of -1 indicates an unstable root of the closed-loop system. Thus we have the number of closed-loop RHP roots

Z =N +P

69

(122)

3.0.5 Nyquist Examples Several examples are given. The rst example has the transfer function (123) G(s) = (s +1 1)2 The root locus shows that the system is stable for all values of K . The Nyquist plot is shown for K = 1 and it does not encircle ;1. Plots could be made for other values of K , but it should be noted that an encirclement of -1 by KG(s) is equivalent to an encirclement of ;K1 by G(s). Since G(s) only crosses the negative real axis at G(s) = 0, it will never encircle ;K1 for positive K .

70

71

The second example has the transfer function

G(s) = s(s +1 1)2

(124)

and is stable for small values of K . As can be seen from the Nyquist plot, larger values of K will cause two encirclements. The large arc at in nity in the Nyquist plot is due to the pole at 0. Two poles at s = 0 would have resulted in a full 360o arc at in nity.

72

The third example given has the transfer function

G(s) = s( ss +;11)2 10

(125)

For large values of K , there is one counterclockwise encirclement (see gures), so N = ;1. But since P = 1 from the RHP pole of G(s), Z = 0 and there are no unstable system roots. When K is small, N = 1 which indicates that Z = 2, that there are two unstable roots in the closed-loop system.

73

3.1 Stability Margins

Now we are interested in de ning the gain and phase margins in terms of how far the system is from encircling the -1 point. The gain margin is de ned as the inverse of jKG(jw)j when the plot crosses the negative real axis. The phase margin is de ned to be the di erence between the phase of G(jw) and ;180o when the plot crosses the unit circle. Their determination is shown graphically in the gures below. A problem with these de nitions is that there may be several GM's and PM's indicated by a Nyquist plot. A proposed solution is the vector margin which is de ned to be the distance to the -1 point from the closest approach of the Nyquist plot. The vector margin can be dicult to calculate though. Recall the de nition of sensitivity

S = 1 +1GD

(126)

The sensitivity minimized over w is equal to the inverse of the vector margin. A similar result holds for a MIMO system, where 1 min  (S (1jw)) = kS (jw (127) )k 1 where  is the maximum singular value of the matrix and k  k1 is the in nity norm.

74

75

Part V

Digital Classical Control 1 Discrete Control - Z-transform X (z ) =

 Examples O

1 X k=;1

X

x(k)z;k

O

X

O

X O X

Step response

exponential decay

{ Step response

sinusoid

1(k) ! 1 ;1z ;1

{ Exponential decay

rk ! z ;z r

{ sinusoid  For stability ! kpolesk < 1  Final value theorem

r cos ) [rk cos k]1(k) ! z 2 ;z (2zr; (cos )z + r2 ;1 lim x(k) = zlim !1(1 ; z )X (z )

k!1

1.1 Continuous to Discrete Mapping G(s)

G(z)

1. Integration Methods

s s s

z ; 1 forward method T z ; 1 backward method Tz 2 z ; 1 trapezoidal/bilinear transformation method T z+1 76

2. Pole-zero mapping 3. ZOH equivalent u

y D/A

A/D

G(s)

ZOH

sample sampler (linear & time varying) (with ant-alias filter)

Gives exact representation between u(k), y(k) (does not necessarily tell you what happens between samples)

1.2 ZOH o

1

o o

o

o

T Impulse- response

sampler - linear, time-variant

Input Y (s) Y (z ) G(z )

= = = =

1(t) ; 1(t ; T ) (1 ; e;Ts ) Gs(s) z-transform of nsamples of y(t) o Z fy (kT )g = Z L;1 fY (s)g

4 Z fY (s)g for shorthand =   G ( s ) ; Ts = Z (1 ; e ) s  G(s)  ; 1 = (1 ; z )Z

s

 Example 1:

G(s) = s +a a G(s) = a 1 1 s s (s + a) = s ; s + a  G(s)  ; 1 L = 1(t) ; e;aT 1(t) s after sampling = 1(kT ) ; e;akT 1(kT )

;aT Z-transform = 1 ;1z ;1 ; 1 ; e;1aT z ;1 = (z ;z (11)(;ze; e;)aT ) ;aT G( z ) = 1 ; e

z ; e;aT

77

pole at a ! pole at e;aT , no zero ! no zero

 Example 2: G(s) = s12   G(z) = (1 ; z ;1 )Z s13 2 G(z) = T2(z(z;+1)1)2 Using Table lookup pole at 0 ! pole at e;0T = 1

zero at 1 ! zero at ;1

 In general,

z = esT for poles

zeros cannot be mapped by the same relationship.

 For 2nd order systems - given parameters (Mp; tr ; ts; ) The poles s1 ; s2 = ;a  jb map to z = rej ; r = e;aT ;  = bT smaller the value of T ! closer to the unit circle, i.e. closer to z = 1

Additional comments on ZOH U (k) ! Y (k) What we really want to control is the continuous output y(t). Consider sinusoid ! sampled ! ZOH

78

As seen in the gure,  fundamental frequency is still the same  but introduction of phase delay - reduced phase margin (bad for control)  adds higher harmonics.

1 ; e;sT ! s = ;j! ) e ;j!T Tsinc( !T ) s 2 2

79

As seen in the gure, extra harmonics excite G(s), this may cause aliasing and other e ects. Therefore we need to add an anti-aliasing lter as shown D/A

A/D

ZOH

G(s) anti-alias filter here

1.3 Z-plane and dynamic response

Plot of z = esT for various s:

80

Typically in digital control we can place poles anywhere in the left-half plane, but because of oscillation, it is preferred to work with positive real part only. z-plane grid is given by "zgrid" in MATLAB

81

Higher order systems  as pole comes closer to z=1, the system slows down  as zero comes closer to z=1, causes overshoot  as pole and zero come close to each other, they tend to cancel each other Dead-beat control. In digital domain we can do several things not possible in continuous domain, e.g. pole-zero cancellation, or suppose we set all closed loop poles to z = 0. Consider closed loop response

b1z3 + b2z2 + b3 z + b4 = b z ;1 + b z;2 + b z;3 + b z;4 1 2 3 4 z4

All poles are at 0. This is called dead-beat control.

2 Root Locus control design 2 methods: 1. Emulation

Transform D(s) ! D(z ) This is generally considered an older approach. 2. Direct design in the z-domain - The following steps can be followed: (a)

ZOH + G(s) ! G(z ) (b) design speci cations

Mp; tr ; ts ! pole locations in z-domain (c) Compensator design : Root locus or Bode analysis or Nyquist analysis in Z-domain 82

y

r

D(z)

G(z)

y = D(z)G(z ) r 1 + D(z )G(z) Solution of the characteristic equation 1 + kD(z )G(z ) = 0 gives the root locus. The rules for plotting are exactly the same as the continuous case. Ex. 1.

a

s(s + a) z + 0:9 G(z) with ZOH = k (z ; 1)( z ; e;aT ) proportional feedback

X

X

O

X

X

-a

O

unstable (probably due to phase lag introduction)

X

X O

X

O

* not great damping ratio as K increases

X

O X X

Better Lead design (gives better damping at higher K - better Kv)

* lead control - add zero to cancel pole

83

2.1 Comments - Latency

u(k) is a function of y (k) (e.g. lead di erence equation).

 computation time (in computer) introduces delay.  Worst case latency - to see the e ect of a full 1 clock delay (z;1), add a pole at the origin i.e 1/z

D(z)

G(z)

 To overcome this problem we may try to sample faster than required. sample faster ! complex control sample slower ! more latency

3 Frequency Design Methods z = ej!

Rules for construction of Bode plot and Nyquist plots are the same as in continuous domain. De nitions for GM and PM are the same. However, plotting by \hand" is not practical. (Use dbode in MATLAB.)

3.1 Compensator design Proportional k ! k ;1 Derivative ; ks ! k 1 ; z = k z ; 1

T z z ; PD ! k z k Integral s ! 1 ;kz ;1 PID D(z ) = kp (1 + zk;d z1 + kp(zz; 1) ) 84

3.2 Direct Method (Ragazzini 1958) Closed Loop Response

H (z ) = 1 +DG DG (z ) D = G1(z ) 1 ;HH (z )

 Sometimes if H(z) is not chosen properly, D(z) may be non-causal, non-minimal phase or    

unstable. Causal D(z) (cannot have a pole at in nity) implies that H(z) must have zero at in nity of the same order as zero of G(z) at in nity. For stability of D(z), { 1 - H(z) must contain as zeros, all poles of G(z) that are outside the unit circle { H(z) must contain as zeros all zeros of G(z) that are outside the unit circle Adding all these constraints to H(z), gives rise to simultaneous equations which are tedious to solve. This method is somewhat similar to a method called Pole Placement, though it is not as easy as one might think. It does not necessarily yield good phase-margin, gain-margin etc. There are more e ective method is State-Space Control.

4 Z-Transfrom Tables

85

86

Part VI

State-Space Control 1 State-Space Representation

 Algebraic based method of doing control.  Developed in the 1960's.  Often called \Modern" Control Theory. Example f

M

x

f  Let x1 x2 x_1 x_2

!

=

ma 2 m dx dt = mx x (position) x_ (velocity)

= = = =

0 1 0 0

!

!

x1 + 0 1 x2 m

!

u

x_ = Fx | +{z Gu} ! state equation linear in x,u

x = xx1 2

!

! State

Any linear, nite state, dynamic equation can be expressed in this form.

1.1 De nition

The state of a system at time t0 is the minimum amount of information at t0 that (together with u(t); t  t0) uniquely determines behavior of the system for all t  t0 . 87

1.2 Continuous-time First order ODE

x_ = f (x; u; t) y = h(x; u; t)

1.3 Linear Time Invariant Systems x_ = Fx + Gu y = Hx + Ju x(t)  Rn (state) u(t)  R (input) y (t)  R (output) F  Rnn G  R1n H  Rn1 J  R Sometimes we will use A; B; C; D instead of the variables F; G; H:J . Note that dimensions change for MIMO systems.

1.4 "Units" of F in physical terms 1 = freq time

 relates derivative of a term to the term  x_ = ax, large a ) faster the response.

1.5 Discrete-Time xk+1 = Fxk + Guk yk = Hxk + Juk Sometimes we make use of the following variables,

F G H J

! ! ! !

88

; A ;; B C D

1.5.1 Example 2 - "analog computers" y + 3y_ ; y = u Y (s) = 1 2 U (s s + 3s ; 1

 Never use di erentiation for implementation.  Instead, use integral model. u

.

..

y

y .

x

x

1

y .

x2

1

x2

-3

1

.

x_1 x_2

!

= ;13 10

!

!

!

x1 + 1 u x2 0

 x1 ! y= 0 1 x2 

Later we will show standard (canonical) forms for implementing ODE's or TF's.

1.6 State Space Vs. Classical Approach

 SS is an internal description of the system whereas Classical approach is an external descrip

  

tion. SS gives additional insight into the control problem and may tell us things about a system that a TF approach misses (e.g. controllability, observability, internal stability). Generalizes well to MIMO. Helps in optimal control design / estimation. Design { Classical - given speci cations are natural frequency, damping, rise time, GM, PM Design a compensator (Lead/Lag PID)

R.L / Bode

89

find closed loop poles which hopefully meet specifications

{ SS - given speci cations are pole/zero locations or other constraints. S.S description

Exact closed loop poles

math (place poles)

iterate on specs to get good GM, PM, etc..

1.7 Linear Systems we won't study 1.

y(t) = u(t ; 1) This simple continuous system of a 1 second delay is in nite dimensional.

x(t) = [u(t)]tt;1 ( state [0; 1] ! R) u

t-1

t

2. Cantilever beam y = deflection u current u

o

y o voltage transmission line

In nite dimensional, distributed system, PDE

90

1.8 Linearization

O

m=1

 =  ; sin  x1 = ; x2 = _ Non-linear state-space representation.

x_ =

x_ 1 x_ 2

!

=

!

x2

f1 = f ( x; u ) = ; sin x1 + u f2

!

Small-signal approximation (linearization)

@f f (x; u) = f (0; 0) + @f @x (0; 0)x + @u (0; 0)u + : : :

(f (0; 0) = 0; assume 0 is an equilibrium point i.e. x_ (t) = 0

3 77 7 .. .. .. 77 = F . . . 5 @fn : : : @fn @x @x 2 @f 3 @xn @f = 66 ..@u 77 = G 4. 5

2 @f 6 @x @f @f = 666 @x @x 64 ... @fn 1 1 2 1

@f1 @x2 @f2 @x2

1

2

::: :::

@f1 @xn @f2 @xn

1

@u

Output

@fn @u

@h u y = h(x; u) ' @h x + @x @u

"

x_ = x;2sin x + u 1

#

2 3 " # 0 1 0 6 7 F =4 ; | cos {z x1} 0 5 ; G = 1 ;1 or 1

91

Equilibrium at

0 0

x=

!



or

!

0

1.9 State-transformation ODE ;! F; G; H; J Is x(t) Unique ? NO Consider,

z = T ;1 x x = Tz Given x ! z , z ! x x, z contain the same amount of information, thus z is a valid state

x_ y x_ z_

= = = =

Fx + Gu Hx + Ju T z_ = FTz + Gu 1 FT z + T ;1 G u T| ;{z } | {z } A

y = HT J u |{z} z + |{z} C

B

D

 There are an in nite number of equivalent state-space realizations for a given system  state need not represent physical quantities " # 1 ; 1 ; 1 T = "

z = 11 ;11

#"

1 1

# "

x1 = x1 ; x2 x2 x1 + x2

#

 A transformation T may yield an A, B, C, D which may have a "nice" structure even though z has no physical intuition. We'll see how to nd transformation T later.

1.10 Transfer Function

1.10.1 Continuous System X_ = AX + BU Y = CX + DU : Take Laplace-transform: 92

sX (s) ; X (0) = AX (s) + BU (s) Y (s) = CX (s) + DU (s) (sI ; A)X (s) = X (0) + BU (s) X (s) = (sI ; A);1 X (0) + (sI ; A);1 BU (s) Y (s) = [C (sI ; A);1B + D]U (s) + C (sI ; A);1 X (0;) : If X (0; ) = 0, How to compute (sI ; A);1:

Y (s) = G(s) = C (sI ; A);1 B + D : U (s) (sI ; A) : (sI ; A);1 = ADJ det(sI ; A)

If det(sI ; A) 6= 0, (sI ; A);1 exists, and poles of the system are eigenvalues of A.

Example: "

# " # ; 3 1 For A = 1 0 B = 10 C = [ 1 0 ] and D = 0, G(s) = C (sI ; A);1B " #;1 " s + 3 ; 1 = [ 0 1 ] ;1 s " # s ;1 " ;1 s + 3 = [ 0 1 ] s(s + 3) ; 1 10 = s2 + 31s ; 1 :

1 0

#

#

1.10.2 Discrete System Xk+1 = Xk + ;Uk Yk = HXk : Take Z -transform, we get

X (z) = (zI ; );1;U (z ) + (zI ; );1zX (0) Y (z ) = H (zI ; );1;U (z ) + H (zI ; );1zX (0) :

93

1.11 Example - what transfer function don't tell us.

The purpose of this exercise is to show what transfer functions do not tell us. For the system in Figures below, u

s-1

1

s+1

s-1

. X1

U -2

. X2

X1

1 s

The state-space equations of the system are as follows:

"

x_1 x_2

#

=

y = Then we have

"

#

"

"

h

;1 0

#"

1 1

0 1

s

# "

#"

#

x1 + ;2 U x2 1

i " x1 # x2

X2

1

+

-1

y

:

# "

#

sx1 (s) ; x1 (0) = ;1 0 x1 (s) + ;2 u(s) sx2 (s) ; x2 (0) 1 1 x2 (s) 1 x1(s) = s +1 1 x1(0) ; s +2 1 u(s) x2(s) = s ;1 1 [x2(0) ; 12 x1(0)] + 2(s 1+ 1) x1 (0) + s +1 1 u(s) :

Take L;1 -transform,

x1(t) = e;t x1 (0) ; 2e;t  u(t) y (t) = x2 (t) = et [x2(0) ; 1 x1(0)] + 1 e;t x1(0) + e;t  u(t) : 2 2

When t ! 1, the term et [x2(0) ; 21 x1(0)] goes to 1 unless x2(0) = 21 x1(0). The system is uncontrollable. Now consider the system below: u

1

s-1

s-1

s+1

94

y

U

. X1

1 s

X1

. X2

-2

1 s

X2

Y

+

we have

"

x_1 x_2

#

=

y =

" h

1 0 ;2 ;1 1 1

#"

# " #

x1 + 1 u x2 0

i " x1 # x2

Take L;1 -transform,

x1(t) = etx1 (0) + et  u(t) x2(t) = e;t [x2(0) + x1(0)] ; etx1(0) + e;t  u(t) ; et  u(t) y(t) = x1(t) + x2(t) = e;t (x1(0) + x2 (0)) + e;t  u(t) The system state blows up, but the system output y (t) is stable. The system is unobservable. As we will see, a simple inspection of A; B; C; D tells us observability or controllability.

1.12 Time-domain Solutions For a system

X_ = AX + BU Y = CX ; X (s) = (sI ; A);1X (0) + (sI ; A);1BU (s) Y (s) = CX (s) : The term (sI ;A);1 X (0) corresponds to the \homogeneous solution", and the term (sI ;A);1BU (s) is called \particular solution". De ne the \resolvent matrix" (s) = (sI ; A);1 , then (t) = L;1 f(sI ; A);1 g, and

X (t) = (t)X (0) +

Zt 0

( )BU (t ;  )d :

Because

(s) = (sI ; A);1 = 1s (I ; As );1 2 = Is + sA2 + As3 +    ; 95

we have

3 2 (t) = I + At + (At2!) + (At3!) +    1 (At)k X = k=0 k! = eAt : Compare the solution of X_ = AX with the solution of x_ = ax, X (t) = eAt X (0) x = eat x(0)

we observed that they have similar format. To check whether X (t) = eAt X (0) is correct, we calculate deAt =dt

P (At)k ) X 1 (At)k;1 deAt = d( 1 k=0 k! = A = AeAt : dt dt ( k ; 1)! 1

From above equation and X (t) = eAt X (0), we have

At X_ = dX dt = Ae X (0) = AX :

The matrix exponential eAt has the following properties:

eA(t +t ) = eAt  eAt e(A+B)t = eAt  eBt; only if (AB = BA) : 1

2

1

2

The conclusion of this section: eAt X (0) +

X (t) = Y (t) = CX (t) : If the matrix A is diagonal, that is

then

Zt 0

eA BU (t ;  )d

2 66 1 2 A = 666  4 



2 e t 66 e t 6 At e = 66  4 

3 77 77 ; 75

1

2



3 77 77 ; 75

If A is not diagonal, we use the following Eqn. to transform A to a diagonal matrix,  = T ;1 AT ; 96

where the columns of T are eigenvectors of A. Then eAt = TetT ;1 :

Example:

"

#

"

#

2 For matrix A = 00 10 , (sI ; A);1 = 10=s 11=s =s , we have

eAt = L;1 f(sI ; A);1g =

"

1 t 0 1

#

:

Calculating eAt using power series

eAt = I + At + (At2 ) +    " # " # " # 1 0 0 t 0 0 = 0 1 + 0 0 + 0 0 +  2

=

"

1 t 0 1

#

:

Note: there is no best way to calculate a matrix exponential. A reference is \19 Dubious method of calculating eAt " by Cleve and Moller. 100 Consider e;100 = 1 ; 100 + 100 2! ; 3! +   . 2

3

State-transition matrices eFt eF (;t) = eF (t;t) = I (eFt );1 = e;Ft : Thus,

X (t0) = eFt X (0) X (0) = e;Ft X (to ) X (t) = eFte;Ft X (t0) = eF (t;t )X (t0) : 0

0

0

0

The eF (t;t ) is the state-transition matrix (t ;  ). The last equation relates state at time t0 to state at time t. 0

For a time variant system,

X _(t) = A(t)X (t) ; X (t) = (t; t0)X (t0) @X (t) = @(t; t0) X (t ) 0 @t @t @(t; t0) = A(t)(t;  ) : @t 97

Because

(t; t) = I (t3 ; t1 ) = (t3; t2)(t2 ; t1) I = (t;  )(; t) ; we have

[(t;  )];1 = (; t) :

1.13 Poles and Zeros from the State-Space Description For a transfer function

G(s) = UY ((ss)) = ab((ss)) ;

a pole of the transfer function is the \natural frequency", that is the motion of aY for input U  0. In the state form we have, X_ = AX and X (0) = Vi : Assume X (t) = esi t Vi, then we have X _(t) = siesi tVi = AX (t) = Aesi t Vi : So,

si Vi = AVi ;

that is si is an eigenvalue of A and Vi is an eigenvector of A. We conclude poles = eig(A). A zero of the system is a value s = si , such that if input u = esi t Ui , then y  0. For a system in state form X_ = FX + GU Y = HX ; a zero is a value s = si , such that

U (t) = esi tU (0) X (t) = esi tX (0) Y (t)  0 : Then we have

h

si ; F ;G

i " X (0) U (0)

X_ = si esi t X (0) si t si t # = Fe X (0) + Ge U (0) ; or = 0:

98

We also have

Y = HX +" JU = 0# ; or h i (0) H J X U (0) = 0 : Combine them together, we have

"

sI ; F ;G H J

#"

"

# " #

X (0) = 0 U (0) 0

:

#

Non-trivial solution exists for det sI H; F ;JG 6= 0. (For mimo systems, look to where this matrix loses rank.)

The transfer function

Example:

"

#

det sI H; F ;JG G(s) = H (sI ; F );1 G = : det[sI ; F ]

For a transfer function

+1 s+1 : G(s) = (s +s2)( = 2 s + 3) s + 5s + 6

In state form, the system is

"

F = ;15 ;06 " #

#

1 0 h i H = 1 1 :

G =

The poles of the system are found by solving det[sI ; F ] = 0, that is

"

#

det[sI ; F ] = det s;+15 6s = 0 or s(s + 5) + 6 = s2 + 5s + 6 = 0

"

#

The zeros of the system are found by solving det sI H; F ;JG = 0, that is

"

det sI H; F ;JG

#

3 2 s + 5 6 ;1 = det 64 ;1 s 0 75 1

= ;1(;1 ; s) = s+1 99

1 0

1.14 Discrete-Systems

1.14.1 Transfer Function Xk+1 = Xk + ;Uk Yk = HXk :

"

Then

#

det zI H;  ;0; Y (z ) = H (zI ; );1; = : U (z ) det[zI ; ] Example: Calculating Xn from X0.

X1 = X0 + ;U0 X2 = (X0 + ;U0 ) + ;U1 X3 = ((X0 + ;U0 ) + ;U1 ) + ;U2



Xn = n X0 +

n X i=1

i;1 ;Un;i

1.14.2 Relation between Continuous and Discrete ZOH equivalent:

U(kT)

Y(kT) ZOH

G(s)

G(z)

Figure 12: ZOH

X_ = FX + GU Y = HX + JU Zt X (t) = eF (t;t )X (t0) + eF (t; )GU ( )d : 0

t0

Let's solve over one sampling period: t = nT + T and t0 = nT , we have

X (nT + T ) = eFT X (nT ) +

Z nT +T nT

100

eF (nT +T ; )GU ( )d :

Because U ( ) = U (nT ) = const for nT    nt + T ,

Z nT +T FT X (nT + T ) = e X (nT ) + f eF (nT +T ; ) d gGU (nT ) : nT

Let 2 = nT ; T ;  , we have

Xn+1

ZT F n + f e d gGUn :

= eFT X

0

So we have  = eFT ZT ; = f eF d gG 0

H $ H J $ J:

2 Controllability and Observability 2.1 Controller canonical form

Y (s) = b(s) = b1s2 + b2s + b3 U (s) a(s) s3 + a1 s2 + a2 s + a3   Y (s) = b(s) Ua((ss)) = b(s) (s)   U (s) = a = s3 + a1 s2 + a2s + a3  (s) u = (3) + a1  + a2_ + a3  y = b1 + b2 _ + b3

b1

... ξ

u +

.

x1

1 s

.. ξ

.

x1

x2

1 s

b2

. ξ

x2

.

x3

-a1 -a2 -a3

Figure 13:

101

1 s

ξ

b3 x3

y +

2 3 2 x _1 64 x_2 75 = 64 ;1a1 ;0a2 ;0a3 x_3 | 0 {z1 0 Ac h i

32 3 2 3 75 64 xx12 75 + 64 10 75 u } x3 | {z0 } Bc

C = b1 b2 b3 D = 0

2.2 Duality of the controller and observer canonical forms Ac = ATo Bc = CoT G(s) = Cc (sI ; Ac );1 Bc G(s) = [Cc(sI ; Ac );1Bc ]T BcT (sI ; ATc );1CcT = Co (sI ; Ao);1 Bo

Question: Can a canonical form be transformed to another arbitrary form? A, B, C ?

?

Ac ,Bc ,Cc

A o ,Bo ,Co

?

Figure 14:

2.3 Transformation of state space forms

Given F, G, H, J, nd transformation matrix T, such that

2 3 ; a 1 ;a2 ;a3 A = 64 1 0 0 75 0 1 0 2 3 1 6 B = 4 0 75 0

Let

T ;1

2 3 t1 = 64 t2 75 t3

102

A = T ;1 FT AT ;1 = T ;1 F B = T ;1 G

2 32 3 2 3 2 3 ; a t t t 1 ;a2 ;a3 1 1 1F 64 1 0 0 75 64 t2 75 = 64 t2 75 F = 64 t2F 75 0 1 0 t t t3 F 2 33 2 3 3 64 t1 75 = 64 tt12FF 75 t2

t3F

t1 = t2 F t2 = t3 F need to determine t3

B = T ;1 G

2 3 2 3 1 t 1G 64 0 75 = 64 t2G 75 t3 G

0

t1 G = 1 = t3 F 2 G t2 G = 0 = t3 FG t3 G = 0

h

i h

i

t3 G FG F 2G = 0 0 1 = In general form,

h |

e3 |{z} T

basis function

i }

tn G FG F 2G : : : F n;1 G = enT

{z

controllability matrix C (F;G)

If C is full rank, we can solve for tn

2 n;1 3 tn F 7 6 ; 1 T = 4 tn F 5 tn

where

tn = enT C ;1 103

De nition: A realization fF; Gg can be converted to controller canonical form i C ;1(F; G) exists () system is controllable. corollary: C is full rank () system is controllable Exercise: Show existence of C ;1 is una ected by an invertible transformation T, x = Tz. Bonus question: What's the condition for a system observable? Given F, G, H, J, solve for Ao ; Bo; Co; Do. By duality

i C ;1 (F T ; H T ) exists,

h

HT F T HT

Ac = ATo Bc = CoT

2 H i T : : : F n;1 H T = 64 HF

HF n;1

3 75 =

O| (F;{z H )}

observability matrix

Exercise u

s-1

1

s+1

s-1

Figure 15:

"

#

F = ;11 01

"

#

h

i

G = ;12 H= 0 1

"

C = ;12 ;21 det(C ) = 2 ; 2 = 0 =) not controllable

"

O = 01 11 104

#

#

y

det(O) = ;1 =) observable

Exercise: u

1

s-1

s-1

s+1

y

Answer: You will get the reverse conclusion to the above exercise. Conclusion: A pole zero cancellation implies the system is either uncontrollable or unobservable, or both.

Exercise: Show controllability canonical form has C = I =) controllable Comments  Controllability does not imply observability, observability does not imply controllability.  Given a transfer function, G(s) = ab((ss))

We can choose any canonical form w like. For example, either controller form or observer form. But once chosen, we can not necessarily transform between the two.

 Redundant states x_ = Fx + Gu y = Hx let xn+1 = Lx

"

x

#

x= x =) unobservability n+1

De nition: A system ( F, G ) is "controllable" if 9 a control signal u to take the states x, from arbitrary initial conditions to some desired nal state xF , in nite time, () C ;1 exists. Proof: Find u to set initial conditions Suppose x(0; ) = 0 and u(t) =  (t)

X (s) = (sI ; A);1 bU (s) = (sI ; A);1b A ;1 ;1 I:V:T: = x(0+) = slim !1 sX (s) = slim !1 s(sI ; A) b = slim !1(I ; s ) b = b

Thus an impulse brings the state to b (from 0)

105

Now suppose u(t) =  (k) (t)

U (s) = sk 2 X (s) = 1s (I ; As );1 bsk = 1s (I + As + As2 + : : :)bsk k+1 k = bsk;1 + Absk;2 + : : : + Ak;1 b + As b + A s2 b + : : : x(t) = b(k;1) + Ab(k;2) + Ak;1 b due to impulse at t=0; Ak b + Ak+1 b + : : :g = Ak b x(0+) = slim s f !1 s s2

if u(t) =  (k) (t) ) x(0+ ) = Ak b Now let

u(t) = g1 (t) + g2_(t) + : : : + gn (n;1) (t), by linearity,

2 i x(0+) = g1 b + g2Ab + : : : + gnAn;1 b = b Ab A2 b : : : An;1b 64 h

2 64

g1 3

g1 3 .. 75 .

gn

xdesired = x(0+)

.. 75 = C ;1 x(0+ ) if C ;1 exists .

gn

and we can solve for gi to take x(0+) to any desired vector

Conclusion: We have proven that if a system is controllable, we can instantly move the states from any given state to any other state, using impulsive inputs. (only if proof is harder )

2.4 Discrete controllability or reachability

A discrete system is reachable i 9 a control signal u that can take the states from arbitrary initial conditions to some desired state xF , in nite time steps.

xk = Ak x0 + xN

k X i=0

Ai;1 buk;1

2 3 u(N ; 1) h i 666 u(N ; 2) 777 N 2 N ; 1 = A x0 + b Ab A b : : : A b 6 4 ... 75 2 u(N ; 1) 3 64 ... 75 = C ;1(xd ; AN x(0)) u(0)

106

u(0)

2.4.1 Controllability to the origin for discrete systems  jCj =6 0 is a sucient condition  suppose u(n)=0, then x(n) = 0 = Anx(0) if A is the Nilpotent matrix ( all the eigenvalues equal to zero ).  in general, if Anx0 2

> < = 6 7 6 7 . . ; 1 x(0) = O (A; C ) >4 .. 5 ; T 4 .. 5> : yn;1 un;1 (0) ;

if O;1 exists, we can deduce x(0)

Exercise: solve for discrete system 2 x(k) = O;1 64

y (k) .. .

y(k + n ; 1)

3 2 75 + T 64

u(k) .. .

u(k + n ; 1)

3 75

2.6 Things we won't prove

 If A; B; C is observable and controllable, then it is minimal, i.e, no other realization has a smaller dimension). This implies a(s) and b(s) are co-prime.  The unobservable space N (O) = fx 2 RnjOx = 0g is the null space of O solutions of x_ = Ax which start in unobservable space cannot be seen by looking at output (i.e. we stay in unobservable space). If x(0) 2 N (O), then y = Cx = 0 for all t.

 The controllable space, 4 y_ 5 ; T 4 u_ 5> : y u ;

Not very practical for real systems

x_ = Fx + Gu + G1w y = Hx + v

where w is the process noise and v is the sensor noise. Want an estimate x^ such that (x;x^) is "small"

if

x ; x^ ;! 0

w=v=0

u

plant

F,G,H

F,G,H

model

x^ = F x^ + Gu error x ; x^  x~ x~_ = x_ ; x^_ = Fx + Gu + G1w ; (F x^ + Gu) = F x~ + G1w

(open loop dynamics - usually not good)

v +

X u

y^ ^

-

+ +

X

~

y = y - y^

x^_ = F| x^ + {z Gu} + L| (y ;{zH x^)} model

correction term

How to choose L ? 134

Pole placement

1. Luenberger (observer)  Dual of pole-placement for K 2. Kalman  Choose L such that the estimates is Maximum Likelihood assuming Gaussian noise statistics. to minimize

Error Dynamics The error dynamics are given by, x~_ = Fx + Gu + G1w ; [F x^ + Gu + L(y ; H x^)] = F x~ + G1 w + LH x~ ; Lv = (F ; LH )~x + G1w ; Lv Characteristic Equation : det(sI ; F + LH ) = e (s) det(sI ; F + GK ) = c (s) e(s) = Te = det(sI ; F T + H T LT ) Need (F T ; H T ) controllable =) (F; H ) observable.

LT = place(F T ; H T ; Pe )

4.1.1 Selection of Estimator poles e 1. Dominant 2nd Order 2. Prototype 3. SRL

x~_ = (F ; LH )~x + G1w ; Lv  want L large to compensate for w (fast dynamics)  L provides lowpass lter from v. want L small to do smoothing in v.

SRL - optimal tradeo

135

w

v y

u

+

X

G1 (s) = wy 1 + q 2 GT1 (;s)G1 (s) = 0 noise energy q = process sensor noise energy

=) steady state solution to Kalman lter

4.2 Compensators: Estimators plus Feedback Control Try the control law u = ;kxb

With this state estimator in feedback loop the system is as shown below. Process . x=Fx + Gu

u(t)

x(t)

Sensor H

y(t)

u(t) Control law -K

^ x(t)

Estimator . ^ ^ ^ x=Fx+Gu+L(y-Hx)

What is the transfer function of this system? The system is described by the following equations.

x_ = Fx + Gu + G1w y = Hx + v Estimation

xb_ = F xb + Gu + L(y ; H xb) Control

!

x_ = xb_

u = ;K xb F ;GK LH F ; GK ; LH

!

136

!

!

!

x + G1 w + 0 v xb 0 L

x~ = x ; xb Apply linear transformation

!

x = x~

I 0 I ;I

!

x xb

!

With this transformation the state equations are :

!

x_ = x~_

F ; GK 0

GK F ; LH

!

!

!

!

x + G1 w + 0 x~ G1 ;L v

The characteristic equation is C.E = det sI ; F0+ GK sI ;;FGK + LH

{z

|

no cross terms

! }

=

= c(s) e(s)!! This is the Separation Theorem. In other words the closed loop poles of the system is equivalent to the compensator poles plus the estimator poles as if they were designed independently. Now add reference input  u = ;K (^x ; Nxr) + Nu r = ;K x^ + Nr What is the e ect on x~ due to r ?

x~_ = x_ ; xb_ = (F ; LH )~x + G1w ; Lv x~ is independent of r, i.e. x~ is uncontrollable from r. This implies that estimator poles do not appear in r!x or r!y transfer function.

 e (s)b(s) Nb  (s) y = N = r e (s) c(s) c(s) This transfer function is exactly same as without estimator. 137

4.2.1 Equivalent feedback compensation

With a reference input the equivalent system is : r

D2(s)

u

P

y

D1(s)

D2(s) is transfer function introduced by adding reference input. We have

xb_ = F xb + Gu + L(y ; H xb)  u = ;K xb + Nr  + Ly ) xb_ = (F ; GK ; LH )xb + GNr From the above equations (considering y as input and u as output for D1 (s)),

D1(s) = ;K (sI ; F + GK + LH );1L (Considering r as an input and u as an output for D2 (s)),

D2(s) = ;K (sI ; F + GK + LH );1GN + N

4.2.2 Bode/root locus The root locus and Bode plots are found by looking at open loop transfer functions. The reference is set to zero and feedback loop is broken as shown below. r =0

D2(s)

uin

uout

138

kG(s)

D1(s)

y

!

i.e.

D1(s) = K (sI ; F + GK + LH );1 L G(s) = H (sI ; F );1 G

x_ = F 0 _xb LH F ; GK ; LH

{z

|

A

!

}

!

!

x + G u in xb 0

  x! uout = 0 ;K | {z } xb

| {z } B

C Rootlocus can be obtained by rlocus(A,B,C,0) and Bode plot by bode(A,B,C,0). Estimator and controller pole locations are given by rlocus(A,B,C,0,1).

0 1 ! r C u B  As an exercise, nd the state-space representation for input @ w A and output y . v

% MATLAB .m file for Two Mass System.

Feedback Control / Estimator

% M m k b

Parameters = 1 = .1 = 0.091 = 0.0036

% F G H J

State-Space Description = [0 1 0 0; -k/M -b/M k/M b/M ;0 0 0 1; k/m b/m -k/m -b/m] = [0 1/M 0 0]' = [0 0 1 0] = 0

% LQR Control Law for p^2 = 4 K = lqr(F,G,H'*H*4,1) K = 2.8730

2.4190

-0.8730

1.7076

% Closed loop pole locations pc = eig(F-G*K) pc = -0.3480 + 1.2817i -0.3480 - 1.2817i

139

-0.8813 + 0.5051i -0.8813 - 0.5051i % Symmetric Root Locus for LQR design %axis([-3 3 -3 3]); %axis('square'); %A = [F zeros(4); -H'*H -F']; %B = [G ;0;0;0;0]; %C = [0 0 0 0 G']; %rlocus(A,B,C,0) %hold %plot(pc,'*') %title('SRL for LQR') % The poles pc are on the stable locus for p^2 = 4

% Standard Root Locus vs Plant Gain %axis([-3 3 -3 3]); %axis('square'); %%rlocus(-num,den) %rlocus(F,G,K,0) %title('Plant/State-Feedback Root Locus') %rcl = rlocus(F,G,K,0,1) %hold %plot(rcl,'*') % Bode plot of loop transfer function %w = logspace(-1,1,200); %bode(F,G,K,0,1,w); %[mag,phase] = bode(F,G,K,0,1,w); %title('Bode Plot') %[gm,pm,wg,wc] = margin(mag,phase,w) % Reference Design Nx = [1 0 1 0]'; Nb = K*Nx Nb = 2.0000 % Step Response %t = 0:.004:15; %subplot(211); %step(F-G*K,G*Nb,H,0,1,t); %title('2-Mass control ref. step') %subplot(212); %step(F-G*K,G,H,0,1,t); %title('2-Mass process noise step ') % Now Lets design an Estimator % Estimator Design for p^2 = 10000 L = lqe(F,G,H,10000,1)

140

L = 79.1232 96.9383 7.8252 30.6172 % Closed loop estimator poles pe = eig(F-L*H) pe = -1.1554 -1.1554 -2.7770 -2.7770

+ + -

2.9310i 2.9310i 1.2067i 1.2067i

% Check natural frequency a_pe = abs(eig(F-L*H))

% Symmetric Root Locus for LQE design %A = [F zeros(4); -H'*H -F']; %B = [G ;0;0;0;0]; %C = [0 0 0 0 G']; %rlocus(A,B,C,0) %hold %plot(pe,'*') %title('SRL for LQE') %axis([-3 3 -3 3]); %axis('square');

% A B C D

Compensator state description for r,y to u. D1(s) D2(s) = [F-G*K-L*H]; = [G*Nb L]; = -K; = [Nb 0];

% Check poles and zeros of compensator [Zr,Pr,Kr] = ss2zp(A,B,C,D,1); [Zy,Py,Ky] = ss2zp(A,B,C,D,2); [Zp,Pp,Kp] = ss2zp(F,G,H,0,1);

Zr = -1.1554 -1.1554 -2.7770 -2.7770

+ + -

2.9310i 2.9310i 1.2067i 1.2067i

Pr =

141

-0.9163 -0.9163 -4.2256 -4.2256

+ + -

3.9245i 3.9245i 2.0723i 2.0723i

Zy = -0.1677 + 0.9384i -0.1677 - 0.9384i -0.3948

Py = -0.9163 -0.9163 -4.2256 -4.2256

+ + -

3.9245i 3.9245i 2.0723i 2.0723i

Zp = -25.2778

Pp = 0 -0.0198 + 1.0003i -0.0198 - 1.0003i 0

% Combined Plant and Compensator state description (Open Loop) D(s)*G(s) Fol = [F zeros(4) ; L*H F-L*H-G*K]; Gol = [G ; [0 0 0 0]']; Hol = [0 0 0 0 K]; % An alternate derivation for D(s)*G(s) [num1,den1] = ss2tf(A,B,C,D,2); [num2,den2] = ss2tf(F,G,H,0,1); num = conv(num1,num2); den = conv(den1,den2); % Plant/Compensator Root Locus %rlocus(-num,den) %rlocus(Fol,Gol,Hol,0) %title('Plant/Compensator Root Locus') %rcl = rlocus(num,den,-1) %hold %plot(rcl,'*') %axis([-5 5 -5 5]); %axis('square');

142

% Plant/Compensator Bode Plot w = logspace(-1,1,200); %bode(Fol,Gol,Hol,0,1,w) [mag,phase] = bode(Fol,Gol,Hol,0,1,w); title('Bode Plot') [gm,pm,wg,wc] = margin(mag,phase,w) gm = 1.5154

pm = 17.3683 % Closed loop Plant/Estimator/Control system for step response Acl = [F -G*K ; L*H F-G*K-L*H]; Bcl = [G*Nb G [0 0 0 0]' ; G*Nb [0 0 0 0]' L]; Ccl = [H 0 0 0 0]; Dcl = [0 0 1]; t = 0:.01:15; % Reference Step %[Y,X] = step(Acl,Bcl,Ccl,Dcl,1,t); %subplot(211) %step(Acl,Bcl,Ccl,Dcl,1,t); %title('2-Mass System Compensator Reference Step') % Control Effort %Xh = [X(:,5) X(:,6) X(:,7) X(:,8)]; %u = -K*Xh'; %subplot(212) %plot(t,u+Nb) %title('Control effort') % Process Noise Step %[Y,X] = step(Acl,Bcl,Ccl,Dcl,2,t); subplot(211) step(Acl,Bcl,Ccl,Dcl,2,t); title('Process Noise Step') % Sensor Noise Step %[Y,X] = step(Acl,Bcl,Ccl,Dcl,3,t); subplot(212) step(Acl,Bcl,Ccl,Dcl,3,t); title('Sensor Noise Step')

143

SRL for LQE 3

2

0

−1

−2

−3 −3

−2

−1

0 Real Axis

1

2

3

Plant/Compensator Root Locus 5 4 3 2 1 Imag Axis

Imag Axis

1

0 −1 −2 −3 −4 −5 −5

0 Real Axis

144

5

2−Mass System Compensator Reference Step

Amplitude

1.5

1

0.5

0 0

5

10

15

10

15

10

15

10

15

Time (secs) Control effort 2 1.5 1 0.5 0 −0.5 0

5

Process Noise Step 2.5

Amplitude

2 1.5 1 0.5 0 0

5 Time (secs) Sensor Noise Step

1

Amplitude

0.5 0 −0.5 −1 0

5 Time (secs)

145

4.2.3 Alternate reference input methods xb_ = F xb + Gu + L(y ; H xb) u = ;K xb

With additional reference the equations are :

xb_ = (F ; LH ; GK )xb + Ly + Mr u = ;kxb + Nr

Case 1 :

M = GN N = N

This is same as adding normal reference input. Case 2 :

N =0 M = ;L ) xb_ = (F ; GK ; LH )xb + L(y ; r)

This is same as classical error feedback term. Case 3:

M and N are used to place zeros. Transfer function where

N for unity gain.

) yr = N (s()s )b((ss)) e

c

 )

(s) = det(sI ; A + MK M = M N

Now estimator poles are not cancelled by zeros. The zeros are placed so as to get good tracking performance.

146

4.3 Discrete Estimators

4.3.1 Predictive Estimator xk+1 = xk + ;uk + ;1 w y = Hx + v Estimator equation

) xk+1 = xk + ;uk + Lp(yk ; yk )

This is a predictive estimator as xk+1 is obtained based on measurement at k.

x~k+1 = xk+1 ; xk+1 = ( ; LpH )~xk + ;1 w ; Lpv e(z ) = det(zI ;  + Lp H ) Need O(,H) to build estimator.

4.3.2 Current estimator Measurement update:

xbk = xk + Lc (yk ; H xk )

Time update:

xk+1 = xbk + ;uk

(128)

These are the equations for a discrete Kalman Filter (in steady state). u

Γ

+

Σ

z

_ x

-1

− H

+ Σ

+

Lc + Φ

^ x

Σ

+

Estimator block diagram

Substitute xb into measurement update equation:

) xk+1 = [xk + Lc (y ; H x)] + ;uk = xk + Lc (y ; H xk ) + ;u 147

y

Comparing with predictive estimator

Lp = Lc x~k+1 = ( ; Lc H )~xk

Now

O[; H ]

should be full rank for this estimator.

0  BB H H 2 Oc = BB .. @.

H n

1 CC CC = Op A

detOc = detOp det

) Cannot have poles at origin of open loop system. Lc = ;1Lp

4.4 Miscellaneous Topics

4.4.1 Reduced order estimator  If one of the states xi = y, the output, then there is no need to estimate that state.  Results in more complicated equations. 4.4.2 Integral control r +

Σ

. xi −

1 − s

+

xi -Ki

Σ

u F,G,H +

-K

x_ = Fx + Gu y = Hx x_ i = ;y + r = ;Hx + r 148

y

)

x_ i x_

!

0 ;H 0 F

=

!

!

!

xi + 0 u x G

 xi ! u = ;Ki K x 

Gains can be calculated by place command.



!



!

;Ki K = place( 00 ;FH ; 0G ; P )  n+1 poles can be placed.  Controllable if F; G are controllable and F; G; H has no zeros at s = 0.

4.4.3 Internal model principle

The output y (t) is made to track arbitrary reference r(t) (e.g. sinusoidal tracking for a spinning disk-drive).

 Augment state with r dynamics.

Ex 1 :

x_ = Fx + Gu y = Hx

r_ = 0 ! constant step

Or

r ; w02r = 0 ! Sinusoid

De ne as new state which is driven to zero.

e=y;r

4.4.4 Polynomial methods b(s)

K

F,G,H,J

a(s)

Nb(s) α c(s)

 Direct transformation between input/output transfer function.  Often advantageous for adaptive control. 149

5 Kalman (Lecture)

150

6 Appendix 1 - State-Space Control Why a Space? The de nition of a vector or linear space is learned in the rst weeks of a linear algebra class and then conveniently forgotten. For your amusement (i.e. you-will-not-be-heldresponsible-for-this-on-any-homework-midterm-or- nal) I will refresh your memory.

A linear vector space is a set V, together with two operations: + , called addition, such that for any two vectors x,y in V the sum x+y is also a vector in V  , called scalar multiplication, such that for a scalar c 2 < and a vector x 2 V the product c  V is in V . 2 Also, the following axioms must hold: (A1) x + y = y + x; 8x; y 2 V (commutativity of addition) (A2) x + (y + z) = (x + y) + z; 8x; y; z 2 V (associativity of addition) (A3) There is an element in V, denoted by 0v (or 0 if clear from the context), such that (x + 0v = 0v + x = x); 8x 2 V (existence of additive identity) (A4) For each x 2 V , there exists an element, denoted by ;x, such that x + (;x) = 0v (existence of additive inverse) (A5) For each r1; r2 in < and each x 2 V , r1  (r2  x) = (r1r2)  x (A6) For each r in < and each x; y 2 V , r  (x + y) = r  x + r  y (A7) For each r1; r2 in < and each x 2 V , (r1 + r2)  x = r1  x + r2  x (A8) For each x 2 V , 1x = x Example 1: n-tuples of scalars. (We will not prove any of the examples.)

82 > > 66 > < 4 666 > > :4

x1 x2 : : xn

9 3 > > 77 > 77 j xi 2 > > ;

Example 2: The set of all continuous functions on a nite interval C [a; b] =4 ff : [a; b] ! < j f is continuousg 2

< is used to denote the eld of real numbers. A vector space may also be de ned over an arbitrary eld.

151

A subspace of a vector space is a subset which is itself a vector space.

Example 1

N (A) =4 x 2
View more...

Comments

Copyright © 2017 PDFSECRET Inc.