control systems 1 notes

211
Course Notes and Laboratory Manual for ENEL 441: Control Systems I David Westwick and Chris Macnab Department of Electrical and Computer Engineering University of Calgary c 2004

Upload: byron-daniels

Post on 21-Jan-2016

106 views

Category:

Documents


9 download

DESCRIPTION

Profs notes from third year electrical course

TRANSCRIPT

Page 1: Control Systems 1 notes

Course Notes and Laboratory Manual

for ENEL 441: Control Systems I

David Westwick and Chris Macnab

Department of Electrical and Computer EngineeringUniversity of Calgary

c©2004

Page 2: Control Systems 1 notes

Contents

1 Laplace Transforms 111.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

1.1.1 Example: Unit Step Function . . . . . . . . . . . . . . . . . . . . . . 111.1.2 Example: Decaying Exponential . . . . . . . . . . . . . . . . . . . . . 11

1.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.2.1 Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.2.2 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.2.3 Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.2.4 Convolution Integral . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.2.5 Final Value Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.2.6 Example: FVT in action . . . . . . . . . . . . . . . . . . . . . . . . . 131.2.7 Initial Value Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2 Inverse Laplace Transform 142.1 Formal Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2 Partial Fraction Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.2.1 Example: Distinct Poles . . . . . . . . . . . . . . . . . . . . . . . . . 152.2.2 Avoiding the Inverse Transform . . . . . . . . . . . . . . . . . . . . . 16

2.3 Special Cases of the Inverse Laplace Transform . . . . . . . . . . . . . . . . 172.3.1 What if n = m? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.3.2 Repeated Poles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.4 Complex Poles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4.1 Completing the Square . . . . . . . . . . . . . . . . . . . . . . . . . . 192.4.2 Expansion with Complex First-Order Poles . . . . . . . . . . . . . . . 202.4.3 Graphical Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3 Transfer Functions and Block Diagrams 223.1 More Block Diagram Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2 Example: Simplifying a Block Diagram . . . . . . . . . . . . . . . . . . . . . 24

3.2.1 Option 1: Just use Algebra . . . . . . . . . . . . . . . . . . . . . . . 253.2.2 Option 2: Block Diagram Manipulation . . . . . . . . . . . . . . . . . 253.2.3 Which approach is better? . . . . . . . . . . . . . . . . . . . . . . . . 26

3.3 Multiple Input Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

4 Case Study: Cruise Control System 284.1 Dynamic Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.2 A Control System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5 Mathematical Models of Dynamic Systems 335.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335.2 Mathematical Models of Linear Mechanical Motion . . . . . . . . . . . . . . 34

5.2.1 Mass/Spring systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 355.2.2 Mass/Damper systems . . . . . . . . . . . . . . . . . . . . . . . . . . 35

2

Page 3: Control Systems 1 notes

5.3 Linear Motion with Gravity . . . . . . . . . . . . . . . . . . . . . . . . . . . 385.3.1 Linearizing the System . . . . . . . . . . . . . . . . . . . . . . . . . . 395.3.2 Example: A car suspension . . . . . . . . . . . . . . . . . . . . . . . 395.3.3 Simulations using quarter-car model . . . . . . . . . . . . . . . . . . 41

5.4 Rotational Mechanical Systems . . . . . . . . . . . . . . . . . . . . . . . . . 455.5 Example: System with gears . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

6 DC Motors 486.1 Field Controlled Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

6.1.1 An external load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506.2 Armature Controlled Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . 516.3 Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536.4 Example: Nonlinear Spring . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

7 Transient Response Analysis: 567.1 First-Order Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

7.1.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597.2 Transient Response of Second-Order Systems . . . . . . . . . . . . . . . . . . 61

7.2.1 Peak Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637.2.2 Peak Overshoot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647.2.3 Settling Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647.2.4 Rise Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677.2.5 10/90 Rise Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

7.3 Dominant-Poles of Higher-Order Systems. . . . . . . . . . . . . . . . . . . . 697.3.1 Graphical Transfer Function Evaluation . . . . . . . . . . . . . . . . 697.3.2 Two Complex Poles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.3.3 Case 1: An Extra Zero . . . . . . . . . . . . . . . . . . . . . . . . . . 727.3.4 Case 2: An extra pole . . . . . . . . . . . . . . . . . . . . . . . . . . 747.3.5 Case 3: Extra Pole/Zero Pairs . . . . . . . . . . . . . . . . . . . . . . 75

7.4 Estimating Pole Locations from Step Responses . . . . . . . . . . . . . . . . 76

8 Stability 788.1 Marginal Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798.2 Instability in the Real World . . . . . . . . . . . . . . . . . . . . . . . . . . . 798.3 Testing for Stabiliy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

8.3.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828.5 Designing for Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

8.5.1 Stability as a Function of Gain . . . . . . . . . . . . . . . . . . . . . 838.5.2 Evaluating Stability as a Function of zero position . . . . . . . . . . . 84

8.6 Special Cases: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848.6.1 Zero in the first column . . . . . . . . . . . . . . . . . . . . . . . . . 848.6.2 A whole row of zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

3

Page 4: Control Systems 1 notes

9 Steady State Errors 879.1 Systems with no poles or zeros at the origin . . . . . . . . . . . . . . . . . . 879.2 Design Example: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889.3 Systems with one pole at s = 0 . . . . . . . . . . . . . . . . . . . . . . . . . 89

9.3.1 Unit ramp input without integrators.... . . . . . . . . . . . . . . . . . 909.4 Systems with 2 poles at s = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . 90

9.4.1 Static Acceleration Error Constant . . . . . . . . . . . . . . . . . . . 919.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929.6 Caveat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

10 PID Controllers 9310.1 Example: Position Control of a DC motor . . . . . . . . . . . . . . . . . . . 93

10.1.1 PD control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9410.1.2 PI Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

11 Root Locus Plots. 9711.1 Drawing Root Locus Plots Directly . . . . . . . . . . . . . . . . . . . . . . . 9911.2 Points on the Real Axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

11.2.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10011.2.2 Example II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

11.3 Complex Poles (or zeros) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10211.3.1 Rule 1 for Root Locus Plots . . . . . . . . . . . . . . . . . . . . . . . 103

11.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10411.5 Open Loop Poles and Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

11.5.1 Rule 2 for Root Locus Plots . . . . . . . . . . . . . . . . . . . . . . . 10511.6 Zeros at Infinity and Asymptotes . . . . . . . . . . . . . . . . . . . . . . . . 105

11.6.1 Rule 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10711.6.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

11.7 Departure Angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10811.8 Example: Breakaway Points . . . . . . . . . . . . . . . . . . . . . . . . . . . 11111.9 Finding the Breakaway Point . . . . . . . . . . . . . . . . . . . . . . . . . . 112

11.9.1 Treating K as a function of s . . . . . . . . . . . . . . . . . . . . . . 11211.9.2 Back to the Example: . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

12 Control System Design using Root Locus Plots 11712.1 Example: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11712.2 PD Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11912.3 Lead Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12012.4 Practical Design of Lead Controllers . . . . . . . . . . . . . . . . . . . . . . 12112.5 Pole-Zero Cancellation Solution . . . . . . . . . . . . . . . . . . . . . . . . . 122

13 Frequency Response Models and Bode Diagrams 12313.1 Response of Linear Systems to Sinusoids . . . . . . . . . . . . . . . . . . . . 12313.2 Bode Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12413.3 Plotting Bode Diagrams of Transfer Functions . . . . . . . . . . . . . . . . . 125

4

Page 5: Control Systems 1 notes

13.3.1 Bode Plot of A Gain, K . . . . . . . . . . . . . . . . . . . . . . . . . 12513.3.2 s in the numerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12613.3.3 s in the denominator . . . . . . . . . . . . . . . . . . . . . . . . . . . 12613.3.4 Real Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12613.3.5 Real Pole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

13.4 Example: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12913.5 Bode Diagrams for Second-Order poles and zeros . . . . . . . . . . . . . . . 132

13.5.1 Low Frequency Behaviour . . . . . . . . . . . . . . . . . . . . . . . . 13313.5.2 High Frequency Behaviour . . . . . . . . . . . . . . . . . . . . . . . . 13313.5.3 What happens near ω = ωn? . . . . . . . . . . . . . . . . . . . . . . . 13413.5.4 Recipe for dealing with complex poles . . . . . . . . . . . . . . . . . . 136

13.6 Steady State Error Behaviour . . . . . . . . . . . . . . . . . . . . . . . . . . 13713.6.1 Review of Static Error Constants . . . . . . . . . . . . . . . . . . . . 13713.6.2 Type 0 systems and Kp . . . . . . . . . . . . . . . . . . . . . . . . . . 13713.6.3 Type 1 systems and Kv . . . . . . . . . . . . . . . . . . . . . . . . . . 13813.6.4 Type-2 systems, and Ka . . . . . . . . . . . . . . . . . . . . . . . . . 141

14 Checking Stability using Bode Diagrams 14214.1 Using G(s) as a mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

14.1.1 The image of a contour . . . . . . . . . . . . . . . . . . . . . . . . . . 14314.1.2 Mapping a pole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14414.1.3 Back to Complex Mappings and Transfer Functions . . . . . . . . . . 144

14.2 Infinite Contours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14614.3 Nyquist Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14714.4 Drawing the Nyquist Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14714.5 Determining Stability Using the Nyquist Plot . . . . . . . . . . . . . . . . . 14914.6 Closed Loop Stability of KG(s) . . . . . . . . . . . . . . . . . . . . . . . . . 151

14.6.1 Gain Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15214.6.2 Phase Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

15 Frequency Response Methods for Controller Design 15515.1 Proportional Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

15.1.1 Example: Using a Proportional Controller . . . . . . . . . . . . . . . 15615.2 Lag Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

15.2.1 Example: Using a Lag Controller . . . . . . . . . . . . . . . . . . . . 15915.3 Lead Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

15.3.1 Example: Lead Compensation . . . . . . . . . . . . . . . . . . . . . . 161

16 State Space Models 16516.1 RC Ladder Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16516.2 The Concept of State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16616.3 Multiple Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16716.4 RLC Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16816.5 Multiple Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16916.6 State Space Models of Mechanical Systems . . . . . . . . . . . . . . . . . . . 170

5

Page 6: Control Systems 1 notes

16.6.1 Example: The car suspension (revisited) . . . . . . . . . . . . . . . . 17116.7 State Space Models and Transfer Functions . . . . . . . . . . . . . . . . . . . 172

16.7.1 Transfer Function of the RLC example . . . . . . . . . . . . . . . . . 17316.8 Other Choices of State Vector . . . . . . . . . . . . . . . . . . . . . . . . . . 17516.9 From Transfer Function to State Space . . . . . . . . . . . . . . . . . . . . . 177

16.9.1 Special Case: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17716.9.2 Check: Compute the Transfer Function . . . . . . . . . . . . . . . . . 17716.9.3 General Case: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

A Lab Policies 181A.1 Lab Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181A.2 Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181A.3 Due dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

Lab 1 182

Lab 2 193

Lab 3 197

Lab 4 202

6

Page 7: Control Systems 1 notes

Administrivia

1. Course Web Page: www.enel.ucalgary.ca/People/Macnab/enel441.

• Course Outline

• Lecture and Tutorial Schedule

• Lab Assignments

• Other study aids.

2. The breakdown of the marks will be as follows:

Quizes: 20%Lab assignments: 10%Midterm test: 20%Final examination: 50%

3. Homework. There will be problems sets given out, followed by answers a week later.These will not be marked. However, they will be good preperation for the quizes andtests.

4. Labs:

• There are 4, 3 hour labs in the course, starting in early October.

• The lab manual is at the back of these course notes.

• Labs are in ENA 305. There are 16 stations, so lab groups should be either 2 or3 students. I will make sure that all available stations are in use.

• 1 Lab report per group (with all names/IDs on it – FOIP).

• Lab report is “semi-formal”. Answer the questions, and justify your answers.Include any graphs that are requested, and make sure that they are labelled, sothe TA knows which plot is which.

• Lab groups can change from week to week.

• Lab material may turn up on a midterm/final (it has before).

5. Office Hours for Dr. Westwick, Wednesday 14:00-16:00, or by appointment.

6. Office Hours for Dr. Macnab Monday, Wednesday, and Friday mornings.

Introduction to Controls

• What is this course all about? Control Systems.

• OK – so what’s a control system? Well, a system is anything that transforms onesignal (its input) into another signal (its output).

7

Page 8: Control Systems 1 notes

y(t)

SystemInput

u(t)

Output

• Example: You could think of a car as a “system”. The inputs are the positions of thecontrols: the steering wheel, gear shift, gas, brake and clutch pedals. The output isthe position of the car.

• You could also think of the engine as the “system”, and the inputs could be the richnessand flow rate of the fuel/air mixture, and the outputs could be the engine speed andtorque.

• At the other extreme, the “system” could be the network of roads around Calgary,the inputs would be the desired arrival times and destinations of all of the drivers,or perhaps the size and location of construction projects, or perhaps the types andlocations of new interchanges, and the outputs could be the speed of traffic, or thenumber of accidents, average travel time, waiting times at certain key intersections.

• There are a two important points here.

1. The scope of what you consider to be a system depends on the problem that youare interested in solving (i.e. the car, the engine which may or may not be partof the car, etc).

2. The input and output signals may be multi-valued.

• OK, so that’s a system. What about the control part. In essence, we will be tryingto build “controllers”. A controller is a system whose output is used as the input toanother system, usually called the “plant” or “process”, such that its output followssome desired trajectory.

• Back to the car example. You could think of yourself as the controller. You alter thecontrol signals (the positions of the steering wheel, pedals, etc) so that the car followsa desired trajectory – ideally down the right side of the road (unless you are in Britain,Japan...) and away from other cars, trees, pedestrians.

• Lets think of a simpler example. Think about what happens when you take a shower.

– Controller: That’s you.

– Control signals: Positions of the hot/cold water taps.

– Plant: water heater, pipes, shower head.

– Objective: Make sure that the water temperature is “just right”

8

Page 9: Control Systems 1 notes

• How are we going to solve this problem? What do you do, first thing in the morning.You set the taps in about the correct position, and then wait for the water temperatureto reach some sort of steady state.

• This is “feed-forward”, or “open-loop” control (or it would be if you just set the taps,and then jumped into the shower).

• The basic idea is that you have a model of how the plant works, and you use thatmodel to construct inputs that will give you the desired result.

Output

Signal

ControlReference

Controller Plant

• So, what’s wrong with this picture?

– The model may not be perfect – hot water tank is full of luke-warm water (orscalding hot water).

– The amount of heat lost between the tank and shower head depends on the tem-perature (especially if you don’t have enough insulation).

– Besides, this is like driving your car blindfolded....

• How do we address these problems? Measure the output, and adjust the control signalsappropriately.

Output

Signal

Control

Controller Plant

Reference Error

Signal

+∑

In this diagram the controller is a function of the error signal. Thus, we can also writean equation for the control as

control signal = controller(error signal) = controller(reference− output)

which is usually calculated by a computer these days (in your car) or more traditionallycomes from something simple like an electric circuit. The plant is a function of thecontrol signal and as well as time so that an equation for the output is

output = plant(time, control signal) = plant(

time, controller(reference− output))

and this equation is a model of a physical system. It is only calculated on a computer(imperfectly) when we want to simulate the system. Otherwise, it is just the behaviourin time of something physical.

9

Page 10: Control Systems 1 notes

• We need one more element in our overall system: something to measure the output ofthe system. In the shower example, the skin (or rather the nerve endings just belowthe skin) would be the transducer, and the brain would be the summing junction andthe controller.

• Now, suppose that you just moved into a new apartment. How will the open andclosed loop control approaches affect your first shower? Your “model” of the plumbingprobably doesn’t reflect your new digs – so your initial setting of the taps probablywon’t give you a pleasant water temperature. However, once you close the loop, youshould have no trouble finding an acceptable temperature.

• What happens if, while you are taking your shower, someone flushes the toilet? There isa temporary reduction in the cold water pressure, which causes the shower temperatureto increase suddenly. You get almost get scalded, jump out of the water stream, andthen adjust the taps – in controls terms, the sudden change in water pressure is adisturbance, and the controller (you) is doing disturbance rejection.

• Lets look at some other everyday control systems. Are they open or closed loop?Identify the plant, controller, transducer, disturbances.

– Temperature in a building

– Driving a car

– Reheating leftovers in a microwave

Overview of Topics

1. Mathematical Modelling of Systems in the Laplace domain.

2. Manipulating block diagrams – especially feedback loops.

3. Relating the Laplace domain model to the time-domain response.

4. Adding a “controller”, to modify the Laplace domain model, and hence time-domainresponse.

5. Frequency responses of systems.

6. Design of controllers based on the frequency response.

7. Introduction to state space models and modern control.

10

Page 11: Control Systems 1 notes

1 Laplace Transforms

1.1 Definition

Let f(t) be a function such that f(t) = 0, for t < 0. Then, the Laplace transform of f(t) is

F (s) = L(f(t))

=

∫ ∞

0

e−stf(t)dt

1.1.1 Example: Unit Step Function

Let 1(t) be the unit step function

u(t) = 1 t > 0

= 0 t < 0

Then, the Laplace transform of u(t) is:

L(1(t)) =

∫ ∞

0

e−stdt

=−1

se−st

0

=1

s

1.1.2 Example: Decaying Exponential

Let f(t) = e−αt1(t), for α ≥ 0, then

F (s) = L(f(t))

=

∫ ∞

0

e−ste−αtdt

=

∫ ∞

0

e−(s+α)tdt

=1

s + α

1.2 Properties

In practise, the definition is almost never used to compute the forward transform. Wealmost always rely on tables of common transforms, and use the properties of the transformto massage f(t) into one or more components that are in the tables.

11

Page 12: Control Systems 1 notes

f(t) F (s)

δ(t) unit impulse 1

u(t) unit step 1s

cu(t) cs

t ramp 1s2

tn n!sn+1

e−at 1s+a

te−at 1(s+a)2

tne−at 1(s+a)n+1

sin bt bs2+b2

cos bt ss2+b2

e−at sin bt b(s+a)2+b2

e−at cos bt s+a(s+a)2+b2

Table 1: Some Laplace Transforms

1.2.1 Linearity

Suppose L(f1(t)) = F1(s) and L(f2(t)) = F2(s). Then, for any constants, A and B,

L(Af1(t) + Bf2(t)) = AF1(s) + BF2(s)

Proof – integration is a linear operation.

1.2.2 Integration

L(∫ t

0

f(τ)dτ

)

=1

sF (s)

Proof – write out the definition, integrate by parts.

1.2.3 Differentiation

L(

d

dtf(t)

)

= sF (s)− f(0)

Proof – write out the definition, integrate by parts. Also

L(

d2

dt2f(t)

)

= s2F (s)− sf(0)− d

dtf(0)

L(

dk

dtkf(t)

)

= skF (s)− sk−1f(0)− sk−2 d

dtf(0) . . .− dk−1

dtk−1f(0)

These properties are incredibly useful for solving ODEs. In the transform domain, inte-gro/differential equations are replaced with algebraic equations.

12

Page 13: Control Systems 1 notes

1.2.4 Convolution Integral

The convolution integral is defined as

f1(t) ∗ f2(t) =

∫ ∞

0

f1(t− τ)f2(τ)dτ

The Laplace transform of a convolution integral is,

L (f1(t) ∗ f2(t)) = F1(s)F2(s)

This is incredibly useful, in a systems context. For example, suppose that h(t) is the impulseresponse of a LTI system. Then, if its input is u(t), the corresponding output is

y(t) = h(t) ∗ u(t) =

∫ ∞

0

h(τ)u(t− τ)dτ

which is a rather ugly expression. However, in the frequency domain, this is just a multipli-cation

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

Furthermore, we will be able to to “block diagram algebra”

1.2.5 Final Value Theorem

The only problem with working in the frequency domain, is that we will eventually haveto transform back to the time domain (more on that later). The central approach in thiscourse, will be to stay in the frequency domain as long as possible. In many cases, we willbe able to answer all of the relevant questions in the FD, and won’t have to do the inversetransform. One of the tools that makes this possible, is the final value theorem.

limt→∞

f(t) = lims→0

sF (s)

Provided that F (s) does not have any poles with non-negative real parts, and has at mostone pole at the origin.

1.2.6 Example: FVT in action

Suppose a control system has the transfer function

H(s) =100

s2 + 10s + 129

and it has to track a step input (i.e. has to go to 1). Let what is the steady state value ofe(t)?

Solution: Let r(t) be a unit step input. Then, R(s) = 1/s, and the output is given by

Y (s) = H(s)1

s=

100

s(s2 + 10s + 129)

13

Page 14: Control Systems 1 notes

Thus, the final value of y(t) is

limt→∞

y(t) = lims→0

100

s2 + 10s + 129=

100

129

The final tracking error is

limt→∞

e(t) = limt→∞

(r(t)− y(t))

= 1− 100

129=

29

129≈ 22%

Is this a good control system? Probably not. However, the important point here, is that wewere able to deduce that without transforming back into the time domain.

1.2.7 Initial Value Theorem

f(0+) = lims→∞

sF (s)

Useful for sanity checks (especially in the rare instances when we actually have to do aninverse transform).

2 Inverse Laplace Transform

• One of the secrets of this course, is that we will be doing everything that we canto avoid returning to the time domain. It’s still useful to remember how the inversetransform works, but you probably won’t have to invert any transforms.

2.1 Formal Definition

L−1(

F (s))

= f(t) =1

2πj

∫ c+j∞

c−j∞

F (s)estds

This isn’t too useful, unless you are a fan of residue calculus.

2.2 Partial Fraction Expansion

Since we will be using the Laplace transform to solve ODEs, we will be dealing almostexclusively with rational polynomials in s.

F (s) =B(s)

A(s)=

K(s− z1)(s− z2) . . . (s− zm)

(s− p1)(s− p2) . . . (s− pn)

with m < n.Note: m > n produces a non-causal system – one which reacts before it is stimulated.

We will deal with the case m = n later.

Vocabulary:

14

Page 15: Control Systems 1 notes

• z1 . . . zm, the solutions to B(s) = 0, are called the zeros of F (s).

• p1 . . . pn, the solutions to A(s) = 0, are called the poles of F (s).

Note: Some books write the transfer function as follows:

F (s) =B(s)

A(s)=

K(s + z1)(s + z2) . . . (s + zm)

(s + p1)(s + p2) . . . (s + pn)

in which case the poles and zeros are at s = −pk and s = −zk, respectively.

If all of the poles are distinct, pi 6= pj, for all i 6= j, then it F (s) can be written as

F (s) =r1

s− p1+

r2

s− p2+ . . . +

rn

s− pn

which is easily inverted, once we know the constants rk.

f(t) = r1ep1tu(t) + . . . + rnepntu(t)

So, how do we find the constants (residues), rk?Multiply both sides by s− pk. Using the expansion, we have

(s− pk)F (s) = (s− pk)r1

s− p1+ . . . (s− pk)

rk

s− pk+ . . . (s− pk)

rn

s− pn

This must be true for all possible values of s. In particular, it must also be true when s = pk.In this case,

(s− pk)F (s)

s=pk

= 0 + . . . + rk + . . . 0.

Therefore, to evaluate rk, compute (s− pk)F (s), and set s = pk.

2.2.1 Example: Distinct Poles

Suppose Y (s) = 3−ss(s2+4s+3)

. Find y(t).

Use partial fraction expansion,

1. Poles of Y (s), s = 0, and s2 + 4s + 3 = 0.

s2 + 4s + 3 = (s + 1)(s + 3) = (s− (−1))(s− (−3))

2. expansion

Y (s) =r1

s+

r2

s + 1+

r3

s + 3

15

Page 16: Control Systems 1 notes

3. find the coefficients.

r1 =3− s

(s + 1)(s + 3)

s=0

= 1

r2 =3− s

s(s + 3)

s=−1

=4

(−1)2= −2

r3 =3− s

s(s + 1)

s=−3

=6

(−3)(−2)= 1

4. Invert the bits

Y (s) =1

s+−2

s + 1+

1

s + 3

Thus,

y(t) = 1(t)− 2e−t1(t) + e−3t1(t) = (1− 2e−t + e−3t)u(t)

2.2.2 Avoiding the Inverse Transform

• Notice that we can tell a lot about the response without actually doing the inversetransform.

• In the previous example, we can see immediately that the response is going to containa step and 2 exponentials,

Y (s) =r1

s+

r2

s + 1+

r3

s + 3

• The 1/s term will give us a unit step, the 1/(s + 1) will give us an e−t term, and the1/(s + 3) will give us an e−3t term.

• Clearly, the two exponentials will decay to zero as t→∞, leaving the unit step.

• We can use the final value theorem to find the steady state response.

limt→∞

y(t) = lims→0

sY (s) = 1

• Secondly, we can see that the longest lasting term in the transient response will beproportional to e−t.

• To get any more information, we will probably have to break down and do the inversetransform. However, this is usually enough information for design purposes.

16

Page 17: Control Systems 1 notes

2.3 Special Cases of the Inverse Laplace Transform

2.3.1 What if n = m?

If n = m, then we can use long division, to rewrite F (s) as the sum of a constant and arational whose numerator order is at least one less than its denominator order.

Example:

F (s) =2s2 + 11s + 13

s2 + 5s + 6

Do the long division

2s2 + 5s + 6

)

2s2 + 11s + 132s2 + 10s + 12

s + 1

Thus,

F (s) = 2 +s + 1

s2 + 5s + 6

= 2 +2

s + 3− 1

s + 2

The inverse Laplace transform of 2 is 2δ(t), we know how to handle the rest.

f(t) = 2δ(t) +(

2e−3t − e−2t)

u(t)

2.3.2 Repeated Poles

• Suppose

F (s) =2

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

K1

(s + 1)+

K2

(s + 2)2+

K3

(s + 2)

• The coefficient K1 can be found in the usual way,

K1 =2

(s + 2)2

s=−1= 2

• To find K2, multiply both sides by (s + 2)2, thus

(s + 2)2F (s) =2

s + 1= (s + 2)2 K1

(s + 1)+ (s + 2)2 K2

(s + 2)2+ (s + 2)2 K3

(s + 2)

= (s + 2)2 K1

(s + 1)+ K2 + (s + 2)K3

which must be true for all s, so set s = −2, resulting in

(s + 2)2F (s)∣

s=−2=

2

−1= −2 = K2

17

Page 18: Control Systems 1 notes

• If you differentiate (s + 2)2F (s), with respect to s,

d

ds(s + 2)2F (s) =

d

ds

2

s + 1=

−2

(s + 1)2

but differentiating the partial fraction expansion yields

d

ds

(

(s + 2)2 K1

(s + 1)+ K2 + (s + 2)K3

)

= K12(s + 2)(s + 1)− (s + 2)2

(s + 1)2+ 0 + K3

• Note that the first term can be rewritten as

K1(s + 2)2(s + 1)− (s + 2)

(s + 1)2

which makes the factor of s + 2 obvious.

• Since the equality must hold for all values of s, we might as well choose a value thatwill make it easy to solve — say s = −2.

• Thus,

K3 =d

ds(s + 2)2F (s)

s=−2

=−2

(s + 1)2

s=−2

= −2

• So, the partial fraction expansion is

F (s) =2

(s + 1)− 2

(s + 2)2− 2

(s + 2)

• The inverse transform is

f(t) = 2(

e−t − te−2t − e−2t)

u(t)

2.4 Complex Poles

• If you get complex poles, they will always occur in complex conjugate pairs.

• Furthermore, a pair of complex conjugate poles with negative real parts, will generatean exponentially decaying sinusoid in the time domain.

• If the transform has a pair of complex conjugate poles, the partial fraction expansionwill include a term like,

K1s + K2

s2 + bs + c

Note: There is no easy way to find K1 and K2 – you’ll probably have to clear fractions,and solve (after you have solved for the other residues).

18

Page 19: Control Systems 1 notes

2.4.1 Completing the Square

• To inverse transform this term, use the two transform pairs,

e−at sin(ωt)u(t) ↔ ω

(s + a)2 + ω2

e−at cos(ωt)u(t) ↔ s + a

(s + a)2 + ω2

• First equate the denominators, to determine a and ω.

s2 + bs + c =

(

s +b

2

)2

+ c− b2

4

= (s + a)2 + ω2

• For example, given

F (s) =s + 2

s2 + 2s + 5=

s + 2

(s + 1)2 + 4so

a = 1 ω = 2

• Now that we have a and ω, write the numerator as

K1s + K2 = α(s + a) + βω

• For example

s + 1 = 1 · (s + 1) +1

2· 2

• Now that we have this, we can write down the inverse Laplace transform,

f(t) = 1 · e−t cos(2t)u(t) +1

2e−t sin(2t)u(t)

• Pull out the common factors, e−t and u(t), and then (since the cos and sin have thesame frequency) we can write the sinusoidal components as a phasor

PSfrag replacementsφ

12

1

90o

0o

f(t) = e−tu(t)[cos(2t) +1

2sin(2t)]

f(t) = e−tu(t)[ 6 0o +1

26 90o]

f(t) =

√5

2e−t cos(2t− φ)u(t)

where φ = tan−1

(

1/2

1

)

≈ 26.6o

19

Page 20: Control Systems 1 notes

2.4.2 Expansion with Complex First-Order Poles

• Alternately, if you don’t mind working with complex numbers (you are EEs after all),simply treat the complex poles as any other poles in the partial fraction expansion,but with complex coefficients.

• Returning to the example,

F (s) =s + 2

s2 + 2s + 5

Factor the denominator,

s2 + 2s + 5 = (s + (1 + 2j))(s + (1− 2j))

= (s− (−1− 2j))(s− (−1 + 2j))

so that the partial fraction expansion is

s + 2

s2 + 2s + 5=

r1

s− (−1− 2j)+

r1

s− (−1 + 2j)

where the over-bar indicates a complex conjugate.

• Solve for r1 in the usual way

r1 =s + 2

s− (−1 + 2j)

s=−1−2j=

1− 2j

−4j=

2 + j

4

• Thus,

F (s) =1

4

(

2 + j

s− (−1− 2j)+

2− j

s− (−1 + 2j)

)

which inverse transforms to

f(t) =1

4e−t ((2 + j)(cos(2t)− j sin(2t)) + (2− j)(cos(2t) + j sin(2t)))u(t)

=e−t

4(4 cos(2t) + 2 sin(2t))u(t)

and the rest proceeds as before.

20

Page 21: Control Systems 1 notes

2.4.3 Graphical Approach

• Suppose that you want to evaluatethe function s−(−2) = s+2 at somepoint s = s0.

• Plot the function s + 2 as a zero inthe complex plane (at s = −2 + j0).

• Plot the point s = s0 in the complexplane.

• Notice that a vector drawn from s =−2+j0 to s = s0 represents the com-plex number

s0−(−2+j0) = s0+2 = (s+2)∣

s=s0

• In polar coordinates, this is r 6 θ.

• Using a ruler and protractor you canmeasure these quantities off the plot

• You can also use trigonometry to findthese quantities

O real

imag

s = −2

s = s0

Example) If s0 = −1+ j then s0 +2 = r 6 θ where r =√

12 + 12 =√

2 and θ = tan−1 11

= 450

Back to the Example

• In the example, we had to do the partial fraction expansion,

s + 2

s2 + 2s + 5=

r1

s− (−1− 2j)+

r1

s− (−1 + 2j)

where

r1 =s + 2

s− (−1 + 2j)

s=−1−2j

• Thus, we must compute the values of

– A zero at s = −2, evaluated at the point s = −1− 2j

– A pole at s = −1 + 2j evaluated at the point s = −1− 2j

and then divide the two.

• Plot the pole and zero in the complex plane, and draw lines from them to s0 = −1−2j(the location of the other pole).

21

Page 22: Control Systems 1 notes

X

O

√5 6 − 63.4o

Re(s)

Im(s)

s = −2

s = −1 + 2j

s = −1− 2j

4 6 − 90o

• (s+2)∣

s=−1−2jis a vector starting at

s = −2, and terminating at s = −1−2j. After a little trigonometry, thisis√

5 6 − 63.4o.

• (s+(1−2j))∣

s=−1−2jis a vector start-

ing at s = −1 + 2j going to s =−1− 2j. By inspection, this is −4j,or 4 6 − 90o.

