Docsity

Classical Control, Lecture notes of Control Systems

Partial preview of the text

Download Classical Control and more Lecture notes Control Systems in PDF only on Docsity!

Classical Control

Bruce A. Francis

Electrical and Computer Engineering Department

University of Toronto

current version (year-month-day hour:minute): 2015-02-24 17:

Contents

Preface

This first course in control systems is aimed at students in electrical, mechanical, and aerospace engineering. Such students will have taken linear algebra, calculus, physics (mechanics), and electric circuits. Electric circuits is ideal background because its tools include differential equations, Laplace transforms, and transfer functions. This control course is normally given in the third or fourth undergraduate year. The subject of this first course is classical control. That means the systems to be controlled are single-input, single-output and stable except possibly for a single pole at the origin, and design is done in the frequency domain, usually with Bode diagrams. A second undergraduate course, sometimes called modern control although that term is out of date, would normally be a state-space course, meaning multi-input, multi-output and possibly unstable plants, with controllers being observer based or optimal with respect to a linear-quadratic criterion. The consensus of opinion among educators seems to be that every electrical engineering graduate should know the rudiments of control systems, and that the rudiments reside in classical control. However, state models, normally relegated to the second course, play an important role in the first third of this course because they are very efficient and unifying. From a nonlinear state model, it is easy to linearize at an equilibrium just by computing Jacobians. It is also natural to introduce the important concept of stability in the state equation framework. On the other hand, classical control is a course that follows electric circuit theory in the standard curriculum. Circuit theory introduces phasors, i.e., sinusoidal steady state, Laplace transforms, transfer functions, poles and zeros, and Bode plots. Classical control should build on that base, and therefore transfer functions and their poles and zeros play a major role. In particular, pole locations are used, not only in the final-value theorem, but also to characterize boundedness of signals. This is possible because only signals having rational Laplace transforms are considered. This is, of course, a severe restriction, but is justified under the belief that undergraduate engineering students should not be burdened with unfamiliar mathematics just for the sake of generality. The main topics of the course are modeling of physical systems and obtaining state equations, linearization, Laplace transforms, how poles are related to signal behaviour, transfer functions, sta- bility, feedback loops and stability, the Nyquist criterion, stability margins, elementary loopshaping, and limitations to performance. There is also a case study of a DC-DC converter. The book is intended to be just long enough to cover classical control.

To students

This is a first course on the subject of feedback control. For many of you it will be your one and only course on the subject, and therefore the aim is to give both some breadth and some depth. From this course it is hoped that you learn the following:

  • The value of block diagrams.
  • How to model a system using differential equations.
  • What it means for a system to be linear and time-invariant.
  • How to put the model in the form of a state equation.
  • How to find equilibria and linearize the model at an equilibrium (if there is one).
  • The value of graphical simulation tools like Simulink.
  • Why we use transfer functions and the frequency domain.
  • The correlation between pole locations and time-domain behaviour.
  • What stability means.
  • What feedback is and why it is important.
  • How to determine if a feedback system is stable by checking poles.
  • The beautiful Nyquist stability criterion and the meaning of stability margin.
  • How to design a simple feedback loop using frequency-domain methods.
  • What makes a system easy or hard to control.

Thanks

This book logically precedes the book Feedback Control Theory that I co-wrote with John Doyle and Allen Tannenbaum. I’m very grateful to them for that learning experience. I first taught classical control at the University of Waterloo during 1982 - 84. In fact, because of the co-op program I taught it (EE380) six times in three years. Thanks to the many UW students who struggled while I learned how to teach. In 1984 I came back to the University of Toronto and I got to teach classical control to Engineering Science students. What a great audience!

be controlled is sensed, compared to a desired reference, and action then taken based on the error. This is the structure of a feedback loop. And because the action is based on the error, instability can result^1 If unstable, the machine is not operable. This raises the fundamental problem of feedback control: To design a feedback controller that acts fast enough and provides acceptable performance, including stability, in spite of unavoidable modelling errors. This, then, is what the course is about:

  1. Obtaining mathematical models of physical systems.
  2. Having a handle on model errors.
  3. Understanding the concept of stability.
  4. Having a mathematical tool to test for stability of a feedback loop. For us that is the Nyquist criterion.
  5. Having a mathematical tool to test for stability margin.
  6. Characterizing desired performance.
  7. Designing feedback controllers to obtain good performance if it is possible.

