Introduction to Applied Digital Control Second Edition
Total Page:16
File Type:pdf, Size:1020Kb
Introduction to Applied Digital Control Second Edition Gregory P. Starr Department of Mechanical Engineering The University of New Mexico November 2006 ii c 2006 Gregory P. Starr Preface This book is intended to give the senior or beginning graduate student in mechanical engineering an introduction to digital control of mechanical systems with an emphasis on applications. The desire to write this book arose from my frustration with the existing texts on digital control, which|while they were exhaustive|were better suited to reference needs than for tutorial use. While the appearance of several new texts with a more student-oriented perspective has reduced my frustration a little, I still feel there is a need for an introductory text such as this. MATLAB has become an almost indispensable tool in the real-world analysis and design of control systems, and this text includes many MATLAB scripts and examples. My thanks go to my wife Anne, and four boys Paul, Keith, Mark, and Jeff for being patient during the preparation and revision of this manuscript|also my late father Duke Starr who recognized that any kid who liked mathematics and motorcycles can't be all bad. Albuquerque, New Mexico November 2006 iii iv PREFACE Contents Preface iii 1 Introduction and Scope of this Book 1 1.1 Continuous and Digital Control . 1 1.1.1 Feedback control . 1 1.1.2 Digital control . 2 1.2 Philosophy and Text Coverage . 4 2 Linear Discrete Systems and the Z-Transform 7 2.1 Chapter Overview . 7 2.2 Linear Difference Equations . 8 2.2.1 Solving Difference Equations . 9 2.3 The Z-Transform and the Discrete Transfer Function . 11 2.3.1 The z-Transform . 11 2.3.2 Discrete Transfer Function . 11 2.3.3 Block Diagrams of Discrete Systems . 13 2.3.4 Going From Transfer Function to Difference Equation . 14 2.3.5 Relation of the Transfer Function to the Unit Pulse Response . 15 2.4 Dynamic Response of Discrete Systems . 16 2.4.1 Unit step . 17 2.4.2 Exponential . 17 v vi CONTENTS 2.4.3 Damped Sinusoid . 18 2.4.4 Relationship between z-plane poles and transient response . 20 2.4.5 Effect of Zeros on Dynamic Response . 21 2.5 Correspondence between Discrete and Continuous Signals . 21 2.6 Frequency Response of Discrete Systems . 23 2.7 Z-Transform Properties . 24 2.7.1 Inverse Transforming . 26 2.8 A Word about LTI Systems and MATLAB functions . 30 2.8.1 LTI Systems . 30 2.8.2 Overloaded Functions . 31 2.9 Table of Z-Transforms . 32 3 Discrete Simulation of Continuous Systems 35 3.1 Chapter Overview . 35 3.2 Discrete Simulation using Numerical Integration . 36 3.2.1 Forward rectangular rule (Euler's rule) . 37 3.2.2 Backward rectangular rule . 38 3.2.3 Trapezoidal rule . 38 3.2.4 Prewarped trapezoidal rule . 41 3.3 Pole-Zero Mapping . 44 3.4 Comparison of Simulations . 45 3.5 Using MATLAB in Discrete Simulation . 46 3.5.1 Finding transfer function from LTI system . 49 3.6 Implementation of Difference Equations in Real Time . 49 3.6.1 Direct realization . 50 3.6.2 Canonical realization . 50 CONTENTS vii 4 Sampled Data Systems 55 4.1 Introduction . 55 4.2 The Sampling Process as Impulse Modulation . 55 4.3 Frequency Spectra of Sampled Signals|Aliasing . 58 4.3.1 Fourier transform and Fourier series . 58 4.4 Desampling or Signal Reconstruction . 62 4.4.1 Impulse response of the Ideal Desampling Filter . 62 4.4.2 The ZOH as a Desampling Filter . 64 4.5 Block Diagram Analysis . 66 4.5.1 Two blocks with a sampler between them . 67 4.5.2 Two blocks without a sampler between them . 69 4.5.3 Response between samples . 72 5 Design Using Transform Methods 75 5.1 Introduction . 75 5.2 Example System and Specifications . 76 5.2.1 Steady-State Accuracy . 78 5.2.2 Transient Response . 80 5.2.3 Disturbance Rejection . 84 5.2.4 Control Effort and Gain Distribution . 85 5.2.5 Parameter Sensitivity . 85 5.3 Design in the s plane by Discrete Equivalent . 85 5.4 Direct Design in the z Plane . 89 5.5 Another Design Example . 95 5.6 Modeling using Simulink . 104 5.6.1 Creating the Simulink Model . 105 5.7 PID Control (Mode Controllers) . 107 5.7.1 Proportional Control . 107 viii CONTENTS 5.7.2 Derivative Action . 108 5.7.3 Integral Action . 108 5.7.4 PD Control . 108 5.7.5 PI Control . 109 5.7.6 PID Control . 109 6 State-Space Analysis of Continuous Systems 113 6.1 Introduction . 113 6.2 System Description . 114 6.2.1 State Equation and Output Equation . 114 6.2.2 State equation from Transfer Function . 116 6.2.3 Transfer Function from State-Variable Description . 116 6.3 Different State-Space Representations . 117 6.3.1 State Variable Transformation . 118 6.3.2 Control Canonical Form . 118 6.3.3 Diagonal (modal or decoupled) Form . 120 6.4 MATLAB Tools . 121 6.4.1 Transform$State-Space . 121 6.4.2 Eigenvalues, Eigenvectors, Diagonalization . 123 6.4.3 Dynamic Response of State-Space Forms . 125 7 Digital Controller Design using State Space Methods 129 7.1 Introduction . 129 7.2 Canonical State-Space Forms from Transfer Function . 129 7.3 Solution to the State Equation . 131 7.3.1 Homogeneous solution . 132 7.3.2 Particular solution . 133 7.3.3 Calculating system and output matrices . 134 CONTENTS ix 7.4 Control Law Design . 135 7.4.1 Pole Placement . 135 7.4.2 Selecting System Pole Locations . 138 7.4.3 Controllability and the Control Canonical Form . 138 7.4.4 Ackermann's Rule and a Test for Controllability . 139 7.4.5 MATLAB Tools . 141 7.4.6 Poles and Zeros . 142 7.4.7 More on Controllability . 143 7.5 State Estimator Design . 144 7.5.1 Prediction Estimator.