• To divide two complex numbers, di-vide their magnitudes, and subtracttheir arguments (angles).

• Thus,

r1 =

√5 6 − 63.4o

4 6 − 90o=

√5

46 26.6o

• Notice that

F (s) =rejφ

s− (−1− 2j)+

re−jφ

s− (−1 + 2j)

f(t) = rejφe(−1−2j)t + re−jφe(−1+2j)t

= re−t(

ej(−2t+φ) + e−j(−2t+φ))

= 2re−t cos(2t− φ)

• So, in the example, r =√

5/4, and φ ≈ 26.6o, we have

f(t) =

√5

2cos(2t− φ)

3 Transfer Functions and Block Diagrams

• In practise, we almost always assume zero initial conditions. In that case, we only haveto deal with the “zero state” response, which leads to the transfer function,

Y (s) = G(s)V (s)

• Suppose we used y(t) (isolated by a buffer amplifier) as the input to another system,whose transfer function is H(s). Then, the output of the combined system will be

Z(s) = H(s)Y (s) = H(s)(G(s)V (s))

provided that the system H(s) doesn’t load the circuit (i.e. it doesn’t change y(t) bydrawing current). This is usually accomplished using some sort of buffer amplifier (orvoltage controller voltage source, if you prefer).

22

Page 23: Control Systems 1 notes

• The implication of this is that when transfer functions appear in series, we can simplymultiply them together. Thus, these two block diagrams are equivalent.

G(s) H(s)

G(s)H(s)

V (s)

V (s)

Y (s) = G(s)H(s)V (s)

Y (s) = G(s)H(s)V (s)

3.1 More Block Diagram Tricks

Before getting into the general strategy for simplifying block diagrams, here are some tools.The general idea is to make sure that none of the outputs is changed by any block diagrammanipulation. For example,

• Simplifying parallel branches

+

+

H(s)

G(s)

Y(s)R(s)

is equivalent toY(s)

G(s)+H(s)

R(s)

R(s)G(s) + R(s)H(s) = Y (s) R(s)[G(s) + H(s)] = Y (s)

• Moving a branch point before a block

R(s)

H(s)

Y(s)

Y(s)

is equivalent toR(s)

H(s)

H(s)Y(s)

Y(s)

R(s)H(s) = Y (s) R(s)H(s) = Y (s)

• Moving a branch point after a block

Y(s)

R(s)

R(s)

H(s)

is equivalent to R(s) Y(s)

R(s)

H(s)

1/H(s)

R(s) = R(s) R(s)H(s)/H(s) = R(s)

23

Page 24: Control Systems 1 notes

• Moving a summing junction

+

+R(s) Y(s)

W(s)

H(s)

is equivalent to

+

+

R(s) Y(s)

W(s)

H(s)

H(s)

[R(s) + W (s)]H(s) = Y (s) R(s)H(s) + W (s)H(s) = Y (s)

• The basic strategy behind these manipulations, is to make sure that none of the outputschange as a result of the simplification.

• Simplifying a feedback loop

−+ Y(s)R(s) E(s)

G(s)

H(s)

Y (s) = G(s)E(s)

Y (s) = G(s)[R(s)−H(s)Y (s)]

Y (s) = G(s)R(s)−G(s)H(s)Y (s)

Y (s)

R(s)=

G(s)

1 + H(s)G(s)

R(s) G(s)

1 + H(s)G(s)

Y(s)

3.2 Example: Simplifying a Block Diagram

++

+R(s)

E(s)

Y(s) C(s)

H(s)

G(s)

F(s)

24

Page 25: Control Systems 1 notes

3.2.1 Option 1: Just use Algebra

C(s) = F (s)E(s) + G(s)E(s)

= (F (s) + G(s))E(s)

E(s) = R(s)−G(s)H(s)E(s)

=R(s)

1 + G(s)H(s)

C(s) =F (s) + G(s)

1 + G(s)H(s)R(s)

3.2.2 Option 2: Block Diagram Manipulation

• Look for feedback loops.

• Is the top half a feedback loop?

• Move the branch-point outside of the feedback loop.

++

+G(s)

H(s)

R(s)

E(s) Y(s)

C(s)

F (s)

G(s)

• Note that we had to compensate for G(s).

• Simplify the feedback loop and the parallel branches.

R(s) C(s)

1 +F (s)

G(s)

G(s)

1 + H(s)G(s)

• Thus, the transfer function is

C(s) =G(s) + F (s)

1 + G(s)H(s)R(s)

25

Page 26: Control Systems 1 notes

General Strategy:

• Identify potential feedback loops, and move branches around to untangle these loops.

• Starting with the innermost loops, simplify them, and then compute their transferfunctions.

• Continue in this manner until you reach the outermost loop.

3.2.3 Which approach is better?

• The algebraic approach is probably more familiar at this stage.

• The graphical approach is easier to debug –

– In the context of this class, it means that the TAs and I will be able to mark/correctyour assignments and tests more easily.

– Out in the real world, it means that your supervisor/co-workers will be able tofigure out your analysis more easily (and you will be able to figure out what youwere thinking when you re-examine a design 6 months later).

– For large systems, it is easy to get lost in the algebra – however, the graphicalapproach is constructed to be “local”. It should be easier to concentrate on asection of the system, simplify it, and then move on.

3.3 Multiple Input Systems

• Multiple-Inputs may represent either control actions or disturbances.

• For a linear system, we can use superposition, and break the system into several transferfunctions, one for each input.

+−

++ C(s)R(s)

D(s)

H(s)G(s)

• Ignore D(s). The transfer function from R(s) to C(s) is

+−

C(s)R(s)

G(s) H(s)G(s)H(s)

1 + H(s)G(s)

26

Page 27: Control Systems 1 notes

• Ignore R(s). Redraw the block diagram, with H(s) in the forward path, and G(s) inthe feedback path. Watch the - sign!!

++

+

C(s)

D(s) C(s)

H(s)

G(s)

G(s) H(s)

D(s)

H(s)

1 + G(s)H(s)

• We can now draw the system as a two-input, single output block diagram:

R(s)

D(s) +

+C(s)

G(s)H(s)

1 + H(s)G(s)

H(s)

1 + H(s)G(s)

• Note that both systems have the same denominator. (1 + the loop gain).

27

Page 28: Control Systems 1 notes

4 Case Study: Cruise Control System

4.1 Dynamic Modelling

This section serves as a motivation for learning about Laplace and Inverse Laplace trans-forms. The basic steps of dynamic modelling are outlined below illustrated with the simpleexample of modelling the velocity of a car, which we will use to design a cruise controlsystem.

1. Draw a diagram

PSfrag replacements

engine

gravity

friction

x

θ

2. Write the differential equation (DE)

Use Newton’s Law F = ma

sum of forces = mass× acceleration

gravity + friction + control (engine) force = mass× acceleration

constantsb friction coefficientg acceleration of gravitym mass of the car

variablesx(t) position of the cary(t) velocity of the carθ(t) angle of the roadu(t) force supplied by the engine

mg sin(θ)− bx + u = mx

3. Linearize the DE if necessary.

We will discuss this formally later, but for now let’s use the property that sin θ ≈ 0when |θ| << 1. Our model will be valid only for a near-horizontal surface.

−bx + u = mx

−by + u = my

4. Take the Laplace transform to get an algebraic expression

−bY (s) + U(s) = m(sY (s)− y(0))

5. Solve for the output variable Y (s)

Y (s) =U(s)

sm + b+

my(0)

sm + b

28

Page 29: Control Systems 1 notes

6. Identify the transfer function(s).

This is the ratio of an output over an input, defined with with zero initial conditions.

T (s) =Y (s)

U(s)=

1

sm + b

If the initial conditions need to be considered, we can also write a ratio of output overthe initial condition, so that the initial condition looks like an “input.” Technically,this is not a transfer function.

Y (s)

y(0)=

m

sm + b

7. Draw a block diagram

The initial conditions are not normally considered in a block diagram, but there is noproblem with doing so.

PSfrag replacements

U(s)

Y(s)

y(0)

1sm+b

1sm+b

msm+b

+

+

Normally in this course, this is as far as we will go. At this point we have all theinformation we need to start desiging a control system. However, right now we areinterested in how the system behaves in time. Thus we are looking for a solution toy(t).

8. Use partial fraction expansion.

If the control is constant u(t) = f then using our table of Laplace transforms we getU(s) = f/s so that

Y (s) =f/s

(sm + b)+

my(0)

sm + b=

f/m

s(s + b/m)+

y(0)

s + b/m

and partial fraction expansion of the first term gives

Y (s) =K1

s+

K2

s + b/m+

y(0)

s + b/m

where

K1 =f/m

s + b/m

s=0

=f

b

K2 =f/m

s

s=−b/m

= −f

b

29

Page 30: Control Systems 1 notes

so that

Y (s) =f/b

s− f/b

s + b/m+

y(0)

s + b/m

Note that at this point we can tell what the final velocity will be using the final valuetheorem

limt→∞

y(t) = lims→0

s

[

f/b

s− f/b

s + b/m+

y(0)

s + b/m

]

=f

b

9. Take the inverse Laplace transform

Using the table of Laplace transforms to do the inverse on each term we get

y(t) =f

b− f

bexp

(

− b

mt

)

+ y(0) exp

(

− b

mt

)

10. Graph the output

Let’s use the following numbers in SI units (1 N = 1 kg m/s2)

constant valueb 100 kg/s friction coefficientm 1000 kg mass of the car

We will graph three different cases

• case 1 u(t) = f = 100 N and y(0) = 0 m/s

We can use MATLAB to do the dirty work for us. First set the constants

b=100

m=1000

Now enter the transfer function using the matlab command “tf()” (type “help tf”in MATLAB for an explanation).

num=[1]

den=[m b]

sys=tf(num,den)

We use the command “lsim()” to simulate the dynamics (it numerically integratesthe differential equation for us)

f=100;

t=[0:1:100];

u=f*ones(1,101);

y1=lsim(sys,u,t);

plot(t,y1);

title(’constant f=100, zero initial condition’);

xlabel(’time (s)’);

ylabel(’velocity (m/s)’);

axis([0 100 0 1.5])

30

Page 31: Control Systems 1 notes

0 10 20 30 40 50 60 70 80 90 1000

0.5

1

1.5constant f=100, zero initial condition

time (s)

velo

city

(m

/s)

PSfrag replacements

U(s)

and we can see the final velocity is indeed f/b = 1 as we knew from the FinalValue Theorem.

• case 2 u(t) = f = 0 N and y(0) = 10 m/s

In this case, there is no actual transfer function so we can’t use “tf()”. We mustuse the mathematical expression we derived from the inverse Laplace transform.

y0=10;

t=[0:1:100];

y2=y0*exp(-b/m*t);

plot(t,y2);

title(’zero engine force, initial condition y0=10 m/s’);

xlabel(’time (s)’);

ylabel(’velocity (m/s)’);

0 10 20 30 40 50 60 70 80 90 1000

5

10zero engine force, initial condition y0=10 m/s

time (s)

velo

city

(m

/s)

PSfrag replacements

U(s)

• case 3 u(t) = f = 100 N and y(0) = 10 m/s

This is a linear system, so we can just add the results of the first two cases aboveto get the answer.

plot(t,y1+y2’);

title(’engine force f=100 N, initial condition y0=10 m/s’);

xlabel(’time (s)’);

ylabel(’velocity (m/s)’);

0 10 20 30 40 50 60 70 80 90 1000

5

10engine force f=100 N, initial condition y0=10 m/s

time (s)

velo

city

(m

/s)

PSfrag replacements

U(s)

31

Page 32: Control Systems 1 notes

4.2 A Control System

How can we design a cruise control system? We want the driver to input a desiredvelocity for the car, a constant ydes, and the computer should do the work. Thecomputer could do the following calculation to decide on the right engine force toapply

u(t) = K (ydes − y(t))

where K is a positive constant that we can choose in the design process. To seeif this works, first take the Laplace transform

U(s) = K(ydes

s− Y (s)

)

Substitute this into our equation

Y (s) =1

sm + bU(s) +

my(0)

sm + b

Y (s) =1

sm + bK(ydes

s− Y (s)

)

+my(0)

sm + b

Y (s)

(

1 +K

sm + b

)

=1

s

Kydes

sm + b+

my(0)

sm + b

Y (s) =1

s

Kydes

sm + b + K+

my(0)

sm + b + K

The Final Value Theorem tells us

limt→∞

y(t) = lims→0

Y (s) =Kydes

b + K

So, for example, if we want to go 30m/s and we picked K = 1000 then no matterwhat velocity we start at (y(0) = anything) we get to

limt→∞

y(t) =100× 30

100 + 100= 27m/s

Note that the larger we choose K, the closer we get to the desired velocity. Butwe would need K = ∞ to get there exactly. Later in the course we will see howto design a control system to get zero steady-state error, if that’s what’s required.

At this piont, we don’t know how long it takes to get to the steady state value.For that information, we need to take the inverse Laplace transform and graphthe behaviour.

32

Page 33: Control Systems 1 notes

5 Mathematical Models of Dynamic Systems

• The first step in designing a control system, such as the cruise control described in theprevious lecture, is to construct a mathematical model of the system.

• Definition: A mathematical model is an equation (or system of equations) that pre-dicts the behaviour of a physical system.

• To be useful, a model must be accurate enough to provide reasonable predictions of thesystem’s response to plausible inputs, yet simple enough that the resulting calculationsare tractable.

5.1 Examples

• In physics/mechanics

– f = ma (Newton II)

– f = −kx (Hooke’s Law)

• In EE, we have a bunch

– v(t) = Ri(t)

– v(t) = Ldi(t)/dt

– v(t) = Cq(t)

– KVL and KCL

– Op-Amp: No voltage across ± terminals, no current into either input terminal.

+

– Diode characteristic

vin(t)

vout(t)

33

Page 34: Control Systems 1 notes

You have used all of these models extensively over the last couple of years. Useful asthey are, they all sweep a lot of detail under the rug. For example, Ohm’s law ignores:

• Thermal effects on resistor

• any inductance/capacitance in the “resistor”

• Quantum mechanical effects,

• etc.

however, we still use Ohm’s law whenever we need to describe a resistor (mathematically).

5.2 Mathematical Models of Linear Mechanical Motion

• We will be dealing with “lumped” models. In circuits, you lumped all of the resistanceinto resistors, despite the fact that the wires also resisted the flow of current, andlumped all of the capacitance into capacitors, ignoring the capacitance between nearbywires, etc. The same approach is used in mechanical systems. All of the system’s massis contained in one or more “point masses”, that obey Newton II.

f(t) = ma(t) = md2

dt2x(t) = mx(t)

• The mechanical equivalent to a node in KCL (or a loop in KVL) is the free body

diagram, which shows a point mass and all of the forces acting on it.

x(t)

mf(t)

• In this case, we are considering horizontal motion (so that we can ignore gravity). Weare also ignoring friction between the mass and the horizontal surface – suppose thatit is sitting on an air-hockey table.

• Note that the free-body diagram also specifies the sign convention. In this case, motionand forces that point to the right are considered to be in the positive direction. Themass obeys Newton II

34

Page 35: Control Systems 1 notes

5.2.1 Mass/Spring systems

• Consider a system consisting of a mass attached to a spring.

k

x(t)

m

• The force produced by the spring obeys Hooke’s law:

f(t) = −kx(t)

where k is the spring constant, and has units of N/m.

• The displacement, x(t), is the displacement away from the resting length of the spring.

• An equivalent free body diagram is:

x(t)

m−kx(t)

• Note the -ve sign. Thus, a displacement to the right causes a force, and hence acceler-ation, to the left.

5.2.2 Mass/Damper systems

• Consider a system consisting of a mass attached to a viscous damper (eg a shockabsorber in an automobile suspension).

x(t)

m

b

• The force produced by the damper is proportional to the velocity,

f(t) = −bx(t)

where b is the damping factor, and has units of Ns/m.

35

Page 36: Control Systems 1 notes

• An equivalent free body diagram is:

x(t)

m−bx(t)

• Note the -ve sign. Thus, motion to the right causes a force, and hence acceleration, tothe left.

Example: Equation of motion

• Consider the following system comprising a mass attached to a spring and damper,that is driven by the external force f(t).

m

k

b

x(t)

f(t)