1.3 MATLAB and Scilab

MATLAB, which stands for matrix laboratory, is a commercial software application for matrix computations. It has related toolboxes, one of which is the Control Systems Toolbox. Scilab is similar but with the noteworthy difference that it is free. These tools, MATLAB especially, is used in industry for control system analysis and design. You must become familiar with it. It is a script language and easy to learn. There are tutorials on the Web, for example at the Mathworks website.

1.4 Notation

Generally, signals are written in lower case, for example, x(t). Their transforms are capitalized: X(s) is the Laplace transform of x(t). Resistance values, masses, and other physical constants are capitals: R, M , etc. In signals and systems the unit step is usually denoted u(t), but in control u(t) denotes a plant input. Following Zemanian^2 , we denote the unit step by 1+(t).

1.5 Problems

  1. Find on the Web three examples of control systems not mentioned in this chapter. Make your list as diverse as possible.
  2. Imagine yourself flying a model helicopter with a hand-held radio controller. Draw the block diagram with you in the loop. (We will formally do block diagrams in the next chapter. This problem is to get you thinking, although you are free to read ahead.) (^1) Try to balance a pencil vertically up on your hand. You won’t be able to do it. (^2) Distribution Theory and Transform Analysis, A.H. Zemanian, Dover
  1. A fourth-year student who took ECE311 last year has designed an amazing device. It’s a wooden box of cube shape that can balance itself on one of its edges; while it is balanced on the edge, if you tapped it lightly it would right itself. How does it work? That is, draw a schematic diagram of your mechatronic system.
  2. Historically, control systems go back at least to ancient Greek times. More recently, in 1769 a feedback control system was invented by James Watt: the flyball governor for speed control of a steam engine. Sketch the flyball governor and explain in a few sentences how it works. (Stability of this control system was studied by James Clerk Maxwell, whose equations you know and love.)
  3. The topic of vehicle formation is of current research interest. Consider two cars that can move in a horizontal straight line. Let car #1 be the leader and car #2 the follower. The goal is for car #1 to follow a reference speed and for car #2 to maintain a specified distance behind. Discuss how this might be done. Solution In broad terms, we need to control the speed of car #1 and then the distance from car #2 to car #1. Regulating the speed of a car at a desired constant value is cruise control. So a cruise controller must be put on car #1. With this in place, on car #2 we need a proximity controller to regulate the speed of car #2 so that the distance requirement is achieved. Let us fill in some details and bring in some ideas that will come later in the course. The best way to work on a problem like this is to try to get a block diagram. Figure 1.1 has two diagrams. The top one is a schematic diagram where the two cars are represented as boxes on wheels. They are moving to the right. The symbols y 1 and y 2 represent their positions with respect to a reference point; any reference point will do. These positions are functions of time. The symbols u 1 and u 2 represent forces applied to the cars, forces produced by engines of some type. Let the velocities of the two cars be denoted v 1 and v 2. Presumably, the forces are to be used to achieve the two given specifications, v 1 equals some desired constant vref , and y 1 − y 2 equals some desired value dref. Back to Figure 1.1, the bottom diagram is a block diagram, where blocks denote subsystems or functional relationships and where arrows denote signals. Let us begin with the part of the diagram containing the symbol u 1. This is a force, and you know from Newton’s second law that force equals mass times acceleration. So if we integrate force and divide by the mass we get the velocity v 1. This is shown in the diagram by the block with input u 1 and output v 1. The desired value of v 1 is vref. The feedback principle, as we will learn in this course, is to define the velocity error ev = vref − v 1 , and then to take corrective action: reduce ev if it is positive, increase ev if it is negative. We can increase or decrease ev only by increasing or decreasing the force u 1. This is shown in the block diagram by a block, the controller, with input ev and output the force u 1. Finally, the lower loop is a feedback loop whose goal is to get dy, defined as y 2 − y 1 , equal to dref. The controller from ey to u 2 has to be designed to do that.

