You are on page 1of 9

ME 132, Dynamic Systems and Feedback

Class Notes
by
Andrew Packard, Kameshwar Poolla & Roberto Horowitz

Spring 2005
Instructor:
Prof. A Packard

Department of Mechanical Engineering


University of California
Berkeley CA, 94720-1740

ME 132, Spring 2005, UC Berkeley, A. Packard

Introduction

In this course we will learn how to model and control engineering systems. Some examples
of systems which benefit from well-designed control systems are
Airplanes, helicopters, rockets, missiles: flight control systems including autopilot, pilot
augmentation
Cruise control for automobiles. Lateral/steering control systems for future automated
highway systems
Position and speed control of mechanical systems:
1. AC and/or DC motors, for machines, including Disk Drives/CD, robotic manipulators, assembly lines.
2. Elevators
3. Magnetic bearings, MAGLEV vehicles, etc.
Pointing control (telescopes)
Chemical and Manufacturing Process Control: temperature; pressure; flow rate; concentration of a chemical; moisture content; thickness.
The two most basic objectives of a control system are:
The automatic regulation (or tracking) of certain variables in the controlled plant to
desired values (or trajectories), in the presence of unforseen disturbances
The stabilization or improved stability of the controlled plant.
A key realization is the fact that most of the systems that we will attempt to model and
control are dynamic. We will later develop a formal definition of a dynamic system. However,
for the moment it suffices to say that dynamic systems have memory, i.e. the present
output of the system is generally a function of previous inputs, as well as the current input
to the system. This means that the control actions have impact both when they are applied,
and later.
Another key concept idea in this course is the use of feedback to control engineering systems.
Let us briefly compared two types of control systems: open loop and closed loop.
1. Open-loop control systems: In an open-loop system, the input to the plant does
not in any way depend on the current and past values of the output of the plant.
The design of the open-loop controller is based on inversion. In some sense, the
controller should be an (usually electrical) inverse of the plant. The biggest problem

ME 132, Spring 2005, UC Berkeley, A. Packard

with open-loop control systems is that they rely totally on calibration, and cannot
effectively deal with exogenous disturbances. Moreover, they cannot effectively deal
with changes in the process, due to various effects, such as aging components. They
require recalibration. Essentially, they cannot deal with uncertainty. Another disadvantage of open-loop control systems is that they cannot stabilize an unstable system,
such as balancing an inverted pendulum.
2. Closed-loop control systems: In order to make the control system robust to uncertainty and disturbances, we design control systems which sense the output of the
system, and adjust the control input, using feedback rules, which are based on how the
system output deviates from its desired value. These feedback rules are based on a
model of how the system behaves. If the system behaves slightly differently than the
model, usually the feedback helps compensate for these differences. However, if the
system actually behaves significantly different than the model, then feedback might
even cause instability. This is a drawback of feedback systems.

1.1

Structure of a closed-loop control system

The physical system to be controlled is called the plant. This term has its origins in chemical
engineering where the control of chemical plants or factories is of concern.
A sensor is a device that measures a physical quantity like pressure, acceleration, humidity,
or chemical concentration. Very often, sensors produce an electrical signal whose voltage
is proportional to the physical quantity being measured. This is very convenient, because
these signals can be readily processed with electronics, or can be stored on a computer for
analysis or for real-time processing.
An actuator is a device that has the capacity to affect the behavior of the plant. An electrical
signal is applied to the actuator, which results in some mechanical motion such as the opening
of a valve, or the motion of a motor, which in turn induces changes in the plant dynamics.
Sometimes, as for example electrical heating coils in a furnace, the applied voltage directly
affects the plant behavior without mechanical motion being involved.
The controlled variables are the physical quantities we are interested in controlling and/or
regulating.
The reference or command is an electrical signal that represents what we would like the
regulated variable to behave like.
Disturbances are phenomena that affect the behavior of the plant being controlled. Disturbances are often induced by the environment, and often cannot be predicted in advance or
measured directly.
The controller is a device that processes the measured signals from the sensors and the
reference signals and generates the actuated signals which in turn, affects the behavior of

ME 132, Spring 2005, UC Berkeley, A. Packard

the plant. Controllers are essentially strategies that prescribe how to process sensed signals
and reference signals in order to generate the actuator inputs.
Finally, noises are present at various points in the overall system. We will have some amount
of measurement noise (which captures the inaccuracies of sensor readings), actuator noise
(due for example to the power electronics that drives the actuators), and even noise affecting
the controller itself (due to quantization errors in a digital implementation of the control
algorithm).
Throughout these notes, we will attempt to consistently use the following symbols:
plant
input
disturbance
reference

P
u
d
r

K
y
n

controller
output
noise