• The first step is to draw a free body digram of the mass. Replace the spring anddamper with the forces that they generate (just copy them in from the appropriatefree body diagrams.

x(t)

m

−bx(t)

−kx(t)f(t)

• Now write down Newton II

mx(t) =∑

external forces

= f(t)− bx(t)− kx(t)

36

Page 37: Control Systems 1 notes

• Transform into the Laplace domain

m(

s2X(s)− sx(0)− x(0))

= F (s)− b (sX(s)− x(0))− kX(s)

group all of the X(s) terms on the left hand side,

(ms2 + bs + k)X(s) = F (s) + mx(0) + (ms + b)x(0)

and solve for X(s)

X(s) =1

ms2 + bs + kF (s) +

m

ms2 + bs + kx(0) +

ms + b

ms2 + bs + kx(0)

• The first term is the transfer function applied to the input, whereas the last two termsare the effects of the initial conditions.

• Assuming zero initial conditions, we have the transfer function

X(s) =1

ms2 + bs + kF (s)

37

Page 38: Control Systems 1 notes

5.3 Linear Motion with Gravity

• So far, we have considered horizontal motion along a frictionless surface.

• The position x = 0 was taken to be the position where the spring produced no force.

• How do we deal with vertical motion? Consider this system,

my(t)

fe(t)fg = −mg

k b

• As before, draw a free body diagram. Note the constant force, fg = −mg, due togravity.

my(t)

fe(t)−mg

−ky(t) −by(t)

• The equation of motion becomes:

my(t) = fe(t)−mg − by(t)− ky(t)

Assuming zero initial conditions, this becomes:

Y (s) =1

ms2 + bs + k

(

Fe(s)−mg

)

• Is this a linear system?

• What happens if we double the amplitude of the input?

• Suppose that Y1(s) is the position that results when the input Fe,1(s) is applied. Whathappens if we double the input, Fe,2(s) = Fe,1(s)?

38

Page 39: Control Systems 1 notes

• If the system is linear, the output will be Y2(s) = 2Y1(s). Does this happen?

Y2(s) =1

ms2 + bs + k

(

2Fe,1(s)−mg

)

= 21

ms2 + bs + k

(

Fe(s)−mg

)

+mg

ms2 + bs + k

= 2Y1(s) + ms2 + bs + k

• So, superposition does not apply, and the system is nonlinear.

5.3.1 Linearizing the System

• All is not lost, at least in this case, as we can make this system linear via a simplechange of variables.

• In the horizontal motion case, we took x(t) = 0 to be the position where the springproduced no force.

• What happens if we define a new position variable, say y0(t), such that y0(t) = 0corresponds to the position where the spring exactly cancels the force due to gravity.

y0(t) = y(t) + mg/k

• Substitute y(t) = y0(t)−mg/k into the equation of motion

my0(t) = fe(t)−mg − by0(t)− k(y0(t)−mg/k)

= fe(t)− by0(t)− ky0(t)

• In the frequency domain, we have

Y0(s) =1

ms2 + bs + kFe(s)

which is a linear system.

• In general, we will choose the “zero position” such that the effects of gravity arecancelled – leaving us to deal with a linear system.

5.3.2 Example: A car suspension

• We will develop a mathematical model of a car suspension where the input is the(vertical) position of the road, and the output is the position of the car chassis.

• To simplify things, we will only consider one corner of the car – so this is really aquarter-car suspension.

39

Page 40: Control Systems 1 notes

Suspension

Chassis

Axle

Tire

m1

k2

y2(t)

y1(t)

b2

m2

u(t)k1

• As in the previous example, we will define the positions y1 = y2 = 0, to be the “restposition” for both masses.

• Draw a free-body diagram for the car chassis.

k2

y2(t)

b2

m2

y1(t)

m2

k2(y1(t)− y2(t))b2(y1(t)− y2(t))

• Notice that the forces produced by the spring and damper are computed by taking theaxle position as if it were fixed. Thus, the spring force is proportional to y1(t)− y2(t).In the previous examples, which all concerned a single body, the other end of the springwas taken to be at zero, in which case we got k(0 − y2(t)) = −ky2(t) as the springforce.

• Write down the equation of motion for the chassis:

m2y2(t) = b2(y1(t)− y2(t)) + k2(y1(t)− y2(t))

and transform into the Laplace domain

(m2s2 + b2s + k2)Y2(s)− (b2s + k2)Y1(s) = 0

• Do the same for the car axle

m1

k2

y1(t)

b2

u(t)k1

y2(t)

m1

k1(u(t)− y1(t))

k2(y2(t)− y1(t))b2(y2(t)− y1(t))

40

Page 41: Control Systems 1 notes

m1y1(t) = b2(y2(t)− y1(t)) + k2(y2(t)− y1(t)) + k1(u(t)− y1(t))

or in the Laplace domain

(m1s2 + b2s + k1 + k2)Y1(s)− (b2s + k2)Y2(s) = k1U(s)

• Just as you did in node/loop analysis, set up a system of 2 equations in 2 unknowns,

[

−(b2s + k2) (m2s2 + b2s + k2)

(m1s2 + b2s + k1 + k2) −(b2s + k2)

] [

Y1(s)Y2(s)

]

=

[

0k1U(s)

]

and invert the matrix[

Y1(s)Y2(s)

]

=1

[

−(b2s + k2) −(m2s2 + b2s + k2)

−(m1s2 + b2s + k1 + k2) −(b2s + k2)

] [

0k1U(s)

]

where ∆ is the determinant

∆ = (b2s + k2)(b2s + k2)− (m1s2 + b2s + k1 + k2)(m2s

2 + b2s + k2)

= −m1m2s4 − b2(m1 + m2)s

3 − (m1k2 + m2(k1 + k2))s2 − b2k1s− k1k2

• Thus, the transfer function from the road position to the chassis position is

Y2(s) =k1b2s + k1k2

m1m2s4 + b2(m1 + m2)s3 + (m1k2 + m2(k1 + k2))s2 + b2k1s + k1k2

U(s)

• Aside from the physical meanings of the symbols, working with free body diagrams isidentical to the node/mesh analysis that we all know and love from circuit analysis.

5.3.3 Simulations using quarter-car model

• Now, use Matlab to simulate the response of the car suspension to a speed bump.

• First, we need some Matlab code the generates the transfer function model

• The model below can compute either the position or the acceleration of the chassis.To get the acceleration, the tranfer function is multiplied by s2 (i.e. two trailing zerosare added to the numerator vector.

41

Page 42: Control Systems 1 notes

function sys = qcar_tf(output);

% generates transfer function model of an automobile suspension tower.

%

% sys = qcar_tf(output)

%

% output = 0 (default) gives chassis position

% output = 1 gives chassis acceleration

if nargin < 1

output = 0;

end

% physical constants

% Tire and axle

m1 = 36 ; % kg -- wheel/axle mass

k1 = 320000 ; % N/m -- spring constant of tire

% suspension and chassis

m2 = 375 ; % kg -- chassis mass (1500/4)

k2 = 30000 ; % N/m -- suspension spring

b2 = 1960 ; % N-sec/m -- damping due to shock absorber

% enter the equations

switch output

case 0

% output is chassis position

num = k1*[b2 k2];

case 1

% output is chassis acceleration

num = k1*[b2 k2 0 0];

otherwise

error(’unrecognized output’);

end

den = [m2*m1 b2*(m2+m1) m1*k2+m2*(k1+k2) b2*k1 k1*k2];

% denominator is the same for all outputs.

sys = tf(num,den);

• Suppose that the speed bump has a semi-circular profile, with a radius of 10 cm. Hereis some Matlab code that generates the speed bump (followed by an equal length offlat road).

42

Page 43: Control Systems 1 notes

function [x,y] = speed_bump(radius);

% generates x and y positions for speed bump.

%

% [x,y] = speed_bump(radius);

% where radius is the radius of the bump (in m).

xx = radius*[-1:0.05:1]’;

yy = sqrt(radius^2 - xx.^2);

x = [xx+radius; radius*(2+[0.05:0.05:2]’)];

y = zeros(size(x));

y(1:length(yy)) = yy;

• If we cross the speed bump in 1 second, then t = 1 sec. will correspond to x = 0.2metres (i.e. twice the radius of the speed bump. Thus

[x,u] = speed_bump(0.1);

t = x/0.2;

sys = qcar_tf;

y = lsim(sys,u,t);

generates the chassis position in response to the speed bump. Similar calcuations areused to get the chassis acceleration.

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.40

0.05

0.1

distance travelled (m)

inpu

t pos

ition

(m

)

Speed Bump Response

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2−0.2

0

0.2

chas

sis

posi

tion

(m)

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2−10

0

10

acce

lera

tion

(m/s

2 )

time (s)

• If we take 2 seconds to cross the bump, then all that changes is

t = x/0.1;

43

Page 44: Control Systems 1 notes

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.40

0.05

0.1

distance travelled (m)

inpu

t pos

ition

(m

)

Speed Bump Response

0 0.5 1 1.5 2 2.5 3 3.5 4−0.2

0

0.2

chas

sis

posi

tion

(m)

0 0.5 1 1.5 2 2.5 3 3.5 4−5

0

5ac

cele

ratio

n (m

/s2 )

time (s)

44

Page 45: Control Systems 1 notes

5.4 Rotational Mechanical Systems

• For a linear mechanical system, we use Newton’s law:

mass× acceleration =∑

forces

mass× acceleration = spring + friction/damping + external

mx(t) = −kx(t) − bx(t) + f(t)

where m is the mass, k is the spring constant, and b is the damping coefficient, andf(t) is an externally applied force.

• For rotational systems, we make the following substitutions

Linear Motion Rotary Motion

Position x(t) Angle θ(t)

Velocity v(t) = x(t) Angular Velocity ω(t) = θ(t)Mass m Inertia JSpring Constant k Spring Constant kDamping Factor b Damping Factor DForce f(t) Torque T (t)

• As with linear mechanical systems, the spring and damping forces will oppose motion.

inertia× angular acceleration =∑

torques

inertia× angular acceleration = rotational spring + friction/damping + external torque

mθ(t) = −kθ(t)−Dθ(t) + T (t)

• Free body diagrams are translated as follows

f = mx

f = bxf = kx

xx

k b

J

θ(t)

Linear

RotationalPSfrag replacements

T (t) θ(t) D

k

J

45

Page 46: Control Systems 1 notes

PSfrag replacements

T1(t) θ1(t) T2(t)θ2(t)N1

N2

r1 r2

• Gears act like transformers in electrical systems. If you have a set of gears

Then the amount of rotation is decreased and the torque is increased

θ2 =N1

N2θ1 T2 =

N2

N1T1

• The idea, is to reflect torques, intertias, etc, through the gear train. Suppose that theequation of motion for gear 2, in isolation, is

(Js2 + Ds + K)θ2(s) = T2(s)

• Putting this in terms of the torque on gear 1

T2(s) =N2

N1

T1(s)

• Expressing the angle in terms of θ1(s),

(Js2 + Ds + K)N1

N2θ1(s) =

N2

N1T1(s)

so that the equation of motion for gear 1 is

(

N1

N2

)2

(Js2 + Ds + K)θ1(s) = T1(s)

• Thus, the “equivalent” inertia, damping and spring constants are given by:

Je =

(

N1

N2

)2

J De =

(

N1

N2

)2

D Ke =

(

N1

N2

)2

K

The transfer function from input T1 to output θ2 can be expressed in the originalparameters

θ2

T1

=N2

N1

1

(Js2 + Ds + K)

46

Page 47: Control Systems 1 notes

PSfrag replacements

T1(s) θ2(s)N2

N1

1Js2+Ds+K

or in the equivelent parameters

θ2

T1

=N1

N2

1

(Jes2 + Des + Ke)PSfrag replacements

T1(s) θ2(s)N1

N2

1Jes2+Des+Ke

5.5 Example: System with gears

• What is the transfer function relating input torque T1 to output position θ2 for thesystem below?

PSfrag replacements

T1(t) θ1(t)T2(t)

θ2(t)

N1

N2

D1

D2

K2

J1

J2

• Although there appear to be two bodies, their motion is coupled through the gear train(so there will only be one differential equation).

• Reflect the motions and torques of J1 onto the body J2, so that we have an equivalentequation of motion

(Jes2 + Des + Ke)θ2(s) = T2(s) =

N2

N1T1(s)

where the equivalent properties are given by,

Je = J2 + J1

(

N1

N2

)2

De = D2 + D1

(

N1

N2

)2

Ke = K

• Substitute these into transfer function

θ2(s)

T1(s)=

N2/N1

Jes2 + Des + Ke

47

Page 48: Control Systems 1 notes

6 DC Motors

• Here is a scematic diagram of a DC motor

+

+

Ra

LaRf

Lfvf(t)

if(t)

φ(t)va(t)

ia(t)

θ(t)Tm(t)

• The torque produced by the motor is proportional to the product of the magnetic fluxand the armature current.

Tm(t) = K1φ(t)ia(t)

where, provided that there is no magnetic saturation, and that there is no hysteresis,the flux is given by

φ(t) = Kf if (t)

• As a result, the torque is proportional to the product of the two currents

Tm(t) = K1Kf if(t)ia(t)

• Even with all of the assumptions, this is still a nonlinear system. However, if we fixone of the two currents, then the torque is proportional to the other current.

6.1 Field Controlled Motors

• For a field controlled motor, the armature current is kept constant. As a result, thetorque is proportional to the field current.

Tm(t) = K1Kf iaif(t) = Kmif (t)

• Since this is a linear relationship, we can take Laplace transforms,

Tm(s) = KmIf (s)

• The field circuit is series RL circuit, so that

Vf(s) = (Rf + sLf)If (s)

48

Page 49: Control Systems 1 notes

PSfrag replacements

Vf(s) If(s) Tm(s)Km

1Rf+sLf

• Combining these, we get

Tm(s) =Km

Rf + sLfVf(s)

• The velocity of the motor is found using Newton’s Law

Jθ(t) = −Dθ(t) + Tm(t)

Jω(t) = −Dω(t) + Tm(t)

Jsω(s) = −Dω(s) + Tm(s)

ω(s) =1

Js + DTm(s)

PSfrag replacements

Vf(s) Tm(s) ω(s)Km

Rf+sLf

1Js+D

• Note that velocity and position are related as follows

θ(t) = ω(t)

sθ(s) = ω(s)

θ(s) =1

sω(s)

• The position of the motor is given by

θ(s) =

(

1

s

)

1

Js + DTm(s) =

1

Js2 + DsTm(s)

PSfrag replacements

Vf(s) Tm(s) ω(s) θ(s)1s

Km

Rf+sLf

1Js+D

where J is the inertia of the motor shaft, and D is the damping due to the shaftbearing. Thus,

θ(s)

Vf(s)=

Km

s(Js + D)(Rf + sLf )=

Km/DRf

s(1 + sJ/D)(1 + sLf/Rf)

49

Page 50: Control Systems 1 notes

• Thus, the transfer function of the field controlled DC motor contains 2 time constants:τf = Lf/Rf , the field time constant, and tL = J/D, the load time constant

θ(s)

Vf(s)=

Km/DRf

s(1 + sτL)(1 + sτf )

In practice, motors are often designed so that τL � τf , so that its effects can beneglected. In that case

θ(s)

Vf(s)=

Km/DRf

s(1 + sτL)

6.1.1 An external load

• But there could be an external torque Td(s) working against the motor (i.e. it’s pushingsomething)

(Js + D)ω(s) = Tm(s)− Td(s)

ω(s) =1

Js + DTm(s)− 1

Js + DTd(s)

PSfrag replacements

Vf(s) Tm(s)

Td(s)

ω(s)θ(s)

1s

+ −Km

Rf+sLf

1Js+D

1Js+D

Note that we can rearrange the algebra to get an equivalent expression

ω(s) =1

Js + D(Tm(s)− Td(s))

so that in the same way the following block diagram is exactly equivelant to the oneabove

PSfrag replacements

Vf(s) Tm(s)

Td(s)

ω(s)

θ(s)1s

+ −Km

Rf+sLf

1Js+D

50

Page 51: Control Systems 1 notes

6.2 Armature Controlled Motors

• The other option, is to leave the field current fixed (or generate the field with a per-manent magnet), and vary the armature current.

• In this case,

Tm(s) = K1KfIf · Ia(s) = KmIa(s)

Note that in this case, the motor constant, Km, includes the constant field current(rather than the constant armature current as in the field controlled case).

• The armature circuit includes the series RL circuit, and a voltage source, termedthe back EMF, generated by the motion of the armature windings through the fluxgenerated by the field coils.

Va(s) = (Ra + Las)Ia(s) + Kbω(s)

• Thus, the armature current is

Ia(s) =Va(s)

Ra + sLa− Kbω(s)

Ra + sLaPSfrag replacements

Va(s) Ia(s)

ω(s)

+ −1

Ra+sLa

Kb

Ra+sLa

Using Newton’s Law gives us

Tm = Jsω(s) + Dω(s) = KmIa(s)

which can be solved for ω(s)

ω(s) =Km

Js + DIa(s) =

Km

Js + D

(

Va(s)

Ra + sLa− Kbω(s)

Ra + sLa

)PSfrag replacements

Va(s) Ia(s) ω(s)+ −

1Ra+sLa

Kb

Ra+sLa

Km

Js+D

51

Page 52: Control Systems 1 notes

• Note that we can rewrite the expression for Ia(s) as

Ia(s) =1

Ra + sLa(Va(s)−Kbω(s))

so an equivalent block diagram is

PSfrag replacements

Va(s) Ia(s) ω(s)+ −

1Ra+sLa

Kb

Km

Js+D

• But we have not isolated ω(s) algebraicly yet. Equating torques, we have

Tm = Jsω(s) + Dω(s) = KmIa(s) = KmVa(s)−Kbω(s)

Ra + sLs

• Divide both sides by Js + D,

ω(s) =KmVa(s)

(Js + D)(Ra + sLa)− KmKb

(Js + D)(Ra + sLa)ω(s)

• Move all the ω terms onto the left(

1 +KmKb

(Js + D)(Ra + sLa)

)

ω(s) =KmVa(s)

(Js + D)(Ra + sLa)

• Bring the right had side over a common denominator(

(Js + D)(Ra + sLa) + KmKb

(Js + D)(Ra + sLa)

)

ω(s) =KmVa(s)

(Js + D)(Ra + sLa)

• Solve for ω:

ω(s) =Km

(Ra + sLa)(Js + D) + KmKbVa(s)

• Again, it is common to design DC motors so that the armature time constant τa =La/Ra, is much faster than the load dynamics, so that τa can be ignored. In that case,we have

ω(s) =Km

Ra(Js + D) + KmKb

Va(s)

which leads to a mechanical time constant,

τl =RaJ

RaD + KmKb

so that

θ(s) =ω(s)

s=

Km/(RaD + KbKm)

s(1 + τls)

52

Page 53: Control Systems 1 notes

6.3 Linearization

• This course deals primarily with linear systems.

• Linear systems are relatively easy to work with because they satisfy the properties ofsuperposition and homogeneity (scaling).

1. Homogeneity (Scaling)

2. Superposition

• Unfortunately, every system in the real world is nonlinear (if you push it hard enough).Although designers and engineers take great care to make sure that many systemsbehave linearly, you may still have to deal with the occaisional nonlinear system.

• The simplest approach, is to linearize the system about one or more operating points,and then to analyse the linearized models.

1. Find an equilibrium point – where the system comes to rest given a constant(often zero) input. Call this point x0.

2. Compute a Taylor expansion about that point

f(x0 + ∆x) = f(x0) + ∆xdf

dx

x=xo

+ Higher Order Terms

3. Redfine x0 as 0, and analyse the linearized system

f(∆x) = K∆x

where K = dfdx

x=xo

• This is essentially how we dealt with gravity, when considering linear motion systems.We found x0, to be the point where the spring force cancelled gravity, and defined alldisplacements relative to xo. (Of course, the rest of the problem was linear).

6.4 Example: Nonlinear Spring

• Suppose that a nonlinear spring has the following characteristic,

fs(x) = k1x + k3x3

where k1 and k3 are positive. This spring gets stiffer as it is stretched away fromequilibrium.

• For k1 = 1000N/m, and k3 = 10, 000N/m3, the characteristic looks like:

53

Page 54: Control Systems 1 notes

−0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4−800

−600

−400

−200

0

200

400

600

800Nonlinear Spring Characteristic

For

ce (

N)

Displacement (m)

• Suppose that we have a mass/spring/damper system that includes this nonlinearspring,

x(t)

f(t)

m

b fs(x)

m = 50Kg

b = 100Ns/m

g ≈ 10m/s2

• How can we analyze the motion of this system?

• First, find the equilibrium point. In this case, we must find x such that

f(xo) = mg

To solve this, we have

1, 000xo + 10, 000x3o = 500 =⇒ 20x3

o + 20xo − 1 = 0

using Matlab’s roots function

>> roots([20 0 2 -1])

ans =

-0.1401 + 0.3986i

-0.1401 - 0.3986i

0.2801

54

Page 55: Control Systems 1 notes

using the single real solution, we have xo = 0.28m.

• Now, consider the variable y = x− xo, and do the Taylor expansion,

f(y) = f(xo) + ydf(x)

dx

x=xo

+ ...

Notice that the first term exactly cancels the effect of gravity.

• The second term is

y · (k1 + 3k3x2o) = yke ≈ 3350y

• Now, we can analyze the system as if the spring had spring constant of ke (providedthat y remains “small”).

−0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4−800

−600

−400

−200

0

200

400

600

800Nonlinear Spring Characteristic

For

ce (

N)

Displacement (m)

Nonlinear Spring ForceLinearized Spring Force

• Suppose that we have a mass/spring/damper system that includes this nonlinearspring,

x(t)

f(t)

m

b fs(x)

m = 50Kg

b = 100Ns/m

g ≈ 10m/s2

55

Page 56: Control Systems 1 notes

7 Transient Response Analysis:

• There are three fundamental questions concerning the performance of a control system:

1. Is the system stable? (i.e. can you apply the final value theorem)?

2. If it is stable, what happens when t → ∞? Ideally, this steady state responseshould track the input, r(t).

3. How does the system get there? This is the transient response. Since we can learnquite a bit about the transient response from the closed loop pole positions, we’lltackle this question first.

• For the most part, we will be concerning ourselves with regulators: systems designedto follow a constant (or at least very slowly changing) input. For that purpose, wemight as well look at the unit step response.

• The shape of the unit step response can be quantified in several ways. Later on,these characteristics of the step response will become design specifications for controlsystems.

0 0.5 1 1.5 2 2.50

0.2

0.4

0.6

0.8

1

1.2Transient Response Analyis

Time (sec)

Am

plitu

de (

V)

Tr1

Ts

P.O.

TpM.P.

• The most common specifications are:

56

Page 57: Control Systems 1 notes

1. The rise time. This measures the speed of the system’s response. It is usuallyquoted as the time required for the system to get from 10% of the final value to90% of the final value. However, it is prudent to specify exactly which rise timeyou mean, when you use this specification.

Last year’s text (Dorf and Bishop) used Tr for the 0/100 rise time, and Tr1 forthe 10/90 rise time. These symbols are not universal.

2. The peak time. The time between the step input, and the point at which thepeak overshoot occurs. This is also used as a measure of the response speed. Theusual symbol is Tp. Thus, if the step occurs at t = 0, then

MP = y(Tp)

is the maximum value of the step response.

3. The Peak Overshoot. This is usually expressed as a percentage,

P.O. = 100× MP − y(∞)

y(∞)

where y(∞) is the final value of the step response.

Note: in some cases, a system will not overshoot its final value. However, thesesystems tend to be rather sluggish.

4. The Settling Time. This is the time after which the output stays within a fixedpercentage of its final value. Generally, either 5% or 2% is used. Thus, the 5%settling time, is the time that elapses between the step input, and the point afterwhich the output remains between 0.95 and 1.05 times the final value. As withthe rise time, you should spell out exactly what you mean by the phrase “settingtime”. Dorf and Bishop use the 2% criterion, and the symbol Ts, for the settlingtime.

7.1 First-Order Systems

• Suppose that we have a first-order system, with transfer function

C(s)

R(s)=

a

s + a

which has a pole at s = −a

• The unit step response of this system is

Y (s) =a

s(s + a)=

1

s− 1

s + a

• In the time domain, this is

y(t) =(

1− e−at)

u(t)

We can define the time constant, τ = 1/a,

y(t) =(

1− e−t/τ)

u(t)

57

Page 58: Control Systems 1 notes

0 1 2 3 4 5 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Unit Step Response, H(s) = 1/s+1

Time (sec)

Am

plitu

de (

V)

Tr1

Ts

• In this case, the final value is y(∞) = 1.

• The output never exceeds y = 1, so there is no overshoot, and no peak time.

• Again, since the final value is only reached as t→∞, the 0/100 rise time is infinite.

• Solve for the 10/90 rise time.

– Find t10, the point where the response crosses through y = 0.1,

0.1 = 1− e−t10/τ

t10 = −τ log(0.9)

= 0.1054τ

Note: this is a natural logarithm. For base-10 logs, I will use the symbol log10.Matlab uses the function log to compute natural logs, and log10 to computebase-10 (aka common) logarithms.

– Find t90 the same way.

t90 = 2.3026τ

58

Page 59: Control Systems 1 notes

– Thus, for a first-order system, the 10/90 rise time is about,

Tr1 ≈ 2.2τ

• How about the settling time. For the 5% and 2% criteria, we have

t5% = −τ log(0.05) = 2.9957τ ≈ 3τ

t2% = −τ log(0.02) = 3.9120τ ≈ 4τ

• For a first-order system we have

Tr1 ≈ 2.2τ

Ts ≈ 4τ

Thus, these specifications depend on the time constant/ pole location. To achievea given rise time or settling time, all we have to do, is choose the appropriate timeconstant.

• Things will get a little more interesting when we look at higher-order systems.

7.1.1 Example

• Given this closed-loop system with an adjustable gain, K,

−+R(s) C(s)

K1

s + 1

Find the range of gains, K, that will result in a 10/90 rise time of less than 1 second.

• Step 1: Find the closed-loop transfer function.

C(s)

R(s)=

Ks+1

1 + Ks+1

=K

s + 1 + K

• Thus, we have a closed-loop pole at

s = −(1 + K)

or a time constant of

τ =1

1 + K

59

Page 60: Control Systems 1 notes

• To obtain the desired rise time, we must have

1 < 2.2τ =2.2

1 + K

Thus, multiplying out the fraction, we have

1 + K > 2.2 ⇒ K > 1.2

• Notice, however, that the final value of the step response is,

c∞ = lims→0

sC(s)

= lims→0

sR(s)H(s)

= lims→0

s1

s

K

s + 1 + K

=K

1 + K

Thus, this system can’t track a step input exactly. Even if you wait forever, the outputwill only reach K/1 + K.

• The larger the gain, K, the better the tracking (and the faster the response).

• Of course, in the real world, we can’t just crank the gain to ∞. Over the next coupleof weeks, we will find more elegant ways of

1. Speeding up the response.

2. Increasing the accuracy

60

Page 61: Control Systems 1 notes

7.2 Transient Response of Second-Order Systems

• Now, consider a (normalized) second-order system,

C(s) =ω2

n

s2 + 2ζωns + ω2n

R(s)

where

ωn is the undamped natural frequency

ζ is the damping factor

• What are the poles of this system? They are the solutions to

s2 + 2ζωns + ω2n = 0

s =−2ζωn ±

4ζ2ω2n − 4ω2

n

2

= −ζωn ± ωn

ζ2 − 1

• ωn is the undamped natural frequency, and is taken to be positive.

• Thus, if ζ < 0, the poles are in the right half plane, and the system is therefore unstable.

• For ζ > 1, we have two real poles, since ζ2 − 1 > 0.

• For 0 < ζ < 1, the poles are complex, and are located at

s = −ζωn ± jωn

1− ζ2

• Plotting them in the complex plane, we see that they lie on a circle of radius ωn,

X

X

−ζωn

jωn

1− ζ2

ωn

σ

61

Page 62: Control Systems 1 notes

• Consider the response to a unit step input, R(s) = 1/s.

C(s) =ω2

n

s(s2 + 2ζωns + ω2n)

Expanding as partial fractions gives,

C(s) =1

s+

as + b

s2 + 2ζωns + ω2n

where

a = −1

b = −2ζωn

So,

C(s) =1

s− s + 2ζωn

s2 + 2ζωns + ω2n

=1

s− s + σ

(s + σ)2 + ω2d

− σ

ωd

ωd

(s + σ)2 + ω2d

where σ = ζωn and ωd = ωn

1− ζ2, and is called the damped natural frequency.

• Doing the inverse Laplace transforms, we have

c(t) = 1− e−σt

(

cos(ωdt) +ζ

1− ζ2sin(ωdt)

)

= 1− 1√

1− ζ2e−σt sin(ωdt + θ)

where

θ = tan−1

(

1− ζ2

ζ

)

= cos−1(ζ)

• The relationships between the various quantities are defined in this figure.

X jωd

−σ

ζωn

ωn

1− ζ2

θ

62

Page 63: Control Systems 1 notes

• Notice that a radial line emanating from the origin, (i.e. constant θ) will have aconstant damping factor, ζ.

7.2.1 Peak Time

• To find the peak time, differentiate c(t), and set the result to zero. It will be easiestto use the first (cos and sin form).

dc(t)

dt= −σe−σt

(

cos(ωdt) +ζ

1− ζ2sin(ωdt)

)

+ωde−σt

(

sin(ωdt)−ζ

1− ζ2cos(ωdt)

)

Notice that the two cosine terms cancel, because

ωdζ√

1− ζ2=

ωn

1− ζ2ζ√

1− ζ2= ζωn = σ

Thus, we have

dc(t)

dt= e−σt sin(ωdt)

(

ωd −σζ

1− ζ2

)

= 0

• Thus, the extrema will occur when sin(ωdt) = 0, since the other two terms will neverbe zero. The extrema occur at ωdt = kπ for k = 0, 1, 2....

• Clearly, k = 0 is a minimum, so k = 1 is the first maximum. Thus,

Tp =π

ωd

63

Page 64: Control Systems 1 notes

7.2.2 Peak Overshoot

• The amplitude of the first peak is obtained from c(Tp). Thus,

Mp = c(Tp)

= 1− e−σπ/ωd

(

cos(π) +ζ

1− ζ2sin(π)

)

but, cos(π) = −1, and sin(π) = 0. Furthermore,

−σπ

ωd=

−πζωn

ωn

1− ζ2=

−πζ√

1− ζ2

So that

Mp = 1 + e−πζ/√

1−ζ2

• As a result, the percent overshoot is,

P.O. = 100 · e−πζ/√

1−ζ2

• Notice that the peak overshoot depends only on the damping factor, ζ. Two handyvalues to remember are

ζ = 0.5(θ = 60o) ←→ P.O. ≈ 16%

ζ = 0.7(θ = 45o) ←→ P.O. ≈ 5%

7.2.3 Settling Time

• If we wanted to calculate this exactly, we would find the smallest Ts that satisfies,

|1− c(Ts)| ≤ 0.02

for the 2% criterion. Thus,

1√

1− ζ2e−σTs sin(ωdTs + θ)

< 0.02

• Solving this requires a numerical approach. Furthermore, the result that one getscannot be readily incorporated into a design rule, so solving this numerically isn’treally all that useful.

• Instead, lets concentrate on the exponential envelope. Clearly, when the envelope iswithin the ±2% bounds, the step response must be inside the bounds as well.

64

Page 65: Control Systems 1 notes

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2Step Response, Envelope, and ± 5% Settling Bounds

time (s)

Am

plitu

de

T5%

1− exp(−ζωnt)√1−ζ2

1 + exp(−ζωnt)√1−ζ2

3ζωn

• Note: This figure shows ±5% bounds, and an approximate 5% settling time of 3/ζωn

(see below), just to make things easier to see. A plot based on the 2% criterion wouldshow essentially the same thing (but be more compressed).

• For the envelope to be inside the 2% bounds, we must have,

1√

1− ζ2e−ζωnt < 0.02

• To simplify things further, ignore the factor of 1/√

1− ζ2, in which case, we must solve

e−ζωnTs = 0.02

which yields

Ts =3.9120

σ≈ 4

ζωn

65

Page 66: Control Systems 1 notes

• Similarly, for the 5% criterion, we have

T5% =2.9957

ζωn≈ 3

ζωn

• Note: There were two approximations used in this derivation.

1. First of all, we used the exponential envelope, rather than the actual step response.Since the step response will always be inside this envelope, this will tend tooverestimate the settling time, unless the 2% threshold is crossed exactly at alocal maximum or minimum in the response.

2. Secondly, we ignored the factor of 1/√

1− ζ2 in the size of the envelope. Thiswill tend to make the envelope slightly smaller (for relatively small ζ), and henceshorten the apparent settling time.

• The figure at the top of the next page shows the exact settling time, as a functionof ζ, and normalized with respect to the time constant, 1/ζωn. The envelope-basedapproximation shown in the figure is 3.91 time-constants (i.e. − log(0.02)) rather than4, which is the figure usually used to characterize the settling time. From the figure,you can see that using 4 time constants gives a reasonable bound on the settling timefor ζ less than about 0.65 or so.

• The large discontinuities in the actual settling time occur when a local max or minfalls completely inside the 2% bound. At that point, the settling time jumps back toa point close to the previous max or min (which will still be outside of the bound).

0.3 0.4 0.5 0.6 0.7 0.8 0.92.5

3

3.5

4

4.5Actual 2 % settling time and envelope−based approximation

ζ

Nor

mal

ized

Set

tling

Tim

e (T

s ζω

n)

Actual Settling TimeEnvelope Approximation

66

Page 67: Control Systems 1 notes

7.2.4 Rise Time

• Although it is less important, practically, consider the 0/100 rise time (Tr in Dorf andBishop) first.

• All we need to do, is to find the first time that c(t) = 1. Thus,

c(Tr) = 1− 1√

1− ζ2e−ζωnTr sin(ωdTr + θ) = 1

Thus,

sin(ωdTr + θ) = 0 =⇒ ωdTr + θ = 0, π, 2π, . . .

The 0/100 rise time is the first positve solution to this equation. Thus,

Tr =π − θ

ωd

• Despite its apparent simplicity, this expression is still difficult to use. Given directlyin terms of ζ and ωn, it becomes

Tr =π − cos−1(ζ)

ωn

1− ζ2

• Proceeding numerically, it is possible to plot lines of constant rise time in the s-plane.The next figure shows these, for the pole with the positive imaginary part – rememberthat the poles occur in complex cojugate pairs. Points below, or to the left of theselines will have longer rise times, points above and to the right will have faster risetimes.

67

Page 68: Control Systems 1 notes

−5 −4.5 −4 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 00

0.5

1

1.5

2

2.5

3

Re(s) = −ζωn

Im(s

) =

ωn (

1 −

ζ2 )1/

2

Loci of Poles with Constant 0/100 Rise Times

Tr = 1 sec.Tr = 2 sec.Tr = 3 sec.Tr = 4 sec.

7.2.5 10/90 Rise Time

• Now, consider the 10/90 rise time. To solve for this, we would have to proceed numer-ically, solving

c(t1) = 0.1

c(t2) = 0.9

Tr1 = t2− t1

However, these are more complicated than the time to 100%, since we cannot ignorethe contribution of the exponential. However, if one computes Tr1 numerically, it canbe shown that the approximation

Tr1 ≈2.16ζ − 0.60

ωn

is reasonably accurate, for 0.3 < ζ < 0.8.

• The observations from the 0/100 rise time also apply. Moving the poles closer to thereal axis tends to slow the rise time.

68

Page 69: Control Systems 1 notes

7.3 Dominant-Poles of Higher-Order Systems.

• We have put a fair bit of effort into understanding/predicting how a second-order,all-pole system will behave.

• Most systems, probably, will either be of higher-order, contain zeros, or both. In thissection, we will see that under certain conditions, it is possible to approximate a systemby a complex conjugate pair of poles.

• In reality, this would be the first step of a cycle

– Design using a second-order approximation.

– Simulate high-order system on a computer, and tweak the design as necessary.

– Build the real system, (and tweak to fix the details that the simulation missed).

7.3.1 Graphical Transfer Function Evaluation

• To make it easier to see why certain terms are more significant than others, it will beuseful to do partial fractions expansions graphically.

• Let’s start with someting simle. Consider the unit step response of a first-order system,

G(s) =a

s + a

C(s) =a

s(s + a)

=1

s− 1

s + a

c(t) =(

1− e−at)

u(t)

• In the partial fraction expansion, the coefficient of the 1/s term was evaluated bycomputing the “rest” of the transform at the point s = 0.

a

s + a

s=0

= 1

• Similarly, the coefficient of the 1/(s + a) term was obtained by evaluating the rest ofthe transform at the point s = −a.

a

s

s=−a

= −1

• In the language of complex analysis, this is called computing the residues at the poles.

• Now, lets see how we could have done this graphically....

69

Page 70: Control Systems 1 notes

• Consider two points, α and β in the complex plane. The number β − α can be repre-sented as a vector from α to β.

α

β

β − α

• How does this help us? Well, to evaluate the coefficient of the 1/s term, we have tocompute

a

s + a

s=0

= a1

0− (−a)

The denominator can be thought of as a vector from s = −a to s = 0 in the complexplane. This vector has length a, at an angle of 0o. Since it is in the denominator, weget

1

a6 0o

which we multiply by the numerator, a, to get the coefficient, 1.

X Xs = 0s = −a

Re(s)

Im(s)

• The “general principal”, is that we draw a vector from the pole or zero that is beingevaluated, to the point where its value is being computed. In the previous example,we were evaluating the contribution of the pole at s = −a at the point s = 0.

70

Page 71: Control Systems 1 notes

• In more general cases, we will have to evaluate the contributions from several polesand zeros. To do that, it is easiest to think in “polar form”, so that

α = r1ejθ1

β = r2ejθ2

αβ = r1r2ej(θ1+θ2

α

β=

r1

r2

ej(θ1−θ2

So, to compute the partial fraction expansion coefficients for the step response of ahigh-order system, we will compute the contributions from all of the zeros and polesand then multiply and/or divide them as appropriate.

• Since we are dealing with step responses, there will always be a pole at s = 0, due tothe unit step input (uless the transfer function as a zero at s = 0 that cancels it).

7.3.2 Two Complex Poles

• Let’s use the graphical tools to evaluate the step respones of a system with two complexconjugate poles

• Suppose we have a system whose transfer function is

G(s) =ω2

n

s2 + 2ζωns + ω2n

• The transform of the unit step response will be

Y (s) =ω2

n

s(s2 + 2ζωns + ω2n)

Evaluating the partial fraction coefficients graphically, we see that the coefficient ofthe 1/s term is 1 since, it is the product of ω2

n from the numerator, divided by ωne−jθ

(i.e. a length of ωn at an angle of −θ) from the pole in the upper half plane, and ωnejθ

from the pole in the lower half plane.

X

X

X

s = 0

Im(s)

Re(s)

−θ

θ

s = −ζωn + jωd

s = −ζωn − jωd

r0 =ω2

n

ωne−jθωnejθ

=ω2

n

ω2nej0

= 1

71

Page 72: Control Systems 1 notes

• The coefficient for the pole at s = −ζωn + jωd is evaluated in much the same way.

X

X

X

s = 0

Im(s)

Re(s)θ

s = −ζωn + jωd

s = −ζωn − jωd

π − θr1 =

ω2n

ωnej(π−θ)2ωn

1− ζ2ejπ/2

=−ejθ

2j√

1− ζ2

• Clearly, the coefficient for the other complex pole is the complex conjugate of r1. Thus,the output is,

y(t) =

(

1− 1

2j√

1− ζ2e−ζωnt+j(ωdt+θ +

1

2j√

1− ζ2e−ζωnt−j(ωdt+θ

)

u(t)

=

(

1− 1

2√

1− ζ2sin(ωdt + θ)

)

u(t)

• The bottom line, is that once you evaluate the partial expansion coefficient for acomplex pole, you know immediately what the gain and phase of the damped sinusoidare going to be.

7.3.3 Case 1: An Extra Zero

• In this case, we want to compare the step responses for the two systems,

G0(s) =ω2

n

(s2 + 2ζωns + ω2n)

G1(s) =ω2

n(s + a)

a(s2 + 2ζωns + ω2n)

• Evaluate the residue at one of the complex conjugate poles.

O X

X

X

Im(s)

s = −a Re(s)

π − θ

2ωd

φ

r ωn

72

Page 73: Control Systems 1 notes

• Without the extra zero, we get the same result as before,

ω2n

2ωdωn

ej(θ−3π/2)

In which case, the two complex poles would contribute

−e−ζωnt

1− ζ2sin(ωdt + θ)

to the step response.

• With the additional zero, we have to multiply the residue by,

r

aejφ

So, the additional zero will scale the transient response by r/a, and add a phase shiftof φ to the damped sinusiod. We would expect the step response to be

c(t) = 1− re−ζωnt

a√

1− ζ2sin(ωdt + θ + φ)

• For the zero to have only a negligible effect on the transient response, we must have

r ≈ a

φ ≈ 0

These can be accomplished if a� ζωn, in which case, r ≈ a− ζωn ≈ a, and φ ≈ 0.

• If the zero gets closer, things get more interseting. Although the exponential envelopeis smaller (i.e. multiplied by r/a), the phase lead means that the first positive peakhappens earlier. The peak time will be

Tp =π − φ

ωd

As a result, the exponential hasn’t had as long to decay, so the peak is higher – thereis more overshoot.

P.O. =r

ae−ζ(π−φ)/

√1−ζ2

73

Page 74: Control Systems 1 notes

7.3.4 Case 2: An extra pole

• In this case, we want to compare the step responses for the two systems,

G0(s) =ω2

n

(s2 + 2ζωns + ω2n)

R(s)G2(s) =ω2

na

(s + a)(s2 + 2ζωns + ω2n)

• Evaluate the residue at one of the complex conjugate poles.

X

X

X

Xs = −a

π − θ

2ωd

φ

r ωn

<(s)

=(s)

• To find the residues at the two complex conjugate poles, all of the computations arethe same as before, except that we must divide where we multiplied (since the extraobject is a pole instaed of a zero). Thus, the e(−ζωn+jωd)t term gets multiplied by

a

re−jφ

so that the decaying sinusoid term becomes

− ae−ζωnt

r√

1− ζ2sin(ωdt + θ − φ)

• We must also consider the term due to the pole at s = −a, which leads to a time-domaincontribution αe−at, where α is the residue at the pole s = −a.

X

X

X

Xs = −a

φ

r

<(s)

=(s)

π − φ

π + φ

74

Page 75: Control Systems 1 notes

The residue will be:

α =aω2

n

(−a) · rej(π+φ) · rejπ−φ

=−ω2

n

r2

• Putting it all together, the step response will be

y(t) =

(

1− ae−ζωnt

r√

1− ζ2sin(ωdt + θ − φ)− ω2

n

r2e−at

)

u(t)

• Looking at the pole-zero plot, a = 2ζωn gives r = ωn, and the extra term will be−e−2ζωnt, which is certainly significant. As a increases, this term will quickly dissapear,since its magnitude scales with 1/r2.

7.3.5 Case 3: Extra Pole/Zero Pairs

• Suppose we have a pair of complex conjugate poles, and we add both a pole and anearby zero to the system. What happens to the step response?

• To answer that question, let’s forget about the complex conjugate poles, and the stepinput for the moment, and evaluate the contribution due to the pole and zero, at anypoint in the complex plane.

G(s) =(s + b)

(s + a)

XO

Im(s)

s = −b s = −a

θ1

r1r2

θ2Re(s)

s = γ

• Consider a point, s = γ, somewhere in the complex plane. Evaluating the transfer

75

Page 76: Control Systems 1 notes

function at s = γ gives,

G(γ) =(s + b)

(s + a)

s=γ

=γ − (−b)

γ − (−a)

=r2e

jθ2

r1ejθ1

=r1

r2ej (θ2−θ1)

• If r1 ≈ r2 � (b− a), then θ2− θ1 ≈ 0, and the pole and zero will largely cancel. Thus,when one is “far” away from the pole/zero pair, their effects cancel each other. A goodrule of thumb would be if r1 or r2 ≥ 10(b− a), then the pole and zero can be ignored.

7.4 Estimating Pole Locations from Step Responses

• Suppose that we have a system that is dominated by two poles, so that its transferfunction can be accurately approximated by

T (s) =ω2

n

s2 + 2ζωns + ω2n

• Is it possible to approximate ωn and ζ simply by measuring the step response?

• The step response will be

y(t) =

(

1− 1√

1− ζ2e−ζωnt sin(ωdt + θ)

)

u(t)

• The damped natural frequency, ωd, can be obtained from the “period” of the dampedoscillations. Measure the time from one maximum to the next (assming there are atleast 2) – or look at the peak time.

• To get the damping factor, you could measure the % overshoot, and use the formula

PO = 100× e−πζ/√

1−ζ2

or,...

– Count the number of oscillations visible in the response.

– Assume that when the exponential envelope decays to 2% of the step size, (i.e.after 4 time constants) that the oscillations will no longer be visible.

76

Page 77: Control Systems 1 notes

– In each time constant, there will be

ωd

2πτ =

1− ζ2ωn

2π· 1

ζωn

=

1− ζ2

2πζ

oscillations.

– Thus, the number of cycles in 4 time constants is

N =4√

1− ζ2

2πζ

For ζ = 0.5, we have√

1− ζ2 ≈ 0.866. If we use this value√

1− ζ2, we get

N =4 · 0.866

2πζ=

0.55

ζ

– Thus, for ζ ≈ 0.5, ζ ≈ 0.55/N , where N is the number of visible oscillations inthe step response.

• If ζ is larger than about 0.6, it will be very difficult to estimate using either method, asthere will be very little overshoot and there will be less than one period of the dampedoscillation visible.

77

Page 78: Control Systems 1 notes

8 Stability

• A system was said to be (BIBO) stable if any bounded input produced a boundedoutput.

• Suppose we have a system

R(s)

H(s)

C(s)

• Clearly, the output is

C(s) = H(s)R(s)

• Let the input be a unit step, R(s) = 1/s, which is clearly a bounded signal, and letthe transfer function be

H(s) =K(s− z1)(s− z2) . . . (s− zm)

(s− p1)(s− p2) . . . (s− pn)

i.e. the system has n poles at s = p1, p2, . . . , pn,and m zeros at s = z1, z2, . . . , zm.

• For simplicity, let all of the poles be distinct, in which case, we can use a partial fractionexpansion,

C(s) =r0

s+

r1

s− p1+

r2

s− p2+ . . . +

rn

s− pn

which we can inverse Laplace transform into

c(t) ={

r0 + r1ep1t + r2e

p2t + . . . + rnepnt}

1(t)

• Now, consider the k’th pole, s = pk. If <(pk) < 0, the pole, s = pk, will be in theleft half plane (its real part will be negative). Furthermore, the time-domain theexponential will decay to zero,

limt→∞

rkepkt = 0

• If we have repeated poles, the response will contain terms like,

rktepkt

but these will also decay to zero as t→∞ (Just use l’Hopitale’s rule).

• Notice, that if any of the poles is in the right half plane, the response will contain anincreasing exponential, and blow up to infinity.

• Thus, in order for a system to be stable, ALL if its poles must be in the left halfplane (LHP).

78

Page 79: Control Systems 1 notes

8.1 Marginal Stability

• Mathematicians like to talk about marginal stability.

• If a system has non-repeated poles on the imaginary axis, its step response (and itsresponse to an impulse, sinusoid, etc), will contain a sinusoid of constant amplitude.

• However, if the input is a sinusoid at the same frequency, the output will blow up toinfinity.

• Since the output only blows up to infinity for a specific (bounded) input, it is sometimescalled Marginally Stable.

• However, since the term does not decay to zero, even for a step or impulse input, thesystem won’t be of much practical use (since we can’t really control it).

• Furthermore, any infinitessimal drift in the system’s parameters will make it eitherstable or unstable.

• Bottom Line: Marginal stability is really just a mathematical curiosity, with littlepractical significance.

8.2 Instability in the Real World

• In the world of mathematical models, we talk about resonses that blow up to infinity.

• This doesn’t really happen in the physical world. Things tend to reach physical limitslong before they get to infinity....

8.3 Testing for Stabiliy

• All that is required, to test for stability, is to look see whether the system’s poles arein the left half plane (good), or in the right half plane (baaad).

• Unfortunately, we are often faced with high degree polynomials,

G(s) =B(s)

A(s)=

B(s)

sn + an−1sn−1 + an−2sn−2 + . . . + a1s + a0

• So, how can you tell where the poles are (if the battery in your laptop just died)....

• Suppose that the polynomial could be factored

A(s) = (s− p1)(s− p2) . . . (s− pn)

so that p1, p2, . . . pn are the system’s poles.

79

Page 80: Control Systems 1 notes

• Consider what would happen if we multiplied this out....

A(s) = sn − (p1 + p2 + . . . + pn)sn−1 + (p1p2 + p1p3 + . . . pn−1pn)sn−2 +

(−1)np1p2p3 . . . pn

• Now, suppose that all of the poles, pk, are in the left half plane. Thus, all of the realparts are negative. Furthermore, since complex poles always appear in conjugate pairs,all of the imaginary parts will cancel.

• First off, all of the coefficients, a1, a2, . . . an will be positive.

• For example, an−1 = −(p1 +p2 + . . .+pn), which is minus a negative real number (sincethe real parts of all of the pk are assumed to be negative.

• Furthermore, none of the coefficients can be zero, as this would require some positvereal parts to cancel the negative real parts....

• This leads to the necessary, but not sufficient, condition:For A(s) to have all left half plane poles, all of the coefficients, an−1 . . . a0 must bestriclty greater than zero,.

• If a system fails this test, then it is unstable.

• If a system passes this test, then we must continue checking, and compute the Routharray.

sn : an an−2 an−4 . . .sn−1 : an−1 an−3 an−5 . . .sn−2 : bn−1 bn−3 bn−5 . . .sn−3 : cn−1 cn−3 cn−5 . . .

......

...s : fn−1

1 : gn−1

• The first two rows are constructed from the polynomial coefficients of the denominatorpolynomial.

• Despite what the notation might suggest, the third row (i.e. b1 etc) is NOT contructedfrom the numerator coefficients.

• The numerator coefficients are computed using (negative) determinants,

bn−1 =an−1an−2 − anan−3

an−1

b2 =an−1an−4 − anan−5

an−1

80

Page 81: Control Systems 1 notes

• Thus, you form (negative) “determinants”, using the left-most column, and each ofthe remaining columns, in the two rows above your current position. (and insert a 0at the end of a short row, if necessary).

• Continue computing in this fashion, until you construct 2 rows with 1 element each.

• The number of sign changes in the first column will be equal to the number of righthalf plane roots.

8.3.1 Example

• Let A(s) = s4 + 2s3 + 3s2 + 4s + 5

• All coefficients are strictly positive.

• Construct the routh array

s4 : 1 3 5s3 : 2 4

• Now compute the next row

b3 =2 · 3− 4 · 1

2= 1

b2 =2 · 5− 0 · 1

2= 5

Note that we had to add a trailing zero to the second row,so that we could computeb2.

• Add this row to the array.

s4 : 1 3 5s3 : 2 4s2 : 1 5

• Compute the next row

c3 =1 · 4− 5 · 2

1= −6

• We can read off the last row, so the Routh array is

s4 : 1 3 5s3 : 2 4s2 : 1 5s1 : −6s0 : 5

81

Page 82: Control Systems 1 notes

• Since there are 2 sign changes in the final row, we know that the system has 2 righthalf plane poles, and is therefore unstable.

• Use Matlab to check our answer

>> roots([1 2 3 4 5])

ans =

0.2878 + 1.4161i

0.2878 - 1.4161i

-1.2878 + 0.8579i

-1.2878 - 0.8579i

Notice that two of the roots have positive real parts, just as the Routh Hurwitz testindicated.

8.4 Summary

• A system is stable if all of its poles are in the open left half plane (i.e. not includingthe imaginary axis).

• The Routh-Hurwitz test can be used to count the number of right-half plane roots ofa polynomial. x

1. All coefficients must be present, and strictly positive.

A(s) = sn + an−1sn−1 + . . . + a1s + a0

2. Form the Routh Array

sn : an an−2 an−4 . . .sn−1 : an−1 an−3 an−5 . . .sn−2 : bn−1 bn−3 bn−5 . . .sn−3 : cn−1 cn−3 cn−5 . . .

......

...s : fn−1

1 : gn−1

where the elements in the third rows and below are formed using negative deter-minants with the next two higher rows.

3. The number of sign changes in the first column is equal to the number of righthalf plane roots.

82

Page 83: Control Systems 1 notes

8.5 Designing for Stability

Ensuring that a control system is stable is the most important job of a control designer. Insome cases, the Routh-Hurwitz test can be used to determine acceptable ranges, in that theydon’t produce unstable systems, for one or more parameters. Once the system is guaranteedto be stable, then we can worry about meeting other performance specifications.

8.5.1 Stability as a Function of Gain

Consider the following feedback control system, and determine what values of K result in astable system.

−+ K

s

1

s2 + s + 1

R(s) E(s) C(s)

Solution:

1. Obtain the closed-loop transfer function.

C(s)

R(s)=

K/(s3 + s2 + s)

1 + K/(s3 + s2 + s)

=K

s3 + s2 + s + K

2. Use the Routh-Hurwitz test, to see what values of K will produce right half planepoles.

(a) A(s) = s3 + ss + s + K.

(b) All coefficients must be positive, so K > 0.

(c) Construct the Routh array,

s3 : 1 1s2 : 1 Ks : 1−K1 : K

Thus, if 0 < K < 1, then all the entries in the first column will be positive,indicating that the system is stable.

83

Page 84: Control Systems 1 notes

8.5.2 Evaluating Stability as a Function of zero position

Consider the following feedback control system, and determine what values of a, i.e. theposition of the zero in the controller, are necessary for a stable system.

−+ 10(s + a)

s

1

s2 + 2s + 4

R(s) C(s)

Solution:

1. Obtain the closed-loop transfer function.

C(s)

R(s)=

10(s + a)/(s3 + 2s2 + 4s)

1 + 10(s + a)/(s3 + 2s2 + 4s)

=10(s + a)

s3 + 2s2 + 14s + 10a

2. Use the Routh-Hurwitz test, to see what values of a will produce right half plane poles.

(a) A(s) = s3 + 2ss + 14s + 10a.

(b) All coefficients must be positive, so a > 0.

(c) Construct the Routh array,

s3 : 1 14s2 : 2 10as : 14− 5a1 : 10a

Thus, if 0 < a < 14/5, then all the entries in the first column will be positive,indicating that the system is stable.

8.6 Special Cases:

8.6.1 Zero in the first column

• A zero in the first column indicates that there is a pair of purely imaginary roots (whynot s = 0 as a root?).

• Thus, the system is at best marginally stable (and hence not BIBO stable).

• However, this zero in the first column might mask the presence of other right half planeroots (in which case the system would be unstable, both to a mathematician and to acontrol engineer).

84

Page 85: Control Systems 1 notes

• Example: Does the following polynomial have any right half plane roots?

A(s) = s3 + 2s2 + s + 2

• All the coefficients are positive – so far so good.

• Construct the Routh array,

s3 : 1 1s2 : 2 2s : b2

1 : c2

b2 =2(1)− 2(1)

2= 0

c2 =2(b2)

b2=

0

0DOH!!!!

• This raises 2 questions:

1. Is 0 positive or negative (i.e. is there a sign change between rows 3 and 4)?

2. What can we do about the divide by zero?

• Suppose that we replace zero by a small positive number, ε. Then, the Routh arraybecomes

s3 : 1 1s2 : 2 2s : ε1 : 2

• As a result there are no sign changes in the first column.

• This indicates that the polynomial A(s) has a pair of complex conjugate roots on theimaginary axis, but no roots in the right half plane.

8.6.2 A whole row of zeros

• Example: Does following polynomial have any right half plane roots?

A(s) = s5 + 7s46s3 + 42s2 + 8s + 56

• All the coefficients are positive – so far so good.

• Construct the Routh array,

s5 : 1 6 8s4 : 7 42 56s3 : 0 0

• What do we do now?

85

Page 86: Control Systems 1 notes

• The row of zeros indicates that the polynomial on the previous (i.e. s4) row dividesevenly into A(s).

P (s) = 7s4 + 42s2 + 56 = 7(

s4 + 6s2 + 8)

• If we do the long division, we see that

A(s) = s5 + 7s46s3 + 42s2 + 8s + 56 = (s + 7)(s4 + 6s2 + 8)

• Clearly, the first pole is in the LHP.

• What about the polynomial

P (s) = s4 + 6s2 + 8

• We could think of this as a polynomial in s2. Let w = s2, and solve

Q(w) = w2 + 6w + 8 = 0

w =−6±

√36− 62

2= −3±−1 = −4 or − 2

• Now, solving for s, we have

s = ±2j, or ±√

2j

• Notice that if roots of Q(w) are anywhere other than on the negative real axis, therewill be a root of P (s) in the right half plane.

• So, we would like to make sure that all of the roots of Q(w) are negative and real. Todo this, compute the derivative of P (s),

P ′(s) = 4s3 + 12s

and construct a Routh array whose first row contains the coefficients of P (s), andwhose second row contains the coefficients of P ′(s).

s4 : 1 6 8s3 : 4 12s2 : 3 8s1 : 4/3s0 : 8

• There are no sign changes. This indicates that all of the roots of P (s) are on theimaginary axis.

• Thus, the system is marginally stable, but not BIBO stable.

86

Page 87: Control Systems 1 notes

9 Steady State Errors

So far, we have figured out when a system is stable, and we have examined the shape of itstransient response. One remaining question is, “how well does it track the input, once thetransients have died away”? Consider the following unity negative feedback system.

−+

R(s) E(s) C(s)

G(s)

Since we are interested in the tracking ability of the system, the relevant “output” isthe error signal E(s) = R(s) − C(s). To compute the transfer function from the input tothe error, rearrange the block diagram so that E(s) is the output, by placing G(s) in thefeedback path.

−+

R(s)

G(s)

E(s)

C(s)

Then, it should be obvious that the relevant transfer function is

E(s)

R(s)=

1

1 + G(s)

9.1 Systems with no poles or zeros at the origin

Suppose that the open loop transfer function is

G(s) =K(s− z1)(s− z2) . . . (s− zm)

(s− p1)(s− p2) . . . (s− pn)

and that none of the poles or zeros is at the origin. Thus,

z1, z2, . . . , zm 6= 0 and p1, p2, . . . , pn 6= 0

If you prefer the to normalize the poles and zeros, you might to write this transfer functionas

G(s) =Kz1z2 . . . zm

p1p2 . . . pn· (1− s/z1)(1− s/z2) . . . (1− s/zm)

(1− s/p1)(1− s/p2) . . . (1− s/pn)

Now, suppose that the input is a unit step, R(s) = 1/s. What is the final value of thetracking error?

limt→∞

e(t) = lims→0

sE(s)

= lims→0

s1

s

1

1 + G(s)

87

Page 88: Control Systems 1 notes

Recall that we had assumed that G(s) had no poles nor zeros at s = 0. Thus, we can justplug in s = 0 to evaluate the limit, and

limt→∞

e(t) =1

1 + G(0)

Furthermore, G(0) is just

G(0) =K(−z1)(−z2) . . . (−zm)

(−p1)(−p2) . . . (−pn)

Definition: Kp = G(0) is called the static position error constant. The steady state errorto a unit step input is given by

limt→∞

e(t) =1

1 + Kp

Note: This is the same symbol that is used for the proportional gain in PI ( and PD andPID) controllers. Hopefully the context will make it obvious which meaning is intended.....

9.2 Design Example:

Consider the following unity negative feedback control system.

−+

R(s) E(s) C(s)

G(s)

where the open-loop transfer function is,

G(s) = Ks + 10

s + 1

Choose the forward gain, K, so that the system can track a step input with less than 1%steady state error.Solution: Since the system is linear, superposition applies. Thus, meeting the design specfor a unit step will automatically mean that the design specification will be met for all stepinputs. Thus, let the input be a unit step,

R(s) = 1/s

and choose K such that

limt→∞

e(t) < 0.01

• Since the input is a unit step, evaluate the static position error constant,

Kp = G(0) = 10K

88

Page 89: Control Systems 1 notes

• The steady state error is given by

limt→∞

e(t) =1

1 + Kp

=1

1 + 10K

• To meet the design spec, we must have

1

10K + 1< 0.01

⇒ 100 < 10K + 1

⇒ K > 9.9

Notice, that we did not have to compute the closed loop transfer function at all. We simplydesigned the open-loop transfer function (which we can do directly).

Secondly, note that we are able to deduce things in the time domain (the steady stateerror), from calculations in the frequency domain. (no inverse transform).

9.3 Systems with one pole at s = 0

Consider, once again, a unity negative feedback control system,

−+

R(s) E(s) C(s)

G(s)

however, this time, let the open loop transfer function, G(s), have exactly one pole at s = 0.Thus,

G(s) =K

s

(s− z1)(s− z2) . . . (s− zm)

(s− p1)(s− p2) . . . (s− pn)

where, z1, . . . , zm and p1, . . . , pn 6= 0.As before, let the input be a unit step. In the frequency domain,

R(s) = 1/s

and the error is

E(s) =1

s

1

1 + G(s)=

1

s + sG(s)

Assuming that the closed loop system is stable, so that we can use the final value theorem,

limt→∞

= lims→0

s

s + sG(s)

= lims→0

1

1 + G(s)

=1

1 +∞ = 0

89

Page 90: Control Systems 1 notes

since G(s) now has a pole at s = 0.Thus, if the OPEN LOOP system has a single pole at the origin, then the CLOSED

LOOP system can track a step input exactly (i.e. with 0 steady state error). Furthermore,this steady state tracking ability is independent of the gain, K.

Another way of looking at this is,

Kp = G(0) =∞

Next, see what happens when we apply a unit ramp input. In this case

R(s) =1

s2

Thus, the steady state error will be

limt→∞

e(t) = lims→0

1

s + sG(s)

=1

0 + K (s−z1)(s−z2)...(s−zm)(s−p1)(s−p2)...(s−pn)

Predictably, we define the static velocity error constant, as

Kv = sG(s)

s=0

so that the steady-state ramp tracking error is

limt→∞

e(t) =1

Kv

9.3.1 Unit ramp input without integrators....

What would happen if we applied a unit ramp input to a system that has no poles at s = 0?Well, for such a system,

Kv = sG(s)

s=0

= 0

so the steady state error to a unit ramp input would be ∞.

9.4 Systems with 2 poles at s = 0

Now, let the input be a unit parabola (i.e. constant acceleration). Thus

r(t) =t2

2R(s) =

1

s3

90

Page 91: Control Systems 1 notes

For a unity feedback system with one integrator in its open loop response, the steady statetracking error is,

limt→∞

e(t) = lims→0

sE(s)

= lims→0

s1

s3

1

1 + G(s)

= lims→0

1

s2 + s2G(s)= ∞

since the single integrator in G(s) can only cancel one of the factors of s in the denominator.Thus, if G(s) has exactly one pole at s = 0, then the closed loop system can

1. Track a unit step input with zero steady state error.

2. Track a unit ramp error with a finite steady state error.

3. Cannot track a unit parabola input.

9.4.1 Static Acceleration Error Constant

So, following the pattern, lets try adding another integrator to the open-loop transfer func-tion. Thus,

G(s) =K

s2

(s− z1)(s− z2) . . . (s− zm)

(s− p1)(s− p2) . . . (s− pn)

where, z1, . . . , zm and p1, . . . , pn 6= 0.We can evaluate the static position and velocity error constants,

Kp = Kv =∞

so the closed loop system will be able to track both steps and ramps with zero steady stateerror.

Still following the pattern, define the static acceleration error constant,

Ka = s2G(s)

s=0

Then, it is easy to show that the steady state error in response to a unit parabola input isgiven by,

limt→∞

e(t) =1

Ka

91

Page 92: Control Systems 1 notes

Table 2: Steady State Tracking Errors

System unit step unit ramp unit parabolaType input input input

0 11+Kp

∞ ∞1 0 1

Kv∞

2 0 0 1Ka

9.5 Summary

Definition: A “Type n” system is any system that has exactly n poles at s = 0.A Type 0 system has no poles at the origin. It can track a unit step input, with a finite

but non-zero steady state error. It cannot track ramps and parabolas.A Type 1 system has exactly 1 pole at the origin. When embedded in a unity negative

feedback loop, it can track a step input with zero steady state error, and track a ramp inputwith a finite, but non-zero steady state error. It cannot track a parabolic input.

A Type 2 system has exactly 2 poles at the origin. The closed loop system can trackboth steps and ramps with zero steady state error, and can track a parabolic input with afinite steady state error.

Technically, a Type -1 system would have a zero at the origin. This would be a very sillycontrol system, since it couldn’t even track a step input......the static error constants are defined as:

Kp = G(s)

s=0

Kv = sG(s)

s=0

Ka = s2G(s)

s=0

Note that for any given system, only one of these will be finite and non-zero. For example,for a Type 1 system, Kp =∞ and Ka = 0.

9.6 Caveat

All of theses derivations depend on the Final Value Theorem. Note, however, that the FinalValue Theorem,

limt→∞

e(t) = lims→0

sE(s)

only holds if all of the poles of E(s) are strictly in the left half plane, with the exception ofone pole which may be located at s = 0. In other words, these static error constants areonly valid when the closed loop system is stable.

Of course, this means that we have to figure out the closed loop transfer function, so thatwe can determine the stability of the system (using the Routh Hurwitz test discussed earlierthis week).

92

Page 93: Control Systems 1 notes

10 PID Controllers

• In industrial applications, the Proportional plus Integral plus Derivative (or PID) con-troller is one of the most popular control designs.

• The transfer function of the PID controller is

Gc(s) =U(s)

E(s)= K1 + K2

1

s+ K3s

where E(s) is the Laplace transform of the error signal, and U(s) is the Laplace trans-form of the control signal, u(t) (a symbol which unfortunately is also used as a unitstep).

Gc(s) Gp(s)+R(s) E(s) U(s) Y (s)

• While we are on the subject of notational glitches, I should mention that the gains inthe PID controller are often called KP , KI and KD — don’t confuse Kp, the staticposition error constant, with KP , the proportional gain in a PID controller. I supposethat Dorf and Bishop use K1, K2 and K3 to avoid this confusion (at least until youstart reading stuff that is written by anybody else).

• Some useful special cases of the PID controller are

1. The proportional controller Gc(s) = K1

2. The PI controller Gc(s) = K1 + K2/s

3. The PD controller Gc(s) = K1 + K3s

10.1 Example: Position Control of a DC motor

• Consider a DC motor, whose open-loop transfer function is

Gp(s) =1

s(s + 1)

• If we use a proportional controller, the closed-loop transfer function will be

T (s) =K

s2 + s + K

resulting in poles at

p1,2 =−1±

√1− 4K

2

93

Page 94: Control Systems 1 notes

• For 0 < K < 0.25, there are 2 real poles, and for K > 0.25, the poles are complexconjugates.

• This is a Type -I system, since the open loop transfer function has 1 pole at the origin.Since the system is stable for all K > 0 (i.e. the poles are always in the left halfplane), it will be able to track a step input with zero steady state error. Furthermore,the static velocity error constant is

Kv = sG(s)∣

s=0= K

so that the steady state error in response to a unit ramp input will be 1/K.

• When the poles are complex, ζωn = 0.5. Thus, the (approximate) settling time willalways be 4/ζωn = 8 seconds. Can we reduce this?

10.1.1 PD control

• Let’s try a PD controller.

+R(s) E(s) U(s) Y (s)K1 + K3s

1

s(s + 1)

• The open-loop transfer function is now

Gc(s)Gp(s) =Y (s)

E(s)=

K1 + K3s

s(s + 1)

so the system is still of Type - I, and the static velocity error constant is

Kv = sG(s)∣

s=0= K1

• The closed-loop transfer function is

T (s) =Y (s)

R(s)=

K1 + K3s

s(s + 1)

1 +K1 + K3s

s(s + 1)

=K1 + K3s

s2 + (1 + K3)s + K1

• The closed-loop poles are

p1,2 =−(1 + K3)±

(1 + K3)2 − 4K1

2

94

Page 95: Control Systems 1 notes

• Notice that the (negative) real part of the poles is

ζωn =1 + K3

2

so that the settling time is,

Ts =4

ζωn=

8

1 + K3

If we require a settling time of 2 seconds, just set K3 = 3.

• To change the rise time, overshoot, and/or peak time, we need to adjust the imaginarypart of the pole position. This can be done by adjusting K1.

• To have complex poles we must choose

(1 + K3)2 − 4K1 < 0

Since we need K3 = 3 to meet the settling time specification, this becomes,

K1 > 4

• For K1 > 4, the damped natural frequency is given by

ωd =√

4K1 − 16

• If we want the fastest response that has less than 5% of overshoot, we would have tochoose ωd = ζωn = 2. Thus

K1 =ω2

d + 16

4= 5

However, the presence of the zero at s = −K1/K3 might affect the peak time andovershoot, so we should go back and evaluate the actual step response....

• In summary, the PD controller does not affect the steady state error, and allows us tospeed up the transient response.

10.1.2 PI Control

• Suppose that instead of speeding up the transient response, we want to improve thesteady state tracking.

• We could try using an integral controller to increase the system type from I to II, sothat there would be zero steady state error to both steps and ramps.

Gc(s)Gs(s) =K2

s2(s + 1)

95

Page 96: Control Systems 1 notes

• Before we get too excited, let’s check on the stability.

• The closed loop transfer function is

T (s) =K2

s3 + s2 + K2

Clearly, this is going to be unstable for all choices of K2 (since there is no s1 term. Wedon’t need to bother computing the Routh array.

• What happens if we use a PI controller instead. The open loop transfer function willbe

Gc(s)Gs(s) =

(

K1 +K2

s

)

1

s2(s + 1)

=K1s + K2

s2(s + 1)

which is still a type II system.

• The closed-loop transfer function is

T (s) =

K1s + K2

s2(s + 1)

1 +K1s + K2

s2(s + 1)

=K1s + K2

s3 + s2 + K1s + K2

• Thus, for stability, we immediately see that K1 > 0 and K2 > 0 are required. Nowform the Routh array

s3 : 1 K1

s2 : 1 K2

s1 : K1 −K2

s0 : K2

so that we must have K1 > K2 > 0 for stability.

• To see what effect this controller has on the transient response, we need to figure outwhere the closed-loop poles are. In this case, it involves solving a cubic equation.

• To be able to get an intuitive feel for what is going on, we will need to have a tool thatallows us to estimate the locations of the closed-loop poles for third (and higher) ordersystems. Luckily, that tool is just around the bend.

96

Page 97: Control Systems 1 notes

11 Root Locus Plots.

• Consider the following unity feedback system,

−+

R(s) C(s)K

s+1

whose open loop transfer function isK

s + 1.

• How does the pole of the closed loop system change as the gain, K, is increased from0 to ∞?

• The closed loop transfer function is

C(s)

R(s)=

K

s + 1 + K

which has a single, real, pole at s = −(K + 1).

• Therefore, the pole starts at s = 0 when K = 0, and moves to the left, toward s = −∞,as K increases. We can plot this in the complex plane as follows,

−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

Real Axis

Imag

inar

y A

xis

Root Locus for G(s) = 1/(s+1)

Open Loop Pole

Closed Loop Pole

for K = 0

Pole Moves towards −∞

as K increases to ∞

Note that the x denotes the pole of the open loop transfer function, which is also theclosed loop pole when K = 0.

• Let’s try a slightly more complicated example.

97

Page 98: Control Systems 1 notes

−+

R(s) C(s)K

(s+1)(s+3)

where the open loop transfer function is

KG(s) =K

(s + 1)(s + 3)

• In this case, the closed loop transfer function is,

C(s)

R(s)=

K

s2 + 4s + 3 + K

• The closed loop poles are:

s =−4±

16− 4(3 + K)

2= −2±

√1−K

• Thus, for K = 0, the closed loop poles are located at −2± 1 = −1,−3, which are alsothe open loop poles. For 0 < K ≤ 1, we have two real poles, and for K > 1, we havea pair of complex conjugate poles at:

s = −2± j√

K − 1

• Thus, as K increases from 0 to 1, the two real poles move toward each other, along thereal axis. As K is increased further, the two poles become complex, moving straightup and down. As K →∞, the poles move toward −2± j∞. Here is what it looks likein the complex plane.

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

−2

−1

0

1

2

3

Real Axis

Imag

inar

y A

xis

Root Locus for G(s) = 1/(s+1)(s+3)

Open Loop Pole

Closed Loop Polefor K = 0

Open Loop Pole

Closed Loop Polefor K = 0

Pole Moves towards +j∞as K increases to ∞

Pole Moves towards −j∞as K increases to ∞

When K = 1, thereare two real polesat s=−2

98

Page 99: Control Systems 1 notes

• These plots, which show how the closed-loop poles move as K is increased from 0 to∞ are called Root Locus Plots, or sometimes Root Loci.

11.1 Drawing Root Locus Plots Directly

• Root Locus Plots wouldn’t be too helpful if we had to find the closed loop polesanalytically before we could draw them. Luckily, they can be constructed directlyfrom the open loop poles and zeros of the system. Consider a unity feedback system

−+

R(s) C(s)

KG(s)

whose closed loop response is

C(s)

R(s)=

KG(s)

1 + KG(s)

• The closed loop poles are the solutions to,

1 + KG(s) = 0

=⇒ KG(s) = −1

• K is a real, positive, number, 0 < K <∞, but G(s) is complex, in general. Therefore,KG(s) is also complex, in general. Thus, for a point, s0, to be a closed-loop pole, itmust satisfy two conditions

|KG(s)| = 1

arg(KG(s)) = 180o + k360o k = 0,±1,±2, . . .

• The Magnitude Condition implies that, if s0 is a closed-loop pole, then,

K =1

|G(s0)|

• The Angle Condition is more useful. Since K is a real positive number, arg(K) = 0.Thus, for the point s0 to be a closed-loop pole, we must have

arg(G(s0)) = 180o + k360o

• For every point, s0, which satisfies the angle condition, arg(G(s0)) = 180o, there is acorresponding gain, K = 1/|G(s0)|, which satisfies the magnitude condition.

99

Page 100: Control Systems 1 notes

• The root locus, which is a plot of the closed loop poles for all values of K between 0and ∞, is also the plot of all points which satisfy the angle condition.

• To draw the root locus, we need only find all of the points which satisfy the anglecondition.

• Back to the first example. The open loop transfer function was

KG(s) =K

s + 1

Plot the open loop pole, s = −1 in the complex plane. Consider a test point, s = s0,which is somewhere else in the plane. Then, s0 +1 = s0− (−1), is a vector drawn from

the pole at s = −1 to the test point at s = s0.

s = s0

s = −1

• To compute G(s0), note that

1. Magnitude: |G(s0)| = 1/(s0 − (−1)), so the magnitude of G(s0) is equal to onedivided by the length of the vector from s = −1 to s = s0.

2. Angle: arg(G(s0)) = − arg(s0 − (−1)). Thus, the argument of G(s0) is equal tonegative one times the angle between the positive half of the real axis and thevector from s = −1 to s = s0.

• Thus, the only points on the root locus, are the points where θ = 180o – i.e. the pointson the real axis, to the left of the open loop pole at s = −1.

11.2 Points on the Real Axis

11.2.1 Example

• Consider first the open-loop system G(s) =1

s + a

100

Page 101: Control Systems 1 notes

X

θ = 180o

sL

sR

θ = 0o

• Consider a test-point, sR, on the real axis, to the right of the pole at s = −a. Then,sR + a = sR − (−a), is a vector drawn from s = −a to s = sR, which is parallel to thepositive real axis. Thus, arg(sR + a) = 0, and hence,

arg(G(sR)) = − arg(sR + a) = 0

Thus, sR is not on the root locus, and the point s = sR will not be a closed-loop poleof the system, regardless of the controller gain, K.

• Now consider a test point, sL, on the real axis, but to the left of the pole at s = −a.As before, sL + a is a vector drawn from s = −a to s = sL. However, in this case, thevector is pointing in the negative real direction. Thus, arg(sL + a) = 180o, and hence

arg(G(sL)) = − arg(sL + a) = −180o

Thus, the test point, s = sL satisfies the angle condition, and is therefore on the rootlocus. As a result, if we set the gain K to

K =1

|G(sL)|

then the point s = sL will be the pole of the closed loop system.

11.2.2 Example II

• Let the open loop transfer function be

G(s) =s + b

s + a

with |b| < |a| (although at this point, it doesn’t really matter which is which).

101

Page 102: Control Systems 1 notes

XO

arg(G(sR)) = 0oarg(G(sL)) = 0o

arg(G(sB)) = 180o

• If we consider a test point, s = sR to the right of both the pole and zero, they bothcontribute 0 to the argument. Thus

arg(G(sR)) = −0 + 0 = 0

and the section of the real axis to the right of the pole is not part of the root locus.

• Next, consider a point, s = sL, to the left of the zero (also to the left of the pole). Inthis case, the pole contributes −180o, but the zero contributes a phase of +180o. Thus,for points to the left of both the pole and zero,

arg(G(sR)) = −180 + 180 = 0o

Therefore, the real axis to the left of both the pole and zero is also not part of the rootlocus.

• Finally, consider a test point, s = sB, which is on the real axis between the pole andthe zero. In this case, the pole contributes −180o to the phase and the zero contributes0o. Thus,

arg(G(sR)) = −180 + 0 = −180o

Therefore, the segment of the real axis which lies between the pole and zero is part ofthe root locus.

11.3 Complex Poles (or zeros)

• In this case, the open-loop system has one real zero, and 2 complex poles.

O

X

X

180o

θ

−θ

102

Page 103: Control Systems 1 notes

• Notice that the phase contributions from the two complex poles cancel each other out.

• Thus, all of the points on the real axis, which are to the left of the zero, are on theroot locus.

11.3.1 Rule 1 for Root Locus Plots

Points on the real axis, which lie to the left of an odd number of poles and/or zeros, arepart of the root locus.

103

Page 104: Control Systems 1 notes

11.4 Summary

• We considered this generic unity feedback system,

−+

R(s) C(s)

KG(s)

whose open loop transfer function is KG(s), and asked ourselves how the locations ofthe closed-loop poles changed as K varied from 0 to ∞.

• We observed that the closed-loop poles are the solutions to

1 + KG(s) = 0

KG(s) = −1

arg(G(s)) = 180o + n360o with K =1

|G(s)|

and convinced ourselves of Rule # 1.

Points on the real axis, which lie to the left of an odd number of polesand/or zeros, are part of the root locus.

11.5 Open Loop Poles and Zeros

• Let the open loop transfer function be:

KG(s) =KB(s)

A(s)= K

sm + bm−1sm−1 + . . . + b0

sn + an−1sn−1 + . . . + a0

• The closed-loop transfer function is,

C(s)

R(s)=

KB(s)

A(s) + KB(s)

• Since n ≥ m, the closed loop transfer function will have the same number of poles asthe open-loop transfer function (n).

• Consider the case when K → 0. The closed-loop poles are the solutions to

A(s) + KB(s) = 0

Thus as K → 0, the closed loop poles approach the solutions to

A(s) = 0

In other words, when K = 0, the closed loop poles are equal to the open loop poles.

104

Page 105: Control Systems 1 notes

• What happens when K →∞? Then, the closed-loop poles approach the solutions to

B(s) = 0

Thus, as K →∞, the open loop zeros become closed loop poles.

• However, the number of open-loop zeros may be less than the number of closed looppoles (which is equal to the number of open loop poles). Where do the rest of theclosed loop poles go?

• As we saw in the examples, the closed loop poles can go to ∞. Indeed, we call theseinfinite points zeros at infinity.

• If the open loop system has n poles and m zeros, then m of the closed-loop poles willtend toward the open loop zeros, as k → ∞. The remaining n −m closed loop poleswill move toward the n−m zeros at infinity.

• Putting these observations together, we have...

11.5.1 Rule 2 for Root Locus Plots

The root locus plot has one branch for each closed loop pole. Each branch starts,for K = 0, at the location of an open loop pole. When K → ∞, m of thebranches terminate at an open loop zero, and the remaining n − m branchesterminate at a zero at infinity.

11.6 Zeros at Infinity and Asymptotes

• Suppose that the open loop system has the transfer function

KG(s) =K(sm + bm−1s

m−1 + . . . + b1s + b0)

sn + an−1sn−1 + . . . + a1s + a0

then, there will be n−m zeros at infinity (but where).

• Divide the top and bottom by B(s). This leaves K as the numerator.

• To compute the denominator, use long division to divide sn +an−1sn−1 + . . .+a1s+a0

by sm + bm−1sm−1 + . . . + b1s + b0.

sn−m + (an−1 − bm−1)sn−m−1 + . . .

sm + bm−1sm−1 + . . .

)

sn + an−1 sn−1 + . . .sn + bm−1 sn−1 + . . .

(an−1 − bm−1) sn−1 + . . .(an−1 − bm−1) sn−1 + . . .

105

Page 106: Control Systems 1 notes

• Thus, the open loop transfer function can be written as

KG(s) =K

sn−m + (an−1 − bm−1)sn−m−1 + . . .

• Now, if we let s → ∞, then the first two terms in the denominator will dominate allof the others (which have lower powers of s). Indeed, for very large values of s,

KG(s) ≈ K(

s + an−1−bm−1

n−m

)n−m

In other words, for large s, the open loop transfer function looks like it is comprised ofn−m poles located at the point

σ = −an−1 − bm−1

n−m

• The point σ, can be computed from the open-loop poles and zeros as follows. Considerwhat would happen if we factored the numerator polynomial

sm + bm−1sm−1 + . . . + b0 = (s− z1)(s− z2) . . . (s− zm)

Multiplying out the zeros, we see that

bm−1 = − (z1 + z2 + . . . + zm)

Similarly

an−1 = − (p1 + p2 + . . . + pn)

• Thus, the n−m poles appear to be at the point

σ =

∑ni=1 pi −

∑mj=1 zj

n−m=

poles−∑

zeros

n−m

• Now, use the angle condition, to figure out the angles of the asymptotes that end atend at the zeros at infinity. Consider an open loop transfer function consisting of n−mpoles at the point s = σ.

X

poles

so

θ

n−m

s = σ

106

Page 107: Control Systems 1 notes

Now place a test point, s0 somewhere in the complex plane. The argument of G(s0) isnegative one times n−m, times the angle subtended by a vector from the point s = σto the test point, s = s0. The argument is negative, because G(s) contains only poles,and is multiplied by n −m, one for each pole in G(s). Clearly, the angle condition issatisfied iff,

(n−m)θ = 180 + k360 k = 0, 1, 2, . . . n−m− 1

In other words, there are n−m asymptotes, spaced equally around the circle.

11.6.1 Rule 3

If the open-loop transfer function has n poles and m zeros, the root locus plot will have n−masymptotes (which terminate at the n −m zeros at infinity). The asymptotes originate atthe point

σ =

poles−∑

zeros

n−m

and depart at angles of

180o + k360o

n−mk = 0, 1, . . . , n−m− 1

11.6.2 Example

• Let the open loop transfer function be

G(s) =1

s(s2 + 2s + 2)

• Find the poles of the unity feedback closed loop system, for 0 < K <∞.

• Step1: Find the open loop poles and zeros.

– There are no open loop zeros.

– The open loop poles are located at s = 0 and s = −1± j.

• Step 2: Find the root locus on the real axis. The negative real axis is to the left of anodd number of poles, and so is part of the root locus.

• Step 3: Zeros at infinity. The open loop system has 3 poles and no zeros. Therefore,there are 3 zeros at infinity, and 3 asymptotes. The asymptotes cross at the point

σ =0 + (−1 + j) + (−1− j)

3= −2/3

The angles of the asymptotes are

θ =180 + k360

3

107

Page 108: Control Systems 1 notes

which gives

k θ0 180/3 = 60o

1 540/3 = 180o

2 900/3 = 300o

• Step 4: Each branch starts at an open loop pole, and terminates either at an openloop zero (there are none in this case), or at a zero at infinity.

• Clearly, one branch starts at the pole at s = 0, and flows along the negative real axis,winding up at −∞.

• All that is required, is to figure out how the remaining two poles get from the twocomplex conjugate open loop poles, to the zeros at infinity.....

−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

Real Axis

Imag

inar

y A

xis

Partial Root Locus for G(s) = 1/s(s2+2s+2)

One Closed Loop Polemoves towards −∞as K goest to ∞

Open Loop PoleClosed Loop Polefor K = 0

One Closed Loop Polefollows this asymptoteto a zero at infinity

60o

−60o

11.7 Departure Angles

• Continuing with the example, let’s figure out what direction the branches start offin. Consider a test-point s0, which is a very small distance, ε away from the pole ats = −1 + j4. Suppose that a vector from the pole to s0 makes an angle of θ withrespect to the positive real axis. In that case, the argument of G(s0) is,

arg(G(s0)) = −θ − 135o − 90o

where −135o is the contributed by the pole at s = 0, and −90o is contributed by thepole at s = −1− j. Note that these angles will be constant, regardless of θ, only if thedistance, ε, between s0 and the pole at s = −1 + j is very, very small.

108

Page 109: Control Systems 1 notes

X

X

X

θ

135o

90o

• To satisfy the angle condition, we must have

arg(G(s0)) = −θ − 225o = −180o

Thus, to satisfy the angle condition,

θ = −45o

The root locus leaves the pole at s = −1 + j at an angle of −45o.

• Since complex poles occur in conjugate pairs, the branch which originates at −1 − j,leaves the open loop pole at an angle of +45o.

• This still leaves a question about how the closed loop poles get from the open looppoles (after their departure at ±45o) to the asymptotes.

• Consider the line at −45o (i.e. along the departure angle) from the pole at s = −1+ j.Clearly, if we move along this line, the contributions to the argument made by thepoles at s = 0 and s = −1 + j will not change. However, the contribution from thepole at s = −1− j will decrease. Thus, the phase will be less negative than −180o onthis line.

• Now consider a test point at σ + j∞, for −1 < σ < 0. At this point, the phase willbe −270o (i.e. −90o from each of the 3 poles). Since the argument is a continuousfunction, it must pass through −180o somewhere between the −45o line, and +∞.Thus, the branch of the root locus must stay above the departure line.

• Therefore, the branch which starts at −1 + j does not cross the real axis, but followsthe +60o asymptote. Similarly, the branch which starts at −1− j terminates along the300o asymptote.

109

Page 110: Control Systems 1 notes

−2 −1.5 −1 −0.5 0 0.5 1−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

Real Axis

Imag

Axi

s

Root Locus for G(s) = 1/s(s2+2s+2)

110

Page 111: Control Systems 1 notes

11.8 Example: Breakaway Points

• Draw the root locus for the system

G(s) =1

s(s + 1)(s + 2)

• Following the usual plan,

1. Plot the open loop poles and zeros in the complex plane. There are no open loopzeros, and 3 open loop poles located at s = 0, s = −1 and s = −2.

2. Points on the real axis which are to the left of an odd number of poles and/orzeros are part of the locus. Thus, the real axis between the poles at s = 0 ands = −1, and to all points to the left of the pole at s = −2 are on the locus.

3. Zeros at infinity. There are 3 zeros at infinity (3 open loop poles, no open loopzeros). The angles of the asymptotes are

θ =180 + k360

3

which gives

k θ0 180/3 = 60o

1 540/3 = 180o

2 900/3 = 300o

The asymptotes origninate from the point

σ =

poles−∑ zeros

n−m=

0 + (−1) + (−2)

3− 0= −1

4. Every branch starts, for K = 0, at an open loop pole, and terminates either at anopen loop zero, or at a zero at infinity. The branch starting at the pole at s = −2is easy. That pole just moves left down the negative half of the real axis. Thepoles at s = 0 and s = −1 move towards each other, eventually join, and thenbecome complex. The two poles eventually wind up following the ±60o degreeasymptotes.

• The question remains: “Where do the two traces leave the real axis”?

111

Page 112: Control Systems 1 notes

−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

Real Axis

Imag

Axi

s

Root Locus for G(s) = 1/s(s+1)(s+2)

11.9 Finding the Breakaway Point

• So far, we have thought of K as a parameter which generates the root locus. We startwith K = 0, and gradually increase K →∞, and plot the resulting closed loop poles.

• Turn this idea on its head, and consider how K changes as we move along the rootlocus.

• Starting from s = 0, and moving to the left (there is no locus to the right of s = 0),we see that K increases.

• Starting from s = −1, and moving to the right, we also see that K increases.

• If we stay on the real axis, rather than following the closed loop poles, once we passthe break away point, K starts decreasing towards 0.

• Thus, the breakaway point is a local maximum in K.

• So, to find the breakaway point, we need to think of K as a function of s, differentiateit, and set the derivative to 0.

11.9.1 Treating K as a function of s

• The problem facing us, is that K is really only defined on the root locus. For pointson the locus, the magnitude condition tells us,

K =1

|G(s)|

112

Page 113: Control Systems 1 notes

• Since points on the root locus satisfy the angle condition, G(s) is a negative real numberon the locus. Therefore, on the locus, we can also write

K =−1

G(s)

• To be able to differentiate K, with respect to s, we need to have a function whichis well defined everywhere (or at least almost everywhere) in the complex plane. Wedon’t care what the function is except when it is on the root locus. One candidate, isto let

K(s) =−1

G(s)

since this function is equal to the controller gain whenever s is on the root locus, andthe definition is simple, and it exists everywhere except possibly at a finite number ofpoints (the zeros of G(s)).

• So, to find the breakaway points, we define the extension of K to the complex plane:

K(s) =−1

G(s)

and then compute ∂K(s)∂s, and set it to zero. Any zeros in the derivative which lieon the root locus correspond to breakaway (or perhaps break in) points.

11.9.2 Back to the Example:

• Define the extension of K to the complex plane

K(s) =−1

G(s)= −(s3 + 3s2 + 2s)

• Take the derivative,

∂K(s)

∂s= −(3s2 + 6s + s)

• Set the derivative to zero

−(3s2 + 6s + 2) = 0

⇒ s =−6±

√36− 24

6

= −1±√

3/3

≈ −1.6 or − 0.4

113

Page 114: Control Systems 1 notes

• Notice that the optimization has two solutions, s = −0.4 and s = −1.6. However, onlyone of them, s = −0.4 is on the root locus. In fact, if we go back and compute K(s)for these two solutions, we get

s K-1.6 -0.38-0.4 0.38

The root which lies on the locus (s = −0.4) corresponds to a positive value of K, andis therefore the breakaway point. The other root corresponds to a local extreme in theextension of K to the complex plane. Since the point isn’t on the locus, it is a featureof the way we chose to extend K onto the complex plane, and can be ignored.

−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

Real Axis

Imag

Axi

s

Root Locus for G(s) = 1/s(s+1)(s+2)

s = −0.4 is on the rootlocus and is thereforea breakaway point

s = −1.6 is not on the rootlocus. Although it is alocal max/min of K(s), itis not a relevant solutionsince K(s) is not positive

While we have this plot handy, what does it tell us about the system?

1. Suppose I apply a step input, and then wait for the transients to die out. Whatis the steady-state error?

Ans: The open loop system has one pole at s = 0, therefore the static positionerror is 0.

2. Suppose that K = 0.35. Is the system under-damped, critically damped, orover-dampled.

Ans: To figure this out, we have to see whether or not the dominant poles are realor complex. For low values of K, all 3 poles are real, whereas for larger values ofK, the dominant poles become complex.

– Figure out what value of K corresponds to the breakaway point. Recall thatthe breakaway point was at,

s = −1 +√

3/3

114

Page 115: Control Systems 1 notes

The corresponding value of K is found from

K =−1

G(s)

= −(s)(s + 1)(s + 2)

= −(

−1 +

√3

3

)(√3

3

)(

−1 +

√3

3

)

=2√

3

9≈ 0.385

– Thus, the breakaway point happens when K = 0.385. Since 0.35 is less than0.385, all 3 poles will be real, and the system will be overdampled.

3. What value of K will cause the root locus to cross into the right half plane?

Ans: Theoretically, we could figure this out graphically, if we had drawn the plotwith extreme precision. However, it is probably simpler to use the Routh-Hurwitztest.

– The open-loop transfer function is,

G(s) =K

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

K

s3 + 3s2 + 2s

– Thus, the closed-loop transfer function is,

C(s)

R(s)=

G(s)

1 + G(s)=

K

s3 + 3s2 + 2s + K

– Test s3 + 3s2 + 2s + K for left/right half plane roots.

(a) All polynomial coefficients must be positive, therefore, K > 0 is necessaryfor stability.

(b) Construct the Routh array

s3 : 1 2s2 : 3 Ks : 1

3(6−K)

1 : K

All entries in the first column must be positive. Therefore, we must have

0 < K < 6

for stability.

– Thus, the root-locus crosses into the right half plane when K = 6.

4. If K = 6, the step response will contain a sinusoidal oscillation. What is itsfrequency?

Ans: Solve for the closed loop poles when K = 6. Thus, we need

s3 + 3s2 + 2s + 6 = 0

115

Page 116: Control Systems 1 notes

Which is a cubic. However, we know that the solution is imaginary. Solve for ωin,

−jω3 − 3ω2 + 2jω + 6 = 0

Since both the real and imaginary parts must be zero, we have

−3ω2 + 6 = 0⇒ ω =√

2

Thus, the sinusoidal oscillation ocurrs at ω =√

2 radians per second. Also, weknow that the root locus crosses into the right half plane at ω =

√2.

Table 3: Summary for Sketching a Root Locus0. a) Write the characteristic equation in the form 1 + KG(s) = 0

b) Factor G(s) into n poles and m zeros 1 + KQm

i=1(s−zi)Qn

i=1(s−pi)= 0

1. a) Locate the root loci on the real axis Points on the real axis, which lie to theleft of an odd number of poles and/or zeros,are part of the root locus.

b) Keep in mind the root loci off the real axis will be a mirror image across the real axis2. a) Find the number of seperate loci The root locus plot has one branch for each

closed loop pole.b) Find where they start Each branch starts, for K = 0, at the

location of an open loop pole.c) Find where they end When K →∞, m of the branches terminate at an

open loop zero, and the remaining n−m branchesterminate at infinity.

3. Plot the n−m loci that go to infinity (they approach infinity along asymptotes)

a) asymptotes centred at σ =Pn