Chapter 2

Mathematical Models of Physical

Systems

It is part of being human to try to understand the world, natural and human-designed, and our way of understanding something is to formulate a model of it. All of physics—Kepler’s laws of planetary motion, Newton’s laws of motion, his law of gravity, Maxwell’s laws of electromagnetism, the Navier-Stokes equations of fluid flow, and so on—all are models of how things behave. Control engineering is an ideal example of the process of modelling and design of models. In this chapter we present a common type of model called state equations. The nonlinear form is

x˙ = f (x, u) y = h(x, u)

and the linear form is

x˙ = Ax + Bu y = Cx + Du.

Here u, x, y are vectors that are functions of time. The dot, ˙x, signifies derivative with respect to time. The components of the vector u(t) are the inputs to the system; an input is an independent signal. The components of y(t) are the outputs, the dependent signals we are interested in. And the vector x(t) is the state; its purpose and meaning will be developed in the chapter. The four symbols A, B, C, D are matrices with real coefficients. These equations are linear, because Ax + Bu and Cx + Du are linear functions of (x, u), and time-invariant, because the coefficient matrices A, B, C, D do not depend on time.

2.1 Block diagrams

The importance of block diagrams in control engineering cannot be overemphasized. One could easily argue that you don’t understand your system until you have a block diagram of it. This section teaches how to draw block diagrams.

CHAPTER 2. MATHEMATICAL MODELS OF PHYSICAL SYSTEMS 9

x

y y

x

Figure 2.1: The curve on the left is the graph of a function; the curve on the right is not.

x y

f

Figure 2.2: The block diagram for the function y = f (x).

  1. Block diagram of a function. Let us recall what a function is. If X and Y are two sets, a function from X to Y is a rule that assigns to each element of X a unique element of Y. The terms function, mapping, and transformation are synonymous. The notation

f : X −→ Y

means thatX and Y are sets and f is a function from X to Y. We typically write y = f (x) for a function. To repeat, for each x there must be a unique y such that y = f (x); y 1 = f (x) and y 2 = f (x) with y 1 6 = y 2 is not allowed.^1 Now let f be a function R −→ R. This means that f takes a real variable x and assigns a real variable y, written y = f (x). So f has a graph in the (x, y) plane. For f to be a function, every vertical line must intersect the graph in a unique point, as shown in Figure 2.1. Figure 2.2 shows the block diagram of the function y = f (x). Thus a box represents a function and the arrows represent variables; the input is the independent variable, the output the dependent variable.

  1. Electric circuit example. Figure 2.3 shows a simple RC circuit with voltage source u. We consider u to be an independent variable and the capacitor voltage y to be a dependent variable. Thinking of the circuit as a system, we view u as the input and y as the output. Let us review how we could compute the output knowing the input. The familiar circuit equation is

RC y˙ + y = u.

Since this is a first-order differential equation, given a time t > 0, to compute the voltage y(t) at that time we would need an initial condition, say y(0), together with the input voltage u(τ ) (^1) The term multivalued function is sometimes used if two different values are allowed, but we shall not use that term.

CHAPTER 2. MATHEMATICAL MODELS OF PHYSICAL SYSTEMS 11

The Author

December 7 , 2007

u y

Figure 2.6: Block diagram of a cart.

u

v

y (^) u

v

y

Figure 2.7: The first summing junction stands for y = u + v; the second for y = u − v.

stands for position in meters. This is a schematic diagram, not a block diagram, because it doesn’t say which of u, y causes the other. Newton’s second law tells us that there’s a mathematical relationship between u and y, namely, u = M ¨y, that is, force equals mass times acceleration. We take the viewpoint that u is an independent variable, and thus it is viewed as an input. Recall that M ¨y = u is a second-order differential equation. Given the forcing term u(t), we need two initial conditions, say, position y(0) and velocity ˙y(0), to be able to solve for y(t). More specifically, for a fixed time t > 0, in order to compute y(t) we would need y(0) and ˙y(0) and also u(τ ) over the time range from τ = 0 to τ = t. So symbolically we have