Based on our discussion above, we can draw the block diagram of Figure 1 that reveals the
structure of many control systems. Again, the essential idea is that the controller processes
measurements together with the reference signal to produce the actuator input u(t). In this
way, the plant dynamics are continually adjusted so as to meet the objective of having the
plant outputs y(t) track the reference signal r(t).

Actuator noise

Disturbances

Actuators

Measurement noise

Plant

Sensors

Controller
Controller noise

Commands

Figure 1: Basic structure of a control system.

1.2

Example: Temperature Control in Shower

A simple, slightly unrealistic example of some important issues in control systems is the
problem of temperature control in a shower.
The components which make up the plant in the shower are

ME 132, Spring 2005, UC Berkeley, A. Packard

Hot water supply (constant temperature, TH )


Cold water supply (constant temperature, TC )
Adjustable valve that mixes the two; use to denote the angle of the valve, with = 0
meaning equal amounts of hot and cold water mixing. In the units chosen, assume
that 1 1 always holds.
1 meter (or so) of piping from valve to shower head
If we assume perfect mixing, then the temperature of the water just past the valve is
C
C
Tv (t) := TH +T
+ TH T
(t)
2
2
= c1 + c2 (t)

The temperature of the water hitting your skin is the same (roughly) as at the valve, but
there is a time-delay based on the fact that the fluid has to traverse the piping, hence
T (t) = Tv (t )
= c1 + c2 (t )
where is the time delay, about 1 second.
Lets assume that the valve position only gets adjusted at regular increments, every
seconds. Similarly, lets assume that we are only interested in the temperature at those
instants as well. Hence, we can use a discrete notion of time, indexed by a subscript k, so
that for any signal, v(t), write
vk := v(t)|t=k
In this notation, the model for the Temperature/Valve relationship is
Tk = c1 + c2 k1

(1)

Now, taking a shower, you have a desired temperature, Tdes , which may even be a function
of time Tdes,k . How can the valve be adjusted so that the shower temperature approaches
this?
Open-loop control: pre-solve for what the valve position should be, giving
k =

Tdes,k c1
c2

(2)

and use this basically calibrate the valve position for desired temperature. This gives
Tk = Tdes,(k1)
which seems good, as you achieve the desired temperature one time-step after specifying
it. However, if c1 and/or c2 change (hot or cold water supply temperature changes, or valve

ME 132, Spring 2005, UC Berkeley, A. Packard

gets a bit clogged) there is no way for the calibration to change. If the plant behavior changes
to
Tk = c1 + c2 k1
(3)
but the control behavior remains as (2), the overall behavior is
Tk+1 = c1 +

c2
(Tdes,k c1 )
c2

which isnt so good. Any percentage variation in c2 is translated into a similar percentage
error in the achieved temperature.
How do you actually control the temperature when you take a shower: Again, the behavior
of the shower system is:
Tk+1 = c1 + c2 k
Closed-loop Strategy: If at time k, there is a deviation in desired/actual temperature
of Tdes,k Tk , then since the temperature changes c2 units for every unit change in , the
valve angle should be increased by an amount c12 (Tdes,k Tk ). That might be too aggressive,
trying to completely correct the discrepancy in one step, so choose a number , 0 < < 1,
and try

k = k1 + (Tdes,k Tk )
(4)
c2
(of course, is limited to lie between 1 and 1, so the strategy should be written in a more
complicated manner to account for that - for simplicity we ignore this issue here, and return
to it later in the course). Substituting for k gives
1

1
(Tk+1 c1 ) = (Tk c1 ) + (Tdes,k Tk )
c2
c2
c2
which simplifies down to
Tk+1 = (1 ) Tk + Tdes,k
Starting from some initial temperature T0 , we have
T1 = (1 )T0 + Tdes,0
T2 = (1 )T1 + Tdes,1
= (1 )2 T0 + (1 )Tdes,0 + Tdes,1
..
.
. = ..
Tk = (1 )k T0 +

Pk1

n=0 (1

)n Tdes,k1n

If Tdes,n is a constant, T, then the summation simplifies to


Tk = (1 )k T0 + 1 (1 )k T
h
i
= T + (1 )k T0 T
h

which shows that, in fact, as long as 0 < < 2, then the temperature converges (convergence
rate determined by ) to the desired temperature.

ME 132, Spring 2005, UC Berkeley, A. Packard

Assuming your strategy remains fixed, how do unknown variations in TH and TC affect the
performance of the system? Shower model changes to (3), giving
Tk + T
des,k
Tk+1 = 1