i=1 pi−Pm

i=1 zi

n−m

b) asymptote angles (from real axis) are 180o+k360o

n−mk = 0, 1, . . . , n−m− 1

4. a) Find angle of departure from complex poles 6 G(s) = 180o ± q360o at s = pi

b) Find angle of arrival at complex zeros 6 G(s) = 180o ± q360o at s = zi

5. Find the breakaway point(s) on the real axis a) find K(s) = −1/G(s)

b) find the maximum(s) by setting dK(s)ds

= 06. Find where the loci cross the imaginary axis use Routh-Hurwitz criterion

116

Page 117: Control Systems 1 notes

12 Control System Design using Root Locus Plots

12.1 Example:

Suppose that we have the following system

Gp(s)KGc(s)

In which the transfer function of the plant is:

Gp(s) =1

(s + 1)(s + 2)

The goal is to design the controller, KGc(s), so that the closed loop system has a 2% settlingtime of 2 seconds, and a peak overshoot of less than 16%.Step 1: Use the design specifications to figure out where the closed-loop poles are going togo.

t2% = 2 sec.

⇒ 4/ζωn = 2

⇒ ζωn = 2

and

Mp = e−πζ/√

1−ζ2= 0.16

⇒ ζ = 0.5

Thus, we have ωn = 4, and the desired closed loop poles are