y = f (u, y(0), y˙(0)).

Again, we leave the initial conditions out of the block diagram to get Fig. 2.6. Inside the box we could put the differential equation or the transfer function, which is 1/(M s^2 )—the Laplace transform of y divided by the Laplace transform of u. If you don’t see this, don’t worry—we’ll do transfer functions in detail later.

  1. Summing junctions. Block diagrams also may have summing junctions, as in Figure 2.7. Also, we may need to allow a block to have more than one input, as in Figure 2.8. This means that y is a function of u and v, y = f (u, v).

Brief Article

The Author

December 7 , 2007

u

v

y

Figure 2.8: Two inputs.

CHAPTER 2. MATHEMATICAL MODELS OF PHYSICAL SYSTEMS 12

Brief Article

The Author December 7 , 2007

on a fulcrum

d

θ

τ

flat board

can of soup free to roll on board

1

Figure 2.9: A can rolls on a board.

Brief Article

The Author

December 7 , 2007

τ

θ

d

1

Brief Article

The Author

December 7 , 2007

τ

θ

d

1

Figure 2.10: One input, two outputs.

  1. Multi-output example. Figure 2.9 shows a can rolling on a see-saw. Suppose a torque τ is applied to the board. Let θ denote the angle of tilt and d the distance of roll. Then both θ and d are functions of τ. The block diagram could be either of the ones in Figure 2.10.
  2. Water tank. Figure 2.11 shows a water tank. The arrow indicates water flowing out. Try to draw the block diagram; the answer is in the footnote.^2
  3. Cart and motor drive. This is a harder example. Consider a cart with a motor drive, a DC motor that produces a torque. See Figure 2.12. The input is the voltage u to the motor, the output the cart position y. We want the model from u to y. To model the inclusion of a motor, draw the free body diagram in Figure 2.13. Moving from right to left, we have a force (^2) There are no input signals. Assuming the geometry of the tank is fixed and considering there is an initial time, say t = 0, the flow rate out at any time t > 0 depends uniquely on the height of water at time t = 0. Therefore, if we let y(t) denote the flowrate out, the block diagram would be a single box, no input, one output labelled y.

Figure 2.11: Water tank.

CHAPTER 2. MATHEMATICAL MODELS OF PHYSICAL SYSTEMS 14

u (^) i m

f

y

vb

L

di dt (1) + Ri = u vb

✓^ ˙ ✓

(2) ⌧m = Ki

(3) J d dt ✓˙ = ⌧m ⌧

(4) y = r✓

(5) f = M y¨

(6) ⌧ = rf

(7) vb = Kb ✓˙

Figure 2.14: The cart and motor drive block diagram.

u y

R

Figure 2.15: RC circut where R can be set externally.

Finally, the relationship between shaft angle and cart position is

y = rθ.

Combining all this gives the block diagram of Figure 2.14.

  1. Occasionally we might want to indicate that a parameter is a variable, or that it can be set at different values. For example, suppose that in the RC circuit in Figure 2.3 several values of R are available for us to select. The the value R ican be selected from an exteral power (us), and we can indicate this by an arrow going through the box as in Figure 2.15.
  2. Summary. A block diagram is composed of arrows, boxes, and summing junctions. The arrows represent signals. The boxes represent systems or system components; mathematically they are functions that map one or more signals to one or more other signals. An exogenous input to a block diagram, e.g., u in Figure 2.4, is an independent variable. Other signals are dependent variables.

CHAPTER 2. MATHEMATICAL MODELS OF PHYSICAL SYSTEMS 15

2.2 State equations

State equations are fundamental to the subject of dynamical systems. In this section we look at a number of examples. We begin with the notion of linearity.

  1. The concept of linearity. To say that a function f : R −→ R is linear means the graph is a straight line through the origin; there’s only one straight line that is not allowed—the y-axis. Thus y = ax defines a linear function for any real constant a; the equation defining the y-axis is x = 0. The function y = 2x + 1 is not linear—its graph is a straight line, but not through the origin. In your linear algebra course you were taught that a linear function, or linear transformation, is a function f from a vector space X to another (or the same) vector space Y having the property