:= c2 . Hence, the deviation in c1 has no effect on the closed-loop system, and the
where
c2
deviation in c2 only causes a similar percentage variation in the effective value of . As long
< 2, the overall behavior of the system is acceptable. This is good, and shows
as 0 <
that small unknown variations in the plant are essentially completely compensated for by
the feedback system.
On the other hand, large, unexpected deviations in the behavior of the plant can cause
problems for a feedback system. Suppose that you maintain the strategy in equation (4),
but there is a longer time-delay than you realize? Specifically, suppose that there is extra
piping, so that the time delay is not just , but m. Then, the shower model is
Tk+m1 = c1 + c2 k1

c2

and the strategy (from equation 4) is k = k1 +

(5)

(Tdes,k Tk ). Combining, gives

Tk+m = Tk+m1 + (Tdes,k Tk )


This has some very undesirable behavior, which is explored in problem 4 at the end of the
section.

1.3

Problems

1. In this class, we will deal with differential equations having real coefficients, and real
initial conditions, and hence, real solutions. Nevertheless, it will be useful to use
complex numbers in certain calculations, simplifying notation, and allowing us to write
only 1 equation
when there are actually two. Recall that if is a complex number,
q
2
then || = R + I2 , where R := Real() and I := Imag(). If 6= 0, then the angle
of , denoted 6 , satisfies
cos 6 =

R
,
||

sin 6 =

I
||

and is uniquely determinable from (only to within an additive factors of 2).


(a) Draw a 2-d picture (horizontal axis for Real part, vertical axis for Imaginary part)
(b) Suppose A and B are complex numbers. Using the numerical definitions above,
carefully derive that
|AB| = |A| |B| ,
6

(AB) = 6 A +
6

ME 132, Spring 2005, UC Berkeley, A. Packard

2. For any C and integer N , consider the summation


:=

N
X

k=0

If = 1, show that = N + 1. If 6= 1, show that


=
If || < 1, show that

1 N +1
1

k =

k=0

1
1

3. Consider the difference equation


pk+1 = pk + uk

(6)

with the following parameter values, initial condition and terminal condition:
R
= 1+
, = 1, uk = M for all k, p0 = L, p360 = 0
12

(7)

where R, M and L are constants.


(a) In order for the terminal condition to be satisfied (p360 = 0), the quantities R, M
and L must be related. Find that relation. Express M as a function of R and L,
M = f (R, L).
(b) Is M a linear function of L (with R fixed)? If so, express the relation as M =
g(R)L, where g is a function you can calculate.
(c) Note that the function g is not a linear function of R. Calculate

dg

dR R=0.065

(d) Plot g(R) and a linear approximation, defined below

dg
gl (R) := g(0.065) + [R 0.065]

dR R=0.065

for R is the range 0.01 to 0.2. Is the linear approximation relatively accurate in
the range 0.055 to 0.075?
(e) On a 30 year home loan of $250,000, what is the monthly payment, assuming an
interest rate of 6.75%. Hint: The amount owed on a fixed-interest-rate mortgage
from month-to-month is represented by the difference equation in equation (6).
The parameters in (7) all have appropriate interpretations.

ME 132, Spring 2005, UC Berkeley, A. Packard

4. Consider the shower example. Suppose that there is extra delay in the showers response, but that your strategy is not modified to take this into account. We derived
that the equation governing the closed-loop system is
Tk+m = Tk+m1 + (Tdes,k Tk )
where the time-delay from the water passing through the mixing value to the water
touching your skin is m. Using calculators, spreadsheets, computers (and/or graphs)
or analytic formula you can derive, determine the values of for which the system
is stable for the following cases: (a) m = 2, (b) m = 3, (c) m = 5. Remark
1: Remember, for m = 1, the allowable range for is 0 < < 2. Hint: For
a first attempt, assume that the water in the piping at k = 0 is all cold, so that
T0 , T1 , . . . , Tm1 = TC , and that Tdes,k = 12 (TH + TC ). Compute, via the formula, Tk
for k = 0, 1, . . . , 100 (say), and plot the result.

5. Given a complex number G, and a real number , show that (here, j := 1)

Re Gej = |G| cos ( + 6 G)


6. Given a real number , and real numbers A and B, show that

A sin t + B cos t = A2 + B 2

1/2

sin (t + )

for all t, where is an angle that satisfies


cos =

A
(A2 +

B 2 )1/2

sin =

B
(A2 + B 2 )1/2

Note: you can only determine to within an additive factor of 2. How are these
conditions different from saying just
tan =

B
A

7. For a function F of a many variables (say two, for this problem, labled x and y), the
sensitivity of F to x is defined as the percentage change in F due to a percentage
change in x. Denote this by SxF . Show that for infinitesimal changes in x, the
sensitivity is
x F
SxF =
F (x, y) x
Let F (x, y) =

xy
.
1+xy

What is SxF .

8. Draw the block diagram for temperature control in a refrigerator. What disturbances
are present in this problem?

You might also like