sD = −2± j2√

3

Step 2: Draw the root-locus for Gp(s). If the root locus crosses over the desired poles, thenall we need to do, is to calculate the value of K which produces the desired poles.

117

Page 118: Control Systems 1 notes

Root Locus

Real Axis

Imag

Axi

s

−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1−4

−3

−2

−1

0

1

2

3

4

As we can see, the root locus does not pass over the desired poles. Therefore, there is novalue of K which will produce a system with the desired response. In fact, we can’t put thepoles anywhere in the desired region.

• Can we add some open loop poles and/or zeros to the system, so that the root locuspasses through the desired poles?

• Angle condition to the rescue.....

• Compute arg(G(s)) at the desired closed loop pole.

XX

106o

sD

θ1 = 90o

θ2 = tan−1(2√

3/(−1)) = 106o

arg(G(sD)) = −90o − 106o = −196o

• Thus, G(s) contains 16 degrees of extra negative phase (phase lag) at the desired poles.

118

Page 119: Control Systems 1 notes

• If we can some poles/zeros to the Gc(s), which provide 16o of phase lead at s = sD,then the desired closed loop poles will be on the root locus.

12.2 PD Controller

• The simplest approach, is to use a proportional plus derivative controller.

Gc(s) = Kp + KDs

= K(1 + sτD)

which provides a single open-loop zero at s = −1/τD

• Of course, this is an idealization (since it has more zeros than poles) – more on thatlater.

• We place the controller zero, so that it adds 16o of phase at s = sD. Thus,

XXO

106o

sD

16o2√

3

x

• If we draw the root locus for the compensated system, we would get a circle, centeredon the zero, passing through the desired pole...

• To compute the zero location, solve

tan(16o) =2√

3

x⇒ x =

2√

3

tan(16o)≈ 12

• Thus, the controller is

Gc(s) = K(s + 14)

• Now, we have to find K. Use the magnitude condition

K =1

(sD + 14)

(sD + 1)(sD + 2)

= 1

119

Page 120: Control Systems 1 notes

• Thus, our controller is Gc(s) = (s + 14)

• What is the static-error performance going to be like? Well, this is a type 0 system,so it can only track a step input, and the relevant error constant is

Kp = G(0) = 1s + 14

(s + 1)(s + 2)= 7

so the static position error is1

1 + 7=

1

8= 12.5%.

• Are the two poles in the system dominant? Well,a

ζωn=

14

2= 7, so the closed loop

poles are almost certainly dominant. From Figure 5.13 in D+P, we can see that ζ = 0.5and a/ζωn = 7 gives an overshoot of about 16%.

12.3 Lead Controller

• One problem with the PD controller, is that it doesn’t (at least ideally) have a pole. Itis impossible to build a PD controller, at least exactly. It will have at least one pole,albeit at very high frequencies.

• This is a more practical controller design, which includes both a pole and a zero.

KGc(s) = Ks + 1/T

s + 1/αT

• If 0 < α < 1, the the pole frequency (1/αT ) is higher than the zero frequency (1/T ).Thus, the pole-zero plot is,

OX

θ2θ1

sD

arg(Gc(sD)) = θ1 − θ2

> 0 since

θ1 > θ2

• In the example, we need only ensure that θ1 − θ2 = 16o to achieve the desired designspecs.

• Note that we have 2 degrees of freedom, in that we can specify the positions of boththe pole and zero. However, there is only one constraint, namely that θ1 − θ2 = 16o.

120

Page 121: Control Systems 1 notes

12.4 Practical Design of Lead Controllers

• In general, it is best to keep α (the ratio of the pole and zero frequencies) as close to1 as possible.

• Adding a lead controller reduces the static-error constant of the system.

• In our example, we have a type 0 system, so the relevant measure is Kp,

Kp = G(0) = Ks + 1/T

s + 1/αT

1

(s + 1)(s + 2)=

2

• Thus, the smaller α is, the worse the steady state tracking error will be.

• This is only an approximation, since K will depend (slightly) on both T and α.

• Try putting the zero at s = −3, so that the zero angle is

θ1 = tan−1

(

2√

3

1

)

= 74o

Then, the pole angle must be, θ2 = 74o − 16o = 58o. The pole position is then

XXOX

106o

sD

58o

74ox

tan(58o) =2√

3

x⇒ x = 2.16

Thus, the controller pole is at s = −4.16.

• To complete the design, compute K using the magnitude condition.

Gc(sD)Gp(sD) =sD + 3

sD + 4.16· 1

(sD + 1)(sD + 2)≈ −0.0707

Thus, K = 14.14. Notice that α = 3/4.16 = 0.72. The final controller design is

Gc(s) = 14.14s + 3

s + 4.16

121

Page 122: Control Systems 1 notes

12.5 Pole-Zero Cancellation Solution

• The simplest lead controller is obtained by cancelling the open-loop pole at s = −2with the controller zero. In that case, the controller is

Gc(s) = Ks + 2

s + 3

• To compute the controller gain,

Gc(sD)Gp(sD) =1

sD + 1sD + 3 = −0.0769

Thus K = 13, and the controller is

KGc(s) = 13s + 2

s + 3

122

Page 123: Control Systems 1 notes

13 Frequency Response Models and Bode Diagrams

• So far, the control design methods have been based on Laplace domain transfer funcitonmodels of the plant and of the controller.

• For simple electrical and perhaps mechanical systems, we can derive these models basedon analysis of first principles.

• Parameter values (R, C, L, m, k, b) were assumed to be given, and exactly known.

• What happens if we have a widget on the lab bench?

• Can we find the system model experimentally?

• This process is called System Identification

• Except in very special cases, like the DC motor in the lab. estimating transfer functionand/or state-space models from experimental data is somewhat tricky, and well beyondthe scope of this course (see ENEL 631).

• We can estimate the transfer function on the imaginary axis (rather than in the wholes plane).

13.1 Response of Linear Systems to Sinusoids

Y (s)G(s)

A sin(ωt)u(t)

• Let the transfer function be:

G(s) =K(s− z1) . . . (s− zm)

(s− p1) . . . (s− pn)

• The output is,

Y (s) =Aω

s2 + ω2

K(s− z1) . . . (s− zm)

(s− p1) . . . (s− pn)

• Do a partial fraction expansion.

Y (s) =r0

s + jω+

r∗0s− jω

+r1

s− p1+ . . . +

rn

s− pn

• Consider all but the first two terms,

rk

s− pk

−→ rkepkt1(t)

Provided all of the system poles are in the left half plane (not even on the jω axis),then all of these terms will decay to zero as t→∞.

123

Page 124: Control Systems 1 notes

• Consider the first two terms:

ro =AωG(s)

s− jω

s=−jω

=AG(−jω)

−2j

• The inverse transform of the first two terms is,

yss(t) =A

2j

(

G(jω)ejωt −G(−jω)e−jωt)

Write G(jω) as magnitude and phase:

G(jω) = |G(jω)|ejΦ(G(jω))

Then,

yss(t) =A|G(jω)|

2j

(

ej(ωt+Φ(G(jω))) − e−j(ωt+Φ(G(jω))))

= A|G(jω)| sin(ωt + Φ(G(jω)))