f (a 1 x 1 + a 2 x 2 ) = a 1 f (x 1 ) + a 2 f (x 2 )

for all vectors x 1 , x 2 in X and all real numbers^3 a 1 , a 2. If the vector spaces are X = Rn, Y = Rm, and if f is linear, then it has the form f (x) = Ax, where A is an m × n matrix. Conversely, every function of this form is linear. This is a useful fact, so let us record it as the next item. We emphasize that Rn^ denotes the vector space of n-dimensional column vectors, and so the basis is fixed.

  1. Characterization of a linear function. If A is an m × n real matrix and f is the function f (x) = Ax, then f is linear. Conversely, if f is a linear function from Rn^ to Rm, then there is a unique m × n matrix A such that f (x) = Ax.
  2. Proof. Suppose A is given and f (x) = Ax. Then f is linear because

A(a 1 x 1 + a 2 x 2 ) = a 1 Ax 1 + a 2 Ax 2.

Conversely, suppose f is linear. We are going to build the matrix A column by column. Let e 1 denote this vector of dimension n:

e 1 =

Take the first column of A to be f (e 1 ). Take the second column to be f (e 2 ), where

e 2 =

(^3) This definition assumes that the vector spaces are over the field of real numbers.

CHAPTER 2. MATHEMATICAL MODELS OF PHYSICAL SYSTEMS 17

Brief Article

The Author December 7 , 2007

M

y

F

1

u

y

D( ˙y) M

Figure 2.16: Cart on wheels.

Brief Article

The Author

December 7 , 2007

u y P

(x)

1

Figure 2.17: Block diagram of the cart.

This is a single second-order differential equation. It will be convenient to put it into two simultaneous first-order equations by defining two so-called state variables, in this example position and velocity:

x 1 := y, x 2 := ˙y.

Then

x˙ 1 = x 2

x ˙ 2 =

M

u −

M

D(x 2 ) y = x 1.

These equations can be combined into

x˙ = f (x, u) (2.1) y = h(x), (2.2)

where

x =

[

x 1 x 2

]

, f (x, u) =

[

x 2 1 M u^ −^

1 M D(x^2 )

]

, h(x) = x 1.

The function f is nonlinear if D is, while h is linear in view of Section 2.2, Paragraph 2 and h(x) =

[

]

x.

Equations (2.1) and (2.2) constitute a state equation model of the system. The block diagram is shown in Figure 2.17. Here P is a possibly nonlinear system, u (applied force) is the input, y (cart position) is the output, and

x =

[

cart pos’n cart velocity

]

CHAPTER 2. MATHEMATICAL MODELS OF PHYSICAL SYSTEMS 18

The Author

December 7 , 2007

y 1 y 2

u 1

M 1

u 2

M 2

K

Figure 2.18: A 2-input, 2-output system.

is the state of P. (We’ll define state later.) As a special case, suppose the air resistance is a linear function of velocity:

D(x 2 ) = D 0 x 2 , D 0 a constant.

Then f is linear:

f (x, u) = Ax + Bu, A :=

[

0 −D 0 /M

]

, B :=

[

1 /M

]

Defining C =

[

]

, we get the state model

x˙ = Ax + Bu, y = Cx. (2.3)

This model is linear; it is also time-invariant because the matrices A, B, C do not vary with time. Thus the model is linear, time-invariant (LTI).

  1. Notation. It is convenient to write vectors sometimes as column vectors and sometimes as n-tuples, i.e., ordered lists. For example

x :=

[

x 1 x 2

]

, x = (x 1 , x 2 ).

We shall use both.

  1. General statement. An important class of models is

x˙ = f (x, u), y = h(x, u),

where u, x, y are vectors that are functions of time, that is, u(t), x(t), y(t). This model is nonlinear if f and/or h is nonlinear, but it is time-invariant because neither f nor h depends directly on time. Denote the dimensions of u, x, y by, respectively, m, n, p.