• Thus, if you wait long enough, you will get a sine-wave,with amplitude A|G(jω)|, andphase Φ(G(jω).

• To measure the transfer function on the imaginary axis (i.e. the frequency response,

1. Apply a sine-wave input with frequency ω.

2. Wait for the transients to decay.

3. Compute the gain and phase shift between the input and output signals.

4. Repeat 1-3 at different frequencies.

13.2 Bode Diagrams

• There is a standard way of displaying frequency response data: The Bode Diagram.

• This is definitely a “core competency” for electrical engineers.

• Gain and Phase are plotted against log10(ω).

• Gain is measured in decibels (dB).dB measures a ratio, and is defined as

10 log10

(

Output Power

Input Power

)

Note that we are usually measuring a voltage. Since P = V 2/R, the decibel becomes

20 log10

(

Output Voltage

Input Voltage

)

• Phase is usually measured in degrees.

• Although this may seem a bit arbitrary, all of theses choices have been made to simplifythe plotting and interpretation of Bode diagrams.

124

Page 125: Control Systems 1 notes

13.3 Plotting Bode Diagrams of Transfer Functions

• Consider the transfer function (in factored form)

G(s) =K(s− z1) . . . (s− zm)

(s− p1) . . . (s− pn)

• Calculate its magnitude, along the imaginary axis

|G(jω)| = |K||jω − z1| . . . |jω − zm||jω − p1| . . . |jω − pn|

• Now, take logs

log10(|G(jω)|) = log10(|K|) + log10(|jω − z1|) + . . .

+ log10(|jω − zm|)− log10(|jω − p1|)− . . .− log10(|jω − pn|)

• Since the gain is plotted in dB (i.e. we are plotting log gain), we can treat each poleand zero individually, and then add up the results.

• Now calculate the argument of G(jω),

Φ(G(jω)) = Φ(K) + Φ(jω − z1) + . . .

+ Φ(jω − zm)− Φ(jω − p1)− . . .− Φ(jω − pn)

• Similarly, the phase due to each pole and zero can be computed individually, and thenthe results added together.

• There are a few basic elements which we must be able to deal with.

1. A Gain K in the numerator.

2. A factor of s in the numerator.

3. A factor of s in the denominator.

4. A single, real zero (other than at s = 0).

5. A single, real pole (other than at s = 0).

6. A pair of complex conjugate zeros (not on real axis).

7. A pair of complex conjugate poles (not on real axis).

• Once we can deal with each of these factors, we can handle anything!

13.3.1 Bode Plot of A Gain, K

• The gain is 20 log10(|K|).

• The phase is 0, for K > 0, and 180o (or −180o) for K < 0.

125

Page 126: Control Systems 1 notes

13.3.2 s in the numerator

• Leads to a factor of jω in numerator.

• Gain: 20 log10(|jω|) = 20 log10(ω).

• Tabulate a few values.

ω 20 log10(ω)1 0 dB10 20 dB100 40 dB0.1 -20 dB0.01 - 40 dB

10−2

10−1

100

101

102

−40

−20

0

20

40

Gai

n in

dB

Bode Diagram for s in numerator

10−2

10−1

100

101

102

0

45

90

135

180

Pha

se in

Deg

rees

Frequency in rad/sec

• Thus, we have a straight line, with slope 20 dB/decade, passing through the point (1rad/s, 0 dB).

• Phase: Φ(jω) = 90o.

• What happens if we have s2 in the numerator? Add them up...

13.3.3 s in the denominator

• Gain and Phase are negative of what we got for a numerator s factor.

• Thus, the gain is a line, passing through (1,0), with slope -20 dB/decade.

• The phase is −90o.

13.3.4 Real Zero

• Consider a normalized zero:

(

s + a

a

)

s=jω

=

(

jω − (−a)

a

)

126

Page 127: Control Systems 1 notes

• The constant a in the denominator can always be corrected for in the final gain.

• The zero location (at −a) has been explicitly shown.

• Think of jω − (−a) as a vector fromthe point −a to the point jω.

• The length of the vector is |jω + a|,and the angle φ, is the argument ofjω + a.

• Think about what happens as wemove the test point from ω = 0 toω =∞.

|s + jw

|

−aφ σ

• For very small values of ω,

– Assumption: ω � a.

– Phase: Φ

(

jω + a

a

)

≈ 0.

– Gain:

jω + a

a

≈ 0dB.

The low frequency gain asymptote,is a horizontal line at 0dB. The lowfrequency phase asymptote is a con-stant at 0 degrees.

• For very large values of ω.

– Assumption: ω � a, thus,

(jω + a) ≈ jω

– Gain:∣

jω + a

a

≈ ω

a

– In dB, we have

20 log10

a

)

= 20 log10(ω)− 20 log10(a)

The second term is a constant, the first term looks like a numerator s factor.

– Thus, high frequency gain asymptote increases at 20 dB per decade (like a nu-merator factor of s). It through 0dB at ω = a.

– Phase:

Φ

(

jω + a

a

)

≈ Φ

(

a

)

= 90o

127

Page 128: Control Systems 1 notes

– The high-frequency phase asymptote is 90 degrees.

• What happens in the middle, for ω ≈ a? – Whip out the ol’ HP, and crunch a fewnumbers.

ω/a dB Φ0.01 0.0004 0.60.1 0.04 5.71 3.01 4510 20.04 84.3100 40.0004 89.4

Bode Diagram

Frequency (rad/sec)

Pha

se (

deg)

Mag

nitu

de (

dB)

0

10

20

30

40

50

ExactAsymptotes

10−2

10−1

100

101

102

0

45

90

ExactAsymptotes

128

Page 129: Control Systems 1 notes

13.3.5 Real Pole

• Consider a normalized pole:

(

a

s + a

)

s=jω

=

(

a

jω − (−a)

)

• Clearly, this is the same as a zero, but with the gain and phase multiplied by -1.

• Gain:

– Low Frequency asymptote, 0dB.

– High frequency asymptote, slope -20 dB/decade, passing through the point (a,0dB).

– Gain is -3dB at ω = a.

• Phase:

– Low frequency asymptote: 0o.

– High frequency asymptote: −90o

– Phase is −45o at ω = a.

Bode Diagram for a real pole at s = −1

Frequency (rad/sec)

Pha

se (

deg)

Mag

nitu

de (

dB)

−50

−40

−30

−20

−10

0

10

10−2

10−1

100

101

102

−90

−45

0

ExactAsymptotes

13.4 Example:

• Draw a Bode diagram for the system:

G(s) =300s

(s + 1)(s + 30)

129

Page 130: Control Systems 1 notes

• First, identify the elements.

1. A gain (compute this last).

2. A factor of s in the numerator.

3. A real pole at s = −1,

1

s + 1

4. A real pole at s = −30. Normalize this, so that its gain is 0 dB at low frequency....

30

s + 30

• Since we added a factor of 30 to the numerator of one of the poles (to normalize it),the real gain is,

K =300

30= 10.

Thus, the real gain gives us, 20 dB gain, and 0 degrees phase.

• The numerator factor of s, give us a gain characteristic with a slope of 20 dB perdecade, passing through 0 dB at ω = 1. Its phase is +90o.

10−2

10−1

100

101

102

103

−40

−20

0

20

40

60

Gai

n in

dB

Approximate Bode Plots for Numerator factors

10−2

10−1

100

101

102

103

−135

−90

−45

0

45

90

135

Pha

se in

deg

rees

Frequency (r/s)

Ks

• The pole at s = −1, gives us a gain of 0 (approximately) dB from ω = 0 to ω = 1rad/sec , followed by a slope of -20 dB/decade thereafter.

• The (normalized) pole at s = −30 gives us a gain of about 0dB for ω = 0 to ω = 30rad/sec, followed by a slope of -20 dB/decade.

130

Page 131: Control Systems 1 notes

10−2

10−1

100

101

102

103

−60

−40

−20

0

20

Gai

n in

dB

Approximate Bode Plots for Denominator factors

1/(s+1) 30/(s+30)

10−2

10−1

100

101

102

103

−135

−90

−45

0

45

Pha

se in

deg

rees

Frequency (r/s)

• Adding these up, we have a slope of + 20 dB/decade, passing through 20 dB at 1rad/sec (gain + numerator). Both poles are still providing 0 dB gain.

• starting at ω = 1, the slope becomes 0, since the pole at s = −1 contributes 20dB/decade after this.

• starting at ω = 30, the slope becomes −20dB/decade, since the pole at s = −30becomes active.

• If you want to be more precise, put in the 3 dB points, and draw a smooth curve,starting at 0.1 r/s (i.e. 1 / 10), and finishing at 300 r/s (10 * 30).

• Now for the phase. The numerator contributes 90 at all frequencies.

• The pole at s = −1 contributes 0 at low frequencies, until 0.1r/s, and −90o forω > 10r/s. Joint these with a straight line (so −45o at 1r/s).

• The pole at s = −30 contributes 0 at low frequencies, until 3r/s, and −90o for ω >300r/s. Joint these with a straight line (so −45o at 30r/s).

• Add up the characteristics.

• The complete bode diagram is

131

Page 132: Control Systems 1 notes

10−2

10−1

100

101

102

103

−60

−40

−20

0

20

40

60

Gai

n in

dB

Approximate Bode Plot for G(s) = 300s/(s2 + 31s + 30)

10−2

10−1

100

101

102

103

−135

−90

−45

0

45

90

135

Pha

se in

deg

rees

Frequency (r/s)

G(s)elements

• To be more precise, we could use the Matlab commands:

>>Gs = tf([300 0],[1 31 30])

>>bode(Gs)

Here is a comparison of the bode plot generated by Matlab, and the “hand drawn”approximation.

Bode Diagram

Frequency (rad/sec)

Pha

se (

deg)

Mag

nitu

de (

dB)

−20

−10

0

10

20

10−2

10−1

100

101

102

103

−135

−90

−45

0

45

90

135

ExactApproximation

13.5 Bode Diagrams for Second-Order poles and zeros

.

• The last building blocks on out list, are pairs of complex conjugate poles and/or zeros.

• I will deal with complex poles explicitly. By now, you should be able to figure out howto deal with zeros.

132

Page 133: Control Systems 1 notes

• Normalized form:

G(s) =ω2

n

s2 + 2ζωns + ω2n

for ωn > 0 and 0 < ζ < 1.

p = −ζωn ± jωn

1− ζ2

• Note that for ζ > 1, the poles will both be real. For ζ < 0 both poles will be in theright half plane, and hence unstable.

• If we plot the plot the poles in the complex plane, we see that:

x

x

σ

p2

p1

−ωnθ

– The poles lie on a circle of radius

|p| = ωn

ζ2 + 1− ζ2 = ωn

– The angle between the poles and thenegative real axis is

θ = tan−1

(

1− ζ2

ζ

)

13.5.1 Low Frequency Behaviour

• The transfer function can be written:

G(jω) =ω2

n

−ω2 + 2jζωnω + ω2n

=1

1−(

ωωn

)2

+ j2ζ(

ωωn

)

• In the low frequency case, let ω � ωn. Then ω/ωn → 0, and

G(jω) ≈ GLF (jω) =1

1− 0 + j0= 1

• Thus, at low frequencies, we have 0dB gain and 0o phase.

13.5.2 High Frequency Behaviour

• In the high frequency limit, ω � ωn. Thus

(

ω

ωn

)2

�(

ω

ωn

)

� 1

133

Page 134: Control Systems 1 notes

• Hence, the high frequency asymptote will be

G(jω) ≈ GHF (jω) =−1(

ωωn

)2

• This is a negative real number, so the phase is −180o (or +180o, or ±π radians, or...).

• What does the gain asymptote do?

|GHF (jωn)| = 1/1 = 0dB

|GHF (j10ωn)| = 1/(102) = −40dB

|GHF (j100ωn)| = 1/(1002) = −80dB

so, the slope is -40 dB/decade, and the asymptote passes through 0dB at ω = ωn.

• Thus, the asymptotes look just like they do for a pair of real poles located at s = −ωn.

10−2

10−1

100

101

102

−80

−60

−40

−20

0

20Bode Diagram: Asymptotes for Second−Order Poles

Gai

n: d

B

10−2

10−1

100

101

102

−150

−100

−50

0

Pha

se: d

egre

es

Frequency ω/ωn

13.5.3 What happens near ω = ωn?

• First, compute the gain and phase for ω = ωn.

G(jωn) =1

1− 1 + 2jζ=−j

|G(jωn)| =1

arg(G(jωm)) = −90o

134

Page 135: Control Systems 1 notes

• Consider the s-plane picture, for the case ζ ≈ 1

x

x

σ

– Magnitude is (1 over) the product ofthe lengths of the two vectors.

– Phase is (negative the) sum of thetwo angles from the poles to the testpoint on the imaginary axis.

– The situation isn’t radically differentfrom having two poles on the realaxis.

• Consider the s-plane picture, for the case ζ ≈ 0

x

x

σ

– Now, as the test point moves alongthe imaginary axis, it passes veryclose to one of the poles.

– Magnitude is (1 over) the product ofthe lengths of the two vectors. Oneof these will become very small, asthe test point passes by the pole.

– The phase contributed by the pole inthe lower left quadrant will be about−90o for all positive frequencies, ω.

– The phase contributed by the pole in the upper left quadrant will change from+90o (giving a total of 0o) for ω ≈ 0, to −90o (for a total of −180o) when ω � ωn.

– The closer the pole is to the imaginary axis, the faster this transition will happen.

• The effect of ζ on the shapes of the magnitude and phase plots is shown in the nextfigure:

135

Page 136: Control Systems 1 notes

13.5.4 Recipe for dealing with complex poles

1. Normalize,

G(s) =ω2

n

s2 + 2ζωns + ω2n

2. Plot low frequency asymptote,0 < ω < ωn/10.gain: 0dBphase: 0o phase

3. Plot high frequency asymptote,gain: -40 dB/decade, passing through 0dB at ω = ωn,phase: -180 degrees.

4. Compute ζ, and fill in the appropriate trace for the behaviour near ω = ωn.

136

Page 137: Control Systems 1 notes

13.6 Steady State Error Behaviour

If we are going to be able to base controller design tools on Bode diagrams, it would be niceto be able to get some information about the steady state error behaviour from them.

13.6.1 Review of Static Error Constants

• Recall, that a system with exactly n poles at s = 0, was called a Type n system.

• A Type n system can be written in the form,

G(s) =K

sn

(1− s/z1)(1− s/z2) . . . (1− s/zm)

(1− s/p1)(1− s/p2) . . . (1− s/p`)

where none of z1 . . . zm or p1 . . . p` are equal to zero.

• The steady state error in response to a unit step input is given by:

ess−step =1

1 + Kp

where Kp = lims→0

G(s)

• The steady state error in response to a unit ramp input is given by:

ess−ramp =1

Kvwhere Kv = lim

s→0sG(s)

• The steady state error in response to a unit parabola input is given by:

ess−par =1

Kawhere Ka = lim

s→0s2G(s)

13.6.2 Type 0 systems and Kp

• Suppose you drew the a Bode diagram of a Type-0 system

G(s) = K(1− s/z1)(1− s/z2) . . . (1− s/zm)

(1− s/p1)(1− s/p2) . . . (1− s/pn)

• The first step, would be to break the system into its normalized poles and zeros. Youwould get

– A constant gain of K

– m zeros at s = z1 . . . zm.

– n poles at s = p1 . . . pn.

• At low frequencies, all of the normalized poles and zeros would contribute 0 dB of gain,and 0o of phase.

• The gain K would contribute 20 log10(K) dB of gain, and 0o of phase at all frequencies.

137

Page 138: Control Systems 1 notes

• Thus, at low frequencies, the phase plot will approach 0o. and the gain plot willapproach 20 log10(K) dB.

• If the low frequency phase is 0o, and the low frequency gain is flat, the Bode diagramis from a Type-0 system. The low frequency gain is 20 log10(Kp) dB.

10−2

10−1

100

101

102

−60

−40

−20

0

20

Flat Gain of 20 log10

(Kp) dBat Low Frequency

Bode Diagram of a Type 0 System

Gai

n (d

B)

10−2

10−1

100

101

102

−180

−135

−90

−45

0Low Frequency

Phase of 0o

Pha

se (

degr

ees)

Frequency (rad/s)

13.6.3 Type 1 systems and Kv

• Can we do something similar for a Type I system?

• Let’s draw a Bode diagram for a Type-I system

G(s) =K

s

(1− s/z1)(1− s/z2) . . . (1− s/zm)

(1− s/p1)(1− s/p2) . . . (1− s/pn)

• To make things easier, assume that all of the poles and zeros (other than the one ats = 0), occur at very high frequencies,

z1, z2, . . . , zm, p1, p2, . . . , pn � 1

and only draw the low frequency portion of the Bode diagram.

• As before, decompose the transfer function into normalized elements,

– A gain K

– An integrator (aka a pole at s = 0), 1/s,

– m zeros at s = −z1 . . .− zm.

– n poles at s = −p1 . . .− pn.

138

Page 139: Control Systems 1 notes

• At low frequencies, all of the normalized poles and zeros would contribute 0 dB of gain,and 0o of phase.

• The gain K would contribute 20 log10(K) dB of gain, and 0o of phase at all frequencies.

• The integrator will contribute a phase of −90o at all frequencies. It’s gain plot will bea straight line with a slope of −20 dB/decade, and will pass through 0 dB of gain atω = 1r/s.

• Thus, at low frequencies, the only non-zero contributions will come from the gain, andthe integrator.

• The phase will be −90o.

• The gain will be a straight line with a slope of −20 dB/decade. At ω = 1, the gainwill be 20 log10(K).

• Thus, phase at low frequencies tends toward −90o, and the gain has a slope of −20dB/decade, also at low frequencies, then the system is a Type I system.

• If the −20 dB/decade slope extends from ω = 0 all the way to ω = 1r/s, then, thevalue of the gain plot at ω = 1 will be 20 log10(Kv).

10−2

10−1

100

101

102

−40

−20

0

20

40

At ω = 1 r/s, the only non−zero

term in |G(jω)| is 20 log10

(Kv)

Bode Diagram of a Type I System

Gai

n (d

B)

10−2

10−1

100

101

102

−90

−45

0

Low Frequency Phase is−90o for a Type I SystemP

hase

(de

gree

s)

Frequency (rad/s)

G(s) K 1/s remaining terms

• What if G(s) contains low frequency poles or zeros?

• Example:

G(s) =

√10(1 + s/0.1)

s

139

Page 140: Control Systems 1 notes

• First, decompose the system into normalized poles and zeros.

– A gain of√

10 = 10dB

– A pole at s = 0

– A normalized zero at s = −0.1

• The gain of√

10 provides 10 dB of gain, and 0o of phase at all frequencies.

• The pole provides −90o of phase at all frequencies. It’s gain characteristic is a straightline at a slope of −20 dB/decade, passing through 0 dB at ω = 1r/s.

• The zero provides 0 dB of gain at frequencies below 0.1 rad/sec, and then increases at20 dB/decade after that.

• The phase plot for the zero starts at 0o, until 0.01 r/s, and then reaches +90o forfrequencies above 1 r/s.

• Plot the Bode diagram, for all three components.

• Now, plot the Bode diagram for just K/s.

10−2

10−1

100

101

0

10

20

30

40

50

Gain Plot for Type I System

Gai

n (d

B)

Frequency (rad/s)

(1, 20 log10

(Kv))

Low Frequency Gain has

−20 dB/decade slope

Plot for K/s obtained by

extending −20 dB/decade slope

G(s) K 1/s (1 + s/0.1)K/s

• 20 log10(Kv) can be read off of the gain plot for K/s, by reading the gain value atω = 1 r/s, as in the case with all high-frequency poles and zeros.

• The gain plot for K/s can be obtained by extending the -20/dB portion of the Bodediagram (i.e. the low frequency gain plot), to higher frequencies.

• Thus, to estimate Kv from the Bode diagram,

140

Page 141: Control Systems 1 notes

1. Find the low frequency range, where the gain is a straight line with a slope of−20 dB/decade.

2. Extend this line at least as far as ω = 1r/s.

3. This line passes through the point (1, 20 log10(Kv)).

13.6.4 Type-2 systems, and Ka

• At this point, the pattern should be obvious.

• At low frequencies, the gain will have a -40 dB/decade slope, and the phase will be-180◦.

• Extend the low frequency line segment as a straight line, and read off the value wherethis line crosses ω = 1. This is Ka.

141

Page 142: Control Systems 1 notes

14 Checking Stability using Bode Diagrams

• So far, we have been discussing how steady state errors relate to Bode Diagrams. Wehave seen that the static error coefficients can be read directly from the Bode plots ofthe open loop transfer function.

• Of course, this is pointless if the closed-loop system turns out to be unstable.

• To analyze stability, we must answer the question: Does the closed-loop system have

any poles in the right half plane?

• In other words, are there any solutions to

1 + G(s) = 0

in the right half plane? (Notice that we have absorbed the gain K back into the openloop transfer function).

• So far this is the same analysis that lead to the root locus. However, we want to answerthis question using only the value of G(s) on the jω axis.

• The challenge, then, is to determine the number of right half plane solutions to

1 + G(s) = 0

using only the information present in G(jω, for ∞ < ω <∞.

14.1 Using G(s) as a mapping

• To answer this question, we are going to need to develop a little bit of complex analysis(which you really should have been taught a proper math course on complex analysis).

• The complex variable s defines a plane (which we always call the complex plane,s = σ + jω.

• There is nothing stopping us from defining another complex plane – say γ = α + jβ.

• Let G(s) be any rational function of s,

G(s) =K(s− z1) . . . (s− zm)

(s− p1) . . . (s− pn)

which will turn out to be the open loop transfer function, when we actually get aroundto using these ideas for something that looks like engineering....

• If we then specify γ = G(s), then G becomes a mapping from the s-plane to theγ-plane.

142

Page 143: Control Systems 1 notes

γ-plane jβ

α

s-plane jω

σ

G(s)

G(s)

γ1

γ0

s1

s0

• If G(s), the mapping function, is continuous, then small changes in s, will lead to smallchanges in γ. Thus, continuous lines/curves on the s plane will map onto continuoustraces in the γ plane.

14.1.1 The image of a contour

• Suppose that G(s) = s + a.

γ-plane jβ

α

s-plane jω

σ

• Draw a circle (clockwise) around the point s = −a.

• What does the image of this circle look like in the γ plane?

• Well, since γ = G(s) = s + a, we just shift the circle to the right by a, so that itencircles the origin (also in a clockwise sense).

• Clearly, with this simple mapping, we can easily image any contour.

• If the contour encloses the zero at s = −a, its image encloses the origin (in the samedirection).

143

Page 144: Control Systems 1 notes

14.1.2 Mapping a pole

• Now, what happens if G(s) = 1/(s + a).

X

γ-plane jβ

α

s-plane jω

σ

1/RR

• Trace a circle of radius r around the pole (clockwise).

s = −a + re−jθ θ : 0→ 2π

s + a = re−jθ

γ = G(s)

= 1/(s + a)

= (1/r)e+jθ

• In other words, when we encircle a pole in the clockwise direction, the image encirclesthe origin, but in the opposite direction – counter-clockwise.

14.1.3 Back to Complex Mappings and Transfer Functions

• If γ = G(s) maps the complex numbers to the complex numbers, we would need a4-dimensional white-board to be able to sketch the function...

• However, we can still show the correspondence between points in s and points inγ = G(s).

• In general, mapping these contours is pretty tricky.

• However, we can at least figure out the number of encirclements of the origin (whichis all we are going to need anyways).

• Suppose the transfer function is

G(s) =s + 1

s2 + 2s + 2

and we draw a contour which encloses the zero (at s = −1), and the two poles (ats = −1± j).

144

Page 145: Control Systems 1 notes

• Consider the contour

s = −1 + re−jθ θ : 0→ 2π

which is a circle, centered at the point s = −1, with radius r.

γ = G(s) for s = −1 + re−jθ where θ : 0→ 2π

=−1 + re−jθ + j

(−1 + re−jθ + 1 + j)(−1 + re−jθ + 1− j)

=re−jθ

(re−jθ + j)(re−jθ − j)θ : 0→ 2π

• If the circle is very small, so that r → 0, then the denominator is approximately 1

limr→0

G(s) =re−jθ

1= re−jθ θ : 0→ 2π

so we get one clockwise encirclement of the origin.

• If, the circle is very large, so that r →∞, then

limr→∞

G(s) =re−jθ

re−jθre−jθ=

1

rej(−θ + θ + θ) =

1

rejθ θ : 0→ 2π

and we get one counter-clockwise encirclement of the origin.

• Thus, if we travel clockwise around a closed contour, its image will encircle the originN times in the clockwise direction, where

N = Z − P

where P is the number of poles inside the contour, and Z is the number of zeros insidethe contour.

−6 −4 −2 0 2 4 6−6

−4

−2

0

2

4

6

Real Axis

Imag

inar

y A

xis

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

145

Page 146: Control Systems 1 notes

14.2 Infinite Contours

• Consider the transfer function G(s) = 1/(s + a).

• Suppose we construct a countour that includes the whole right half plane, but thatdoes not include the pole at s = −a.

• For example, try the following contour. Let the radius of the large half circle, R, tendto ∞, and let the radius of the small half circle (around the pole), ε→ 0.

X

α

γ0

γ1

γ2

γ3

γ4

γ5

γ-plane

σ

s0

s1

s2

s3

s4

s5

s-plane

• Start at s0 = −a + jε, which maps to γ = 1/(s0 + a) = −j/ε. As ε→ 0, γ → −j∞.

• Move up the line from s0 = −a + jε to s1 = −a + jR. γ moves up the line from −j∞,to −j/R→ 0, as R→∞.

• Travel around the little bump. |γ| = 1/ε → ∞. However, the argument of γ movesfrom +90o, through 0, to −90o.

• Continue on up the vertical line. Now, the magnitude of γ reduces to zero.

• Travel around the outer contour, which maps to a little bump.

• Notice that the contour does not enclose the pole in the s-plane, and that its imagedoes not enclose the origin in the γ plane.

• What happens if we flip the little bump over, enclosing the pole? The large half-circlein the γ plane flips as well, enclosing the origin.

146

Page 147: Control Systems 1 notes

X

α

σ

s0

s1

s2

s3

s4

γ0

γ1

γ2

γ3

γ4

γ5

s-planeγ-plane

s5

14.3 Nyquist Stability

• The basic idea is to map a con-tour which encloses the entire righthalf plane in the s-plane, to the γ(or G(s)) plane, and then use themapped contour to determine howmany closed loop poles lie in the righthalf plane.

• To map the contour, evaluate G(s)along the contour, and plot the re-sulting points in the γ plane.

R = ∞

Infinite D Contour Enclosing the Right Half Plane

Real Axis

Imag

inar

y A

xis

14.4 Drawing the Nyquist Plot

• Each time you evaluate G(s), you get a complex number. Plot this as a point in theγ-plane.

147

Page 148: Control Systems 1 notes

• It is usually best to work in polar co-ordinates, in which case, the radius is |G(s)|, themagnitude of G(s), and the angle is arg(G(s)), the argument (or phase) of G(s).

• In general, we are using the frequency response, G(jω), for a finite range of positivefrequencies. These can be plotted directly onto the Nyquist plot.

• For Example, consider the open-loop transfer function:

G(s) =1

(s + 1)3

which has the following Bode Diagram

Bode Diagram

Frequency (rad/sec)

Pha

se (

deg)

Mag

nitu

de (

dB)

−100

−80

−60

−40

−20

0

10−2

10−1

100

101

102

−270

−225

−180

−135

−90

−45

0

• Read of the gain at several easy an-gles (say 0, -45 , -90, etc), and plotthem in the γ plane (don’t forget toundo the 20 log10 in the gain).

• For example, when the phase is−45o,the frequency is about 0.27 radiansper second (on the phase plot). Fromthe gain plot, the gain at ω = 0.27 isabout -1 dB, or 0.9. Thus, in polarco-ordinates, you would plot a pointat a radius of 0.9, at an angle of−45o. −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 1.2

−0.7

−0.6

−0.5

−0.4

−0.3

−0.2

−0.1

0

0.1

0.2

Real Axis

Imag

inar

y A

xis

ω = 0gain = 1phase = 0

ω = 0.268gain = 0.901phase = −45

ω = 0.577gain = 0.650phase = −90

ω = 1gain = 0.354phase = −135

ω = 1.73gain = 0.125phase = −180

Polar Plot of the G(jω) on the Positive Frequency Axis

• Now, deal with the curve from +j∞, to −j∞.

– Case 1: The high frequency gain in the Bode plot goes to −∞ dB (i.e. 0). In thiscase, the system has more poles than zeros. Clearly, |G(Rejθ)| → 0 as R→∞.

– Technically, this is a circle of radius zero about the origin. However, when all thedust settles, we will wind up counting encirclements of -1, so whether or not thiscircle encloses the origin is of no concern to us.

148

Page 149: Control Systems 1 notes

– Case 2: The high frequency gain reaches a finite, non zero gain. This onlyhappens if the number of poles and zeros is equal. Thus, as R → ∞, the phaseof G(Rejθ) must go to zero, for all θ. Thus, the curve becomes a point on thepositive real axis.

• Finally, draw the image of the -ve jω axis.

– Recall that G(s) = Lg(t), thus,

G(jω) =

∫ ∞

0

g(t)e−jωtdt

=

∫ ∞

0

g(t) cos(ωt)dt−∫ ∞

0

g(t) sin(ωt)dt

– On the negative frequency axis, we have

G(−jω) =

∫ ∞

0

g(t) cos(−ωt)dt−∫ ∞

0

g(t) sin(−ωt)dt

=

∫ ∞

0

g(t) cos(ωt)dt +

∫ ∞

0

g(t) sin(ωt)dt

– Thus, Re(G(−jω) = Re(G(jω), and Im(G(−jω) = −Im(G(jω).

– Thus, reflect the image of the positive frequency axis through the real axis of theγ plane.

• The complete Nyquist plot is therefore

Nyquist Diagram

Real Axis

Imag

inar

y A

xis

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

14.5 Determining Stability Using the Nyquist Plot

• If we were to plot the Nyquist diagram for 1+G(s), we would simply shift the Nyquistplot for G(s) one unit to the right.

• Thus, the number of encirclements of the origin in the 1 + G(s) plot is equal to thenumber of encirclements of γ = −1 in the polar plot of G(s).

149

Page 150: Control Systems 1 notes

• If the Bode plot was determined experimentally by applying sinusoidal inputs in openloop, then the plant must be open loop stable. G(s) is stable in open loop, then1 + G(s) has no poles in the right half plane, since the poles of G(s) are the same asthe poles of 1 + G(s) – just think about 1 +∞, and you’ll see why.

• Thus, the number of clockwise encirclements of γ = −1 is equal to the number of righthalf plane zeros of 1 + G(s), and hence the number of closed-loop poles in the righthalf plane.

• In this example, N = 0 – the Nyquist plot does not encircle the point -1.

• Thus, the closed-loop system has no right half plane poles, and is therefore stable.

150

Page 151: Control Systems 1 notes

14.6 Closed Loop Stability of KG(s)

• Now, insert a gain K into the open-loop transfer function, so that the closed-loopsystem becomes:

−+

R(s) C(s)

KG(s)

• To investigate the stability of this system, draw the Nyquist diagram for KG(s).

• Notice that

|KG(jω)| = K|G(jω)|arg(KG(jω)) = arg(G(jω))

Thus, the shape of the Nyquist plot remains the same, it just that its size is scaled bythe gain K

Nyquist Diagram

Real Axis

Imag

inar

y A

xis

−1 −0.5 0 0.5 1 1.5 2−1.5

−1

−0.5

0

0.5

1

1.5

G(s) = −−−−−2

(s+1)3

G(s) = −−−−−1

(s+1)3

151

Page 152: Control Systems 1 notes

14.6.1 Gain Margin

• Look at the point where the Nyquist diagram crosses the negative real axis, and findthe corresponding point on the Bode plot.

• In other words, let ωpc be the frequency where the phase crosses through −180o. Thus,

arg(G(jωpc)) = −180o

This is known as the frequency at phase cross-over – hence the subscript PC (Nothingto do with Joe Clark).

• Let Kpc. be the gain at phase cross-over

Kpc = |G(jωpc)|

so that Kpc is the amplitude of the frequency response at the frequency where thephase crosses through −180o.

• If we scale the open-loop transfer function by anything larger than 1/Kpc, the systemwill become unstable – this will cause the point where the Nyquist plot cuts the negativereal axis to move farther left than -1, hence encircling the point γ = −1.

• This critical gain, Kg = 1/Kpc, is called the gain margin. It is the largest gain thatcan be added to the closed loop system without making it become unstable. Whenwe talk about adding gain to a system, this is in a logarithmic sense – we are reallymultiplying the open loop transfer function by the gain K.

• Notice that the gain margin can be read directly off of a Bode Diagram

1. On the phase plot, find the frequency at which the phase crosses through −180o.This is the phase cross-over frequency ωpc.

2. On the gain plot, read the gain at ωpc. The distance that this point is below 0dBis Kg, the gain margin (in dB, of course).

152

Page 153: Control Systems 1 notes

Bode Diagram

Frequency (rad/sec)

Pha

se (

deg)

Mag

nitu

de (

dB)

−100

−80

−60

−40

−20

0

Gain Margin = 18 dB

10−2

10−1

100

101

102

−270

−225

−180

−135

−90

−45

0

ωpc

= 1.73 r/s

14.6.2 Phase Margin

• Here is a Nyquist plot of the examplesystem, with a gain of 2 added to theforward path. Notice that the systemis still stable.

• To this diagram, I have added theunit circle.

• The angle between the point wherethe Nyquist plot crosses the unit cir-cle, and the negative real axis iscalled the phase margin.

Nyquist Diagram

Real Axis

Imag

inar

y A

xis

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.5−1.5

−1

−0.5

0

0.5

1

1.5

PhaseMargin

• The phase margin represents the maximum phase lag that can be added to the systemwithout making it unstable in closed loop.

• If a phase lag of φ was added to the system, then the gain would be unity when thephase crossed through −180o, and the system would become unstable.

• The phase margin can also be read directly from the Bode diagram.

1. On the gain plot, locate the frequency where the gain crosses through 0 dB (i.e.a gain of 1). This is the gain cross-over frequency, ωgc

2. On the phase plot, measure the phase at the gain cross-over frequency, arg(G(jωgc)).

153

Page 154: Control Systems 1 notes

3. The phase margin is the distance that this point is above −180o.

φ = 180 + arg(G(jωgc))

Bode Diagram

Frequency (rad/sec)

Pha

se (

deg)

Mag

nitu

de (

dB)

−100

−80

−60

−40

−20

0

ωgc

= 0.76 r/s

10−2

10−1

100

101

102

−270

−225

−180

−135

−90

−45

0

Phase Margin: 68o

154

Page 155: Control Systems 1 notes

15 Frequency Response Methods for Controller Design

• When frequency response methods are used, design criteria are usually given in termsof the open-loop Bode diagram

– 30o < PM < 60o

– GM ≥ 6dB

are common specifications, that lead to rather stable systems.

• To meet these specifications, it is usually necessary for the gain plot to have a slope of-20 dB/decade at cross-over. It is very difficult to get a reasonable phase margin whenthe slope is -40 dB/decade.

• For a second-order system, with no zeros, it can be shown that the phase margin isapproximately related to the damping factor of the closed-loop poles by

100ζ ≈ φ

where the phase margin is given in degrees.

• Static error constants (give in dB) are used to specify the steady state tracking errors.

• The open-loop bandwidth of the system (usually given in terms of the 0 dB cross-overfrequency) effects the time-constants, and hence the speed of the system’s response.(In reality, the speed of the response is determined by the bandwidth of the closed loop

system, but the open loop bandwidth is directly available, so it is often used).

10−1

100

101

−40

−30

−20

−10

0

10

Gai

n (d

B) Gain Margin

6 dB

Kp = 5 dB

Estimating Kp, Gm and Pm from a Bode Diagram

10−1

100

101

−270

−180

−90

0

Phase Margin49 degrees

Frequency (r/s)

Pha

se (

degr

ees)

155

Page 156: Control Systems 1 notes

15.1 Proportional Controllers

• We have discussed several performance measures that can be read directly from theBode Diagram:

1. Gain and Phase Margins (relative stability).

2. Static Error Constants (tracking errors).

3. Open loop bandwidth.

• To improve the steady state error performance, we can always increase the open loopgain, K.

• This, however, reduces both the gain margin and the phase margin.

• Clearly, increasing the gain takes up part of the gain margin.

• Increasing the gain also tends to increase the cross-over frequency, which usually re-duces the phase margin.

• By increasing the gain cross-over frequency, the open-loop bandwidth is also increased.This tends to speed up the response of the system.

15.1.1 Example: Using a Proportional Controller

• Given the plant:

G(s) =3

s(s + 1)(s + 3)

• Plot the Bode diagram for the uncompensated system

10−2

10−1

100

101

102

−120

−80

−40

0

40Bode Diagram for Uncompensated Plant

Gai

n (d

B) GM: 12 dB

ωGC

= 0.77 r/s

Kv = 0dB

10−2

10−1

100

101

102

−270

−240

−210

−180

−150

−120

−90

Pha

se (

degr

ees)

Frequency (r/s)

PM: 38o

ωPC

= 1.7 r/s

156

Page 157: Control Systems 1 notes

• Place the plant in a unity negative feedback loop with a proportional controller.

– Choose K so that Kv = 10 dB.

– Evaluate the gain and phase margins with this new value of K.

• From the Bode diagram, we see that Kv = 1, PM = 38o and GM = 12dB.

• To obtain Kv = 10 dB, we must shift the gain curve up by 10 dB (i.e. choose K =√

10).Plot the Bode diagram of the compensated system, and evaluate the gain and phasemargins.

10−2

10−1

100

101

102

−100

−60

−20

20

Bode Diagram for Plant and Proportional ControllerG

ain

(dB

) GM: 2 dB

ωGC

= 1.5 r/s

Kv = 10dB

10−2

10−1

100

101

102

−270

−240

−210

−180

−150

−120

−90

Pha

se (

degr

ees)

Frequency (r/s)

PM: 6o

ωPC

= 1.7 r/s

• From the plot, the Gain Margin has been reduced to 2 dB, and the Phase Margin hasshrunk to 6 degrees. The system is just barely stable.

15.2 Lag Controllers

• To increase the static error constant, without reducing the gain and phase margins, wewill need to use some sort of compensator.

Gp(s)GLag(s)

• Consider a Lag Network

GLag(s) =s + 1/T

s + 1/βT= β

1 + sT

1 + sβT

where β > 1.

157

Page 158: Control Systems 1 notes

• Draw the Bode diagram for this system. It contains

1. A constant gain of β – Magnitude of 20 log10(β), Phase of 0o at all frequencies

2. A zero at a frequency of 1/T . – Magnitude of 0dB for ω < 1/T , then increasing at20 dB/decade. Phase is 0 degrees for ω < 1/10T and +90 degrees for ω > 10/T .

3. A pole at a frequency of 1/βT . – Magnitude of 0dB for ω < 1/βT , then a slope of-20 dB/decade. Phase is 0 degrees for ω < 1/10βT and -90 degrees for ω > 10/βT .

10−2

10−1

100

101

102

0

5

10

Gai

n (d

B)

Lag Network, T = 1, β = 3.16

~0 dB Gain

from here

10−2

10−1

100

101

102

−45

−30

−15

0

Pha

se (

degr

ees)

Frequency (r/s)

approx. 0o

phase shiftfrom here

• Notice that for ω > 10/T , the gain of the lag controller is about 0dB, and the phaseis close to 0o.

• Provided we keep the gain and phase cross-over frequencies above this, the lag controllerwill not have an adverse effect on the gain and phase margins.

• Thus, to design the lag controller,

– Choose β to get the required low frequency gain. (Static error constants willincrease by 20 log10(β).

– Choose T so that 10/T < ωgc.

• It is possible to meet gain and phase margin specifications, and static error require-ments using only a lag controller.

– Reduce K until the GM and PM are adequate.

– Use a lag controller to get the required static error constant.

• However, doing this generally requires dropping the system gain to meet the gain andphase margins. This has the unfortunate effect of reducing the system’s bandwidth,and hence slowing down the response.

158

Page 159: Control Systems 1 notes

15.2.1 Example: Using a Lag Controller

• Given the plant:

G(s) =3

s(s + 1)(s + 3)

use a Lag Controller, and produce a closed-loop system with Kv ≥ 10 dB, PM ≥ 50o,and GM ≥ 6dB.

• To accomplish this, first use a proportional controller to get the required phase margin,then design a lag compensator to get the required Kv.

• First, look at the Bode diagram for the uncompensated plant. Notice that the phasemargin is 38o, and the gain margin is 20dB.

10−2

10−1

100

101

102

−120

−80

−40

0

40

5.3 dB

Finding the gain required for a 50o phase margin

Gai

n (d

B)

10−2

10−1

100

101

102

−270

−240

−210

−180

−150

−120

−90

50o

New Gain Crossover Frequency

Pha

se (

degr

ees)

Frequency (r/s)

• To get a 50 degree phase margin, we will have to move the gain cross-over frequencyto the frequency at which the phase crosses through -130 degrees. From the Bodediagram, this appears to be about ω = 0.5r/s

• At ω = 0.5r/s, the gain is about 5 dB. Thus, to get the required phase margin, wemust set K = −5.3dB = 0.54

• To get Kv = 10dB, we need to apply a total gain of 10 dB at low frequencies. Thus,β = 15.3dB = 5.8 will be required.

• Place the zero of the lag compensator at about ωGC/10. The idea is to use the highestpossible frequency, that is still far enough below the phase cross-over that the lagcontroller won’t affect the phase margin. Thus

T = 10/ωGC = 10/0.5 = 20

159

Page 160: Control Systems 1 notes

so that the controller is

Gc(s) = Kβ1 + sT

1 + sβT= 3.1

1 + 20s

1 + 112s

• Now, lets evaluate the controller

10−4

10−3

10−2

10−1

100

101

102

−120

−80

−40

0

40

80

Bode Diagram for Lag Compensated Plant

Gai

n (d

B)

GM: 17 dB

ωGC

= 0.5 r/s

Kv = 10dB

10−4

10−3

10−2

10−1

100

101

102

−270

−240

−210

−180

−150

−120

−90

Pha

se (

degr

ees)

Frequency (r/s)

PM: 49.7o

ωPC

= 1.7 r/s

• We see that the phase margin is 49.7 degrees, rather than the 50 that we designed for.This is probably due to some small negative phase provided by the lag controller (sinceit isn’t exactly zero at 1 decade above the zero frequency). In addition, some errorsget introduced by rounding, and from eyeballing values off of the Bode diagrams. Weshould have added a small positive phase to the desired phase shift, (say 5 - 10 degrees)as a safety margin.

15.3 Lead Controllers

• A lead controller

Gc(s) =1

α

s + 1/τ

s + 1/ατ=

1 + sτ

1 + sατ

with 0 < α < 1, can be used to increase the gain and phase margins, while simultane-ously increasing the open loop bandwidth.

• Consider the Bode diagram of a lead controller.

– The DC gain is 0 dB.

– A zero at 1/τ

160

Page 161: Control Systems 1 notes

– A pole at 1/ατ .

10−2

10−1

100

101

102

0

10

20

Gai

n (d

B)

Lead Controller α = 0.333, T = 1

Gain at Max. Phase Lead

4.77 dB

10−2

10−1

100

101

102

0

15

30

45P

hase

(de

gree

s)

Frequency (r/s)

Maximum Phase Lead

φm

= 30o

• The maximum phase lead occurs at the frequency:

ωm =1√αT

• The maximum phase lead is given by:

sin(φm) =1− α

1 + α

• The corresponding gain is

|GLag(ωm)| = 1√α

15.3.1 Example: Lead Compensation

• Let the plant transfer function be:

Gp(s) =10

s(s + 1)

• Design a controller which meets the following specifications

1. Kv = 26sec−1

2. PM = 50o

161

Page 162: Control Systems 1 notes

3. GM ≥ 10dB

• Draw a Bode diagram for the system

100

101

−20

0

20

40

Gai

n (d

B)

Plant Gp(s) = 10/(s2 + s)

Gain Margin ∞(at ω = ∞)

Kv = 20 dB

100

101

−180

−135

−90

Pha

se (

degr

ees)

Frequency (r/s)

Phase Margin

18.0o

• In this case, PM ≈ 18o.

• GM =∞, since there are only two extra poles.

• Use a proportional controller to get the required Kv.

• To get Kv = 20, we need K = 2 (i.e. 6dB).

• However, this reduces the phase margin to PM ≈ 13o.

100

101

−20

0

20

40

Gai

n (d

B)

Plant + Gain KGp(s) = 20/(s2 + s)

Gain Margin ∞(at ω = ∞)

Kv = 26 dB

100

101

−180

−135

−90

Pha

se (

degr

ees)

Frequency (r/s)

Phase Margin

13.0o

162

Page 163: Control Systems 1 notes

• We need an additional 37o (i.e. 50-13) of phase lead to meet our PM.

Initial Lead Controller

• First, let’s try a slightly naive solution...

• Choose α so that φm = 37o. Thus,

1− α

1 + α= sin(37o) = 0.6018

α = 0.2486

• Put the maximum phase lead at the gain cross-over frequency, to maximize the phasemargin, – Thus, ωm = 4.41r/s.

1√αT

= 4.41⇒ 1

T= 2.2r/s

Thus, the compensator is

Gc(s) =2

α

s + 2.2

s + 8.8≈ 0.5

s + 2.2

s + 8.8

• Note that the factor of 2 is the initial gain from the proportional controller.

• add this compensator to the bode diagram, and evaluate the phase margin.

100

101

102

−20

0

20

40

Gai

n (d

B)

Plant + Lead Controller α = 0.2486, T = 0.4548

PlantCompensatorCombined

100

101

102

−180

−90

0

90

Pha

se (

degr

ees)

Frequency (r/s)

Phase Margin

41.0o

• The phase margin is only 41o. What went wrong?

• Notice that the gain cross-over frequency is now 7.3 r/s, rather than 4.4 r/s.

• The maximum phase lead in the controller is happening at 4.4 r/s.

163

Page 164: Control Systems 1 notes

A Better Approach

• Adding the lead compensator increases the gain cross-over frequency.

• Since the phase decreases with increasing frequency, this offsets some of the phase lead.

• Furthermore, moving the gain cross-over frequency meant that the maximum phaseadvance happened below the gain cross-over.

• To fix these problems – we need a more sophisticated strategy.

1. Add about 5o to the required phase lead. In this example, φm = 37 + 5 = 42o.

2. Compute the corresponding value of α (0.1982 in this example).

3. Compute the controller gain at maximum phase lead.

|Gc(ωm)| = 1/√

α = 2.2462 = 7dB

4. Find the new gain cross-over frequency. This is the frequency where the gain ofthe plant is equal to −|Gc(ωm)| (7 dB in this case, so ωm = 6.66r/s).

5. Choose T so that the maximum phase lead occurs at this new cross-over frequency.

1

T√

α= 6.66⇒ (1/T ) = 2.97r/s

• Using this approach, the controller becomes

Gc(s) = 10.09s + 2.97

s + 14.97

100

101

102

−20

0

20

40

Gai

n (d

B)

Plant + Lead Controller α = 0.1982, T = 0.3370

PlantCompensatorCombined

100

101

102

−180

−90

0

90

Pha

se (

degr

ees)

Frequency (r/s)

Phase Margin

50.5o

• The maximum phase lead now occurs at the new gain crossover frequency.

164

Page 165: Control Systems 1 notes

16 State Space Models

• Lets concentrate on a type of system that we have got lots of experience with – acircuit.

• Chapter 2 contains a discussion of the relationship between various physical systems,and equivalent electrical elements.

• Thus, the principals shown here can be used in lots of different applications.

• We will be discussing what is called a “state variable” model, or a “state-space de-scription” of a system (electric circuit in this case).

16.1 RC Ladder Example

• Consider the second-order RC ladder network.

i2(t)i1(t)

R1 R2

C2C1vin(t)

• Let q1(t) and q2(t) be the charges on the two capacitors.

• This and the input, vin(t), is all the information necessary to solve the circuit.

• For example, the voltages on the two capacitors, call them v1(t) and v2(t) are simply,

v1(t) = q1(t)/C1

v2(t) = q2(t)/C2

• The two loop currents, i1(t) and i2(t), shown in the figure, are given by

i1(t) =1

R1

(vin(t)− v1(t))

=−1

R1C1

q1(t) +1

R1

vin(t)

and

i2(t) =1

R2

(v1(t)− v2(t))

=1

R2C1q1(t)−

1

R2C2q2(t)

• In other words, we own the circuit – “all your bases are belong to us”.

165

Page 166: Control Systems 1 notes

16.2 The Concept of State

• In the RC ladder example, the two charges are an example of “the state of the sys-tem”. Together with any external inputs, the state is all the information necessary tocompletely describe the system’s behaviour.

• It is customary to group the state variables into a vector, called the state vector.

x(t) =

[

q1(t)q2(t)

]

• One of the things that we can figure out from the input and state vector, is the timederivative of the state vector.

x(t) =dx(t)

dt=

[

q1(t)q2(t)

]

• In the example, the state derivative are the currents flowing into the two capacitors.

q1(t) = i1(t)− i2(t)

=1

R1

vin(t)− 1

R1C1

q1(t)−1

R2C1

q1(t) +1

R2C2

q2(t)

=−(R1 + R2)

R1R2C1q1(t) +

1

R2C2q2(t) +

1

R1vin(t)

and

q2(t) = i2(t)

=1

R2C1q1(t)−

1

R2C2q2(t)

• Customarily, these are written as a matrix equation,

x(t) =

[

−(R1+R2)R1R2C1

1R2C2

1R2C1

−1R2C2

]

x(t) +

[

1R1

0

]

vin(t)

= Ax(t) + Bvin(t)

• Notice, that we have a first-order (matrix) matrix equation for the state (vector). Inprinciple, we could solve this, and then know the state for all time.

• For example, we could choose a very short time-step, ∆t, and use

x(t + ∆t) = x(t) + ∆t · x(t)

= x(t) + ∆tAx(t) + ∆tBvin(t)

over and over and over to compute the state vector as a function of time.

166

Page 167: Control Systems 1 notes

• In practise, there are much more efficient and accurate methods for doing numericalintegration, but you get the idea.

• If we can compute the state for all t, then, we can compute anything about the systemfor all t. So, this first-order differential equation is a mathematical model of the system.

• So far, we haven’t really mentioned the output. Suppose that v2(t) is the systemoutput. Then, we can write a matrix equation

v2(t) =1

C2

q2(t)

=[

0 1C2

]

x(t)

= Cx(t)

16.3 Multiple Outputs

• So far, the state-space model seems like a rather complicated way of doing things. Youmay be wondering “why bother”?....

• Suppose, instead, that i1(t) is the system output. Then, we could write,

i1(t) =−1

R1C1

q1(t) +1

R1

vin(t)

=[

−1R1C1

0]

~x(t) +[

1R1

]

vin(t)

= C~x(t) + Dvin(t)

• Notice that all we did, was figure out how to compute the new output from the stateand input. We didn’t have to change the state equation at all.

• OK, now suppose that the system has 2 outputs, v2(t) and i1(t). Then, we could definean output vector,

~y(t) =

[

v2(t)i1(t)

]

=

[

0 1C2

−1R1C1

0

]

~x(t) +

[

01

R1

]

vin(t)

• We can still write the system output (now a 2× 1 vector) as,

~y(t) = C~x(t) + Dvin(t)

it’s just that C and D now have 1 row per output.

167

Page 168: Control Systems 1 notes

16.4 RLC Example

• Construct a state variable model of this RLC circuit, driven by a voltage source (r(t)).Let y(t), the voltage between the resistor and capacitor, be the output.

CR L

y(t)

r(t)

• First of all, we must choose a state vector. The two energy storing elements are theinductor and the capacitor.

• We already know that the charge on the capacitor works well as a state variable (totalstored energy is q2/2C)

• The energy stored in an inductor is Li2/2. So, why not use the inductor current as thesecond state variable.

• Thus, choose the state vector as

~x(t) =

[

q(t)i(t)

]

since these reflect the energy stored in the system.

• Next, figure out d~x(t)dt

in terms of ~x(t) and r(t).

• The first one is easy,

dq(t)

dt= i(t)

• For the second state derivative, consider the voltage drops around the loop,

r(t) = Ri(t) + Ldi(t)

dt+ q(t)/C

⇒ di(t)

dt=−1

LCq(t)− R

Li(t) +

1

Lr(t)

• Thus, the state equation is,

d~x(t)

dt=

[

0 1−1LC

−RL

]

~x(t) +

[

01L

]

r(t)

• The output is

y(t) = u(t)−Ri(t)

=[

0 −R]

~x(t) +[

1]

r(t)

168

Page 169: Control Systems 1 notes

16.5 Multiple Inputs

• Suppose we add an ideal current source to the system.

Cr1(t)

r2(t)R

y(t)

L

• What changes? Well, the input is now a 2 element vector,...

~r(t) =

[

r1(t)r2(t)

]

• What about the state equations? Well, diLdt

is still computed from the voltage dropsaround the (left) loop. So the equation remains the same.

• How about dqC

dt? In this case, we must add the current flowing out of the source r2(t).

Thus, the state equation becomes.

d~x(t)

dt=

[

0 1−1LC

−RL

]

~x(t) +

[

0 11L

0

]

~r(t)

• For completeness, we should also change the output equation (although, in this case,the additional input does not have a direct effect on the output, – all of the extramatrix entries will be 0).

y(t) = r1(t)−Ri(t)

=[

0 −R]

~x(t) +[

1 0]

~r(t)

• Note, in a multiple input system, B and D have one column per input. The form of theequations, and the A matrix, is exactly the same, regardless of the number of inputsor outputs.

• This is much different than a IRF or transfer function based model, where the systemwould need one single-input single-output model for each combination of input andoutput.

169

Page 170: Control Systems 1 notes

16.6 State Space Models of Mechanical Systems

• The basic building block in a mechanical system was the point mass, which obeyedNewton II,

mx =∑

applied forces

where forces could be external forces, or due to springs (f = −kx) or dampers (f =−bx).

• Consider a simple mass-spring-dashpot system:

my(t)

fe(t)

my(t)

k b

fe(t)

−ky(t) −by(t)

which has the equation of motion

my(t) = fe(t)− by(t)− ky(t)

• To describe the motion of any particular mass requires solving a second-order dif-ferential equation, and hence involves specifying two initial condtions (i.e. y(0) andy(0).)

• Thus, each point mass will require 2 states: its position and its velocity.

• Its state vector will be

~x(t) =

[

y(t)y(t)

]

which leads to the state equation

d~x(t)

dt=

[

0 1−k

m

−b

m

]

~x(t) +

[

01

m

]

fe(t)

• The upper row comes from the fact that x(t) = x(t).

• The lower row is obtained by dividing both sides of the equation of motion by m.

170

Page 171: Control Systems 1 notes

16.6.1 Example: The car suspension (revisited)

• Consider the quarter-car model,

Suspension

Chassis

Axle

Tire

m1

k2

y2(t)

y1(t)

b2

m2

u(t)k1

• In this case, we have two masses, and hence 4 states.

~x(t) =

y1(t)y2(t)y1(t)y2(t)

• As before, we draw free-body diagrams for both masses.

• First, consider the chassis,

k2

y2(t)

b2

m2

y1(t)

m2

k2(y1(t)− y2(t))b2(y1(t)− y2(t))

which has the equation of motion

m2y2(t) = b2(y1(t)− y2(t)) + k2(y1(t)− y2(t))

• Divide both sides by m2, to solve for y2(t)

y2(t) =b2

m2

(y1(t)− y2(t)) +k2

m2

(y1(t)− y2(t))

=

[

k2

m2

−k2

m2

b2

m2

−b2

m2

]

y1(t)y2(t)y1(t)y2(t)

• Similarly, for the axle,

171

Page 172: Control Systems 1 notes

m1

k2

y1(t)

b2

u(t)k1

y2(t)

m1

k1(u(t)− y1(t))

k2(y2(t)− y1(t))b2(y2(t)− y1(t))

which has the equation of motion

m1y1(t) = b2(y2(t)− y1(t)) + k2(y2(t)− y1(t)) + k1(u(t)− y1(t))

• Solving for y1(t),

y1(t) =b2

m1(y2(t)− y1(t)) +

k2

m1(y2(t)− y1(t)) +

k1

m1(u(t)− y1(t))

=

[ −k1 − k2

m1

k2

m1

−b2

m1

b2

m1

]

y1(t)y2(t)y1(t)y2(t)

+k1

m1u(t)

• Plug all of this in to the state equation

d~x(t)

dt=

0 0 1 00 0 0 1

−k1 − k2

m1

k2

m1

−b2

m1

b2

m1k2

m2

−k2

m2

b2

m2

−b2

m2

~x(t) +

000k1

m1

u(t)

• Lastly, we need to get the output(s) of the system. Generate a model that has thechassis position and acceleration as outputs:

~y(t) =

[

y2(t)y2(t)

]

=

0 1 0 0k2

m2

−k2

m2

b2

m2

−b2

m2

~x(t) +

[

00

]

u(t)

16.7 State Space Models and Transfer Functions

• What if we take Laplace transforms on both sides, ignoring initial conditions.

s ~X(s) = A ~X(s) + BU(s)

Y (s) = C ~X(s) + DU(s)

172

Page 173: Control Systems 1 notes

• Solve the first equation for the state,

(sI − A) ~X(s) = BU(s)

⇒ ~X(s) = (sI − A)−1BU(s)

• Substitute this into the output equation,

Y (s) = C(sI − A)−1BU(s) + DU(s)

• Thus, the transfer function is

Y (s)

U(s)= C(sI − A)−1B + D

• Notice that for a single-input single-output (SISO) system, C has 1 row, B has 1column, so that C(sI − A)−1B is a scalar function of s. So that you get a singletransfer function.

• For a multiple-input multiple-output (MIMO) system, the result will be a matrix whereeach entry is a transfer function. The (i, j) entry will be the transfer function from thej’th input to the i’th output.

16.7.1 Transfer Function of the RLC example

• Last lecture we derived a state space model for the series RLC curcuit,

CR L

y(t)

r(t)

d

dt

[

q(t)i(t)

]

=

0 1

−1

LC

−R

L

[

q(t)i(t)

]

+

0

1

L

vin(t)

vout(t) =

[

1

C0

] [

q(t)i(t)

]

+ [0] vin(t)

which we abbreviated as

~x(t) = A~x(t) + Bvin(t)

vout(t) = C~x(t) + Dvin(t)

173

Page 174: Control Systems 1 notes

• To get the transfer function

G(s) = D + C(sI − A)−1B

frist compute (sI − A)

sI − A =

s 0

0 s

0 1

−1

LC

−R

L

=

s −1

1

LCs +

R

L

• Now invert it – its just a 2× 2 matrix:[

a bc d

]−1

=1

ad− bc

[

d −b−c a

]

• To compute, (sI − A)−1, first tackle the denominator,

∆ = s(s +R

L) +

1

LC

= s2 +Rs

L+

1

LC

• Thus

(sI − A)−1 =1

s +R

L1

−1

LCs

• Since ∆ is just a number,

G(s) =1

[

1

C0

]

s +R

L1

−1

LCs

0

1

L

+ 0

=1

1

LC

=

1

LC

s2 +Rs

L+

1

LC

=1

1 + RCs + LCs2

174

Page 175: Control Systems 1 notes

• Notice, that we could get the same result (a lot more easily in this case), by setting upa voltage divider in the frequency domain.

• Where do the poles come from? These are the solutions to

∆ = 0

• The system poles are completely determined by the A matrix.

• In fact, the system poles are the eigenvalues of the A matrix.

16.8 Other Choices of State Vector

• The idea behind the state, is that it is the minimum information needed to describethe system completely.

• Look back at the RC ladder example.

• Suppose we construct the vector

~w(t) =

[

v2(t)i2(t)

]

i1(t)

R1 R2

C2C1vin(t)

i2(t)

q2(t)q1(t)

v2(t)v1(t)

• Could we use ~w(t) as a state vector?

• Notice that we can compute the “original” state vector from ~w(t),

q2(t) = C2v2(t) (1)

q1(t) = C1v1(t)

= C1(v2(t) + R2i2(t)) (2)

• Therefore, we can completely solve the circuit using ~w(t), so ~w(t) also contains all ofthe information needed to describe the system’s behaviour.

175

Page 176: Control Systems 1 notes

• Can we construct a state-space model of the form:

d~w(t)

dt= A′ ~w(t) + B′vin(t)

y(t) = C ′ ~w(t) + D′vin(t)

• First write down matrix equations relating ~x(t) and ~w(t)

~x(t) =

[

C1 C1R2

C2 0

] [

v2(t)i2(t)

]

= T ~w(t)

and the reverse,

~w(t) =

01

C2

1

R2C1

−1

R2C2

q1(t)

q2(t)

= T−1~x(t)

• To get the new state equation, computed~w(t)

dt

d~w(t)

dt= T−1d~x(t)

dt= T−1 {A~x(t) + Bvin(t)}= T−1AT ~w(t) + T−1Bvin(t)

Thus,

A′ = T−1AT

B′ = T−1B

• Now, express the output equation in terms of ~w(t)

y(t) = C~x(t) + Dvin(t)

= CT ~w(t) + Dvin(t)

Thus,

C ′ = T

D′ = T−1B

• In principle, T could be any n × n, invertible matrix, where n is the length of thestate-vector (2 in this example).

• Clearly, there is an infinite number of choices for the state-vector (corresponding to aninfinite number of choices for the invertible transformation matrix T ).

176

Page 177: Control Systems 1 notes

16.9 From Transfer Function to State Space

16.9.1 Special Case:

• Suppose we have this second-order transfer function

Y (s) =1

s2 + a1s + a0R(s)

which corresponds to the ODE

y(t) + a1y(t) + a0y(t) = r(t)

• Is the vector,

~x(t) =

[

y(t)y(t)

]

a valid state vector?

• In other words, can we write down an equation for ~x(t) in terms of ~x(t) and r(t)?

• The first equation is easy,

x1(t) = y(t) = x2(t)

• The equation for the second state is,

x2(t) = y(t) = −a1y(t)− a0y(t) + r(t)

= −a1x2(t)− a0x1(t) + r(t)

• Thus, the state equation is

~x(t) =

[

0 1−a0 −a1

]

~x(t) +

[

01

]

r(t)

• Clearly, the output equation is

y(t) =[

1 0]

+[

0]

r(t)

16.9.2 Check: Compute the Transfer Function

• Recall that the transfer function is given by:

G(s) = C(sI − A−1B) + D

177

Page 178: Control Systems 1 notes

• Compute (sI − A)

sI − A =

[

s 00 s

]

−[

0 1−a0 −a1

]

=

[

s −1a0 s + a1

]

• Invert sI − A

(sI − A)−1 =1

s(s + a1) + a0

[

s + a1 1−a0 s

]

• Multiply out C(sI − A)−1 + D

G(s) =1

s2 + a1s + a0

[

1 0]

[

s + a1 1−a0 s

] [

01

]

+ 0

=1

s2 + a1s + a0

[

s + a1 1]

[

01

]

=1

s2 + a1s + a0

• This is what we started with....

In Class Exercise:

Write down a state-space model which is equivalent to the transfer function:

Y (s) =2

s4 + 2s3 + 3s2 + 2s + 1R(s)

178

Page 179: Control Systems 1 notes

16.9.3 General Case:

• How can we deal with a more general case, like

Y (s) =b2s

2 + b1s + b0

s2 + a1s + a0R(s)

or, equivalently

y(t) + a1y(t) + a0y(t) = b2r(t) + b1r(t) + b0r(t)

• Separate out the direct transmission (in that it produces an impulse in the impulseresponse) term by long division.

G(s) = b2 +(b1 − a1b2)s + (b0 − a0b2)

s2 + a1s + a0

= D + C(sI − A)−1B

• By inspection, D = b2.

• The poles of this system are the same as in the special case, above. Since the poles aregenerated exclusively by the A matrix, we must have

A =

[

0 1−a0 −a1

]

• Choose the coefficients in the B and C matrices to equate the numerators of the twotransfer functions.

• Notice that we have 4 unknowns, but only 2 equations. Therefore, we can (more orless) arbitrarily choose two of the coefficients.

• For argument’s sake, choose

C =[

1 0]

There are a few reasons for this choice....

– This is the C that we used in the “all pole” case

– These numbers make the resulting equations easy to solve.

– Obviously, we cannot choose[

0 0]

(WHY NOT???).

• Now, let

B =

[

β1

β0

]

and compute C(sI − A)−1B.

179

Page 180: Control Systems 1 notes

• We have already computed,

(sI − A)−1 =1

s(s + a1) + a0

[

s + a1 1−a0 s

]

Thus,

C(sI − A)−1B =1

s2 + a1s + a0

[

1 0]

[

s + a1 1−a0 s

] [

β1

β0

]

= β1(s + a1) + β0

• But this must be equal to the numerator (after the long division),

(b1 − a1b2)s + (b0 − a0b2)

• Therefore, equating the transfer function numerators, we have 2 equations in 2 un-knowns: one for the s coefficient, and one for the ones coefficient.

s : b1 − a1b2 = β1

1 : b0 − a0b2 = β1a1 + β0

• Solving for the β’s

β1 = b1 − a1b2

β0 = b0 − β1a1 − b2a0

= b0 − a1b1 + a21b2 − b2a0

• Thus, the state-space model is,

~x(t) =

[

0 1−a0 −a1

]

x(t) +

[

b1 − a1b2

b0 − a1b1 + a21b2 − b2a0

]

r(t)

y(t) =[

1 0]

x(t) +[

b2

]

r(t)

• Notice that the D matrix is equal to b2. Thus, the D term is only non-zero when b2

(the s2 term in the numerator) is non-zero.

• Thus, if D is non-zero, the number of poles and zeros is equal.

• Furthermore, if D is non-zero, there is a constant (D = b2) in the transfer function.Inverse Laplace transforming this will produce an impulse (in the impulse response).

• This is called a “direct feedthrough term”.

180

Page 181: Control Systems 1 notes

A Lab Policies

A.1 Lab Groups

For labs 1 2 & 3, lab groups should consist of either 2 or 3 students. Lab groups may changefrom week to week. Lab 4 is to be done individually.

A.2 Reports

Each lab group (student for lab 4) should turn in one report.You are not required to write a formal report in a laboratory notebook. Instead your

report should be informal but neat, well-organized, and written in complete, gramaticallycorrect sentences. Compose your report from laser printer output and/or hand-writtenmaterial on ordinary loose-leaf paper.

Make a simple cover page for each report; put all partners’ names on the cover. Put allpartners’ names and ID numbers on an inside page of the report. Hand in your report tothe ENEL 441 Lab Assignment box (for whichever section you are in), on the second floorof the ICT building.

A.3 Due dates

Labs are due one week after the lab period when the experiement was performed.

181

Page 182: Control Systems 1 notes

Laboratory Assignment #1

Introduction to Simulinux and

the Matlab Real-Time Workshop

Author: David Westwick

Equipment

Built into the lab station, you should find,

• PC, with Multi-Q data acquisition card.

• Oscilloscope,

• Function Generator

• Digital Multimeter

• I/O Panel for the Multi-Q card

On the bench in front of you (or in the little red drawer in the lab station), there shouldbe

• DC motor with brass inertia wheel and angular position encoder, attached to a linearactuator system.

• RCA cable.

• 8-pin DIN cable

• Co-axial T connectors.

Coaxial cables can be found hanging in the rack on the end of the lab bench.

Introduction

In this lab, you will use the Simulinux software to communicate with a Multi-Q board inthe PC. The Multi-Q board includes Analog to Digital (A/D) converters, Digital to Analog(D/A) converters, and demodulators for quadrature position encoders. In this lab, you willuse the A/D and D/A converters to read electrical signals with the PC, and to send signalsfrom the PC to the “real world”. You will us an encoder to measure the position of the shaftof a DC motor, which you will drive in both open and closed loop.

182

Page 183: Control Systems 1 notes

Getting Started

Simulinux runs under RTLinux, which is a Linux operating system built around a RealTime kernel. If your computer is running ms windows, reboot it, and select rtlinux at theLILO boot prompt.

Log in. If X doesn’t start automatically, type startx at the command prompt. Openup an xterm. Create a directory for ENEL 441 lab1, and cd to it. At this point, Simulinuxonly runs under Matlab 5.3.1, so start Matlab by typing]$matlab5.3

in the xterm. To initialize Simulinux, type>>slx setoptions

in your Matlab session. Then start up Simulink

>>simulink

Be sure to power up the oscilloscope, function generator, power supply, multimeter and theI/O interface, all of which are in the panel to the right of the monitor.

Sine Wave

Quanser ConsultingMultiQ−PCI DAC

Analog Output

Figure 1: Simulink Block Diagram for Exercise A

Exercise A: Digital to Analog Conversion

In this exercise, you will generate a sine wave in a Simulink model, send it out through aD/A converter, and observe the result on the oscilloscope.

• In the Simulink window, choose File-New-Model.

• In the Simulink window, double-click on the sources library and drag a Sine-Wave

block from the resulting window into your model window.

• Open the Blockstets & Toolboxes library, which contains several libraries includingone called Quanser Toolbox.

• From the Quanser toolbox, open the Quanser Consulting MultiQ-PCI series li-brary. It is very important that you use this library, since it contains the drivers forthe PCI card that is installed in the computer.

• Drag a copy of the Analog Output (Quanser Consulting MultiQ-PCI DAC) block andput it in your model window.

• Connect the two blocks as shown in Figure 1.

183

Page 184: Control Systems 1 notes

Figure 2: Screenshot of the Simulation Parameters Dialog Box

• Double click on the Sine-Wave block, to bring up its parameters dialog box, and changeits amplitude to 5 and its frequency to 31.4 radians per second (approximately 5 Hz).

• Connect a co-axial cable from the output of DAC A (topmost BNC connector in thecentre of the patch panel) to the oscilloscope.

Getting Simulink to communicate with the real-time software requires several parame-ters to be set correctly.

• From the menus on your model window, choose Simulation--External.

• Choose Simulation--Parameters from the menus on top of your model window. Inthe resulting dialog box:

– Select the Solver tab, if it is not active. This should reveal three panels.

– In the Simulation time panel (top most), change the Stop time to large number(say 999).

– In the Solver options panel, click on the Type menu, and select Fixed-step.The lower half of this panel should now display the fixed step size options (andthe bottom-most panel should become inactive).

– Change the Mode from Auto to Single-tasking.

– Set the Fixed step size to 0.01 seconds. This is where you will specify thesampling rate for the A/D and D/A cards.

– Click on Apply, and then OK to close the dialog box.

The next step, is to compile the code that will run your model in real time, and interfacewith the Analog to Digital converter that will send signals out to the physical world.

184

Page 185: Control Systems 1 notes

• Choose Tools---RTW Build to compile the real-time code. The compiler should reportits progress in the Matlab window. If all goes well, the last line should read ****

Download Complete.

• Once the real-time code has been compiled, choose Simulation--Connect to Target

to start the system. You should see a sine wave appear on the oscilloscope.

• You may get a popup dialog box with a warning message, telling you that no signalswill be saved (which happens to be true for this exercise). You can safely ignore it,and hit cancel.

The “auto-scale” feature on the HP scopes is designed for high-frequency signals. It mayhave problems locking on to the low frequency signals common in control applications. Youwill probably have to set the time-base and triggering levels manually.

• Set the time-base to 50.0 ms.division

• Set the vertical scale to 2V/division

• Make sure that the scope is triggering off of the same channel that you are using forthe sine-wave.

• Trigger on a rising edge, and set the level to 0V.

Notice that the display on the scope consists of a staircase, and that the stairs appear to“roll” slowly up and down.

• In the Sine Wave block change the frequency to 10*pi, and hit Apply. If you get anerror message, stop the real-time code, rebuild it and then restart it.

In your report, explain why the oscilloscope display is a staircase, instead of a perfect

sinusoid, and discuss the origin of the “rolling” effect. Include a a sketch of the oscilloscope

output in your report.

Exercise B: Analog to Digital Conversion

The objective of this exercise is to read in a signal from the real world, display it on a virtualscope in the Simulink environment, and import the data into the Matlab work-space sothat it can be analyzed.

Hardware Setup

• Connect the output of the function generator to the input to Chn. A of the analog todigital converter (upper left hand BNC on the patch panel).

• Use a T connector to split the coaxial cable, and send the output to the HP scope aswell.

• Set the function generator to produce a 5 Hz, 10 Vpp sine wave.

185

Page 186: Control Systems 1 notes

Scope

Quanser ConsultingMultiQ−PCI ADC

Analog Input

Figure 3: Simulink Block Diagram for Exercise B

• Make sure that the function generator is set to drive a high-impedance load (such asthe A/D input).

• Verify the amplitude and frequency of the sine-wave on the oscilloscope.

Software Setup

• Open a new model window.

• Set Simulation -- External, and open the Simulation -- Parameters dialog box.

• Set the stop time to 1 second, and set the time step to 0.001 sec (a sampling frequencyof 1000 Hz).

• Go to the Quanser - Multi-Q PCI series library, and copy an analog input (ADC)block into your model window.

• Open up the sinks library, and copy a scope into your model window.

• Connect the ADC and Scope blocks, as shown in Figure 3.

Figure 4: Screenshot of the Signal and Triggering Control Panel

186

Page 187: Control Systems 1 notes

Configuring the Scope Block

Next, configure the virtual scope to read the signals in real time, as follows,

• Select Tools--External Mode Control Panel from your model window, and click onSignal and triggering ... button in the resulting dialog box.

• Click on the line that says Scope to select it.

• Activate the scope by clicking on the the On button located to the right of the window.

• Click on the Arm when connect to target button in the lower left corner of thecontrol panel.

• Fig. 4 shows the Signal & Triggering dialog box, after configuration.

• Double click on the scope icon, to bring up the virtual scope display window.

Configuring the A/D converter

• Double click on the ADC block to bring up its parameters dialog

• set the range to 10 (i.e. ± 10 Volts, which is the maximum range of the ADC).

• Note that there is only one board in the computer, and that it is board 0 (the defaultsetting).

• The channels (0,1,2,3) correspond to the BNC connectors on the I/O Panel markedChn. A, Chn. B, Chn. C and Chn. D, respectively.

Testing the Virtual Scope

• Build the real-time code, and select Connect to Target.

• If nothing happens at this point, select Simulation -- Start Real Time Code, atwhich point, a sine wave should start to appear in the virtual scope window.

Importing the Scope Output to MATLAB

• Choose Tools -- External Mode Options and click on Signals and Triggering.Make sure that the duration (lower left corner) is set to 1000. (1000 points = 1second sampled at 1000 Hz).

• Click on the the Properties button on the Scope window (second button from theright), and then on the Data History tab in the resulting dialog box.

• Click on the Save to Workspace button.

• In the drop-down menu, select Matrix, and choose a name for the scope output (thedefault is ScopeData).

187

Page 188: Control Systems 1 notes

• De-select the button labelled Limit Rows to Last.

Rebuild the model and then run the code. After the “simulation” stops, click on theMatlab xterm window, and type>> who

to get a list of the variables in the Matlab workspace. There should be a variable calledScopeData (or whatever you decided to name the output of the Scope). This will be a 2column matrix: the first column contains the time points, the second column contains thedata. Plot the captured data by typing>> plot(ScopeData(:,1),ScopeData(:,2))

The plot should show 5 cycles of a sine-wave (1 second of a 5 Hz. sine wave). Zoom in on ashort time range by typing (for example)>> set(gca,’xlim’,[0.5 0.7]);

To add a label to the x-axis, type>> xlabel(’Time (sec)’);

To give to plot a title>> title(’Zoomed in Plot of a Sine Wave’);

Finally, add a label to the y-axis>> ylabel(’Amplitude (V)’);

Hand in a copy of this zoomed in plot with your report.

Printing: THe printer name is lw-305.

Scope

Quanser ConsultingMultiQ−PCI ENC

Encoder Input

Figure 5: Reading an Encoder Input: Exercise C

Exercise C: Reading an Encoder

In this exercises, you will use an encoder to read the position of the motor shaft. The encoderoutput will then be transformed into an analog voltage by an A/D converter. You will set asoftware gain so that the A/D converter returns +5 volts per rotation of the motor shaft.

An encoder consists of a transparent ring, with equally spaced radial lines, all aroundits circumference. The ring is placed between a LED and photocell. As the ring spins,the photocell counts the number of dark bars that pass it by, and so calculates the angularposition of the shaft.

This encoder ring has 512 lines, each of which produces 4 equally spaced pulses (it is aquadrature encoder). Thus, the encoder should count 2048 pulses per revolution.

188

Page 189: Control Systems 1 notes

• Set up the Simulink model, as shown in Fig 5, using the Encoder input from theQuanser Multi-Q PCI-series library.

• Use the procedures outlined In Exercise B to configure the the scope block so that itsends its data to the Matlab workspace. Set the stop time to 10 seconds (Simulation-- Parameters), and set the duration (External Mode Options -- Signals and

Triggering, lower left corner), to 10000 (i.e. 10 seconds times 1000 Hz.).

• Build the real-time code.

• Connect the 8-pin DIN connector on the motor bracket to the Optical Encoder 1-2input on the I/O panel.

• Start the simulation, and rotate the motor shaft through one complete turn (approxi-mately).

• Wait for the simulation to end, and then look at the scope-output in the Matlab

workspace.

• What were the initial and final values of the encoder output?

• Plot the encoder output as a function of time, and hand it in with your report. Record

the initial and final values of the encoder output.

Note: You probably didn’t get exactly 2048 pulses, since the rotation probably wasn’texactly 360o. This is just a quick and dirty check.

Setting the Encoder gain

• add a gain block (from the math library) and a D/A converter, from the Multi-Q/PCIlibrary, as shown in Fig. 6.

• Double-click on the D/A converter block, to bring up its properties. Set channel(s)

to 3, which sends the output to Dac. D on the I/O panel, and leave the other settingsat their defaults.

• Double click on the gain element, and set it so that the D/A produces 5 volts perrevolution of the shaft.

• Include the gain, and its computation, in your report.

• Build the real-time code.

• Connect the output of the D/A converter to the Digital Multimeter, and set up themultimeter so that it reads a DC voltage.

• Set your code running. Turn the motor shaft counter-clockwise through 3 completerotations, and then back.

189

Page 190: Control Systems 1 notes

• Compare the output on the virtual scope in your Simulink diagram with that of themultimeter on your lab bench.

• Were there any differences? If so, describe them in your report, and explain why they

might have happened.

Scope

1

Gain

Quanser ConsultingMultiQ−PCI ENC

Encoder Input

Quanser ConsultingMultiQ−PCI DAC

Analog Output

Figure 6: Reading an encoder input, and sending the signal out a D/A converter

Exercise D: Driving the Motor in Open Loop

• Set up the block diagram shown in Figure 7. The only new element is the step inputblock. It can be found in the Sources library.

• Set the gain in the gain block so that the encoder reads 5 volts per revolution of theshaft.

• Double click on the step input block, to open its configuration dialog. Set the finalvalue to 5. This will produce a 5 volt step in the analog output.

• Connect an RCA cable between the Motor A output, and the RCA jack on your motor.Note that the plastic insulation has been partially stripped from one of the RCA plugs,so that it can fit into the recessed RCA jack on the I/O panel.

• Connect a DIN cable between the encoder output on the motor and the Enc. 1-2 inputon the I/O panel.

Step

Input

−K−

Gain

Quanser ConsultingMultiQ−PCI ENC

Encoder Input

Angle

Quanser ConsultingMultiQ−PCI DAC

Analog Output

Figure 7: Driving the motor in open loop

190

Page 191: Control Systems 1 notes

• Configure the encoder input and analog output blocks as you did in the previousexercises. Set up the scopes to export data into the Matlab workspace, into variablescalled InputData and AngleData.

• Set the simulation duration to 5 seconds, at a sampling rate of 100 Hz, and build yourcode.

• Run your code. After a delay of 1 second (the start time of the step, set in the step

input’s dialog box), the motor should start spinning. Wait until the code stops running(4 more seconds).

• The Matlab workspace should now contain matrices corresponding to the outputs ofthe 2 scopes. As before these will have two columns: the first will be time, the secondwill be the variable.

• In the Matlab window, type >> subplot(211)

>> plot(InputData(:,1),InputData(:,2))

>> subplot(212)

>> plot(AngleData(:,1),AngleData(:,2))

• Give your plot a title, and label the axes. Hand in this plot with your report.

• Create a similar plot, that shows the step input and angle output but limit the timeaxes of the two windows the show the range between t = 0.8 seconds and t = 1.2seconds.

• Hand in this plot with your report

Exercise E: A Simple Position Controller

• Set up the block diagram in Figure 8.

• The summing junction is in the Math library. Double click on the summing junctionto change the signs (it defaults to 2 + signs).

• Set the gain on the encoder output so that its output reads 5 volts per revolution ofthe shaft.

• Check your plots from Exercise D. Make sure that applying a positive voltage to themotor causes the shaft to turn in the “positive direction” (i.e. so that the outputincreases as a time goes on.)

• Configure the 3 scopes to export their data to the Matlab workspace into matricesnamed InputData, ErrorData and AngleData.

• Build and run the code.

191

Page 192: Control Systems 1 notes

• What happened? How does this compare to the open loop response observed in Exer-cise D?

• Generate a plot that superimposes the input, error and angle signals, by typing thefollowing>> clf

>> plot(InputData(:,1),InputData(:,2));

>> hold on

>> plot(ErrorData(:,1),ErrorData(:,2),’--’);

>> plot(AngleData(:,1),AngleData(:,2),’-.’);

>> legend(’Input’,’Error’,’Angle’);

• Give the plot a title, and label its axes.

• Hand in this plot with your report.

• Use your plot to answer these questions

1. How long did it take for the error to fall below 0.5 V?

2. How long did it take for the error to fall below 0.25 V?

3. What is the “final value” of the error signal?

Step

Reference

−K−

Gain

Error

Quanser ConsultingMultiQ−PCI ENC

Encoder Input

Angle

Quanser ConsultingMultiQ−PCI DAC

Analog Output

Figure 8: A closed loop position controller

192

Page 193: Control Systems 1 notes

Laboratory Assignment #2

Measuring the step response of a

DC-motor operating as a position servo.

Author: David Westwick

Equipment

Built into the lab station, you should find,

• PC, with Multi-Q data acquisition card.

• Oscilloscope,

On the bench in front of you (or in the little red drawer in the lab station), there shouldbe

• DC motor with encoder.

• RCA and DIN cables for the motor and encoder.

• coax to banana plug adaptor.

Introduction

In this lab, you will examine the step response of a DC motor operating as a closed loopposition servo.

Pre-Lab Preparation

Go to the ENEL 441 web page, and follow the links to the Lab2 pages. Download the filecalled Trise.m. This is a MATLAB m-file that computes the 10/90 rise time of a stepresponse. Modify this function so that it also computes,

• The 5% settling time

• The peak time (if any overshoot)

• The percentage overshoot (if any).

There are several datasets linked to the webpage, called StepResponse1.mat, StepResponse2.mat,etc. These each include a matrix called ScopeData, that contains a step response. The analy-sis of the step responses is presented in figures called StepResponse1.pdf, StepResponse2.pdf,etc.

Test your function on the simulated step responses, and compare your results to thoseprinted on the figures.

193

Page 194: Control Systems 1 notes

Getting Started

This lab will use Simulinux, and builds upon the experience gained in lab 1. As before, makesure that you are running RTlinux, and log in, and type startx to start up Gnome.

Open up an x-term, and start matlab5.3. At the Matlab prompt, type>>slx setoptions

Then start up Simulink. Be sure to power up the black I/O board, and the HP oscilloscope.

Step Motor Position

Motor InputInput Voltage

−K−

Gain1

2

Gain

Quanser ConsultingMultiQ−PCI ENC

Encoder Input

Quanser ConsultingMultiQ−PCI DAC

Analog Output

Figure 9: Simulink block diagram for Exercise A.

Exercise A — Step Response of a Position Servo

In this exercise, you will obtain the step response of a DC position servo.

• Open up a new model window in simulink, and set the simulation mode to external.Set the sample time to a fixed step size of 0.001 seconds, and set the simulation modeto single tasking.

• Set up the model as in Figure 9.

• Set the encoder gain to -5/2048, so that the encoder reads 5 volts per revolution of themotor (where the direction that the motor spins when a positive voltage is applied isdefined to be the positive direction).

• Set the controller gain (i.e. the gain at the input to the DAC) to 2.

• Set the three scopes to send their data to the Matlab workspace.

• Set the step amplitude to 0.5 volts.

• Connect the motor and encoder wires, then build and run your code.

• Generate a plot superimposing the input step, the motor input and the motor position.Hand in this plot as part of your report.

• Answer the following questions in your report

1. Is the system over-damped or under-damped?

194

Page 195: Control Systems 1 notes

2. What is the 5% settling time?

3. What is the 10/90 rise time?

4. What is the percentage of overshoot?

Exercise B — Testing the Linearity of the Position Servo

Now, you will test the linearity of the position servo, by comparing the responses to stepinputs of several different amplitudes.

• Obtain the responses to input steps with amplitudes of 0.5, 1, 2 and 5 volts.

• If the system is truly linear, the responses should all be scaled versions of each other.Generate a plot which superimposes the motor positions resulting from the 4 differentstep inputs. Hand in this plot with your report

• Test superposition by dividing each of the motor inputs and motor positions by theamplitude of the step inputs which generated them. (i.e. for the 0.5 volt step input,multiply the responses by 2). Generate a plot which superimpose the 4 scaled motorinputs, and one which superimposes the 4 scaled motor position signals. Hand in these

plots with your report.

• Based on these plots, is the system linear?

Exercise C – Examining Saturation

One of the most common nonlinearities that control engineers have to deal with is amplifiersaturation. This phenomenon was demonstrated in Lab 1, when you tested the encoder –the scope in simulink increased to 15 volts, whereas the D/A output stopped increasing atthe 10 V power supply rail. In this exercise, you will see how this affects a control system.

• Attach the HP scope across the power-amplifier. Connect the scope ground to any ofthe ground connections on the black I/O panel. Connect the scope input to the outputof the op-amp (i.e. the right-most banana plug on the resistor in the feedback path ofOp-Amp A on the I/O panel).

• Set the input step to 1 V amplitude, and re-run your code. Compare the trace thatyou see on the HP oscilloscope to that on the Motor Input simulink scope. (You mayhave to adjust the triggering setup on the HP scope to capture the response).

• What is the gain of the Op-Amp circuit?

• Set the input step amplitude to 10 V, and re-rerun your code.

• Compare the output of the HP and simulink scopes. Aside from the additional gain,are there any other differences?

• Compute the amplitude of the largest step input which does not cause the amplifierto saturate (or find it experimentally).

195

Page 196: Control Systems 1 notes

• Obtain the position output and motor input of the system in response to this “LargestLinear Step” input. Superimpose them, together with the step input on a single plot.

Hand in this plot with your report .

Exercise D – Changing the Controller Gain

Next, you will change the feed-forward gain in the controller, and observe the effect that ithas on the step response.

• Change the controller gain, labelled Gain in Figure 9, to 20.

• Calculate the amplitude of the largest step that will not cause saturation with this newcontroller gain.

• Obtain the step response to this input.

• Answer the following questions in your report

1. Is the system over-damped or under-damped?

2. What is the 10/90 rise time?

3. What is the 5% settling time?

4. What is the percentage of overshoot?

• Change the controller gain back to 2, and obtain the response to the same step input(i.e. the largest step that did not cause saturation with the controller gain set to 20).

• Generate a plot superimposing the two motor position responses.

• Hand in this plot with your report. Discuss any differences between the two step re-

sponses.

196

Page 197: Control Systems 1 notes

Laboratory Assignment #3

Proportional and PI control

of a DC-motor position servo.

Author: David Westwick

Equipment

Built into the lab station, you should find,

• PC, with Multi-Q data acquisition card.

• Oscilloscope,

On the bench in front of you (or in the little red drawer in the lab station), there shouldbe

• DC motor with encoder.

• RCA and DIN cables for the motor and encoder.

• coax to banana plug adapter.

Introduction

In this lab, you will proportional and proportional plus integral controllers to enhance thestep response of a DC motor operating as a closed loop position servo. You will use the tran-sient analysis Matlab function that you developed in Lab 2 to analyze the step responses.

Getting Started

This lab will use Simulinux, and builds upon the experience gained in labs 1 and 2. Asbefore, make sure that you are running RTlinux, and log in, and startx.

Open up an x-term, and start matlab5.3. At the Matlab prompt, type>>slx setoptions

Then start up Simulink. Be sure to power up the black I/O board, and the oscilloscope.In the last lab, you set up a DC position servo with a proportional controller. Recall, that

friction in the motor caused the system to have a non-zero position tracking error. In thislab, you will add an integrator to the control loop, which should eliminate the steady stateerror, despite the friction. In order to keep the system stable, you will use a proportionalplus integral controller.

197

Page 198: Control Systems 1 notes

Step

Saturation

Position

Input

2

Gain2

−K−

Gain1

Kp

Gain

Error

Quanser ConsultingMultiQ−PCI ENC

Encoder Input

Controller Output

Quanser ConsultingMultiQ−PCI DAC

Analog Output

Figure 10: Simulink block diagram for Exercise A.

Exercise A – A Proportional Controller

This exercise is a recap of Lab 2. You will modify your Simulink block diagram so that youcan monitor amplifier saturation without using the HP oscilloscope.

• Open up a new model window in Simulink, and set the simulation mode to external.Set the sample time to a fixed step size of 0.001 seconds, and set the simulation modeto single tasking.

• Set up the model as in Figure 10.

• Note that a gain (in the math library) and a saturation block (in the nonlinear library)have been added to the “Controller Output” scope. These will be used to mimic thegain and saturation in the (physical) power amplifier.

• Set this new gain to 2 (to mimic the gain of the op-amp).

• Determine the maximum output of your power amplifier, and set the limits on thesaturation block to this level.

• In the simulation parameters dialog, set the stop time to 10 seconds.

• When you activate the scopes in the Signals and Triggering control panel, makesure that the duration is set to 10,000 samples.

• Set the encoder gain, (gain 1 in Figure 10), to -5/2048, so that the encoder reads 5volts per revolution of the motor, with the input and output polarities in the samedirection.

• Set the controller gain, Kp, to 20.

• Set the four scopes to send their data to the Matlab workspace.

• Set the step amplitude to 2.5 volts.

• Use the HP scope to measure the output of the power amplifier (as you did in lab 2).

• Connect the motor and encoder wires, then build and run your code.

198

Page 199: Control Systems 1 notes

• Compare the output on the HP scope with that of the Controller Output Simulink

scope. If there are any significant differences, adjust the gain and/or saturation limitsuntil they agree.

• Use your transient analysis program from Lab 2 to answer the following questions.(you may have to modify it to compute the steady state error).

1. Is the system over-damped or under-damped?

2. What is the 5% settling time?

3. What is the percentage of overshoot?

4. What is the steady state error?

• Generate a plot superimposing the error signal and the controller output. Zoom in onthe last 6 seconds of the error/controller output. Hand in a copy of this plot with your

report. Why doesn’t the system reduce the error to 0?

Step

Saturation

Position

Input

2

Gain2

−K−

Gain1

Kp

Gain

Error

Quanser ConsultingMultiQ−PCI ENC

Encoder Input

s+4

s

DiscretizedTransfer Function

Controller Output

Quanser ConsultingMultiQ−PCI DAC

Analog Output

Figure 11: Simulink block diagram for Exercise B.

Exercise B — A Proportional plus Integral Controller

In this exercise, you will set up a DC position servo with a proportional plus integral con-troller, and measure its step response. You will see how the integral action changes thebehaviour of the control system.

• Save your model from Exercise A, and then modify it as in Figure 11. Note that theDiscretized Transfer Function block is found in the Quanser Toolbox.

• The Discretized Transfer Function will be used to implement a proportional plusintegral (PI) controller. The transfer function of a PI controller can be written as,

Gc(s) = Kp +Ki

s

= Kp

(

s + Ki/Kp

s

)

= Kp

(

s + a

s

)

199

Page 200: Control Systems 1 notes

Initially, we want Kp = 2 and Ki = 8, so double-click on the Discretized Transfer

Function block and set the numerator polynomial to

[1 4]

and set the denominator polynomial to

[1 0]

Set the controller gain, Kp to 2.

• In the simulation parameters dialog, set the stop time to 20 seconds.

• When you activate the scopes in the Signals and Triggering control panel, makesure that the duration is set to 20,000 samples (i.e. 20 seconds).

• Build and run your code.

• Generate a plot superimposing the input step, the motor position. Hand in this plot

as part of your report.

• Answer the following questions in your report

1. Is the system over-damped or under-damped?

2. What is the 5% settling time?

3. What is the percentage of overshoot?

4. What is the steady state error?

Exercise C — Varying the Parameters of a PI controller

In this exercise, you will vary the parameters of the PI controller, and observe their effecton the transient response of the system.

• Set a = 0.25, and Kp = 1. Obtain the response to a 1V step, and compute theovershoot, rise time and settling time. Check the controller output, to make sure thatthe amplifier is not being driven into saturation.

• Obtain the overshoot, rise time and settling time for Kp = 2, 4 and 8. Did the amplifiersaturate in any of these cases?

• Include a table, showing Kp, the rise time, settling time and percent overshoot for these

4 step responses.

• Set the gain Kp = 4, and obtain step responses for a = 0.25, 0.5, 1 and 2. Did theamplifier saturate for any of these? Include a table, showing Kp, the rise time, settling

time and percent overshoot for these 5 step responses.

• Using the tables generated above as a starting point, tune the controller so that theunit step response has

200

Page 201: Control Systems 1 notes

– Peak Overshoot < 5%.

– Rise Time < 0.25 sec.

– Steady State error < 0.5%.

– No saturation.

Exercise D – Saturation and PI controllers.

In this exercise, you will see what happens to a PI controller when the amplifier saturates.The phenomenon is often called integrator windup.

• Modify your controller so that Kp = 20, and a = 3.

• Apply a 5 volt step to the system, and record the result.

• Superimpose the error signal and the controller output on a single plot.

• Zoom in on the first 3 seconds of the response. Hand in a copy of this plot with your

report.

• How long does the controller output remain saturated?

• When does the error first cross through zero?

• Why does the controller stay at full positive saturation, even though the error is neg-ative and decreasing?

201

Page 202: Control Systems 1 notes

Laboratory Assignment #4

Drawing Bode Diagrams and Polar Plots

Author: Chris Macnab

Group sizes

Work individually. You do not have to come to the lab but help is available there if youwant it.

What to hand in, where to hand it in

You are required to write a informal report and hand it in to the lab assignment box. Thereport will consist of answering the questions outlined in this manual.

Instructions

Read the instructions below and attempt all 3 parts of the lab. You are to attempt the laband write the report individually (i.e. by yourself!). You can attempt the lab on your owntime or come into the regularly scheduled lab where the TA or professor can give you anyhelp you need.

This lab uses MATLAB, and a MATLAB function written for this lab. First create adirectory in your account (on your computer) where you want to put this function. Nowdownload the function which is called do bode.m from

http://enel.ucalgary.ca/People/Macnab/enel441/lab4/do bode.mand save it in your new directory. Now run MATLAB from your new directory, sincedo bode.m must be in MATLAB’s working directory.

We will simply be drawing bode diagrams and then getting MATLAB to do it for usso we can see if our answer was right. MATLAB will also graph the time domain solutionfor us. All the necessary MATLAB code is given to you. You will simply change certainvariables in the code as you’re told.

To do this lab you will need semi-log graph paper and a ruler. If you don’t have yourown semi-log paper, photocopy the last page of this lab manual and do your plots on that.Labs handed in with graphs that are not on semi-log paper will receive a mark of zero.

Part 1: Frequency response in time domain

Let’s look at the open-loop transfer function of a PID control applied to a second ordersystem

G(s) =KI + KP s + KDs2

s(s2 + as + b)

202

Page 203: Control Systems 1 notes

Type the following commands (comments are optional). Type them into a text editorbefore cutting and pasting them into MATLAB so that you don’t have to retype them everytime.

%define the control gains

kp=3

ki=2

kd=1

%define the plant parameters

a=1

b=10

%create the transfer function

num=[kd kp ki]

den=[1 a b 0]

sys=tf(num,den)

We are going to examine what happens to the output of this transfer function G(s) whenthe input is sinusoidal. Let’s look at the time domain solution. Since we are applying asinusoidal input, we should see a transient response followed by a steady-state oscillation.

%set our variables of interest (you will have to change these)

%frequency in radians per second

w=3; %use values of w=0.01,0.03,0.1,0.3,1,3,10,30

%number of oscillations that will be graphed

ncycles=10; %you may have to change this to see anything

%now calculate and graph the solution

T=2*pi/w;

tmax=ncycles*T;

dt=1/w/10;

t=[0:dt:tmax];

u=sin(w*t);

[y,tout]=lsim(sys,u,t);

clf;

plot(t,u,’r--’,tout,y,’b’);

legend(’input’,’output’);

xlabel(’time (s)’);

The above code lets you answer questions 1 and 2 (Part 1) for a particular frequency w.Before you go back and try it for a different frequency, try the next piece of code with thesame frequency w which will allow us to get a better look at the steady-state performance.

203

Page 204: Control Systems 1 notes

min1=round(T*(ncycles-1)/dt);

max1=round(T*ncycles/dt);

s=size(tout);

dt2=tmax/s(1);

min2=round(T*(ncycles-1)/dt2);

max2=round(T*ncycles/dt2);

plot(t(min1:max1),u(min1:max1),’r--’,tout(min2:max2),y(min2:max2),’b’);

legend(’input’,’output’);

xlabel(’time (s)’);

grid on;

Now you can answer questions 3,4,5 for a particular frequency. Then you can go backand repeat all the above code for another frequency (change w) which will let you fill in thetable for Part 1. Note that you may have to change the variable ncycles to get a good lookat the transient performance.

Part 2: Bode Diagrams

We now want to draw a bode diagram. For a particular frequency w you now have again (ratio of amplitudes), gain in dB, and a phase. You will be plotting points on threegraphs, one for magnitude (the gain), one for magnitude in dB (the gain in dB), and onefor phase as a function of frequency (the log of frequency actually). Decide the ranges youneed on your plots and put numbers on the axes. Remember that the frequency axis islogarithmic (base 10), so that the evenly spaced vertical lines are a factor of 10 apart (e.g.0.01,0.1,1,10,...). If you don’t understand why there are vertical lines not evenly spaced,whip out your calculator and take a few logarithms to convince yourself why. Now graphyour points and try to connect them with a smooth line (not straight lines).

You have now drawn a Bode diagram. Now let’s see if MATLAB agrees with you. Trythe following:

%draw a bode diagram for sys=tf(num,den)

clf;

bode(sys);

grid on;

Notice MATLAB only gives you the magnitude in dB, so there are only 2 plots insteadof three. If your plot does not agree with MATLAB, try it again (you can just leave yourincorrect plots on the graph; no marks will be deducted).

We just plotted bode diagrams the hard way. The easy way is to plot bode diagrams ofindividual functions and then add them together. Use the tables and graphs given in theback of the lab manual to find the plots of individual functions. This works because bothlogarithms and phase angles are added when functions are multiplied. Note that it doesn’twork for gain/magnitude not in dB. First we must factor out any terms multiplying the

204

Page 205: Control Systems 1 notes

highest values of s. There aren’t any in this case. Notice with kd=1,kp=3,ki=2,a=1,b=10that we can factor the numerator with real coefficients (but not the denominator) so thetransfer function looks like:

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

s(s2 + s + 10)

We can now see there are two simple leads (two zeros on the real axis), one integrator(s in the denominator), and one quadratic lag (one pair of complex poles). Plotting theBode Diagram using these functions is what you have to do for Part 2 of this lab. Plotthese individual functions on your Bode diagram (gain in dB and phase as functions offrequency) with dotted lines. Now plot the summation of all the functions with a solid line.The next piece of code gets MATLAB to do this for you and you can check your answer.The MATLAB graph plots the individual function asymptotes with dotted lines, the totalasymptote (summation) with a dashed line, and the real answer with a solid line. You areonly to expected to be able to draw the asymptotes exactly; the total function you can onlyestimate.

K=2/10;

num=[1 3 2];

den=[1 1 10 0];

ndiffs=0;

nints=1;

lags=[]; nlags=0;

leads=[1 2]; nleads=2;

qlags=[sqrt(b)]; nqlags=1;

qleads=[]; nqleads=0;

min=0.01;

max=100;

clf;

do_bode(num,den,K,nints,ndiffs,leads,nleads,lags,nlags,qlags,nqlags,qleads,

nqleads,min,max);

%you can turn the grid off to see the asymptotes more clearly

subplot(2,1,1);

grid off;

subplot(2,1,2);

grid off;

Part 3: Drawing a polar plot

Now we want to produce a polar plot (and ultimately what we call a Nyquist diagram) fromthe above graphs. Use the data from the table you made in part one. For each frequency

205

Page 206: Control Systems 1 notes

you have a phase and magnitude(gain). Plot six points on the complex plane (no semi-loggraph for this), where each point is the tip of a vector with a certain magnitude and phase.

The basic part of a Nyquist diagram consists of a polar plot with its mirror image.MATLAB will plot it for us and we can check our answer. If you found 6 points was notenough to get close to the real shape, you can use other points by simply estimating amagnitude and phase at a certain frequency right off the bode diagram (remember you willbe estimating magnitude in dB so you have to convert it to real units).

clf;

nyquist(sys);

Work to be handed in

You are to hand in the answers to the following questions. Do not hand in any of theMATLAB work.

Questions for Part 1: Frequency response in the time

domain

For the frequencies w =0.01,0.03,0.1,0.3,1,3,10,30 estimate the following from the graphs andenter them in a table layed out like the one below:

1. The time and number of oscillations (ncycles) it takes for the transient response to dieout (when the steady state takes over)

2. The frequency of the output (steady-state) in Hz

3. The ratio of the amplitude of the output to the amplitude of the input (the gain)

4. The gain in decibels (calculate this by taking 20 times the base 10 logarithm of theoriginal gain)

5. The phase measured as the number of degrees the output leads the input.

w time ncycles freq gain gain(dB) phase0.010.030.10.3131030

206

Page 207: Control Systems 1 notes

Questions for Part 2: Bode Diagrams

1. Using the data from the table, plot 3 graphs (8 points plotted on each graph). USESEMI-LOG PAPER. The top graph should have gain vs. frequency, the middle gainin dB vs. frequency, and the bottom phase vs. frequency. Connect your points with asmooth line on each graph (straight lines not necessary)

2. Let’s do it the easy way now. Draw a Bode Diagram (magnitude and phase vs fre-quency) using the individual functions plots from the original transfer function (notusing the data from the table). USE SEMI-LOG PAPER.

Question for Part 3: Polar Plots

Make a polar plot using the data from the table. This is plotted on the complex plane soyou do not need semi-log paper.

207

Page 208: Control Systems 1 notes

Bode plots of basic functions

Constant gain, zeros, and poles.

K (jω)n 1/(jω)n

M(dB) 20 log K n20 log(ω) −n20 log(ω)slope (dB/dec) 0 n20 −n20

φ(deg) 0 n90 −n90

10−2

10−1

100

101

102

−100

−50

0

50

100

Gai

n (d

B)

10−2

10−1

100

101

102

−100

−50

0

50

100

150

200

Pha

se (

deg)

Freq. (rad/s)

Page 209: Control Systems 1 notes

Pole on the real axis (simple lag) 1/(jωτ + 1)

ω << 1/τ ω >> 1/τM(dB) −10 log(ω2τ 2 + 1) 0 −20 log ωτ

slope (dB/dec) 0 −20φ(deg) − tan−1(ωτ) 0 −90

Zero on the real axis (simple lead) (jωτ + 1).

ω << 1/τ ω >> 1/τM(dB) 10 log(ω2τ 2 + 1) 0 20 log ωτ

slope (dB/dec) 0 20φ(deg) tan−1(ωτ) 0 90

Examples of simple lag and simple lead for 1/τ = 2 shown below

10−2

10−1

100

101

102

−40

−20

0

20

40

Gai

n (d

B)

10−2

10−1

100

101

102

−100

−50

0

50

100

Pha

se (

deg)

Freq. (rad/s)

Page 210: Control Systems 1 notes

Complex conjugate poles (quadratic lag) 1/ ((ju)2 + 2ζuj + 1) where u = ω/ωn

u << 1 u >> 1M(dB) −10 log((1− u2)2 + 4ζ2u2) 0 −40 log u

slope (dB/dec) 0 −40φ(deg) − tan−1(2ζu/(1− u2)) 0 −180

Quadratic lag with ωn = 1 with examples for ζ = 0.02 and ζ = 2 shown below

10−2

10−1

100

101

102

−100

−80

−60

−40

−20

0

20

40

Gai

n (d

B)

10−2

10−1

100

101

102

−200

−150

−100

−50

0

Pha

se (

deg)

Freq. (rad/s)

Page 211: Control Systems 1 notes

MagnitudeMagnitude (dB)Phase (deg)

Frequency (rad/s)