reglerteknik ak med utvalda tentamenstal - kth · pdf filereglerteknik ak med utvalda...

264
Reglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary AUTOMATIC CONTROL LINKÖPINGS UNIVERSITET COMMUNICATION SYSTEMS 1

Upload: dangphuc

Post on 17-Mar-2018

245 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Reglerteknik AK med Utvalda Tentamenstal

Exercises

Hints

Answers

Solutions

Introduktion till Control System Toolbox

Dictionary

AUTOMATIC CONTROL

LINKÖPINGS UNIVERSITETCOMMUNICATION SYSTEMS

1

Page 2: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 3: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

ExercisesThis version: August 2013

Page 4: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 5: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1 Mathematics1.1 Determine the one-sided Laplace transform of the following signals.

a) u(t) ={

0, t < 0A, t ≥ 0

, where A is a constant.

b) u(t) ={

0, t < 0At, t ≥ 0

, where A is a constant.

c) u(t) = e−2t for t ≥ 0.d) u(t) = cos 5t for t ≥ 0.

Express the following in U(s), the Laplace transform of u(t).

e) u(t)f) u(t), when u(t) = 0 for t ≤ 0.g) u(t)h) u(t), when u(t) = u(t) = 0 for t ≤ 0.i) u(t− T )

1.2 Consider the differential equationy(t) + 2y(t) = u(t)

a) If u(t) is constant then y(t) ≈ 0 when time goes to infinity. What value will y(t) approach as t→∞ if u(t) = 5?b) Determine the transfer function relating U(s) and Y (s) for the differential equation above.

1.3 Determine the general solution of the differential equation

d3y

dt3 + 4d2y

dt2 + 5dydt + 2y = 3 sin(2t)

1.4 Below, differential equations that describe dynamic systems are given together with system inputs and initial conditions.Use the Laplace transform to determine the system outputs.

a)d2y

dt2 + 3dydt + 2y = σ(t)

σ(t) ={

0, t < 01, t ≥ 0

dydt (0) = y(0) = 0

b)y(t) + y(t) = u(t)

u(t) = 1 + sin ty(0) = 0

1.5 Write the following complex numbers in polar form, that is, determine their absolute value and argument.

a) 1 + ib) 1+i

5i(1+√

3i)

Write the following complex numbers on rectangular form:

c) 2eiπ3

1

Page 6: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

d) 5e−iπ

1.6 A system has amplification 100. What is the amplification expressed in decibel (dB20)? What is the amplificationcorresponding to 20 dB20, −3 dB20, 0 dB20, −10 dB20, and 10 dB20 respectively?

1.7 Verify that the following rule for inversion of 2× 2 matrices holds.

A =(a11 a12a21 a22

)⇒ A−1 = 1

a11a22 − a12a21

(a22 −a12−a21 a11

)

1.8 Determine eigenvalues and eigenvectors of the matrix

A =

2 −1 −10 3 0−6 2 1

1.9 Determine a transformation matrix T , such that T−1AT is a diagonal matrix, where

A = 13

6 0 −3−1 5 −1−2 −2 7

1.10 Characterize the range space and null space of the matrix A by specifying bases for them. Find the rank of the matrix.

A =

2 1 2 10 1 1 03 1 3 21 0 1 1

1.11 What are the time functions corresponding to the Laplace transforms below? What values will the time functions

approach as time goes to infinity?

a)F (s) = 1

s2 + s

b)F (s) = 1

s2 − 1

c)F (s) = 1

(s+ 1)2

1.12 The water level, y, in a tank is modelled by the differential equation

y(t) + y(t) = z(t)

where z denotes the inflow. The inflow is a function of a valve position, which in turn is controlled by the electric controlsignal u. The relation between control signal and flow is given by the differential equation

z(t) + z(t) + z(t) = u(t)

What differential equation relates the water level y to the control signal u?

2

Page 7: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

2 Dynamic Systems

Ra La

Load

J, f

i

u v θ

Figure 2.1a

2.1 A common component in a control system is a DC-motor. A schematic picture of the motor is shown in Figure 2.1a. Themotor is characterized by a number of physical relationships as will now be explained. The rotating axis is described by

Jθ = −fθ +M,

where θ is the angle of rotation, M is the torque, J is the moment of inertia of the load and f is the frictional coefficient.The interplay between rotor and stator is given by

M = kai and v = kvθ

where i is the anchor current, ka a proportional constant characteristic for the motor, v is voltage induced by the rotatingaxis and kv is a proportional constant. The input voltage u is the control signal and θ is the output.

a) Use the equations above and Kirchhoff’s voltage law to write a differential equation that relates u and θ. Theinductance La can be neglected.

b) Determine the transfer function of the system from u to θ.c) Study the behavior of the system by calculating θ when u is a step.

Amp MotorKΣ+e u

r y

Figure 2.2a

2.2 A servo system for positioning of a tool in a tooling machine is depicted in Figure 2.2a. In Figure 2.2b, the poles ofthe closed loop system are plotted for different values of the gain K. Find (without calculations), for each of the stepresponses in Figure 2.2c, the corresponding value of K used when generating the step response.

3

Page 8: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Re

Im

K = 0.1K = 0.5

K = 2.5 K = 3.0

K = 0.1

K = 0.5

K = 2.5 K = 3.0

K = 0.1

K = 0.5

K = 2.5

K = 3.0

Figure 2.2b

1

0

1

0

Step 1 Step 2

1

0

1

0

Step 3 Step 4

Figure 2.2c. All comparable axes have equal scaling.

d1 d2

L

Screw

u

Roller

Plate

Figure 2.3a

2.3 Consider the simple model of the roller depicted in Figure 2.3a. To obtain a simple model we describe the relationshipbetween the position of the screw and the thickness of the sheet d1 directly after the rollers as a first order transferfunction

G(s) = β

1 + sT

To determine the constants β and T we register the effect of a sudden change in the position of the screw. The unitsused in the model are chosen such that a unit step will make an appropriately sized input for identification purposes,and that is the input used in the experiment for which the resulting thickness profile d1(t) is shown in Figure 2.3b. Inproduction the thickness cannot be measured directly behind the rollers for practical reasons, and instead the thicknessd2(t) is measured L length units after the rollers. Find the transfer function from the position of the screws to thethickness d2. The sheet moves with speed V .

4

Page 9: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0

2

4

6

8

10

12

0 4 8 12 16 20

d1

t [s]

Figure 2.3b

2.4 The step response of the following system

G(s) = 1s2 + s+ 1

is shown as the dashed line in each part of Figure 2.4a.

a) The step response of the system

G(s) = 1s2 + as+ 1

is shown as the solid line in the left of Figure 2.4a. Determine if a > 1 or a < 1.

b) The step response of the system

G(s) = b2

s2 + bs+ b2

is shown as the solid line in the right of Figure 2.4a. Find b.

0

1

0 5 10

0

1

0 5 10

t [s] t [s]

a)b)

Figure 2.4a. Dashed: original system. Solid left: part a). Solid right: part b).

2.5 Pair the step responses and pole-zero diagrams in Figure 2.5a.

2.6 Consider the systems

GA(s) = 1s2 + 2s+ 1 GB(s) = 1

s2 + 0.4s+ 1

GC(s) = 1s2 + 5s+ 1 GD(s) = 1

s2 + s+ 1

GE(s) = 4s2 + 2s+ 4

a) Use Matlab to plot the step responses of the systems. Find Tr (rise time), Ts (settling time) and M (overshoot)for the five step responses.

b) Compute the poles of the systems GA(s), GB(s), GC(s), GD(s), and GE(s) respectively.

c) How is the location of the poles related to the properties of the step responses?

5

Page 10: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Pole-zero map Step response

ARe

Im

BRe

Im

CRe

Im

DRe

Im

ERe

Im

FRe

Im

Real part Time

Figure 2.5a. All comparable diagrams have equal scaling. In the pole-zero maps, imaginary and real parts have equal scaling, × markspoles, and ◦ marks zeros.

6

Page 11: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

2.7 Consider a system with the transfer functionG(s) = αs+ 1

s2 + 2s+ 1Compute and plot the step response of the system for some different values of α in the range −10 < α < 10. How arethe properties of the step response affected by the location of the zero of the system?

2.8 Consider a system described by the model Y (s) = G(s)U(s) as shown in Figure 2.8a. Given G(s), how is the stepresponse computed? How can the step response be determined using experiments?

Gu y

Figure 2.8a

2.9 Figure 2.9a shows the step response of a system Y (s) = G(s)U(s). The input step has amplitude 1. Use the figure anddetermine

a) Steady state value.b) Overshoot M in % of the final value.c) Rise time Tr.d) Settling time Ts.

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

0 5 10 15

y

t [s]

Figure 2.9a

2.10 Figure 2.10a shows the step responses of four different systems. Combine each step response with a transfer functionfrom the alternatives below.

Transfer function Poles Zeros |G(0)|G1(s) = 100

s2+2s+100 −1± 10i 1G2(s) = 1

s+2 −2 1/2G3(s) = 10s2+200s+2000

(s+10)(s2+10s+100) −10,−5± 8.7i −10± 10i 2G4(s) = 200

(s2+10s+100)(s+2) −2,−5± 8.7i 1G5(s) = 600

(s2+10s+100)(s+3) −3,−5± 8.7i 2G6(s) = 400

(s2−10s+100)(s+2) −2, 5± 8.7i 2

7

Page 12: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Step A Step B

Step C Step D

Figure 2.10a. All comparable axes have equal scaling.

Acid process flow NaOH solution

Flow with desired pH

Figure 2.11a

2.11 In the continuously stirred tank, see Figure 2.11a, an acid process flow is neutralized by adding a concentrated NaOHsolution. The acid process flow has a tendency to vary its pH with time, which gives undesired variation of the pH inthe outflow. In an effort to reduce these variations one has decided to use control.

a) Classify the different signals as input, output, and disturbance signal.

b) Draw a block diagram of the system with a control strategy.

8

Page 13: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

q1, cA,1 q2, cA,2

V , cA

q, cA

Figure 2.12a

2.12 Two flows with different concentrations of a chemical component A are mixed in a continuously stirred tank, seeFigure 2.12a. The volume can be assumed constant, V = 1 m3.

a) During a stationary period the values of the concentrations and flows are, c∗A,1 = 1.0 kmol/m3, q∗1 = 1.0 m3/min,c∗A,2 = 4.0 kmol/m3 and q∗2 = 0.5 m3/min. What are cA(t) and q(t) during this period?

b) Write down the dynamical balance equation for component A. State all your assumptions. Is the dynamical modellinear?

c) Assume that cA,1 changes value from 1.0 kmol/m3 to 1.2 kmol/m3 at t = 0. Show that the expression for cA(t)can be written as

cA(t) = k0 + k1

(1− e−t/τ

)Determine the constants k0, k1 and τ .

Mi, xi

Vi

yi

Vi+1

yi+1

Li−1

xi−1

Li

xi

Figure 2.13a

2.13 The distillation plate, see Figure 2.13a, has the following variables:

Li - Liquid flow from plate i (kmol/min)Vi - Steam flow from plate i (kmol/min)Mi - Amount of liquid on plate i (kmol)xi - Mole fraction of the most volatile component in the liquid on plate i.yi - Mole fraction of the most volatile component in the steam from plate i.

Assumptions:

9

Page 14: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

- Perfect mixing of liquid on the plate.- Binary separation- yi is in equilibrium with xi.- The equilibrium is described by

yi = αxi1 + (α− 1)xi

a) Write the two differential equation that describes Mi(t) and xi(t).b) Linearize the model under the assumption that the change of the mass on the plate is zero.

2.14 Tentamenstal 2009-12-15 Upg. 1dBeräkna överföringsfunktionen från U(s) till Y (s) för systemet i figur 2.14a.

Figure 2.14a

Solution

2.15 Tentamenstal 2009-12-15 Upg. 1dI denna deluppgift ska vi studera de sex överföringsfunktionerna

GA(s) = s+ 1s2 + s+ 1 , GB(s) = 1− s

s2 + s+ 1 , GC(s) = s+ 1s2 + 0.3s+ 1

GD(s) = 15s , GE(s) = 1

s2 + 2s+ 1 , GF (s) = 9s2 + 6s+ 9

I Figur 2.15a syns de sex stegsvaren för överföringsfuktionerna ovan. Para ihop rätt stegsvar och överföringsfunktion.Skalorna på både x-axlarna (tid) och y-axlarna (utsignal) är lika för alla figurerna. Rätt svar ger +1p, fel svar ger −1p,och inget svar ger 0p.Motivera noga! (Ej fullständig motivering räknas som felaktigt svar.)

10

Page 15: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Figure 2.15a

11

Page 16: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

3 Feedback Systems

hTank1 m2

PID-controller

href

h

x

Inflow

Valve

u

v

Pump

Figure 3.1a

3.1 A feedback system for level control is shown in Figure 3.1a where all variables denote variations from a working point.The flow to the tank is given by the valve position and the outflow from the tank by the flow v(t) via the pump. Thetransfer function from valve opening u to the flow x is denoted Gv(s).

a) Determine the important signals of the system and draw a block diagram of the whole system. Use mass balance∗to determine a transfer function for the tank.

b) The transfer function of the valve is

Gv(s) = kv

1 + Ts.

To find kv and T a unit step change in u has been applied. The step response is shown in Figure 3.1b. Determinethe constants kv and T .

0

0.5

1

1.5

2

0 5 10 15 20 25 30

x

t [s]

Figure 3.1b

c) Compute the transfer functions from href to h and from v to h and verify that they have the same poles.∗That the change in tank level is proportional to the difference between inflow and outflow.

12

Page 17: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

d) Assume that we use proportional control, that is, F (s) = K. How large gain, K, can we select if we want all polesof the closed loop system to be in the area shown in Figure 3.1c?

e) Assume that a disturbance is introduced in the outflow v in the form of a unit step. How large will the level errordue to the disturbance be in steady state with control according to d)?

f) How large will the steady state level error due to the disturbance be with a PI controller?

1

1Re

Im

Figure 3.1c

3.2 Consider the tank system in Problem 3.1.

a) Assume that proportional control with gain K = 1 has been selected. Which poles will the closed loop systemhave?

b) Consider a PD controller

u = −KPh−KDdhdt

Assume that KP = 1 and calculate a value of KD so the damping ratio of the closed loop poles will be greater than1/√

2. This corresponds to the grey area in Figure 3.1c. Poles in this region corresponds to an overshoot of lessthan 5% (the overshoot may also be affected by the zeros).

3.3 While working in space an astronaut has to be able to move. Necessary force is obtained by letting out gas fromthrusters. For such a positioning control system the control law

u = K1(r − y)−K1K2dydt

is used, where u = thruster force, r = set point for the astronaut’s position and y = the actual value of the astronaut’sposition. Draw a block diagram of the system, and use physics (Newton’s law) to make a model of the astronaut. Alsodetermine K1 and K2 such that

• If the set point r(t) = t there has to be a time T0 so that |r(t)− y(t)| < 1 for t ≥ T0.• The damping ratio of the closed loop system will be 0.7. The mass of the astronaut is assumed to be 100 kg,

equipment included.

Σ1

ms2 + dsF (s)Σ

Controller Hydraulic cylinder

+e

+

+

−yref y

fc

Figure 3.4a

3.4 Figure 3.4a shows the block diagram for a hydraulic servo system in an automatic lathe (Swedish: svarv). The outputsignal y(t) represents the position of the lathe tool (Swedish: svarvstål), yref(t) is the desired position of the lathe tool,m is the mass of the tool slide (Swedish: verktygsslid) and the hydraulic piston (Swedish: kolv), d is the viscous dampingof the tool slide, F (s) is the transfer function for the controller, fc is the cutting power.

13

Page 18: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

a) How large, in steady state, is the error e(t) between the actual value of the lathe tool and its desired referencevalue, when there is a step disturbance in the cutting power fc(t)? The controller is assumed to be an amplifierwith a constant gain F (s) = K.

b) How is this error changed if the amplifier is replaced by a PI controller with transfer function F (s) = K1 +K2/s?

3.5 Consider the systemY (s) = G(s)U(s) = 0.2

(s2 + s+ 1)(s+ 0.2)U(s).

a) Suppose G(s) is controlled by a proportional controller with gain KP, that is,

U(s) = KP(R(s)− Y (s)).

Use Matlab to compute the closed loop system, and to plot the step response of the closed loop system. Choosesome values for KP in the range 0.1 to 10. How are the properties of the step response affected by KP? Whathappens with the steady state error when KP increases? Is it possible to obtain a well damped closed loop systemand small steady state error using proportional control?

b) Let us now introduce integration in the regulator and use

U(s) = (KP +KI1s

)(R(s)− Y (s)).

Put KP = 1 and try some values of KI in the range 0 < KI < 2. How are the step response and the steady stateerror affected by the introduction of the integrating part and the value of KI?

c) Finally we will introduce the differentiating part in the regulator and use

U(s) = (KP +KI1s

+ KDs

sT + 1)(R(s)− Y (s)).

Since true differentiation is difficult to implement, the derivative part is approximated by KDs1+sT . (This will low-pass

filter the error signal before differentiation.) Put KP = 1,KI = 1 and T = 0.1 and try some values of KD in therange 0 < KD < 3. How does the D-part affect the step response of the closed loop system?

Σ GO(s)+−

Figure 3.6a

3.6 Draw a root locus with respect to K for the system in Figure 3.6a, with Go(s) given below. For which values of K arethe systems stable? What conclusions on the principal shape of the step response can be drawn from the root locus?

a) A Ferris wheel (Swedish: Pariserhjul):

Go(s) = K(s+ 2)s(s+ 1)(s+ 3)

b) A Mars rover:Go(s) = K

s(s2 + 2s+ 2)

c) A magnetic floater:

Go(s) = K(s+ 1)s(s− 1)(s+ 6)

3.7 Consider the servo system in Figure 3.7a with a DC-motor. Suppose that the angular velocity can be measured with atachometer and let the control law be as in the block diagram. Let τ = 0.5 and k = 2.

a) Draw the root locus with respect to K for the system without the tachometer feedback (that is, α = 0).b) Draw the root locus with respect to K for α = 1.c) Draw the root locus with respect to K for α = 1/3.d) Let K = 1 and draw the root locus with respect to α.

14

Page 19: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

KΣΣk

1 + sτ

1s

α

+ +θ

−−

θref θ

Figure 3.7a

δ

θ

Figure 3.8a

Discuss, using the results from a), b), c), and d), what is gained by using the tachometer.

3.8 Consider an aircraft where the pitch angle θ is controlled by the elevator deflection (Swedish: höjdroderutslag) δ, seeFigure 3.8a. Let ω be the angular velocity,

ω = θ.

If we consider small deviations from a reference value θ0, we get the transfer function from δ to ω for a specific aircraftas

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

This model is valid when the aircraft is flown with a large θ0. The elevator (Swedish: höjdroder) is driven by a hydraulicservo amplifier with the transfer function

G1(s) = 10s+ 10

from elevator command δref to δ.

a) What happens with ω if one gives a constant elevator command δref? Motivate!b) The angular velocity ω is measured and a control law is used so that the input δref to the servo amplifier is

K(ωref − ω).

Draw root locus with respect to K. For which values of K is the system stable?c) Is there any value of K such that the closed loop system is stable and all poles are real?

1(s + 1)(s + 10)

ΣΣ1s

K1

K2

+ +θ

−−

θref θ

Figure 3.9a

3.9 The block diagram in Figure 3.9a shows a cascade controlled DC-motor where K1 > 0 and K2 > 0.

a) Draw root locus with respect to K2 for the characteristic equation of the closed loop system. For which K2 > 0are the closed loop system asymptotically stable?

b) How is the stability requirement on K2 affected by the size of the velocity feedback K1?

15

Page 20: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

3.10 We want to control the temperature of an unstable chemical reactor. The transfer function is

1(s+ 1)(s− 1)(s+ 5)

a) Use a proportional controller and draw a root locus with respect to the amplification K. Calculate which K in thecompensator that stabilizes the system.

b) Use a PD controller. The control law is given by

u = K(e+ TDdedt )

where e is the error. Let TD = 0.5 and draw a root locus with respect to K. For which values of K does thecontroller stabilize the system?

k

s(s + 2)

a

s + a

Σ

Σ

+u

+ymyf

+

r y

Measurementnoise

Figure 3.11a

3.11 Consider the system in Figure 3.11a. In a realistic situation what you really measure is not y(t) but a signal ym(t) whichis the sum of y(t) and measurement noise. To avoid that the control is based on noisy measurements one uses yf(t)instead of ym(t). The signal yf(t) is ym(t) filtered through the low pass filter

a

s+ a

a) First we assume that the measurement noise is negligible. Choose k = 6. Draw a root locus for the closed loopsystem with respect to the time constant of the low pass filter 1/a. Find for which a > 0 the system is stable.

b) Use k = 6 and assume that the noise is a high frequency sinusoid. The amplitude of yf when

ym(t) = sin(10t)

is used as a measurement of how effective the noise reduction is. What is the smallest value you can obtain (aftertransients) by choosing a suitable a. We also want y to tend to the steady state value 1 when r(t) is a unit step.

3.12 Figure 3.12a shows the root locus for the characteristic equation of a P-controlled process G with respect to the gain K.In Figure 3.12b four step responses for the closed loop system with different values of K are shown. Match the plots inFigure 3.12b with the K-values below. Justify your answer.

K = 4 K = 10 K = 18 K = 50

16

Page 21: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

-4 -2 2

-2

2

Re

Im

Figure 3.12a. Starting points are marked × and end points ◦.

Step A Step B

Step C Step D

Figure 3.12b. All comparable axes have equal scaling.

3.13 Consider a system with the transfer function

G(s) = sn−1 + b1sn−2 + · · · bn

sn + a1sn−1 + · · ·+ an

that has all zeros strictly in the left half plane. Show that such a system always can be stabilized by

u(t) = −Ky(t)

if K is selected large enough.

17

Page 22: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Lake

Dam Dam

qdam

qin qout

Figure 3.14a

3.14 We want to control the level in a lake by controlling the flow using flood gates, see Figure 3.14a. The relationshipbetween changes in the level of the lake, h∆, and changes in the flows, qin,∆ and qout,∆, is given by

ddt (Ah∆) = qin,∆ − qout,∆

where A is the area of the lake. In order to try to keep the level of the lake constant the flows through the lake arecontrolled at the inflow such that

qdam,∆ = K(href,∆ − h∆)

where href,∆ is the reference value. The reservoir that controls the outflow is controlled so that qout is constant, that is,qout,∆ = 0. Since it takes time before a change in qdam gives a result in qin we have

qin,∆ = qdam,∆(t− T )

where T = 0.5 hours. How large can the quotient K/A be at the most before the system becomes unstable?

Σ K G(s)+−

Figure 3.15a

3.15 A system G(s) is controlled using feedback with a proportional controller according to Figure 3.15a.

a) For K = 1, the open loop system KG(s) has the Nyquist diagram according to (i), (ii), (iii), or (iv) in Figure 3.15b.Is the closed loop system stable in each case? G(s) has no poles in the right half plane.

b) If K > 0, for which values of K are the different closed loop systems stable?

3.16 a) Draw the Nyquist curve for an integrator G(s) = 1/s.

b) Draw the Nyquist curve for the double integrator G(s) = 1/s2.

18

Page 23: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

-1 Re

Im

(i)

-0.4

-1 Re

Im

(ii)

-1 Re

Im

(iii)

-2 -1-2-4Re

Im

(iv)

Figure 3.15b

−1.5 2

−3

Re

Im

ω = 0

ω = 2

ω = 10 ω =∞

Figure 3.17a

3.17 The system G(s) is asymptotically stable and has the Nyquist curve in Figure 3.17a. It is controlled using feedbackaccording to Figure 3.17b.

a) For what values of K (K > 0) is the closed loop system asymptotically stable?b) Determine the steady state error, e, as a function of K if yref is a unit step.c) Assume that G is controlled using an I controller according to Figure 3.17c. For what values of K is the closed

loop system stable?

19

Page 24: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Σ K G(s)+e

yref y

Figure 3.17b

ΣK

sG(s)+

e

yref y

Figure 3.17c

3.18 Consider the DC-motorτ y(t) + y(t) = u(t)

It is controlled byu(t) = K(r(t− T )− y(t− T ))

Here τ and T are positive constants. K is slowly increased until the system oscillates with the angular frequency ω = 1.K is then set to 33% of this value. After a while the system starts to oscillate again, now with the angular frequencyω = 0.5. This is due to the fact that the time delay T has changed to T1. Can the parameters τ , T , and T1 be decidedfrom these data? If so determine τ , T and T1.

Σ F (s) G(s)+e

yref y

Figure 3.19a

3.19 A system G(s) is to be controlled using the regulator

F (s) = K

s+ 1

according to the Figure 3.19a. The controller has positive gain K that, however, is not completely known. For whatvalues of K is the closed loop system asymptotically stable? The Nyquist curve for G(s) is given in Figure 3.19b.

1

1

Re

Im

ω = 1/√

3

ω = 1

ω =√

3 ω = 0ω =∞

Figure 3.19b

3.20 The Nyquist curve for the system G(s) = B(s)A(s) can be seen in Figure 3.20a. Determine which one of the root loci in

Figure 3.20b that matchesA(s) +KB(s) = 0

for this system.

20

Page 25: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0.25

−0.25Re

Im

Figure 3.20a

Re

Im

Re

Im

Root locus A Root locus B

Re

Im

Re

Im

Root locus C Root locus D

Figure 3.20b. Starting points (K = 0) are marked ×, and end points (K →∞) are marked ◦. All diagrams have equal scaling.

3.21 The system 1s(s+1) with input u and output y has the controller

U(s) = F (s)(R(s)− Y (s)) F (s) = b0s2 + b1s+ b2

s

How should the coefficients of F be chosen to achieve pure P, pure I and pure D control respectively?

3.22 The equations for the P, PI, and PID controllers to be used in this problem are given in Problem 3.5.

a) Let the system

Y (s) = G(s)U(s) = 0.2(s2 + s+ 1)(s+ 0.2)U(s)

be controlled by a proportional controller with gain KP. Use Matlab to plot the root locus with respect to KPof the characteristic equation of the closed loop system. For which values of KP > 0 is the closed loop systemasymptotically stable?In Problem 3.5, we found that the step response was slow but well damped for small values of KP, while it becamefaster but more oscillatory when KP was increased. For large values of KP the system became unstable. We alsofound that the steady state error was reduced when KP was increased. Can these results be interpreted using theplot of the root locus?

21

Page 26: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) Now assume that the system is controlled by a PI controller where KP = 1. Plot the root locus of the characteristicequation, with respect to KI, and determine for which values of KI > 0 the closed loop system is asymptoticallystable.Problem 3.5 showed that an integrator eliminates the steady state error. A small value of KI gives a large settlingtime, while a too large value gives an oscillatory, and perhaps unstable closed loop system. Give an interpretationof these results using the root locus.

c) Finally, let the system be controlled by a PID controller where KP = 1, KI = 1 and T = 0.1. Plot a root locus ofthe closed loop characteristic equation, with respect to KD > 0, and relate the behavior of the root locus to thesimulation result in Problem 3.5, that is, that the derivative part increases the damping of the closed loop system,but a too large KD will give an oscillation with a higher frequency, and finally an unstable closed loop system.

3.23 Consider the systemY (s) = G(s)U(s) = 0.2

(s2 + s+ 1)(s+ 0.2)U(s).

a) Use Matlab to plot the Nyquist curve of the open loop system when G(s) is controlled by a proportional regulator.Try some different values of KP and find for which KP the closed loop system is asymptotically stable. Compareyour results with those from Problem 3.22a.

b) Assume now that the system is controlled by a PI controller where KP = 1. Investigate how KI affects the Nyquistcurve and determine for which values of KI the closed loop system is asymptotically stable. Do you get the sameresults as in Problem 3.22b?

c) Finally test a PID controller with KP = 1, KI = 1 and T = 0.1 (cf Problem 3.5. How is the Nyquist curve affectedby the value of KD?

3.24 a) Assume that the systemY (s) = G(s)U(s) = 0.4

(s2 + s+ 1)(s+ 0.2)U(s)

is controlled by a proportional controller where KP = 1. Use Matlab to make a Bode plot of the open loop systemand determine ωc (gain crossover frequency), ωp (phase crossover frequency), ϕm (phase margin) and Am (gainmargin) respectively. Compute the closed loop system and plot the step response.

b) Now let KP = 2.5. How does the change of KP affect ωc, ωp, ϕm, and Am ? Simulate the step response of theclosed loop system and plot the result. How have the properties of the step response changed?

c) How much can KP be increased before the closed loop system becomes unstable? How does this value relate to thevalue of Am that was obtained for KP = 1? Compute and plot the step response of the closed loop system for thisvalue of KP. How does the closed loop system behave in this case?

3.25 A system is controlled by a PID controller,

U(s) = (KP +KI1s

+KDs)E(s)

In Figure 3.25a four step responses from a unit step for the parameter triples

i) KP = 1 KI = 0 KD = 0ii) KP = 1 KI = 1 KD = 0

iii) KP = 1 KI = 0 KD = 1iv) KP = 1 KI = 1 KD = 1

are shown. Match each one of the parameter triples to one of the step responses. Justify your answer!

3.26 Assume that a DC-motor of the type described in Problem 2.1 is controlled by a proportional controller, that is,u(t) = KP(θref − θ).

a) Write down a block diagram for the control system. Compute the closed loop transfer function and determine howthe poles of the closed loop system depend on the control gain KP. Discuss what this means for the behavior ofthe system for different values of KP.

b) Determine the transfer function from the reference signal to the error. Let the reference signal be a step and aramp respectively and determine what the control error will be in steady state in these two cases.

22

Page 27: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1 1

1 1

A B

C D

Figure 3.25a. Four step responses. All comparable axes have equal scaling.

Figure 3.25b

c) Let the controller be a PI controller. What will the steady state error be in this case if the reference signal is aramp?

3.27 Determine the transfer function for the loop gain and the closed loop system for the control system given by the blockdiagram in Figure 3.27a.

GO(s)Σ

−1

+u

+

r y

Figure 3.27a

GFΣ

Σ

+e u

+−+

r

n

y

Figure 3.28a

3.28 Figure 3.28a shows a block diagram of a control system. Determine the transfer function

a) of the loop gain,b) of the closed loop system from R(s) to Y (s),c) from the disturbance N(s) to the output Y (s),d) from the reference signal R(s) to the error signal E(s).

3.29 Consider again the control system in Figure 3.28a, with n = 0 and

G(s) = 1(s+ 1)(s+ 3)

a) Assume F (s) = K. Determine the steady state control error when r(t) is a step.b) Determine a regulator F (s) such that the steady state error is zero when r(t) is a step.c) Assume F (s) = 1. Determine the poles and zeros of the closed loop system.

23

Page 28: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

3.30 The system

Y (s) = 1(s/0.6 + 1)(s+ 1)U(s)

is controlled using PID feedback

U(s) = (KP +KI1s

+KDs)(R(s)− Y (s))

Figure 3.30a shows the step responses for the following four combinations of coefficient values. Combine the stepresponses and coefficients.

(1) KP = 4 KI = 0 KD = 0(2) KP = 4 KI = 3 KD = 0(3) KP = 4 KI = 1 KD = 0(4) KP = 4 KI = 0 KD = 4

1 1

1 1

A B

C D

Figure 3.30a. Four step responses. All comparable axes have equal scaling.

Vt, Tt

Tank

CoolerFc, Tc

Fc,in, Tc,in

Ft,in, Tt,in

Ft, Tt

Figure 3.31a. Process consisting of a tank and a cooler. Input flows have a “in” subscript, while outputs have no such subscript sincethey are also the same as the quantities found inside the tank or cooler.

3.31 Continuously stirred tanks have an extensive use in chemical processes. They are often supplied with some sort of heatexchange system. If the tank is used for a chemical or biochemical reaction it is often important to keep a certaintemperature to obtain desired productivity. A continuously stirred tank with a common type of heat exchange systemis shown in Figure 3.31a. The tank is surrounded with a heating/cooling layer in which a liquid flows through in orderto heat or chill the liquid in the tank.

a) Determine the important signals of the system. Suggest a control strategy based on feedback and draw the blockdiagram.

24

Page 29: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) To be able to construct and evaluate different controllers it is necessary to have a process model. Determine adynamical model for this system. Assume that the volumes in the tank and in the heat exchange system areconstant.

c) Linearize the model. (Stationary values: T ∗t = 50.0 ◦C, T ∗c = 75.0 ◦C.)d) The parameters of the model are as follows

ρt = ρc = 1000.0 kg/m3 cpt,in = cpc = 4.2 kJ/kg◦C U = 672 kJ/◦CminFt = 0.1 m3/min Fc = 0.2 m3/min Vt = 1.0 m3 Vc = 1.0 m3

Tt,in = 10.0 ◦C Tc,in = 95.0 ◦C

Determine the transfer function from flow in the heat exchange system to the temperature in the tank.e) Let the system be controlled by a P controller. Draw the root locus for the system.

3.32 Consider a continuously stirred tank with a cooling system. In the tank a component A reacts to form component B inan exothermic reaction. This reaction is unstable, but possible to stabilize with feedback. A model for the purpose ofcontrol has been established

Y (s) = −1s2 + 2s− 3U(s)

where y(t) is the temperature in the tank and u(t) is the cooling flow.

a) Show that the system is unstable.b) Prove that the system can be stabilized by a P controller.

3.33 Bacterial growth is described by the equation y = µy where y is the amount of bacteria and µ is a positive constant.Assume that we have a control signal u available that affects the speed of growth so that

y = µy + u

One can then use a P controller u = K(r−y) where r is a reference signal. For which K-values will the system approachan equilibrium?

3.34 Tentamenstal 2009-06-10 Upg. 2Givet systemet

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

a) Antag att systemet återkopplas med en P-regulator med förstärkning K,0 ≤ K <∞. Rita rotort och ange för vilka värden på K som det återkopplade systemet är stabilt. Markera ocksåi rotorten det val av poler som ger snabbast möjliga stegsvar utan svängningar.

b) Antag att man istället använder en PI-regulator

u(t) = KP e(t) +KI

∫ t

0e(τ)dτ

Rita rotorten med avseende på KI , 0 ≤ KI <∞, då KP = 4.c) Vilka kvalitativa skillnader finns det mellan stegsvaren för de återkopplade systemen i uppgift a) och b)?

25

Page 30: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

4 Frequency Description4.1 A mercury thermometer can be described with high accuracy as a first order linear time invariant dynamic system. The

input is the real temperature and the output is the thermometer reading. In order to decide the transfer function ina thermometer it is placed in liquid where the temperature is varied as a sinusoid. The obtained result is shown inFigure 4.1a. Find the transfer function of the thermometer.

0

28

30

32

30.9

29.1

0.056 min

Period = 0.314 min

Transient Stationary state

Bath temperature

Thermometerreading

Figure 4.1a

δ

Ψ

Figure 4.2a

Σ F (s) Gr(s) Gs(s)+e u δ

Ψref Ψ

Figure 4.2b

4.2 We want to keep a ship on a given course, Ψ, with an automatic control system using the rudder angle δ. See Figure 4.2a.If ω denotes the angular velocity of the ship,

ω = Ψ (4.1)

the following differential equation is valid for small values of ω and δ,

T1ω = −ω +K1δ (4.2)

where T1 = 100 and K1 = 0.1. The desired course, Ψref , and the measured course, Ψ, are fed in to the auto pilot, whichgives the signal u to the rudder engine. Figure 4.2b shows a block diagram of the auto pilot. The auto pilot has thetransfer function

F (s) = K1 + s

a

1 + sb

, a = 0.02, b = 0.05

26

Page 31: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

while Gr is given byGr(s) = 1

1 + sT2, T2 = 10

and Gs(s) is defined by (4.1) and (4.2).

a) Make a Bode plot for the transfer function FGrGs, for K = 0.5.

b) At the testing of the auto pilot we do the following experiment. The gain of the auto pilot K is increased until thecontrol system oscillates with constant amplitude. At what value of K does this occur? What is the period timeof the oscillation?

c) Ψref is allowed to vary as a sinusoidΨref(t) = A sinαt

where A = 5◦ and α = 0.02. When the movements of the ship have stabilized we have

Ψ(t) = B sin(βt+ ϕ)

What values do B, β, and ϕ have if K = 0.5?

1

1

Re

Im

Figure 4.3a

4.3 a) In Figure 4.3a the Nyquist curve for a system is shown. Draw the Bode plot for the same system. The scale on theω-axis is not important, as long as the amplitude and phase curve are in agreement.

b) Draw a diagram for the poles and zeros for the system. The relative placement is important, not the scale.

4.4 Figure ?? shows the step responses (when the input is a unit step) and Bode gain plots of four different systems, inno particular order. Identify the pair of plots that belongs to each system. That is, for each step response, find thecorresponding Bode gain plot (amplitude curve). Motivate your answer by pointing out a set of unique features for eachsystem.

27

Page 32: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Step response Bode plot

A 1

0

1

B 1

0

1

C 1

0

1

D 1

0

1

Time Frequency

Figure 4.4a. All comparable diagrams have equal scaling.

4.5 a) Consider the transfer functions GA(s), GB(s), GC(s), GD(s), and GE(s) in Problem 2.6.

GA(s) = 1s2 + 2s+ 1 , GB(s) = 1

s2 + 0.4s+ 1

GC(s) = 1s2 + 5s+ 1 , GD(s) = 1

s2 + s+ 1

GE(s) = 4s2 + 2s+ 4

Study the amplitude curves of the Bode plots for the systems and find the static gain and bandwidth of the systems.In cases when it is relevant find also the resonance frequency and resonance peak.

b) Describe qualitatively (without formulas) the relationships between Tr (rise time) and ωB (bandwidth) and betweenM (overshoot) and Mp (resonance peak) respectively?

4.6 A system has the transfer function

G(s) = e−2s

s(s+ 1)What is the output (after transients) when the input is

u(t) = 2 sin(2t− 1/2)

4.7 For the systems below the input is chosen as u(t) = sin(2t). Determine the output signal y(t) after transients have fadedaway, provided that it exists.

a) Y (s) = 1s+1U(s)

b) Y (s) = 1s−1U(s)

c) Y (s) = 1(s+1)(2s+1)U(s)

28

Page 33: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

d) Y (s) = e−0.5s

s+1 U(s)

4.8 A system is described by Y (s) = G(s)U(s). Figure 4.8a shows u(t) = sin(ωt) and the corresponding output y(t) (afterall transients have faded away) for the frequencies ω = 1, 5, 10, and 20 rad/s (from top to bottom).

a) Determine the gain (|G(iω)|) and phase (argG(iω)) for the system for each value of ω.b) Determine the gain values in dB20 (20 log10(|G(iω)|)).c) Sketch the Bode plot using the values determined above.

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

-1

-0.5

0

0.5

1

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

-1

-0.5

0

0.5

1

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

-1

-0.5

0

0.5

1

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

-1

-0.5

0

0.5

1

Figure 4.8a. u(t) = sin(ωt) (solid) and y(t) (dashed).

4.9 Combine the transfer functions below with the Bode plots in Figure 4.9a.

G1(s) = 1s+ 1 , G2(s) = 6(s+ 1)

(s+ 2)(s+ 3)

G3(s) = 1s, G4(s) = 1

s(s+ 1)

G5(s) = 5s2 + 2s+ 5 (poles: − 1± i2)

29

Page 34: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1 1

Bode gain A Bode gain B

1 1

Bode gain C Bode gain D

1

Bode gain E

Figure 4.9a. All diagrams have equal scaling.

4.10 Figure ?? shows the Bode gain plots and step responses of four different systems, in no particular order. Identify thepair of plots that belongs to each system. That is, for each Bode gain plot (amplitude curve), find the correspondingstep response. Motivate your answer by pointing out a set of unique features for each system.

4.11 The pH in a biochemical reactor is controlled by addition of a base. The transfer function G(s) from added base to pHfor the open system has been determined by experiments to be

G(s) = 1.7(s+ 1)(0.7s+ 1)(0.5s+ 1)

In a attempt to control the pH the control structure shown in Figure 4.11a is employed

a) Make a Bode plot for the transfer function G(s).b) Assume that a P controller is used (F (s) = K). At what value of K does the pH start to oscillate with constant

amplitude?

30

Page 35: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Bode plot Step response

A1 1

0

B1 1

0

C1 1

0

D1 1

0

Frequency Time

Figure 4.10a. All comparable diagrams have equal scaling.

Σ F (s) G(s)+e u

yref y

Figure 4.11a

4.12 Consider the biochemical reactor in Figure 4.12a. It is desirable to control the concentration of biochemical material cX(output y) by manipulating the dilute flow qF (input u). A model of this system can be described as

Y (s) = 2e−5s

30s+ 1U(s)

where the time delay reflects the time it takes to measure the biochemical concentration. The bode digram of the systemis shown in Figure 4.12b.

a) For which values of K is a P controller going to stabilize the system?b) Construct a controller which has the crossover frequency ωc,d = 0.1 and no steady-state error.

4.13 Tentamenstal 2010-10-19 Upg. 1aDå man applicerar insignalen

u(t) = sin(2t), t ≥ 0

på ett första ordningens systemy(t) + ay(t) = bu(t), y(0) = y0

får man utsignaleny(t) = 2 sin(2t− π/4).

Bestäm systemparametrarna a och b samt initialvärdet y0.

31

Page 36: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

cX

u

qF

Figure 4.12a

0.050.10.2

0.512

−360◦

−270◦

−180◦

−90◦

0◦

10−3 10−2 10−1 100

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Figure 4.12b

32

Page 37: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

5 Compensation

Σ F (s)0.1

(s + 0.1)(s + 0.5)4

s2 + 0.4s + 4

Controller Motor Mechanical resonance

+−

ωref ω

Figure 5.1a

5.1 The block diagram for speed control of a DC-motor is shown in Figure 5.1a. Find a compensator F (s) such that thefollowing specifications are fulfilled.

• The system should be twice as fast as for F (s) = 1, but with the same damping as for F (s) = 1.• If ωref is constant, |ωref − ω| /ωref should be less than 5%.• The controller should not be unnecessarily sensitive for high frequency disturbances and the open loop system’slow frequency amplification should not be larger than necessary.

u

A

B

Figure 5.2a

5.2 The outflow temperature θ in the liquid A can be controlled in a heat exchanger by controlling the flow of the liquid Bby a valve with the setting denoted u. See Figure 5.2a. Measurements have been made using a sinusoidal input u andthe gain and phase shift have been measured at different frequencies. The results are given in the following table.

Frequency [rad/s] Gain Phase shift0.05 1.37 −67◦0.1 0.80 −106◦0.2 0.34 −153◦0.3 0.18 −185◦0.4 0.11 −210◦

a) Make a Bode plot for the system.b) What is the largest crossover frequency possible to achieve when using proportional control and wanting a phase

margin of at least 50◦?c) Suggest a compensator that doubles the speed compared to b) and still keeps the phase margin.

5.3 A hydraulic system with a valve and a piston is described by the following linearized transfer function

G(s) = ku/A

s( s2ω2

0+ 2ζ s

ω0+ 1)

where A is the area of the piston and ku the hydraulic gain.

33

Page 38: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

a) Make a Bode plot for the system when ω0 = 150 rad/s, ζ = 0.1, and ku/A = 20.b) What is the smallest value of the ramp error that can be achieved using proportional control if we want an amplitude

margin of 2? What is the crossover frequency in this case?c) Suggest a compensator such that the ramp error decreases 15 times at the same time as the crossover frequency,

phase margin and amplitude margin will be the same as in b). Due to physical constraints in the implementation,this regulator has to have finite amplification at all frequencies.

Σ F (s)km

s(1 + sTm)(1 + sTe)+e u

θref θ

Figure 5.4a

5.4 Figure 5.4a shows a position servo including a DC-motor. The extra time constant Te is due to the inductance in thewinding of the motor, which is usually not taken into account. The parameter values are km = 10, Tm = 0.1 andTe = 0.01. We want the servo to fulfill the following specifications:

• Rise time ≤ 0.1 s.• Overshoot ≤ 10%.• The steady state error at step in θref should be zero.• The steady state error when θref is a ramp with slope 10◦/s should be less than 0.1◦.

Suggest a compensator such that the specifications are fulfilled. (Clue: Suppose that the relationship between rise time,overshoot, and other specifications are the same as for a second order system, that is, according to Figures 5.4b and 5.4cin Solution 5.4 (the figures can also be found in Glad&Ljung).)

5.5 In Figure ?? we have arranged step responses and open loop and closed loop (feedback with −1) Bode plots for fivedifferent systems. Identify the three plots that belong to each of the five systems, one open loop and one closed loopBode plot and one step response. Motivate your answer by pointing out one unique feature for each system.

5.6 A DC-servo is described by the block diagram in Figure 5.6a, where T1 = 50 ms is a mechanical time constant, km = 10is a proportional constant, T2 = 25 ms is an electrical time constant, and T = 10 ms is an amplifier time constant. Thesystem is tested with F (s) = 1 and we find that the dynamic properties are satisfactory but that the system is somewhattoo slow. Find an F (s) so that the closed loop system is twice as fast as for F (s) = 1, without increasing the overshoot.F (s) should also give a closed loop system which fulfills the following accuracy demands:

• |θ − θref | ≤ 0.001 rad in steady state when θref is constant.• When θref is a ramp with slope 10 rad/s we should have |θ − θref | ≤ 0.01 rad in steady state.

5.7 The amplitude curves and the phase curves in Figure 5.7b have been measured for a system without poles in the righthalf plane. The system is controlled using feedback according to Figure 5.7a. Use the Nyquist criterion to decide forwhich values of K the closed loop system is stable (K > 0).

5.8 A block diagram for a control system with time delay is shown in Figure 5.8a. The system G1 has no poles in the righthalf plane.

a) G1 has a Bode plot according to the plot in Figure 5.8b. Determine for what values of the time delay T the closedloop system is stable.

b) The same as in a), but for the plot in Figure 5.8c.

34

Page 39: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Bode plotOpen loop system

Bode plotClosed loop system

Step responseClosed loop system

A1

0◦

-180◦

1 1

0

B1

0◦

-180◦

1 1

0

C1

0◦

-180◦

1 1

0

D1

0◦

-180◦

1 1

0

E1

0◦

-180◦

1 1

0

Frequency Frequency Time

Figure 5.5a. All comparable diagrams have equal scaling.

Σ F (s)1

1 + sT

km

s(1 + sT1)(1 + sT2)+e u

θref θ

Figure 5.6a

Σ K G(s)+−

Figure 5.7a

35

Page 40: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1

5

0.6

0.2

-180◦

-205◦

-160◦ -155◦|G

(iω)|

arg

G(i

ω)

ω [rad/s]

Figure 5.7b

Σ G1(s) e−sT+

Figure 5.8a

1

0.1

-180◦

1 5

|Go(i

ω)|

arg

Go(i

ω)

ω [rad/s]

40◦

Figure 5.8b

11.5

-180◦

5 7 108

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

80◦40◦

40◦

Figure 5.8c

36

Page 41: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Σ F (s) Amplifier Motor+e u

r y

Figure 5.9a

5.9 A servo system based on a DC-motor has to be designed. A block diagram for the system is given in Figure 5.9a. Bymeasuring the phase shift and the gain at different frequencies the Bode plot for the motor, see Figure 5.9b, has beendetermined. The amplification is a system of the first order, that is, it has the transfer function

GA(s) = kA

s+ a.

In order to find the constants kA and a, a unit step experiment has been carried out on the amplifier, giving the outputshown in Figure 5.9c.

a) Find the constants kA and a from Figure 5.9c. Also draw the Bode plot for the open loop system, that is, thesystem from u to y.

b) Find a compensator F (s), such that the closed loop system fulfills the following demands:� The system has to be 5 times as fast as when using F (s) = 1.� The overshoot should not be larger than for F (s) = 1.

10-3

10-2

10-1

100

101

-270◦

-180◦

-90◦

10-2 10-1 100

|Gm

(iω)|

arg

Gm

(iω)

ω [rad/s]

Figure 5.9b

0

0.2

0.4

0 2 4 6 8 10 12

y

t [s]

Figure 5.9c

37

Page 42: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

G11s

u y

Figure 5.10a

5.10 A system G(s) can be split into two sub-systems

G(s) = G1(s)1s

according to Figure 5.10a. The Bode plot for G1(s) is given in Figure 5.10b. Find a compensator for the system G(s)such that the following is fulfilled:

• The phase margin for the compensated system is 40◦.• The closed loop system is twice as fast as what is possible to achieve using proportional control with a 40◦ phase

margin.• The steady state error when the reference signal is a ramp is 1% of the corresponding error with proportional

control and 40◦ phase margin.

10-2

10-1

-180◦

-90◦

0◦

10-2 10-1 100 101 102

|G1(i

ω)|

arg

G1(i

ω)

ω [rad/s]

Figure 5.10b

5.11 The Bode plot for a system is given in Figure 5.11a.

a) Draw the Nyquist curve of the system.b) Assume that the system is controlled using the proportional feedback

U(s) = K(R(s)− Y (s))

For which K > 0 is the closed loop system asymptotically stable?c) Assume that we choose K = 2 in the proportional controller in problem b). What will the steady state error be

when r(t) = 10t?d) Assume that y(t) is delayed T seconds. How large is T allowed to be in order for the system to still be asymptotically

stable with K = 2?

38

Page 43: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0.01

0.1

1

10

100

-210◦

-180◦

-150◦

-120◦

-90◦

10-2 10-1 100 101

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Figure 5.11a

5.12 a) A plot of the amplitude curve of a stable transfer function Go(s) is given in Figure 5.12a. Choose one of thefollowing alternatives regarding the stability of the closed loop system Go

1 +Go:

1. It is stable.2. It is not stable.3. Impossible to determine given these facts only.

b) Repeat for the transfer function whose amplitude curve is given in Figure 5.12b. Justify your answers carefully.

10−1

100

10−2 10−1 100 101 102

|Go(i

ω)|

arg

Go(i

ω)

ω [rad/s]

?

Figure 5.12a

39

Page 44: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

10−1

100

10−2 10−1 100 101 102

|Go(i

ω)|

arg

Go(i

ω)

ω [rad/s]

?

Figure 5.12b

5.13 Consider the relationY (s) = G(s)U(s)

whereG(s) = 725

(s+ 1)(s+ 2.5)(s+ 25)

a) Assume that the system is controlled by

U(s) = F (s)(R(s)− Y (s))

where F (s) = 1. Find ωc, ωp, ϕm, and Am for the loop gain.

b) Compute a regulator such that the open loop system fulfills the following requirements:(i) ωc = 5(ii) ϕm ≥ 60◦

and the closed loop system fulfills:(iii) e0 = 0Draw the Bode plot of the compensated open loop system and check that the requirements are satisfied. Simulatethe closed loop system for a step in the reference signal and plot the step response. Check that the requirement onthe steady state error is satisfied.

c) Draw the amplitude curve of the Bode plot of the closed loop system with and without the compensator. Describehow the properties of the closed loop system have been changed by the compensation.

d) Simulate the control error when the reference signal is a ramp and the regulator designed in b) is used. Is thestationary error zero?

5.14 When using microorganisms in production it is important to keep the oxygen concentration at a certain level to getmaximum productivity. There are many ways to control the amount of dissolved oxygen, in this example we will use the

40

Page 45: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

speed of stirring as the controlled signal. The transfer function from the stirrer speed N∆ to the oxygen measurementOp∆ becomes (linearized model)

G(s) = b

s+ T1

e−sτ

1 + sT2

The parameters τ = 2 s, T2 = 20 s and b = 0.02 remain constant with change in stirrer speed while T1 can vary from0.02 s−1 to 0.224 s−1 as the stirrer speed increases from 400 r/min to 1200 r/min. A Bode plot for G(s) is given inFigure 5.14a. Construct a controller, for the 1200 r/min case, which has a crossover frequency ωc = 0.2 rad/s, a phasemargin ϕm = 60◦ and no steady-state error.

10-3

10-2

10-1

100

-360◦

-270◦

-180◦

-90◦

0◦

10-3 10-2 10-1 100 101

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

G400

G1200

G400

G1200

Figure 5.14a. Solid line: 400 r/min. Dash-dotted line: 1200 r/min.

5.15 A read/write head of a hard disk is mounted on a mechanical arm which is moved by a motor. The system from motorinput voltage to the angle of the arm is modelled by

Y (s) = 5τ1s+ 1 ·

0.05s(τ2s+ 1)U(s)

where Y and U are the Laplace transforms of the output and input respectively. The numerical values of the constantsare τ1 = 10−3 och τ2 = 0.05. The Bode plot of the system is given in Figure 5.15a.

a) To begin with, assume that the arm is controlled using proportional feedback,

U(s) = K(R(s)− Y (s))

What are the step and ramp error coefficients (often referred to as e0 and e1)? For what values of K are theydefined?

b) Compute a controller,U(s) = F (s)(R(s)− Y (s))

for the same system, such that the resulting system fulfills the following requrements:� e0 = 0� e1 ≤ 0.001� ωc = 100 rad/s� ϕm ≥ 50◦

5.16 Tentamenstal 2009-06-10 Upg. 3Processer hämtade från kemisk industri kan ofta förenklat beskrivas av ett första ordningens system med tidsfördröjning.Ett exempel på ett sådant system är

G(s) = 2s+ 1e

−0.25s

Man börjar med att reglera systemet med en P-regulator med K = 1/√

2. Fasmarginalen för detta fall är acceptabelmen systemet blir för långsamt.

41

Page 46: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

10-4

10-3

10-2

-180◦

-150◦

-120◦

-90◦

101 102

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Figure 5.15a

För att upprätthålla produktkvalitén kräver man att utsignalens värde stationärt inte avviker mer än 5% procent fråndet konstanta börvärdet.

Bestäm en regulator F (s) så att skärfrekvensen fördubblas jämfört med P-regleringen ovan, samt att de stationärakraven uppfylls. Systemet skall ha samma fasmarginal som vid den rena P-regleringen.

5.17 Tentamenstal 2011-06-10 Upg. 4Betrakta ett system med överföringsfunktion

G(s) = k1

(s+ a)(s+ b)(s+ c) ,

där k1 = 100, a = 3, b = 6 och c = 100. Bodediagrammet för G(s) visas i Figur 5.17a.

a) Designa en fasavancerande och fasretarderande kompenseringslänk för G(s) så att skärfrekvensen blir 30 rad/s,fasmarginalen blir 40◦, och statiska felet då referenssignalen är ett enhetssteg blir noll.

b) Antag nu att det finns en tidsfördröjning i systemet så att öppna systemets verkliga överföringsfunktion ges avG0(s) = G(s)e−Tds. För vilka värden på Td är slutna systemet stabilt då regulatorn från Uppgift a) används?

c) En regulator har nu designats för G(s) och förstärkningen för det resulterande slutna systemet Gc(s) återges iFigur 5.17b. För att reducera översvängen då steg i referenssignalen appliceras införs ett förfilter Fr(s) = 1

1 + τsså att överförings-funktionen från referens till utsignal blir G0

c(s) = Gc(s)Fr(s).

Uppskatta det minsta värdet av τ som kommer att påverka systemets snabbhet vid steg i referenssignalen.

42

Page 47: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

10−3

10−2

10−1

100

Ma

gn

itu

de

(a

bs)

10−1

100

101

102

−270

−225

−180

−135

−90

−45

0

Ph

ase

(d

eg

)

Frequency (rad/sec)

Figure 5.17a

100

101

102

103

10−3

10−2

10−1

100

101

Magnitude (

abs)

Frequency (rad/sec)

Figure 5.17b

43

Page 48: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

6 Sensitivity and Robustness

Σ K1

s(s + 1)Σ+

e u+

+

r = 0 y

v

Figure 6.1a

6.1 Consider the control system in Figure 6.1a where v(t) is a sinusoidal disturbance, v(t) = sin(t). Compute the absolutevalue of the sensitivity function at ω = 1 rad/s as a function of K. How must K be selected if the amplitude of y(t)shall be less than the amplitude of v(t) at this frequency?

Σ F (s) G(s)+e u

r y

Figure 6.2a

6.2 Assume that we have constructed a controller F (s) for the model G(s), see Figure 6.2a, such that there is no steadystate error when the reference signal is a step. Let the real system be given by

G0(s) = (s+ 1)G(s)

and assume that G0(s)→ 0, s→∞. Also assume that the amplitude curve of the closed loop system has no resonancepeaks and decreases, at least and asymptotically, with 20 dB20/decade for frequencies over the bandwidth. What is thehighest possible bandwidth we can use for the closed loop system in Figure 6.2a, while at the same time guaranteeingstability?

−1

Re

Im

Go

Figure 6.3a

Σ GO Σ+ +

+

y

v

Figure 6.3b

6.3 Figure 6.3a shows a Nyquist diagram for the loop gain Go. Show in a figure for what frequencies (that is, for what partof the Nyquist curve above) additive disturbances on the output are amplified in the sense that the output amplitudeof the control system in Figure 6.3b is larger than the disturbance amplitude.

44

Page 49: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Σ F (s) G0(s)+e u

r y

Figure 6.4a

6.4 Consider the control system in Figure 6.4a. The true system, denoted G0(s), is modeled as

G(s) = 1s+ 10

The controllerF (s) = s+ 10

s

gives an asymptotically stable closed loop system with the model G(s). Now assume that the system is given by

G0(s) = G(s)(1 +G∆(s))

where it is known that G∆(s) has no poles in the right half plane, and that

|G∆(iω)| < 0.9√1 + ω2

Can we be sure that the closed loop system is asymptotically stable?

6.5 A process is described by the model G(s), while the process in reality has the transfer function

G0(s) = e−sTG(s)

a) Draw the absolute value of the inverse of the relative model error, that is,

1|G∆(iω)|

b) Assume that we design a controller F (s) starting with the model G(s). How large may∣∣∣∣ F (iω)G(iω)1 + F (iω)G(iω)

∣∣∣∣be at most, in order to guarantee asymptotic stability of the closed loop system for all values of T , when thecontroller F (s) is used on the system G0(s)?

Σ K1

s(s + 5)Σ+

e u+

+

r = 0 y

v

Figure 6.6a

45

Page 50: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

6.6 Consider the control system in Figure 6.6a.

a) Assume that the real system is given byG0(s) = G(s) + G(s),

whereG(s) = 1

s(s+ 5)

and let K = 25/2. Use the robustness criterion to obtain a condition on∣∣G(iω)

∣∣ that guarantees stability in theclosed loop system. Does G(s) = 1 fulfill the conditions?

b) Now let G(s) = α where α is a scalar. Calculate the characteristic equation for the closed loop system and decidefor which α the system is stable. Does this contradict the condition from the robustness criterion?

10-1

100

10-1 100 101

|Gc(i

ω)|

ω [rad/s]

Figure 6.7a

6.7 A DC-motor is assumed to have the transfer function

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

and it is controlled using proportional feedback,

U(s) = F (s)(R(s)− Y (s))

where F (s) = 4. The amplitude curve of the feedback system

|Gc(iω)| =∣∣∣∣ F (iω)G(iω)1 + F (iω)G(iω)

∣∣∣∣is given in Figure 6.7a. Assume that the real system is given by

G0(s) = G(s) α

s+ α, α > 0

and the controller F (s) is used on the system G0(s).

a) Draw a root locus with respect to α for the characteristic equation of the closed loop system and determine forwhich α the closed loop system is asymptotically stable.

b) Use the robustness criterion to decide for which α the closed loop system is asymptotically stable.c) Comment on the possible differences in the demands on α in a) and b).

6.8 A system G0(s) is controlled using a regulator F (s). In Figure 6.8a the amplitude part the Bode plot of the nominalclosed loop system,

Gc(s) = F (s)G(s)1 + F (s)G(s)

is shown. Assume Gc is stable, and that G and G0 have the same number of poles in the right half plane. The modeluncertainty G∆(s), defined by

G∆ = G0 −GG

is assumed bounded by |G∆(iω)| ≤ γω. In what interval must γ lie to guarantee stability of the closed loop system?

46

Page 51: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

10-3

10-2

10-1

100

101

10-1 100 101

|Gc(i

ω)|

ω [rad/s]

Figure 6.8a

GOΣ Σ

Σ

+u

+

+

+−+

r

n

v

y

Figure 6.9a

6.9 Consider the system in Figure 6.9a. For r(t) = 0, n(t) = 0 and v(t) = sin t the steady-state output is given by

y(t) = 1√2

sin(t− π

4 )

Determine the steady-state output y(t) when r(t) = 0, v(t) = 0 and n(t) = sin t.

6.10 Recall the model that was used in the design of a lead-lag controller using Matlab in Problem 5.13. Assume that thetrue system contains a time constant that was neglected, and that the transfer function of the system is given by

G0(s) = G(s) 1s+ 1

a) Determine the relative model error G∆(s).

b) Draw 1|G∆(iω)| and

∣∣∣ F (iω)G(iω)1+F (iω)G(iω)

∣∣∣ in a Bode plot, when G(s) is given by

G(s) = 725(s+ 1)(s+ 2.5)(s+ 25)

for the two cases F (s) = 1 and F (s) being the controller designed in Problem 5.13. What can be said about therobustness of the closed loop system in these two cases when F (s) is used for control of the “true” system G0(s)?One possible solution to the design problem in Problem 5.13 was the controller

F (s) = 0.45 · 5 · s+ 2.2s+ 11 ·

s+ 0.5s

Σ F (s) G(s)+e u

r y

Figure 6.11a

6.11 Consider the control system in Figure 6.11a. The controller F (s) = 2 gives the Bode plot of the loop gain F (iω)G(iω)shown in Figure 6.11b. The Bode plot of the sensitivity function is shown in Figure 6.11c. The reference signal isr(t) = 2 sin 0.1t. Determine the amplitude of the error in steady state.

6.12 In Problem 5.14 we saw how the amount of dissolved oxygen depends on the stirring speed. A lead-lag controller wasdesigned for the model linearized around 1200 r/min. Check if this controller also stabilizes the system when the stirringspeed is 400 r/min.

47

Page 52: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

-40 dB20

-20 dB20

0 dB20

20 dB20

-270◦

-180◦

-90◦

10-1 100 101

|Go(i

ω)|

arg

Go(i

ω)

ω [rad/s]

Figure 6.11b

-30 dB20

-20 dB20

-10 dB20

0 dB20

10 dB20

-30◦

0◦

30◦

60◦

90◦

10-1 100 101

|S(i

ω)|

arg

S(i

ω)

ω [rad/s]

Figure 6.11c

6.13 Consider the connected tank system in Figure 6.13a where u is the inflow to the upper tank and y is the level in thelower tank. The system can approximately be described by the following transfer function

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

The level in the lower tank is controlled by a P controller;

U(s) = K(R(s)− Y (s))

The goal of the control is to minimize the influence of the disturbance v. This has been formalized as the followingdemand on the system:

|S(iω)| ≤ 0.1

at ω = 1, where S(s) denotes the sensitivity function. How must K be selected if the demand should be satisfied?

6.14 Tentamenstal 2011-10-17 Upg. 5abSystemet

G0(s) = 1(s− 1)(εs+ 1) , ε ≥ 0

regleras med PI-regulatorn

u(t) = 3[e(t) + 13

∫ t

0e(τ)dτ ], e(t) = [r(t)− y(t)]

48

Page 53: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

y

v

u

Figure 6.13a

a) Härled överföringsfunktionen från referenssignal r(t) till utsignal y(t) och rita en rotort för det slutna systemetetspoler som function av ε ≥ 0. För vilka värden på ε ≥ 0 är det återkopplade systemet stabilt?

b) Använd istället robusthetskriteriet (Resultat 6,2, sidan 125 i kursboken) med nominell modell

G(s) = 1s− 1

för att avgöra för vilka ε ≥ 0 vi kan garantera att det verkliga slutna systemet enligt uppgift a) är stabilt.Amplitudkurvan för motsvarande komplementera känslighetsfunktion, dvs |T (iω)|, är given i Figur 6.14a. Deträcker med att använda approximativa metoder för att svara på denna uppgift.

10−2

10−1

100

101

10−0.5

10−0.4

10−0.3

10−0.2

10−0.1

100

100.1

100.2

Magnitude (

abs)

Bode Diagram

Frequency (rad/sec)

Figure 6.14a

6.15 Tentamenstal 2010-12-14 Upg. 5abFör det återkopplade systemet i Figur 6.15a definieras känslighetsfunktionen S(s) och slutna systemets överföringsfunk-tion Gc(s) som

S(s) = 11 +Go(s)

och Gc(s) = Go(s)1 +Go(s)

,

där Go(s) är det öppna systemets överföringsfunktion.

a) Förklara hur |S(iω)| påverkar ett återkopplat systems förmåga att undertrycka en additiv störning v till utsignalen,samt hur |Gc(iω)| påverkar ett återkopplat systems förmåga att undertrycka mätbrus n. Kan både störningen ochmätbruset undertryckas godtyckligt mycket samtidigt? Motivera ditt svar.

b) Visa att om r är ett steg så blir statiska reglerfelet noll ifall S(s) har alla poler strikt i vänstra komplexa halvplanetoch ett nollställe i origo.

49

Page 54: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

GOΣ Σ

Σ

+u

+

+

+−+

r

n

v

y

Figure 6.15a

50

Page 55: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

7 Special Controller Structures

Cooling water

GR1 GR2

θ

θm

w

θref

u

Figure 7.1a

7.1 To control the temperature θ in a chemical reactor, the control system in Figure 7.1a is used, where θref is the desired(reference) temperature. The temperatures θ and θm in the reactor and the cooler, respectively, are measurable and canbe used to control the valve u. The structure of the control system is given by Figure 7.1b. It is here assumed that bothGR1 and GR2 are P controllers.

a) Let K2 = 9 and draw the Bode plot of the transfer function from w to θ. Then choose K1 so that the gain marginAm = 2. What are the gain crossover frequency ωc and the steady-state error, if we assume that θref is changedstepwise?

b) Suppose that we make a simple feedback loop instead, see Figure 7.1c. How is the Bode plot affected? Again,choose K1 so that the gain margin Am = 2, and determine the gain crossover frequency ωc and the steady-stateerror. Compare with a) with respect to steady-state errors and response times. Conclusions?

K2ΣK1Σ1

10s + 11

(30s + 1)(3s + 1)

GR1GR1 GR2GR2

Valve andcooling jacket

Valve andcooling jacket Wall and liquidWall and liquid

+w+

u θm

−−

θref θ

Figure 7.1b

51

Page 56: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

K1Σ1

10s + 11

(30s + 1)(3s + 1)

Valve andcooling jacket

Valve andcooling jacket Wall and liquidWall and liquid

+u θm

θref θ

Figure 7.1c

hTankP-controller

Feed-forward

x

Inflow

Valve

u

v

Pump

Figure 7.2a

7.2 A level control system for a water tank is shown in Figure 7.2a, where all variables denote offsets from an operationpoint. The inflow, x(t), to the tank is determined by the valve, and the outflow, v(t), is determined by the pump. StuDent has got the assignment to keep the water level in the tank constant, in spite of variations in the outflow v(t).First, Stu determines the transfer function Gv(s) from the valve to x(t). By step response experiments, he obtains thefollowing result:

Gv(s) = 10.5s+ 1

a) Because the disturbance v(t) is measurable, Stu first considers a feedforward compensator to completely eliminateit. Stu, who also knows that it is dangerous to differentiate the disturbance, cancels all the derivative terms in thecompensator. Compute the feedforward compensator, and determine the response h(t) Stu will get, if the outflowv(t) is changed stepwise with an amplitude of 0.1.

b) To improve the control system, Stu also introduces a proportional feedback of the water level h. What is thesteady-state error in the level h now, if the outflow is changed in the same way as in a)?

7.3 Consider the following system

Y (s) = 2s+ 3U(s) + 3

s+ 4V (s)

where u is the control signal, y is the output and v is a disturbance. It is desired that y should be as small as possibledespite the disturbance v.

a) Design a feedforward controller from v to u that eliminates the influence of v on y.b) Assume that v is a pure sinusoid with amplitude 2. How large will the control signal be?c) The real system is described by

Y (s) = b

s+ 3U(s) + 3s+ 4V (s)

52

Page 57: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Figure 7.5a

where b value is not exactly known but has its value close to 2. To solve this problem a P controller is added tothe feedforward controller that was designed in a). The full controller looks like

U(s) = −KY (s) + Ff(s)V (s)

where Ff(s) is the feedforward controller. What is the stationary error if v = 1?

7.4 The transfer function for a temperature control system is given by

Y (s) = 3s+ 1U(s) + 4

(s+ 2)(s+ 5)V (s)

where y is the controlled temperature, u is the supplied power and v is the temperature of the surroundings. Assumethat the desired temperature is zero.

a) Design a feedforward controller U(s) = Ff(s)V (s) which eliminates the influence of the disturbance v on y.

b) To simplify implementation Ff(s) is replaced with a constant, Ff = Ff(0). Assume that v is given by v(t) = −1−0.1tand that U(s) = FfV (s) is used. What will y(t) be in steady state?

c) The previous controller is now extended with a P controller:

U(s) = FfV (s)−KY (s)

What will now y(t) be in steady state?d) Assume that one only uses the P controller

U(s) = −KY (s)

What will now y(t) be in steady state?

7.5 Tentamenstal 2011-06-10 Upg. 1ab

a) I Figur 7.5a visas en process och en regulator med både framkopplings- och återkopplings-länkar. Härled (uttrycki G1(s), G2(s), Fy(s), Fr(s) och Ff (s))i) överföringsfunktionen från referenssignalen r till utsignalen y,ii) överföringsfunktionen från störsignalen d till utsignalen y.

b) Antag att processen i Figur 7.5a har överföringsfunktionerna G1(s) = s+ 2s2 + 2s+ 1 och G2(s) = 1

s+ 3 . Ta framen lämplig framkoppling Ff (s) för att eliminera inverkan av störningen d. Diskutera även hur du enkelt kanimplementera framkopplingen om målet är att eliminera konstanta störsignaler i stationäritet.

53

Page 58: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8 State Space Description8.1 Define suitable state space variables for the DC motor discussed in Problem 2.1, and write the system in state space

form.

z

m

θ

l

Figure 8.2a

8.2 Consider the system illustrated in Figure 8.2a. It consists of a hinge that can move in the direction marked “z”, and athereto attached pendulum. The system is described by the equation

`θ + g sin θ + z cos θ = 0

Define state space variables, input, and output as

x1 = θ x2 = θ u = z/` y = θ

andω2

0 = g/`

Linearize the system around the equilibrium point given by

x1 = π x2 = 0 u = 0

K1 Σ1s

Σ1s

K2 Σ1s

Mi

+z+

θ+

Ma−

− +i y

Ml

Figure 8.3a

8.3 The block diagram in Figure 8.3a describes an electric motor that drives a load via an elastic axis. Here i is the drivingcurrent to the motor, which gives the torque Mi. z is the turning rate of the motor and y is the turning rate of the load.θ is the angle of the transmission axis. Ma = K2θ is the torque this angle causes. Ml is the torque from the load. Givea state space description for the system with Ml and i as inputs and y as output. (There are at least two different waysto solve this problem.)

8.4 Write the following systems in state space form.

a)d3y

dt3 + 6d2y

dt2 + 11dydt + 6y = 6u

54

Page 59: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b)d3y

dt3 + d2y

dt2 + 5dydt + 3y = 4d2u

dt2 + dudt + 2u

c)

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

Use for example controllable or observable canonical form or diagonal form.

8.5 A system has the impulse response (weight function)

g(t) = 2e−t + 3e−4t

Write the system in state space form.

8.6 Consider the system

x =(−2 10 −3

)x+

(11

)u

y =(−1 2

)x

Compute the transfer function of the system.

8.7 Consider the system

x(t) = Ax(t) +Bu(t)y(t) = Cx(t)

The input is being held constant, u = u0, for the time t0 ≤ t ≤ t0 + T .Give a relation between x(t0), x(t0 + T ), y(t0), y(t0 + T ) and u0.

q1

Inflow

u1

q2

Inflow

u2

hTank

q

Figure 8.8a

55

Page 60: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8.8 Consider the tank in Figure 8.8a. The tank can be filled from two different pipes, where the flows q1 and q2 aredetermined by the valve settings u1 and u2. If q1, q2, u1, u2, and h denote the deviation from a nominal value, we getthe linearized equation

h+ 1τh = u1 + u2

where τ = 1. It is desired that the level should follow a reference value href and that q1 and q2 should be of approximatelythe same size. Therefore two PI controllers are used so that

u1 = (href − h) +∫ t

0(href − h) dτ (8.1)

u2 = (href − h) +∫ t

0(href − h) dτ (8.2)

a) Introduce the state variable x1 = h, and let x2 and x3 represent the integrals in (8.1) and (8.2) respectively. Derivea state space description of the closed loop system with href as input and h as output.

b) Verify that the closed loop system is unobservable and that the unobservable subspace is spanned by the vector 01−1

Give a practical interpretation of this phenomenon.

c) The level is measured by two different sensors, and due to the poor accuracy in the first sensor it delivers the levelsignal together with an error. The equation of the first regulator can hence be written

u1 = −(h+ n) +∫ t

0−(h+ n) dτ (8.3)

where it for simplicity has been assumed that href = 0. The second regulator is then given by

u2 = −h+∫ t

0−hdτ (8.4)

Modify the state space model by letting the measurement disturbance be the input to the state space model of theclosed loop system.

8.9 Consider the system

x =(−1 12 −3

)x+

(11

)u

Is it possible to control the system from the origin to x =(1 3

)T within 4 seconds?

8.10 Give the dimensions of the controllable and unobservable subspaces to the systems below. Give also the controllableand unobservable subspaces.

a)

x =

−2 0 00 −1 10 0 −3

x+

1−12

u

y =(1 3 1.5

)x

b)

x =

−1 0 01 −2 00 0 −4

x+

04−2

u

y =(0 3 0

)x

56

Page 61: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8.11 A state space representation of

G(s) = 1s+ 1

is given by

x =(−1 00 2

)x+

(11

)u

y =(1 0

)x

a) Compute x1(t) x2(t) and y(t) if x(0) = 0 and

u(t) ={

0, t < 01, t ≥ 0

b) Is the system asymptotically stable? Input-output-stable?c) Examine the controllability and observability for the system.d) Explain why the realization is not suitable for simulating a system whose transfer function is G(s).

8.12 Compute the poles and zeros of the system

x =(

1 −12 1

)x+

(10

)u

y =(1 1

)x

z

m

l

m

αl

ϕ

Figure 8.13a

8.13 Two mathematical pendulums are mounted on a trolley. They are mounted so that they can move without friction ina plane coinciding with the direction of movement for the trolley. The lengths of the pendulums are ` and α` and theirmasses are m. For one pendulum we have

z cosϕ+ ϕ` = g sinϕ

a) Linearize the system to the left in Figure 8.13a around ϕ = 0 and put the constants `, m, and g to 1 and write theequations in the form x = Ax+Bu.

b) Give the values on α for which the system is controllable. Give a practical motivation.

57

Page 62: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1s + 1

1s + 3

Σ

Σ+

x1

+

x2++

u y

Figure 8.14a

8.14 A system is given by the block diagram in Figure 8.14a. Derive a state space model of the system, with the state spacevariables given in the figure.

8.15 The substances A and B react according to, 3A→ B, in a tank. The reaction speed is given by rA = −k1c3A. The inflow,

q to the tank has concentration cA,in. The tank volume V and the in- and outflow can be considered constant.

a) Determine the dynamical mass balance for the components A and B in the form of differential equations.b) Linearize the differential equations around a stationary point, c∗A, c∗B, c∗A,in, and use the state space representation

dxdt = Ax+Bu

y = Cx+Du

where the state x consists of the deviations cA,∆ and cB,∆ of the concentrations. The input signal u is the deviationcA,in,∆ in the inflow concentration and the output signal y is the deviation BcB,∆ in concentration of component.

8.16 Tentamenstal2008-12-20 Upg. 5Studera det olinjära systemet

y(t) = −y(t)u(t) + v

med insignal u(t), utsignal y(t) och där v är en okänd konstant positiv störning (v > 0). Målet är att konstruera enregulator, som håller utsignalen y(t) på en given konstant nivå y(t) = y0, y0 > 0.

a) Linjärisera systemet runt motsvarande stationära punkt.b) Uppgiften är att konstruera en regulator så att det återkopplade linjäriserade systemet med styrlag

U(s) = F (s)E(s), F (s) = KτIs+ 1τIs

, e(t) = y0 − y(t)

är stabilt för alla positiva värden på den okända störningen v.

Visa att det är möjligt samt ange ett val av −∞ < K <∞och τI > 0.

8.17 Tentamenstal2011-12-17 Upg. 4abcBetrakta systemet

x1(t) = x1(t) + u(t)x2(t) = −2x1(t) + αx2(t)− u(t)y(t) = x2(t).

a) För vilka värden på α är det öppna systemet (d.v.s. då u(t) = 0 för alla t) asymptotiskt stabilt?b) För vilka värden på α är systemet observerbart?c) För vilka värden på α är systemet styrbart?

58

Page 63: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9 State Feedback9.1 Consider the system

x =(−2 −11 0

)x+

(10

)u

y =(1 0

)x

a) Calculate a state feedback that places the poles in I) {−3, −5 }, II) {−10, −15 }. What limits the possibility toachieve arbitrary dynamics of the closed loop system?

b) Suppose only the output is measured. Calculate an observer that makes the transfer function from the referencesignal to the output the same as in a). Discuss the influence of the poles of the observer.

Figure 9.2a

9.2 Figure 9.2a shows the Lunar Excursion Module from the Apollo project. Consider the module hovering a short distanceabove the surface of the moon using its main engine. If the pitch angle of the module (angle between the vertical lineand the direction of movement) differs from zero, a horizontal component of the force is obtained and the module isaccelerating along the surface.We will study a block diagram which shows the connection between the input u (the control signal to the attitudethrusters), the pitch angle θ and the position coordinate z. See Figures 9.2b and 9.2c.The module is both in the θ-direction and in the z-direction obeying Newton’s law of motion without any kind ofdamping. The transfer function from the control signal of the astronaut (yref) to velocity z is

K1K2

s3

which is very difficult to control by hand.

a) Write the system in state space form.

z

θ

Directionof motion

Attitudethrusters

Figure 9.2b

59

Page 64: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Σ K11s

1s

K21s

1s+

u θ θ θ z zyref z

m1 m2 m3

Feeback

Figure 9.2c

b) In order to make the control duty of the astronaut easier we change the dynamics of the module by making internalfeedback. The following signals are measurable:m1, the attitude angular velocity measured using rate gyro.m2, the acceleration in z-direction measured using accelerometers positioned on gyro-stabilized platforms.m3, the velocity in z-direction measured using doppler-radar.Calculate a state-feedback using these signals such that the closed loop system obtains its poles in s = − 1

2 and thecontrol signal of the astronaut becomes the reference signal of the velocity in z-direction.

c) Suppose we by safety reasons are interested in the possibility of controlling the module even if the sensors measuringm1 and m2 are not working. Design a controller that can handle this and has approximately the same behavior asin a).

9.3 A DC motor with an external load, T , is described by

ω = θ

ω = −1τω + c1u+ c2T

where θ is the angle, ω the angular velocity, u the control signal, T the torque of the load, and c1, c2, and τ are constants.

a) Introduce a controlleru = l0θref − l1θ − l2ω

such that the poles of the closed loop system becomes 1τ (−1 ± i) and θ = θref in steady-state if T = 0 and θref is

constant.b) Introduce a modified controller

u = l0θref − l1θ − l2ω + u′

such that θ = θref in steady-state even for constant non-zero T and constant θref .

9.4 A system can be described in state space form as

x =(

0 00 −1

)x+

(11

)u

y =(1 −1

)x

We want to place the poles in {−2, −3 }. Suggest an observer, and use a linear state feedback controller. Which arethe poles of the closed loop system?

9.5 Is it possible to design an observer with poles in { -5, -6, -7, -8 } for the system below? Motivate your answer.

x =

0 1 1 10 0 1 10 0 0 10 0 0 1

x+

110−32

u

y =(1 0 0 0

)x

60

Page 65: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

u1 x1 x2 x3 u2

Figure 9.6a

9.6 We want to control the temperature in a long copper rod by heating or cooling its endpoints. Principally, this problemis described by a partial differential equation. To simplify the problem we assume that the temperature profile in therod can be approximated by the temperatures x1, x2, and x3 at three points. The temperatures in the end points arethe inputs, u1 and u2. All temperatures are relative to the temperature of the surroundings.We get the following ordinary differential equations:

x1 = α(u1 − x1) + α(x2 − x1)x2 = α(x1 − x2) + α(x3 − x2)x3 = α(x2 − x3) + α(u2 − x3)

where α is a constant that depends on the coefficient of thermal conductivity and the specific heat of the rod. Forsimplicity, let α = 1. Consider the problem of controlling the temperature in x1, x2, and x3 with u1 only, assumingu2 = 0.

a) Assume that we want to have an arbitrary temperature profile, that is, arbitrary values of x1, x2, and x3. Is thispossible? Why/why not?

b) Assume that all the temperatures x1, x2 and x3 are measurable. Find a state feedback that brings any initial stateto zero as e−3t.

c) Assume that only one of the temperatures x1, x2, or x3 is measurable, and that we still want a controller whichdamps a disturbance as e−3t by using an observer. The sensor can be placed so that any of the three values x1,x2, or x3 is measured. Which choices of measure point make it possible to control the system as desired? Givea motivation. Choose one of the points making the wanted design possible and design a controller, that is, anobserver and a state feedback, giving the desired error damping.

9.7 Consider the lunar excursion module in Problem 9.2. Suppose that there are no rate-gyro measurements available butthat the sensors measuring m2 and m3 are still working.Show how m1 can be reconstructed from u and measurements of m2 such that the reconstruction error decreasesarbitrarily fast without differentiation of any of the measured signals.Propose a filter and describe the resulting controller when the feedback consists of both measured and reconstructedstates as in Problem 9.2.

61

Page 66: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

hTankh

TocontrollerFrom

controller

q

InflowTo

controller

Valve

u

v

Tocontroller

Pump

Figure 9.8a

9.8 In Figure 9.8a a level control system for a tank is shown. The objective is to keep the level at a desired value. Let u,h, q, and v denote small variations around the desired working point. The inflow, q, to the tank is determined by thevalve, u, calculated by the controller. The outflow v is determined by the pump and deviations from zero is consideredas process noise. The valve has some dynamics, which is modeled with the transfer function

Q(s) = k1

1 + TsU(s)

where k1 = 1 and T = 0.5. The level is given byAh = q − v

where the tank cross-section area is A = 1m2.

a) Let q and h be state variables and give a corresponding state space model of the process. Compute a state feedbacku = −l1q − l2h+ r, such that the closed loop system poles both are at −2.

b) How large is the steady-state level error for a constant disturbance v = 0.1 if r = 0?c) Consider the closed loop system in a) and compute a feedforward control law from v to r such that the influence

from v is completely eliminated. Exclude all terms in the control law in which v is differentiated to make itimplementable. How does this modified feedforward control law work? Steady-state level error?

d) Suppose that k1 differs slightly from 1, but that the same control law as in c) is used (the control law derived underthe assumption k1 = 1). What happens with the steady-state level error?

e) Propose a modified control law such that the stationary level error is zero for constant disturbances regardless ofsmall deviations from the nominal value of k1.

62

Page 67: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Plant

ObserverL

Σ+−

u

x

r y

Figure 9.9a

9.9 We want to control the system

x =(

0 10 0

)x+

(01

)u

y =(1 0

)x

with a state feedback. (This can be interpreted as a moving vehicle in one dimension, where x1 is the position, x2 is thevelocity, and the acceleration is the control signal.) We introduce the control law

u(t) = −Lx(t) + r(t)

where x is constructed by an observer˙x = Ax+Bu+K(y − Cx)

We choose the vectors K and L as L =(1 2

)and KT =

(4 4

). These choices put the eigenvalues of A − BL in −1

and the eigenvalues of A −KC in −2. A block diagram of the closed loop system is shown in Figure 9.9a. Due to atime delay, the real input is given by the equation

u(t) = −Lx(t− T ) + r

What is the largest possible time delay T without the closed loop system getting unstable?

9.10 One wants to construct an observer for the system

x(t) =(−1 1a −2

)x(t) +

(11

)u(t)

y(t) =(2 1

)x(t)

a) Suppose a = 1. Construct an observer with the poles in {−5, −10 }. For which values of a is this possible?b) Suppose that the measured signal y is given by

y(t) =(2 1

)x(t) + v(t)

Here v(t) is the measurement noise. Compute the transfer function from v to x1(t), that is, the first element in thestate vector for the observer error x(t) = x(t)− x(t).

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

1.2

0 2 4 6 8 10

y

t [s]

Figure 9.11a

9.11 Consider the systemG(s) = 1− s/α

(1 + s/β)2 , α > 0, β > 0

Systems of this kind, that is, with a zero in the RHP have the property that the step response goes in the “wrongdirection” initially, see Figure 9.11a.

63

Page 68: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

a) Show that the derivative of the step response at t = 0, that is, y(0), decreases as the zero of the system approachesthe origin.

b) Is it possible to use state feedback to eliminate the problem that the step response goes in the wrong directioninitially? Justify your answer.

9.12 Theoretically one can place the poles of a controllable system arbitrarily. Which practical difficulties limit the perfor-mance that one can actually achieve?

9.13 Consider the system

x =(−3 11 −2

)x+

(−12

)u

y =(1 1

)x

a) Determine L of a state feedback u = r − Lx, that places the poles at −2± i.b) The state feedback of a) is used. It is observed that the output y(t) = 0 for all t is obtained for a reference signal

of the form r(t) = eαt. For what value(s) of α does this occur?

9.14 Consider the model of a DC-motorY (s) = G(s)U(s)

whereG(s) = 1

s(s+ 1)

a) Generate a state space representation using Matlab. Which physical signals are represented by the states?b) Suppose that the system is going to be controlled using state feedback

u(t) = −Lx(t) + l0r(t)

Compute the gain vector L and simulate the closed loop system for the following two choices of closed loop poles:� Two poles at −2.2� Poles at −1± i

Also compute l0 such that the closed loop system gets static gain one. In particular look at the properties of thestep response and the magnitude of the control signal in the two cases. Which pole locations give the best tradeoff between response speed and control signal magnitude?

c) Now let L be computed using linear quadratic optimization (LQ) for the three choices of weight matrices givenbelow. Compute the closed loop poles and the step responses of the closed loop system for the three cases. Describehow the properties of the step responses in the different cases.

(i) Q1 =(

0 00 1

), Q2 = 1

(ii) Q1 =(

0 00 10

), Q2 = 1

(iii) Q1 =(

0 00 0.1

), Q2 = 1

d) Start from case (ii) and increase the weight on the control signal gradually until Q2 = 10. Compare the result withthe result obtained for case (i).

e) Start from case (i) and introduce a weight on the velocity y(t). Increase the weight gradually and study how thepoles and the step response of the closed loop system change.

64

Page 69: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9.15 The ingestion and metabolism of a drug in a human body can be described by the following equations:

dq(t)dt = −k1q(t) + u(t)

dy(t)dt = k1q(t)− k2y(t)

where the input signal u(t) is the ingestion rate of the drug, the output y(t) is the mass of the drug in the blood, andq(t) is the mass of the drug in the gastrointestinal tract. The constants k1 and k2 are metabolism rates, satisfyingk1 > k2 > 0. k2 characterizes the excretory process of the individual. In this example, k1 = 0.05 and k2 = 0.02.

a) Is the system controllable?b) Design a state feedback that places the closed loop poles in −0.1.

q(t) (the mass of the drug in the gastrointestinal tract) cannot be measured, so to be able to use the state feedback inb) we need an observer.

c) How should the poles of the observer be selected?d) Design an observer with poles in −0.2.

9.16 A system is described by the state space equations

x(t) = Ax(t) +Bu(t− τ)y(t) = κCx(t) + e(t)

(9.1)

where it is known that

τ < 0.30.9 ≤ κ ≤ 1.1

It is also known that e is a sinusoidal disturbance with angular frequency 10 rad/s. The control design is based on thesimplified model

x(t) = Ax(t) +Bu(t)y(t) = Cx(t)

(9.2)

The specifications for the control system are given by:

1. The bandwidth of the closed loop system must fulfill ωB ≥ 5 rad/s.2. The closed loop system shall be stable despite the disturbance and the uncertainties in the parameters τ and κ.3. The static gain of the closed loop system shall be 1 despite the disturbance and the uncertainties in the parametersτ and κ.

4. The closed loop system shall handle the measurement disturbance sufficiently well.

The regulator design is carried out using state space methods. The poles of the closed loop system, that is, eigenvaluesof A − BL, are placed in {−4, −2 ± 2i } and the poles of the observer, that is, the eigenvalues of A −KC, are placedin {−17, −0.2± 10i }.The figures below show different aspects of the control system. It is important to note that the diagrams are obtainedusing the model (9.2) and the designed regulator. Determine if the requirements 1–4 are fulfilled when controlling thesystem given by (9.1).

65

Page 70: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

10−3

10−2

10−1

100

101

−360◦

−270◦

−180◦

−90◦

0◦

10−1 100 101 102

|Go(i

ω)|

arg

Go(i

ω)

ω [rad/s]

Figure 9.16a. Bode plot of the loop gain.

11

Re

Im

Figure 9.16b. Nyquist curve of the loop gain.

10−1

100

101

10−1 100 101 102

|S(i

ω)|

ω [rad/s]

Figure 9.16c. Gain curve of the sensitivity function.

10−2

10−1

100

101

10−1 100 101 102

|T(i

ω)|

ω [rad/s]

Figure 9.16d. Gain curve of the complementary sensitivity function.

66

Page 71: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

10−3

10−2

10−1

100

10−1 100 101 102|G

c(i

ω)|

ω [rad/s]

Figure 9.16e. Gain curve of the transfer function of the closed loop system.

9.17 In purification processes sometimes bacteria are used to consume the unwanted substance (possibly converting it tosomething more useful). Let ξ denote the amount of bacteria, η the amount of substance to be removed, and q theinput flow (that contains the substance to be removed). The system is then described by a set of nonlinear differentialequations

ξ = f1(ξ, η, q)η = f2(ξ, η, q)

When considering small deviations from an equilibrium the equations can be approximated by a linear system. In thisexample, the numeric values of the linearization are given by

x =(

0 1−1 −3

)x+

(−11

)u

where x1, x2, and u denote the deviations from the equilibrium values of ξ, η, and q respectively.

a) Assume that both x1 and x2 can be measured. Determine a state feedback placing the closed loop poles in{−2, −4 }.

b) Assume that only x2 is measured. Is it possible to calculate the amount of bacteria x1 from this measurement if uis known? If the answer is yes: Why is it important that u is known?

c) Assume that the value of u is unknown, but let it be known that it is constant. Is it then possible to calculate theamount of bacteria, x1 from a measurement of x2? In case it is, show some way of doing the computation.

9.18 A certain species of bacteria grows by consuming glucose, whose inflow is controlled. The following model is used

m = (f − 1)m f = −m+ q

where m is the amount of bacteria, f the amount of glucose and q the inflow of glucose. One wants the system tooperate in the neighborhood of the operating point m = 1, f = 1, q = 1. Using the notation x1 = m − 1, x2 = f − 1,u = q − 1, an approximate model (x1x2 neglected) is

x1 = x2

x2 = −x1 + u

Sometimes there are disturbances that are modeled as a constant, unknown external signal w:

x1 = x2 + w

x2 = −x1 + u

One wants to drive x1 to a reference value r using u as control variable.

a) x1 is measured. What performance (stationary error, speed of response) can be obtained using a P controller?b) x2 is measured. What performance (stationary error, speed of response) can be obtained by using a control law

where u depends linearly on r and x2 if w = 0? What happens when w 6= 0?c) x2 is measured. Determine a controller that does not differentiate x2, gives an asymptotically stable closed loop

system and makes x1 converge to r asymptotically for an arbitrary constant but unknown w.

9.19 Tentamenstal 2010-12-14 Upg. 2Ett system har modellerats genom att dela upp det i flera delsystem enligt Figur 9.19a.

67

Page 72: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Figure 9.19a

a) Finn överföringsfunktionerna:1. GX(s), så att X(s) = GX(s)U(s).2. G(s), så att Y (s) = G(s)U(s).

b) Genom att sätta samman överföringsfunktionerna i Figur 9.19a har man funnit att

Y (s) = G(s)U(s) där G(s) = s+ 2s2 .

Skriv systemet G(s) på en valfri tillståndsform

x(t) = Ax(t) +Bu(t)y(t) = Cx(t).

Det vill säga, bestäm matriserna A,B, och C. Är din valda tillståndsform en minimal realisation? (Motivera dittsvar.)

c) Bestäm en tillståndsåterkoppling för systemet ovan,

u(t) = −Lx(t) + l0r(t),

så att slutna systemets poler hamnar i {−1,−1} och så att det slutna systemets statiska förstärkning från r(t) tilly(t) blir 1.(Om du inte kunde svara på uppgift b), gör själv ett lämpligt val av A och B.)

d) Designa en observerare för systemet ovan så att observerarens egenvärden hamnar i {−10,−10}.(Om du inte kunde svara på uppgift b), gör själv ett lämpligt val av A och C.)

68

Page 73: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

11 Implementation11.1 If you “translate” the compensator

U(s) = KN( s+ b

s+ bN)E(s)

with Tustin’s formula you get a controller of the form

u(t) = β1u(t− T ) + α1e(t) + α2e(t− T )

What are the values of α1, α2, and β2, if T = 0.1, N = 10, b = 0.1, and K = 2?

11.2 Consider the systemy(t) = u(t)

Suppose it is controlled with a computer, so that the control signal is constant over the sampling interval, that is,

u(t) = uk, kT ≤ t < (k + 1)T

a) Introduce the notation yk = y(kT ) and derive a relation between yk+1, yk, and uk.b) Suppose we use the proportional feedback

uk = −Kykand that y(0) = y0. What are the values of K, for which the closed loop system is stable?

11 + sT1

Samplingu y

Figure 11.3a

11.3 Consider the system in Figure 11.3a, which illustrates sampling with prefiltering. Suppose we are sampling with thesampling period T and that u = u0 + u1, where u0 is an “interesting” low frequency signal in the frequency interval0 < ω < π/T and that u1 is a sinusoidal control signal

u1(t) = sinω2t,π

T< ω2 <

2πT

Since the sampling causes aliasing, the output will be

y(t) = y0 + y1

where y0 is interesting and y1 is a disturbance signal

y1(kT ) = A sin(ω1kT + ϕ), ω1 < π/T

a) What are A, ω1 and ϕ?b) It is clear from a) that the choice of T affects the amplitude of the disturbance signal y1. What is the smallest

amplitude you can get if you do not want to damp any frequencies in u0 more than√

2 times?

11.4 Tentamenstal 2011-01-13 Upg. 1dGenom att approximera en PI-regulator med Euler bakåt med samplingsintervall T = 1 fås den tidsdiskreta regulatorn

u(t) = u(t− 1) + 2e(t)− e(t− 1)

Ange parametrarna K och TI för motsvarande tidskontinuerliga PI-regulator

u(t) = K

[e(t) + 1

TI

∫ t

0e(τ)dτ

]

69

Page 74: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Motor

Figure 11.5a

11.5 Tentamenstal 2011-06-10 Upg. 5En kula är placerad på en bom enligt Figur 11.5a. En elektrisk motor kan rotera bommen och därmed få kulan i rullning.Kulans rörelse modelleras av differentialekvationen(

m+ J

r2

)z = −mg sin θ +mzθ2,

där m är kulans massa, J dess tröghetsmoment och r dess radie. Kulans position på bommen ges av z och bommensvinkel av θ, enligt Figur 11.5a.Bommens vinkelhastighet är proportionell mot den elektriska spänningen u över motorn, d.v.s. θ = Ku, där K är enkonstant.

a) i) Skriv ovanstående modell på tillståndsform med tillstånden θ, z och z, ochii) linjärisera sedan modellen kring en jämviktspunkt där u = θ = z = 0, och skriv ekvationerna på formen

x = Ax+Bu. Du kan anta att m

m+ J/r2 = 57 .

b) Vi fokuserar nu på reglering av enbart bommens vinkel θ. Låt därför y = θ vara utsignal. Om spänningen övermotorn kommer från en D/A-omvandlare så är den konstant över varje samplingsintervall och ges av u(t) = uk,för kT ≤ t < (k + 1)T där heltalet k anger sampelnummer och T samplingsintervallet.

Låt yk = y(kT ) vara den samplade utsignalen, och uttryck yk+1 i variablerna yk and uk.c) Antag att spänningen i Uppgift b) ges av uk = −Kpyk. För vilka Kp är det slutna systemet asymptotiskt stabilt?

(Om du inte kunde lösa Uppgift b) kan du anta yk+1 = 12yk + 1

3uk.)

70

Page 75: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

HintsThis version: August 2013

Page 76: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 77: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

2 Dynamic Systems

2.1 Start with Jθ = −fθ +M and try to write M as a function of θ and u using Kirchhoff’s voltage law.

2.2 What is the relationship between the response of the system and the pole locations?

2.3 Separate the pure delay and the dynamic response. Use the final value theorem to find the steady state gain andcalculate the time constant by estimating the time to reach 63% of the final value (neglecting the time delay).

2.4 Identify the coefficients ω0 and ζ in the system description

G(s) = ω20

s2 + 2ζω0s+ ω20

2.9 See Glad&Ljung.

2.11 a) Consider what you can control, what is uncontrollable and what is desired.

b) Consider the relationship between the signals.

2.12 a) Use mass balance and assume that the densities are equal.

b) Consider the change in mass and change in component A.

c) Assume that all the other independent variables (q1, q2, cA,2) are constant.

2.13 a) Use mass and component balance.

Solution

1

Page 78: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

3 Feedback Systems

3.1 a) Consider the three blocks; tank, valve, and PID. What is the input and the output from each block? Connect theblocks and consider v as a disturbance.For the tank model use the fact that the flow into the tank is x− v and the amount of liquid changes as h ·A.

b) Consider the final value and the time constant.

d) Put F (s) = K and express the closed loop poles as a function of K.

e) Use the final value theorem.

f) Put F (s) = KPs+KIs in the expression for the error, and use the final value theorem.

3.2 a) Use the expression for the poles from Problem 3.1.

b) Put F (s) = KP + KDs in the expression for the closed loop system from Problem 3.1. The relative damping isdefined in Glad&Ljung.

3.3 Use Newton’s force equation F = ma to derive the transfer function for the astronaut.

3.4 Start with deriving an expression for the transfer function from the disturbance fc to the error e.

a) Use F (s) = K and the final value theorem.

b) Use F (s) = K1 +K2/s and the final value theorem.

3.6 a) The characteristic equation iss(s+ 1)(s+ 3) +K(s+ 2) = 0

which gives P (s) = s(s+ 1)(s+ 2) and Q(s) = s+ 2.

b) Characteristic equation:s(s2 + 2s+ 2) +K = 0

P (s) = s(s2 + 2s+ 2), Q(s) = 1.

c) Characteristic equation:s(s− 1)(s+ 6) +K(s+ 1) = 0

P (s) = s(s− 1)(s+ 6), Q(s) = s+ 1.

3.7 Derive the general closed loop transfer function by first deriving the transfer function for the inner loop.

a) Let α = 0. The characteristic equation is then

s(s+ 2) + 4K = 0

Compute the poles explicitly as a function of K.

b) The characteristic equation iss(s+ 2) + 4K(1 + s) = 0

c) Characteristic equation:s(s+ 2) + 4K(1 + s/3) = 0

d) Characteristic equation:s2 + 2s+ 4 + 4αs = 0

2

Page 79: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

3.8 a) Derive the transfer function from ωref to ω.

b) The characteristic equation is(s+ 10)(s+ 4)(s− 3) + 10K(s+ 1) = 0

3.9 a) Derive the closed loop transfer function by first deriving the transfer function for the inner loop. The characteristicfunction is

s((s+ 1)(s+ 10) +K1) +K2 = 0

We get two principally different root loci when there are complex starting points, and when all starting points areequal. Treat the cases separately.

3.10 a) The characteristic equation is(s+ 1)(s− 1)(s+ 5) +K = 0

b) Characteristic equation:(s+ 1)(s− 1)(s+ 5) +K(1 + 0.5s) = 0

3.11 a) Characteristic equation:s3 + 2s2 + a(s2 + 2s+ 6) = 0

b) First check for which a the system is stable and the steady state requirement is fulfilled. Then use that “sinusoidin” gives “sinusoid out” after transients.

3.12 Check the root locus to find which K-values gives a stable/unstable system, more/less oscillative system.

3.13 Investigate the starting points and end points of the root locus.

3.14 Find the open loop transfer function and use the Nyquist criterion.

3.15 Since G(s) has no poles in the RHP, the closed loop system is stable if the Nyquist path of KGo does not encircle −1.Note that the K will only modify the distance to the origin, not the shape of the curve.

3.16 Study the amplitude and phase of G(iω).

3.17 a) Draw the complete Nyquist path and use the Nyquist criterion. (Note that Go(−iω) is the mirror image of Go(iω),mirrored in the real axis.)

b) Use the final value theorem, and that Go(0) is known from the Nyquist path.

c) Apply the Nyquist criterion to Ks G(s)

3.18 The system oscillates when the open-loop gain is equal to −1 (check Ke−iωTG(iω)).

3.19 Try to find the ω that gives argF (iω)G(iω) = −180◦.

3.20 The Nyquist curve for small ω determines if the system may have an integrator or not. Also check if the system isunstable for some K (from the Nyquist diagram).

3.25 Check the steady state error, the relative damping, etc.

3.26 a) To compute the closed loop transfer function combine

θ(s) = G(s)U(s)

andU(s) = F (s)(θref(s)− θ(s))

3

Page 80: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) The control error can be computed using

E(s) = 11 + F (s)G(s)θref(s)

To find the steady-state error, use the final value theorem.

c) See b).

3.31 a) Consider what you can control, what is uncontrollable and what is desired.

b) Use mass and energy balance for both the tank and the heating system.

3.32 a) Compute the poles of the system.

b) Note that the system has negative sign in the numerator.

3.33 Check the pole for the closed loop system.

4

Page 81: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

4 Frequency Description

4.1 Determine the angular frequency ω of the signals using the figure. Use the relationship saying that when u(t) = A sinωtthe output becomes

y(t) = |G(iω)|A sin(ωt+ argG(iω))

to determine |G(iω)| and argG(iω).

4.2 a) For K = 0.5 the open loop system is given by

Go(s) = F (s)Gr(s)Gs(s) = 0.05(1 + s/0.02)s(1 + s/0.01)(1 + s/0.05)(1 + s/0.1)

Use the rules in Glad&Ljung to make the Bode plot.

b) What can be said about the phase and gain margin when the output of the closed loop system oscillates withconstant amplitude?

c) When the reference signal is A sinαt the output signal becomes

y(t) = |Gc(iω)|A sin(αt+ argGc(iω))

The Bode plot of the open loop system can be used to compute Gc(iω).

4.3 a) Check the behavior of G(iω) when ω → 0 and ω →∞ respectively. See also if the absolute value and the argumentdecrease monotoneoulsy or not.

b) Translate the behavior of the amplitude and phase curves to a pole-zero diagram.

4.4 Check the final values of y(t) against the static gain G(0). Check also the overshoots of y(t) against the height of theresonance peaks in G(iω). Check the frequency of the oscillation in y(t) against the resonance frequency in G(iω).

4.5 Use Matlab, in particular the command bode.

4.6 Recall that for stable, linear systems “a sinusoid in gives a sinusoid out” after initial transients.

4.7 Recall that for stable, linear systems “a sinusoid in gives a sinusoid out” after initial transients.

4.11 a) Use the rules in Glad&Ljung to make the Bode plot.

b) What can be said of the phase and gain margin when the output of the closed loop system oscillates with constantamplitude?

4.12 a) What is the stability criterion in the Bode plot?

b) What is the current phase margin? Is a lead really necessary?

5

Page 82: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

5 Compensation

5.1 Try a lead-lag compensator. A table of phase advance versus “the N -parameter” is found in Glad&Ljung.

5.2 a) Glad&Ljung gives a good description of how Bode plots can be drawn by hand.

b) A proportional controller does not affect the phase curve.

c) Try lead compensator.

5.3 a) Draw asymptotic Bode plot (see 5.1) by hand or use Matlab.

b) Start with calculating the controller and then use the final value theorem.

c) Try a lag compensator.

5.4 Start with drawing a Bode plot for the open loop transfer function. The final value theorem is a good tool in thisexercise.

5.5 Check for signs of dominating poles, pure integrations, resonance frequencies...

5.6 Draw asymptotic Bode plot using the guidelines in Glad&Ljung. See the discussion on lead-lag compensators inGlad&Ljung.

5.7 Use values of |G(iω)| and argG(iω) to plot the Nyquist curve G(s).

5.8 The time delay alters the phase curve but not the amplitude curve. Use the Nyquist stability criterion.

5.9 Check steady state level and rise time. Modify Figure 5.9b using GA(s) and adapt a lead-lag compensator. You can usetwo lead compensators to acchieve a big phase advance.

5.10 Start by adjusting Figure 5.10b to obtain the Bode plot of G.

5.11 b) It is possible to derive limits on K using either the Bode plot or the Nyquist curve.

c) Use the final value theorem.

d) A time delay is described by the transfer function e−sT .

5.12 Think of all possible phase curves, for example originating from time delays, and think about the corresponding Nyquistcurves or Bode plots.

5.13 See “Introduktion till CSTB” and previous exercises in this section.

5.14 Try a lead-lag compensator.

6

Page 83: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

6 Sensitivity and Robustness

6.1 The sensitivity function is the transfer function from v to y.

6.2 Derive the relative model errorG∆(s) = G0(s)−G(s)

G(s)Make a simple plot of Gc(iω) using the information in the problem formulation. Compare with the inverse of the relativemodel error.

6.3 Convert the condition that the amplitude of y is larger than the amplitude of v to the condition

|1 +Go(iω)| < 1

What does this inequality say about the distance between the Nyquist curve and the origin?

6.4 Compute the transfer function of the closed loop system. Apply the robustness criterion using the given upper boundof the relative model error.

6.5 a) Derive the relative model order

G∆(s) = G0(s)−G(s)G(s)

and plot 1/ |G∆(iω)|.

b) Determine the level that |Gc(iω)| cannot exceed.

6.6 a) Use the robustness criterion and check the condition for G(iω) when ω →∞.

b) The characteristic equation of the closed loop system is

s2(2 + 25α) + 5s(2 + 25α) + 25 = 0

6.7 a) The characteristic equation becomess2(s+ 1) + α(s2 + s+ 4) = 0

b) Derive the relative model error

G∆(s) = G0(s)−G(s)G(s)

Check where the absolute value of the inverse of the relative model error intersects |Gc(iω)| given in the figure. Itis sufficient to check the low frequency asymptote.

c) What can be said about the necessity and sufficiency of the stability conditions in a) and b)?

6.8 Check where the absolute value of the relative model error intersects |Gc(iω)| given in the figure.

6.9 Derive the closed loop equation relating y(t), r(t), v(t), and n(t) using Y (s) = V (s) + Go(s)(R(s) − N(s) − Y (s)).Then use the fact that the sensitivity function S(s) and the complementary sensitivity function T (s) are related asS(s) + T (s) = 1. (Here T (s) coincides with the closed loop system.)

6.10 a) The relative model error is given by

G∆(s) = G0(s)−G(s)G(s)

b) Use Matlab and results from previous exercises.

7

Page 84: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

6.11 Recall that for stable, linear systems “a sinusoid in gives a sinusoid out” after initial transients.

6.12 Create the loop gain transfer function and use its Bode plot to check stability.

6.13 The sensitivity function is the transfer function from v to y.

8

Page 85: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

7 Special Controller Structures

7.1 a) Derive the transfer function from w to θm which then implies the open loop transfer function

Θ(s) = 0.9(1 + s/0.033)(1 + s/0.33)(1 + s)W (s)

Draw the Bode plot using the rules from Glad&Ljung.

b) Draw the Bode plot using the rules from Glad&Ljung.

7.2 a) Use the relationship

H(s) = 1As

(1

1 + s/2U(s)− V (s))

b) Derive the transfer function from V to H when both feedforward and feedback are used.

7.3 a) Use Y (s) = (Gu(s)Ff(s) +Gv(s))V (s).

b) Recall that for stable, linear systems “a sinusoid in gives a sinusoid out” after initial transients.

9

Page 86: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8 State Space Description

8.1 Define x1 = θ, x2 = θ, and utilize the differential equation for the motor.

8.2 For the nonlinear equation x2 = f2(x1, x2, u), the linearized equation is given by

x2 = f2(x1,0, x2,0, u0)

+ ∂f2

∂x1(x1,0, x2,0, u0) · (x1 − x1,0)

+ ∂f2

∂x2(x1,0, x2,0, u0) · (x2 − x2,0)

+ ∂f2

∂u(x1,0, x2,0, u0) · (u− u0)

8.3 Define x1 = y, x2 = θ, and x3 = z. Use block diagram algebra to find expressions for s ·Xi(s), then use the inverseLaplace transform.

8.4 Use canonical forms.

8.5 Take the Laplace transform of g(t).

8.6 G(s) = C(sI −A)−1B.

8.7 x(t) = eA(t−t0)x(t0) +∫ tt0eA(t−τ)Bu(τ) dτ

8.8 a) Insert the control signals and take Laplace transforms. Use the final value theorem.

b) Examine the difference u1(t)− u2(t) for arbitrarily small constant ε.

8.9 Check controllability.

8.10 The controllable subspace is spanned by the linearly independent columns of S. The unobservable subspace is spannedby the null space of O.

8.11 b) Compare what happens to the states as t→∞, to the transfer function poles.

c) Check if detS and detO are nonzero.

8.12 The system is minimal, compute the transfer function.

8.13 a) For small deviations around 0, sin(φ) ≈ φ, cos(φ) ≈ 1. Take z as input.

b) detS = 1α (1− 1

α )2

8.15 a) Combine mass balance with the given equation for reaction speed.

10

Page 87: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9 State Feedback

9.1 a) The closed loop system x = Ax+Bu, y = Cx, u = −Lx+ yref has characteristic polynomial det(sI −A+BL) = 0.

b) The observer poles are given by det(sI −A+KC) = 0 and should be placed to the left of the closed loop poles.

9.2 a) Write the system in state space form by introducing three state variables corresponding to the outputs of the threeleft-most integrators in the figure (z = output). Design a state feedback controller u = −Lx + yref and place thepoles in −0.5.

c) Design an observer with poles to the left of the closed loop poles.

9.3 a) The constant l0 can be found by using that θ = ω = 0 at steady state.

b) Introduce the integrated control error as an auxillary state.

9.4 Decompose the system into two subsystems, one controlled by u1 and one by u2, and check the controllability.

9.5 Is the system observable?

9.6 Is the system observable?

9.7 • Is the system controllable?

• x(t) converges to zero as p(t)e−αt if (A−KC) has a double eigenvalue in −α.

• Check the observability of the system.

9.9 Study the phase margin of the open loop system.

9.11 Use the initial value theorem.

9.12 Compute the transfer function from u(t) to z(t) = Lx(t), that is, the loop gain, and check the stability margin given acertain time delay T .

9.13 • The closed loop poles are given by det(sI −A+BL) = 0

9.17 a) The closed loop system x = Ax+Bu, u = −Lx has the characteristic polynomial det(sI −A+BL) = 0.

b) Check oberservability.

c) Introduce a new state.

11

Page 88: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 89: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

AnswersThis version: August 2013

Page 90: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 91: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1 Mathematics

1.1 a) A step has Laplace transform As .

b) A ramp has Laplace transform As2 .

c) 1s+2

d) ss2+25

e) sU(s)− u(0)

f) sU(s). (u(0) = 0 is a common assumption in the course.)

g) s2U(s)− su(0)− u(0)

h) s2U(s). (u(0) = u(0) = 0 is a common assumption in the course.)

i) A time delayed signal has Laplace transform, e−sTU(s).

1.2 a) limt→∞ y(t) = 5/2

b) Y (s) = 1s+2U(s)

1.3 The general solution is given by

y(t) = C1e−2t + (C2 + C3t)e−t −

3100(cos(2t) + 7 sin(2t))

1.4 a) y(t) = 12 − e

−t + 12e−2t, t ≥ 0

b) y(t) = 1− 0.5e−t + 0.5 sin t− 0.5 cos t

1.5 a)√

2eiπ4

b)√

210 e−i 105

180π

c) 1 +√

3i

d) −5

1.6deciBel (dB20) Definition Amplification F

20 20 logF = 20 ⇒ F = 101 = 10−3 20 logF = −3 ⇒ F = 10−3/20 ≈ 0.708 ≈ 1√

20 20 logF = 0 ⇒ F = 100 = 110 20 logF = 10 ⇒ F = 100.5 =

√10 ≈ 3.16

−10 20 logF = −10 ⇒ F = 10−0.5 = 1√10 ≈ 0.316

1.7 Multiplication of the two matrices gives the unit matrix.

1.8

λ1 = 3 v1 =

11−2

λ2 = −1 v2 =

103

λ3 = 4 v3 =

−102

1

Page 92: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1.9

T =

1 1 −11 −1 01 0 1

1.10 A basis for the null space is for example

01−11

A basis for the range space is

2031

1110

2131

The rank of the matrix is hence 3.

1.11 a) f(t) = 1− e−t; 1.

b) f(t) = −0.5e−t + 0.5et; ∞.

c) f(t) = e−t · t; 0.

1.12 y(3) + 2y + 2y + y = u

2

Page 93: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

2 Dynamic Systems

2.1 a) Differential equationθ + 1

τ· θ = k0 ·u

where1τ

= Raf + kakv

JRak0 = ka

JRa

b) Transfer function

G(s) = θ(s)U(s) = k0

s(s+ 1/τ)

c) Step responseθ(t) = k0τt− k0τ

2(1− e−t/τ )

2.2 (1) K = 0.1

(2) K = 2.5

(3) K = 3

(4) K = 0.5

2.3 G(s) = 10e−(L/V )s

1+3s

2.4 a) a < 1

b) b = 2

2.5 A–B, B–F, C–A, D–C, E–E, F–D.

2.6System Tr Ts M polesGA 3.3 4.7 0% −1,−1GB 1.2 13.6 52% −0.2± i0.98GC 10.6 14.6 0% −4.8,−0.2GD 1.7 5.4 16% −0.5± i0.87GE 0.8 2.6 16% −1± i1.73

2.7 α > 0 gives overshoot, α < 0 gives undershoot.

2.8 y(t) = L−1(G(s) 1s )

2.9 a) 1.5

b) M ≈ 26%

c) Tr ≈ 1.5

d) Ts ≈ 7.8

2.10 G1–C, G3–B, G4–A, G5–D.

3

Page 94: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

2.11 a) The signals can be classified as

� Disturbances signal: Acid process flow (unknown pH and flow)

� Control signal: NaOH solution

� Measured and controlled signal: The pH of the outflow

b) A block diagram where the control strategy is based on feedback could look like Figure 2.11a

TankFΣ+NaOH

outflow pHref

Acid flow

Figure 2.11a

2.12 a) q∗ = 1.5 m3/min and c∗A = 2.0 kmol/m3.

b) The model is nonlinear since the model is described by the following nonlinear equations

d(ρV )dt = ρ(qin − qout)

d(V cA)dt = q1cA,1 + q2cA,2 − qcA

c) k0 = 2.0 kmol/m3, k1 = 0.13 kmol/m3, and τ = 11.5 = 0.67 min.

2.13 a) The model is given by

yi = αxi1 + (α− 1)xi

dMi

dt = Li−1 + Vi+1 − Li − Vi

Midxidt = Li−1 (xi−1 − xi) + Vi+1 (yi+1 − xi) + Vi (xi − yi)

b) The linearized model is given by

M∗idxi∆

dt = L∗i−1xi−1,∆ + V ∗i+1yi+1,∆ − L∗i xi∆ − V ∗i yi∆

+ x∗i−1Li−1,∆ + y∗i+1Vi+1,∆ − x∗1Li∆ − y∗i Vi∆

yi∆ = α

(1 + (α− 1)x∗i )2xi∆

Solution

4

Page 95: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

3 Feedback Systems

Gv(s)F (s)Σ Σ Gt(s)+e u x

+−

−href h

v

Figure 3.1a

3.1 a) Transfer function of the tank Gt(s) = 1s . Block diagram see Figure 3.1a.

b) kv = 2, T = 5

c) H(s)Href(s) = Gt(s)Gv(s)F (s)

1+Gt(s)Gv(s)F (s) ,H(s)V (s) = − Gt(s)

1+Gt(s)Gv(s)F (s)

d) K < 0.05

e) 12K

f) 0

3.2 a) −0.1±√

0.39i

b) KD > 1.7

3.3 K2 < 1 and K1 = 200/K22 .

3.4 a) −a/K

b) 0

3.5 a) For small values of KP the step response is slow, well damped and the steady state error is large. For increasingKP the step response becomes faster but more oscillatory, while the error is reduced. For large KP the amplitudeof the oscillations increases, that is, the closed loop system becomes unstable.

b) The integrator in the regulator eliminates the steady state error. A too small value of KI gives a large settling timewhile a too large value gives an oscillatory (finally unstable) closed loop system.

c) Using the (approximate) derivative of the error in the regulator increases the damping of the closed loop system.Increasing KD too much, however, gives that an oscillation with higher frequency appears in the step response andfinally (approximately when KD > 65) the closed loop system becomes unstable.

3.6 Root loci are shown in Figure 3.6a.

b) Intersection with the imaginary axis for K = 4, ω = ±√

2.

c) Intersection with the imaginary axis for K = 7.5, ω = ±√

1.5.

Conclusions about the step response of the corresponding systems:

a) Asymptotically stable all K > 0.Small K: No oscillations, larger K gives faster system.Larger K: Oscillations. Larger K gives more oscillations.

5

Page 96: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

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

−4

−3

−2

−1

0

1

2

3

4

5

Real Axis

Imag

Axi

s

−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

−7 −6 −5 −4 −3 −2 −1 0 1 2 3−8

−6

−4

−2

0

2

4

6

8

Real Axis

Imag

Axi

s

Figure 3.6a

b) Asymptotically stable for 0 < K < 4. Oscillating all K > 0.Small K: larger K gives faster system.Larger K: larger K gives more oscillating system. Unstable for large K (> 4).

c) Asymptotically stable for K > 7.5. Unstable for K < 7.5. Stable and oscillating for K > 7.5. Larger K gives fastersystem, until the real pole becomes dominating, then larger K gives a slower system.

3.7 General characteristic equation:s(s+ 2) + 4K(1 + αs) = 0

The root loci are shown in Figure 3.7a.

a) Asymptotically stable for all K > 0, oscillatory for large K.

b) Asymptotically stable for all K > 0, not oscillatory for any K.

c) Asymptotically stable for all K > 0, no oscillations for small and large K, faster for large K.

d) Asymptotically stable for all α > 0. Oscillatory for small α. Larger α gives more damped system.

With the tachometer feedback we can make the system both fast and well damped. The tachometer feedback is equivalentto the D-part in a PID controller.

3.8 a) The system is unstable so ω will grow to infinity.

b) The root locus is shown in Figure 3.8a. The system is asymptotically stable for K > 12.

c) No. When K = 12, s = 0 is one pole but the other two are complex.

6

Page 97: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

Real Axis

Imag

Axi

s

−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

Real Axis

Imag

Axi

s

−7 −6 −5 −4 −3 −2 −1 0 1 2−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

Real Axis

Imag

Axi

s

−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

Figure 3.7a

3.9 a) Starting points: s = −5.5±√

5.52 − 10−K1. The starting points are all real for K1 ≤ 20.25, while we have complexstarting points for K1 > 20.25. The two principal root loci are shown in Figure 3.9a. The system is asymptoticallystable for 0 < K2 < 11K1 + 110.

b) A larger K1 gives stability for larger K2.

3.10 Root loci in Figure 3.10a.

a) The system is unstable for all K.

b) Asymptotically stable for K > 5.

3.11 a) The root locus is shown in Figure 3.11a. The system is asymptotically stable for a > 1.

b) The smallest amplitude is 0.1.

3.12 K Step4 C10 D18 B50 A

3.13 The poles of the system all tends to points in the LHP or to −∞ for large K.

7

Page 98: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−12 −10 −8 −6 −4 −2 0 2 4 6−15

−10

−5

0

5

10

15

Real Axis

Imag

Axi

s

Figure 3.8a

−15 −10 −5 0 5 10 15

−15

−10

−5

0

5

10

15

Real Axis

Imag

Axi

s

Root locus

−15 −10 −5 0 5 10 15

−15

−10

−5

0

5

10

15

Real Axis

Imag

Axi

s

Root locus

Figure 3.9a

3.14 The system is stable for K/A < π.

3.15 a) The closed loop system is stable in (i), (ii), and (iv).

b) Stable when: (i) K < 2.5, (ii) K > 0, (iii) K < 1/2, and (iv) K < 1/4 or K > 1/2.

3.16 The Nyquist curves are shown in Figure 3.16a.

3.17 a) K < 2/3

b) 11+2K when K < 2/3

c) K < 2/3

8

Page 99: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−7 −6 −5 −4 −3 −2 −1 0 1 2 3−8

−6

−4

−2

0

2

4

6

8

Real Axis

Imag

Axi

s

−6 −5 −4 −3 −2 −1 0 1 2 3−8

−6

−4

−2

0

2

4

6

8

Real Axis

Imag

Axi

s

Figure 3.10a

−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

Real Axis

Imag

Axi

s

Figure 3.11a

3.18 τ = 1.69T = π

2 − arctan τ = 0.53T1 = π − 2 arctan τ

2 = 1.74

3.19 K < 2

3.20 Root locus 1.

3.21 P ⇒ b0 = b2 = 0I ⇒ b0 = b1 = 0D ⇒ b1 = b2 = 0

3.22 a) The root locus with respect to KP is shown in Figure ??. When KP increases the two complex poles move towardsthe imaginary axis, that is, the closed loop system becomes more oscillatory. Finally, for KP ≈ 6.2, the poles crossthe imaginary axis and the closed loop system becomes unstable. This result is in accordance with Problem 3.5.For small values of KP the properties of the step response are mainly determined by the real pole close to the origin.For larger values the complex poles start to dominate and when the complex poles cross the imaginary axis theamplitude of the oscillations in the step response increases and the system becomes unstable.Note, however, that the root locus alone does not give sufficient information to tell how the steady state errorchanges with the parameter.

b) The root locus with respect to KI is shown in Figure ??. For small KI the response of the closed loop system isdominated by the poles on the real axis close to the origin. When KI increases the poles become complex and move

9

Page 100: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Re

Im

a)

Re

Im

b)

ω

ω

Figure 3.16a

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

Real Axis

Imag

Axi

s

Figure 3.22a

towards the imaginary axis, that is, the closed loop system becomes more oscillatory. Finally, for KI ≈ 1.5, thepoles cross the imaginary axis, that is, the closed loop system becomes unstable. As can be seen in Problem 3.5 asmall value of KI, that is, a pole close to the origin, gives a slow step response. When KI increases the dominatingpoles become complex and the step response becomes oscillatory.A large settling time will typically follow if the system is slow or has poor damping. Here, the large settling timefor small KI is due to the system being slow. That the steady state error is eliminated cannot easily be seen in theroot locus.

c) The root locus with respect to KD is shown in Figure ??. When KD increases the complex poles closest to theorigin move towards the origin and and at the same time the damping of the poles is increased. When KD increaseseven more the second pair of complex poles moves towards the imaginary axis giving a high frequency oscillationwhich finally gives instability.

3.23 a) The Nyquist curve is “far away” from the point −1 for all frequencies and the step response of the closed loopsystem is well damped. As KP increases the Nyquist curve grows in size and for KP = 6.2 the Nyquist curvereaches −1 and thus is the limit of stability.

b) For low frequencies the Nyquist curve is now far away from the origin since the integrating part makes |G(iω)|large for low frequencies. The Nyquist curve now passes closer to −1 which results in a more oscillatory closed loopsystem. The system becomes unstable around KI = 1.44.

10

Page 101: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−1.5

−1

−0.5

0

0.5

1

1.5

Real Axis

Imag

Axi

s

Figure 3.22b

c) The Nyquist curve is now further away from −1 which corresponds to an improved damping of the closed loopsystem. The system becomes unstable around KD = 66.

3.24 a) ωc = 0.38, ωp = 1.1, ϕm = 94◦ and Am = 3.1.

b) The closed loop system is now much more oscillatory due to the reduced phase and gain margins.

c) KP = 3.1.

3.25 A–iii, B–i, C–iv, D–ii.

3.26 a) KP small ⇒ Both poles on the real axis, but one pole very close to the origin ⇒ Slow but not oscillatory system.KP = 1/(4τ2k0) ⇒ Both poles in −1/(2τ), that is, faster than in (1) but still no oscillations.KP large ⇒ Complex poles with large imaginary part relative to the real part, that is, oscillatory system.

b) If the reference is a step,limt→∞

e(t) = 0

If the reference is a ramp,limt→∞

e(t) = A

KPk0τ

c) limt→∞ e(t) = 0

3.27 Gc = Go1+Go

3.28 a) Go = FG

b) Gc = FG1+FG

c) Gny = − FG1+FG

d) Gre = 11+FG

11

Page 102: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−4

−3

−2

−1

0

1

2

3

4

Real Axis

Imag

Axi

s

Figure 3.22c

3.29 a) 3A3+K

b) F (s) = 1s (for example)

c) Poles in −2, −2. No zeros.

3.30 A–4, B–2, C–3, D–1.

GFΣ+Fc,in, Tc,in

TtTref

Ft,in, Tt,in

Figure 3.31a

3.31 a) See the block diagram in Figure 3.31a. There, the signals are classified as:

� Input Fc,in and Tc,in

� Output Tt

� Disturbance Ft,in and Tt,in

b) The model is given by

VtdTt

dt = Ft(Tt,in − Tt) + U

cpt,inρt(Tc − Tt)

VcdTc

dt = Fc(Tc,in − Tc)− U

cpcρc(Tc − Tt)

c) Tt∆(s) = 32(s+3.675)(s+0.185)Fc∆(s)

d,e) The root locus for a P controller is shown in Figure 3.31b.

3.32 a) The system has a pole in −3.

12

Page 103: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

-3 -1-2

-1

1

Re

Im

K = 0.0952

Figure 3.31b

b) The system is stable for K ≤ −3.

3.33 K > µ

3.34

13

Page 104: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

4 Frequency Description

4.1 G(s) = 0.16s+0.16

4.2 a) See figure in the solution. ωc = 0.025, ϕm = 31◦, Am = 2.5.

b) The period time will be 108 seconds, K = 1.25.

c) B = 8◦, β = 0.02 rad/s and ϕ = −42◦.

4.3 a) Figure 4.3a in Solutions.

b) Figure 4.3b in Solutions.

4.4 A–B, B–C, C–D, D–A.

4.5 a)System G(0) ωB ωr Mp

GA 1 0.64GB 1 1.5 1 2.5GC 1 0.21GD 1 1.27 0.7 1.15GE 1 2.54 1.4 1.15

b) The bandwidth of a system is (approximately) inversely proportional to the rise time. The damping is inverselyproportional to the height of the resonance peak. A large peak implies low damping and large overshoot.

4.6 y(t) = 1√5 sin(2t− 1/2− 4− π

2 − arctan 2).

4.7 a) 0.45 sin(2t− 1.1)

b) Unstable system.

c) 0.11 sin(2t− 2.4)

d) 0.45 sin(2t− 2.1)

4.8 a,b)ω |G(iω)| argG(iω)1 1 = 0 dB20 −0.2 rad = −11◦5 0.8 = −1.9 dB20 −0.9 rad = −52◦10 0.5 = −6 dB20 −1.6 rad = −92◦20 0.2 = −14 dB20 −2.2 rad = −126◦

c) See Figure 4.8a in Solutions.

4.9 G1–B, G2–D, G3–A, G4–C, G5–E.

4.10 Bode gain–step response pairs: A–D, B–C, C–A, D–B.

4.11 a) The bode digram of the system is shown in Figure 4.11a.

14

Page 105: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

10−6

10−4

10−2

100

102

Mag

nitu

de (

abs)

10−2

10−1

100

101

102

−270

−225

−180

−135

−90

−45

0

Pha

se (

deg)

Bode Diagram

Frequency (rad/sec)

Figure 4.11a

b) K = 10.1946 = 5.14

4.12 a) K ≤ 5.04

b) F (s) = 1.58 s+0.01s

15

Page 106: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

5 Compensation

5.1 For example, the following controller fulfills the requirements:

F (s) = 3.33 · s+ 0.185s+ 0.555

s+ 0.032s+ 0.0036

5.2 a) See Figure 5.2a.

b) Largest crossover frequency: 0.14 rad/s.

c) One controller that fulfills the requirements is the lead compensator (with gain adjustment)

F (s) = 1.9 · 7 s+ 0.106s+ 0.106 · 7

5.3 a) See Figure 5.3a.

0.1

0.20.3

0.50.7

1

0.525

-270◦

-180◦

-90◦

0◦

0.03 0.05 0.07 0.1 0.2 0.3 0.5

ωc = 0.079 ωp = 0.280.145

-130◦

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Am

=5.0

m=

88.1

3◦

Figure 5.2a

0.010.02

0.050.10.2

0.512

-270◦

-180◦

-90◦

10 20 50 100 200 500 1e + 03

ωcA = 20.4

ωcB = 15.2

ωp = 150

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

A

B

Am

=1.5

m=

88.4

2◦

Figure 5.3a

16

Page 107: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) Smallest value of ramp error 0.067 and crossover frequency 150 rad/s.

c) One controller that fulfills the constraints is

F (s) = 0.75s+ 1.4s+ 0.1

5.4 One controller which fulfills the requirements is

F (s) = 1.02 · 4 · s+ 6.3s+ 25 ·

s+ 1.26s+ 0.13

5.5 A–E–C, B–C–E, C–A–B, D–D–D, E–B–A.

5.6 One controller which satisfies the demands is

F (s) = 1.2 · 5 s+ 8.0s+ 5 · 8.0 ·

s+ 1.8s+ 1.8/84

5.7 The system is stable when 0 < K < 0.2 or 1.67 < K < 5.

5.8 a) T < 0.698 s

b) 0.1 s < T < 0.279 s

10-3

10-2

10-1

100

101

0.0473

-270◦

-180◦

-90◦

10-2 10-1 100

ωc = 0.078 ωc,d = 0.40

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Gm

Go

Gm

Go

ϕ∆

=67.8

4◦

Figure 5.9a

5.9 a) kA = 0.25 and a = 0.5. The Bode plot is given in Figure 5.9a.

b) One controller that does the job is

F (s) = 10.6 ·(

4 (s+ 0.2)(s+ 0.2 · 4)

)2

5.10 The following compensator fulfills the requirements:

F (s) = 4.4 ·(

4 s+ 0.53s+ 0.53 · 4

)2s+ 0.105

s+ 0.105/195

5.11 a) See Figure 5.11a.

17

Page 108: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−0.091 1

Re

Im

ωc = 0.78

ωp = 3.2

133◦

Figure 5.11a

b) Asymptotically stable for 0 < K < 10.

c) limt→∞ e(t) = 5

d) T < 0.4

5.12 a) Impossible to determine.

b) It is stable.

5.13 a) ωc = 5 rad/s, ωp = 9.5 rad/s, Am = 3.5 and ϕm = 27◦.

b)-d) See solution.

5.14 The following controller will do:F (s) = 35.7 · 3 s+ 0.12

s+ 3 · 0.12s+ 0.02

s

5.15 a) e0 = 0, e1 = 4K , provided K < 4000. Larger K results in an unstable system.

b) The following controller will do:F (s) = 756 · 7 s+ 37.8

s+ 264.6 ·s+ 10s+ 1.9

18

Page 109: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

6 Sensitivity and Robustness

6.1 The gain of the sensitivity is:

|S(1i)| =√

2√(K − 1)2 + 1

and the requirement on K becomes K > 2.

6.2 The maximum bandwidth is ωB = 1.

6.3 See the solution, Figure 6.3a.

6.4 Yes.

6.5 a) See the solution, Figure 6.5a.

b) ∣∣∣∣ F (iω)G(iω)1 + F (iω)G(iω)

∣∣∣∣ < 12

6.6 a) No, stability cannot be guaranteed when G(s) = 1.

b) α > −2/25. This is not contradictory since the robustness criterion is a sufficient but not necessary condition.

6.7 a) Asymptotically stable for α > 3. See the solution, Figure 6.7a.

b) α > 4

c) The robustness criterion gives a sufficient but not necessary condition.

6.8 0 ≤ γ < 135

6.9 y(t) = 1√2 sin(t− π

4 )− sin(t)

6.10 a) 1G∆(s) = − s+1

s

b) Stability cannot be guaranteed for F (s) = 1, while it can be guaranteed for the regulator from Problem 5.13.

6.11 The amplitude of the steady state error will be 0.2.

6.12 The controller also stabilizes the system for the stirring speed 400 r/min.

6.13 K ≥√

396 ≈ 19.9

19

Page 110: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

7 Special Controller Structures

7.1 a) See Figure 7.1a in the solution. ωc and ϕm are undefined and Am = 43.5. The stability requirement givesK1 = 21.75which implies

limt→∞

e(t) = 0.0487 · a

where a is the size of the step.

b) See Figure 7.1b in the solution. ωc and ϕm are undefined, and Am = 16. The requirement gives K1 = 8 whichimplies

limt→∞

e(t) = 0.111 · a

7.2 a) Ff(s) = 1, and h(t) = − 0.1A · 2 (1− e−2t).

b) Zero steady state error.

7.3 a)

Ff = −Gv

Gu= −3(s+ 3)

2(s+ 4)

b) The amplitude of the control signal is 3.

c) limt→∞ y(t) = 9(1−b/2)12+4Kb

7.4 a) Ff(s) = − 4(s+1)3(s+2)(s+5)

b) limt→∞ y(t) = −0.012

c) limt→∞ y(t) = − 0.0123K+1

d) y(t) doesn’t have a final value.

20

Page 111: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8 State Space Description

8.1

x =(

0 10 −1/τ

)x+

(0K

)u

y =(1 0

)x

8.2

x1∆ = x2∆

x2∆ = ω20x1∆ + u∆

y∆ = x1∆

8.3

x1(t) = K2x2(t) +Ml(t)x2(t) = −x1(t) + x3(t)x3(t) = −K2x2(t) +K1i(t)

8.4 a)

x1(t) = x2(t)x2(t) = x3(t)x3(t) = −6x1(t)− 11x2(t)− 6x3(t) + 6u(t)y(t) = x1(t)

b)

x1(t) = −x1(t) + x3(t) + 4u(t)x2(t) = −3x1(t) + 2u(t)x3(t) = −5x1(t) + x2(t) + u(t)y(t) = x1(t)

c)

x1(t) = −2x1(t)− u(t)x2(t) = −3x2(t) + 3u(t)y(t) = x1(t) + x2(t)

8.5

x1(t) = −x1(t) + 2u(t)x2(t) = −4x2(t) + 3u(t)y(t) = x1(t) + x2(t)

8.6 G(s) = s(s+2)(s+3)

21

Page 112: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8.7

x(t0 + T ) = eATx(t0) +(∫ t0+T

t0

eA(t0+T−s) ds))Bu0

8.8 a) The state space description of the closed loop system

x(t) =

−3 1 1−1 0 0−1 0 0

x(t) +

211

href(t)

h(t) =(1 0 0

)x(t)

b,c) The state space description of the closed loop system with noise

x(t) =

−3 1 1−1 0 0−1 0 0

x(t) +

−1−10

n(t)

h(t) =(1 0 0

)x(t)

8.9 Yes, since the system is controllable.

8.10 a) Dimensions: 2 and 1. Subspaces:{(

1 −1 2)T,(−2 3 −6

)T}

and{(

0 −1 2)T}.

b) Dimensions: 2 and 1. Subspaces:{(

0 4 −2)T,(0 −8 8

)T}

and{(

0 0 1)T}.

8.11 a) x1 = 1− e−t, x2 = 0.5(e2t − 1)

b) No. Yes.

c) Controllable, not observable.

d) Unobservable growing state ⇒ simulation collapses.

8.12 Poles: 1± i√

2. Zeros: −1.

8.13 a)

x1 = x2

x2 = 1αx1 −

u

αx3 = x4

x4 = x3 − u

b) detS = 1α2 (1 − 1

α )2. Thus, the system is controllable except for the case α = 1, that is, when the two pendulumshave the same lengths.

8.14 a)

x =(−1 01 −3

)x+

(11

)u

y =(1 1

)x

b) u = −5x1 + x2 + 3.2r

c) Y (s) = 3.2(2s+5)(s+4)2 R(s)

22

Page 113: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8.15 a) The model is given by

VdcAdt = −V k1c

3A + qcA,in − qcA

VdcBdt = V k1c

3A

3 − qcB

b) The linearized model is given by

ddt

(cA,∆cB,∆

)=(−q−3k1c

∗AV

V 0k1c∗A

−qV

)(cA,∆cB,∆

)+(qV0

)u

y =(0 1

)(cA,∆cB,∆

)

23

Page 114: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9 State Feedback

9.1 a) State feedback. Poles in {−3, −5 } gives the state feedback

u = −6x1 − 14x2 + yref

Poles in {−10, −15 } gives the state feedback

u = −23x1 − 149x2 + yref

b) Observer poles in −20 gives the observer gain

K =(

38−399

)

9.2 a)

x =

0 K2 00 0 10 0 0

x+

00K1

u

b) u = − 18K1K2

x1 − 34K1

x2 − 32K1

x3

c) Observer gain KT =(6 12/K2 8/K2

)9.3 a) u = − 2

c1τ2 θ − 1τc1

ω + 2c1τ2 θref

b) u = − 2c1τ2 θ − 1

τc1ω + 2

c1τ2 θref − c2c1x3

9.4 State feedback gain L =(6 −2

). Observer gain KT =

(16 9

).

9.5 The system is observable and the poles of the observer may be placed arbitrarily.

9.6 a) Yes, since the system is controllable.

b) Closed loop poles in −3 givesu = −3x1 − 5x2 − 4x3 + yref

c) The system is observable with the sensor at x1 or x3. The sensor at x1 and observer poles in −4 give KT =(6 14 14

).

9.7 X3(s) = K1s+KU(s) + K2s

s+KX2(s)

9.8 a) L =(1 2

)b) In steady state: h = −0.1.

c) Ff(s) = 2 gives, in steady state, h = 0.

d) h = 2(k1−1)k1

v

e) Introduce the integral of the height as a new state

z(t) =∫ t

0h(s) ds⇒ z = h

24

Page 115: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9.9 T < arctan 2ωcωc

= 0.65s

9.10 a) KT =(−13 38

)b) The transfer function from v to x1 is

−C1(sI −A+KC)−1K = 13s− 12s2 + 15s+ 50

where C1 =(1 0

).

9.11 a) The initial value theorem gives

y(0) = −β2

α

and hence y(0) decreases as α decreases.

b) No, since the zero is not affected by the feedback.

9.12 A very fast closed loop system:

• implies that the poles are far into the LHP which implies a need for generating large input signals.

• easily becomes unstable in case of model uncertainties.

• becomes sensitive to measurement noise.

• has a sensitivity function with a large peak.

9.13 a) L =(1 0

)b) r(t) = r0e

−5t

9.14 a) x2 = y (motor angle) and x1 = y (angular velocity).

b) The pole locations give similar rise and settling times. With complex poles the maximum value of the input islower.

c) Larger weight on the motor angle gives faster response.

d) Increasing weight on the input makes the system slower.

e) Increasing weight on the velocity makes the system slower.

9.15 a) Yes the system is controllable.

b) Poles in −0.1 gives the state feedbacku = −0.13x1 − 0.128x2

c) It is desirable that the estimation error converges to zero faster than the dynamics of the system. Thus, we shouldplace the eigenvalues of the observer to the left of the poles of the closed loop system. To avoid large amplificationof the measurement noise the poles of the observer should not be placed too far into the left hand plane.

d) Observer poles in −0.1 gives the observer gain

K =(

0.450.33

)9.16 Are the specifications 1–4 fulfilled?

1. The bandwidth requirement is not fulfilled.

2. The system is stable despite the model errors.

25

Page 116: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

3. The gain is different from 1 when κ 6= 1

4. Both measurement and process noise are amplified for some frequency.

9.17 a) u = 4x1 + x2

b) Yes! It is essential that the input u is known since u is required in the observer design to get an asymptoticallyvanishing state estimation error.

c) Yes, by introducing a third state x3 = u. This new system is observable hence a observer can be designed toestimate u.

9.18 a) The poles are pure complex and thus the system doesn’t have a well defined stationary error or speed of response.

b) A linear combination of r and x2 is given byu = l0r − l2x2

with this controller the poles can be placed with l2 as

s = −l22 ±√l22 − 4

4

and by setting l0 = 1 the stationary error will be zero when w = 0. If w 6= 0 and l0 = 1 then there will be stationaryerror of size l2w.

c) Designing a observer with the following observer gains k1 = −11, k2 = 6, and k3 = −8. Let the control law beu = l0r − l2x2 − l3x3. With l3 = l2 and l0 = 1 there will be no error. Place the poles to the closed loop with l2.

26

Page 117: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

11 Implementation

11.1 β1 = 0.905, α1 = 19.14, and α2 = −18.95.

11.2 a) yk+1 − yk = Tuk

b) 0 < K < 2T

11.3 a)

A = 1√1 + (ω2T1)2

ω1 = 2πT− ω2

ϕ = π + arctanω2T1

b) T1 = T/π gives A = 1√1+(ω2T/π)2

.

27

Page 118: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 119: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

SolutionsThis version: August 2013

Page 120: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 121: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1 Mathematics

1.1 a) A step has Laplace transform As .

b) A ramp has Laplace transform As2 .

c) 1s+2

d) ss2+25

e) sU(s)− u(0)

f) sU(s). (u(0) = 0 is a common assumption in the course.)

g) s2U(s)− su(0)− u(0)

h) s2U(s). (u(0) = u(0) = 0 is a common assumption in the course.)

i) A time delayed signal has Laplace transform, e−sTU(s).

1.2 a) Insert y(t) = 0 och u(t) = 5 directly into the differential equation ⇒ y(t) = 5/2. It is also possible to solve thedifferential equation and let t→∞, or to use b) and the final value theorem.

b) Use Laplace transform on the differential equation Y (s) = 1s+2U(s). The denominator coincides with the charac-

teristic polynomial of the differential equation. Note that we also have assumed y(0) = 0.

1.3 The general solution is given by

y(t) = C1e−2t + (C2 + C3t)e−t −

3100(cos(2t) + 7 sin(2t))

1.4 a)y(t) = 1

2 − e−t + 1

2e−2t, t ≥ 0

b) The Laplace transform of the inputu(t) = 1 + sin t

yieldsU(s) = 1

s+ 1s2 + 1

The differential equationy(t) + y(t) = u(t)

may be represented by the transfer function

G(s) = Y (s)U(s) = 1

s+ 1

Hence, the Laplace transform of the system output is given by

Y (s) = 1s· 1s+ 1︸ ︷︷ ︸Y1(s)

+ 1s+ 1 ·

1s2 + 1︸ ︷︷ ︸

Y2(s)

Rewriting the first term using partial fractions leads to

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

s− 1s+ 1

1

Page 122: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

with inverse transformy1(t) = 1− e−t

Rewriting the second term using partial fractions leads to

Y2(s) = 1s+ 1 ·

1s2 + 1 = 0.5

s+ 1 −0.5ss2 + 1 + 0.5

s2 + 1with inverse transform

y2(t) = 0.5e−t − 0.5 cos t+ 0.5 sin tHence, the system output is

y(t) = 1− 0.5e−t + 0.5 sin t− 0.5 cos t

1.5 a) The abolute value is |1 + i| =√

2, and the argument is arctan 11 = π

4 = 45◦. Hence, the polar form is√

2eiπ4

b) The absolute value is|1 + i|

5∣∣∣1 +

√(3)i∣∣∣ =

√2

5 · 2 ≈ 0.14

The argument is

arg(

1 + i5i(1 +

√3i)

)= arg (1 + i)− arg 5i− arg (1 +

√3i)

= arctan 1− 90◦ − arctan√

3 = 45◦ − 90◦ − 60◦

= −105◦

Hence, the polar form is √2

10 e−i 105

180π

c) 2eiπ3 = 2 cos π3 + 2i sin π3 = 1 +

√3i

d) 5e−iπ = 5 cos(−π) + 5i sin(−π) = −5

1.6 The amplification in deciBel is computed as 10 log |F |2 = 20 log |F |, where F is the absolute value of the amplification.The amplification F = 100 hence corresponds to 20 log 100 = 40 dB20.

deciBel (dB20) Definition Amplification F20 20 logF = 20 ⇒ F = 101 = 10−3 20 logF = −3 ⇒ F = 10−3/20 ≈ 0.708 ≈ 1√

20 20 logF = 0 ⇒ F = 100 = 110 20 logF = 10 ⇒ F = 100.5 =

√10 ≈ 3.16

−10 20 logF = −10 ⇒ F = 10−0.5 = 1√10 ≈ 0.316

1.7 Multiplication of the two matrices gives the unit matrix.

1.8 The eigenvalues (λ) of the matrix A are given by the equation det(λI −A) = 0, and the corresponding eigenvectors (v)are given by the equation (λI −A)v = 0.

λ1 = 3 v1 =

11−2

λ2 = −1 v2 =

103

λ3 = 4 v3 =

−102

2

Page 123: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1.9

T =

1 1 −11 −1 01 0 1

1.10 A basis for the null space is for example

01−11

A basis for the range space is

2031

1110

2131

The rank of the matrix is hence 3.

1.11 a) Writing the function with partial fractions yields

F (s) = 1s− 1s+ 1

The inverse transform is then computed by use of a Laplace transform table:

f(t) = 1− e−t

This means that f(t)→ 1 as t→∞. The same result can also be obtained by use of the final value theorem, thatis, by computing lims→0 sF (s).

b) Writing the function with partial fractions yields

F (s) = − 0.5s+ 1 + 0.5

s− 1The inverse transform is then computed by use of a Laplace transform table:

f(t) = −0.5e−t + 0.5et

This means that f(t) will grow without bound as t →∞. Here, the final value theorem cannot be used since f(t)lacks a final value.

c) The inverse transform can be computed by use of the relation

L−1{G(s+ a)} = e−at · g(t)

Here, G(s) = 1s2 and a = 1. The inverse transform of G is g(t) = t, so

f(t) = L−1{ 1(s+ 1)2 } = e−t · t

which tends to 0 as t→∞. This result can also be obtained by use of the final value theorem.

1.12 The relation between inflow and water level is given by the transfer function

Y (s) = 1s+ 1Z(s)

and the relation between control signal and inflow may be written as

Z(s) = 1s2 + s+ 1U(s)

This means that the Laplace transforms of the control signal and water level are related by

Y (s) = 1(s+ 1)

1(s2 + s+ 1)U(s) = 1

s3 + 2s2 + 2s+ 1U(s)

which corresponds to the differential equation

y(3) + 2y + 2y + y = u

3

Page 124: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

2 Dynamic Systems

2.1 a) We start from the equations

Jθ = −fθ +M (2.1)M = kai (2.2)v = kvθ (2.3)

Voltage equilibrium givesu−Rai− La

didt − v = 0 (2.4)

where La = 0. Equation (2.2) in (2.1) givesJθ + fθ = kai (2.5)

From (2.4) and (2.3) we geti = (u− kvθ)/Ra

which in (2.5) givesJθ + fθ = ka(u− kvθ)/Ra

that isθ + Raf + kakv

JRaθ = ka

JRau

Let1τ

= Raf + kakv

JRak0 = ka

JRa

which givesθ + 1

τ· θ = k0u (2.6)

b) Laplace transformation of (2.6) gives(s2 + 1

τ· s)θ(s) = k0U(s)

and this gives the transfer functionG(s) = θ(s)

U(s) = k0

s(s+ 1/τ)

c) Suppose that u is a unit step, that is,

u ={

0, t < 01 t ≥ 0

that isU(s) = 1

s

This gives

θ(s) = G(s)U(s) = k0

s(s+ 1/τ) ·1s

=(k0τ

s− k0τ

s+ 1/τ

)· 1s

Inverse Laplace transformation givesθ(t) = k0τt− k0τ

2(1− e−t/τ )

that is, θ will grow unlimited when t increases.

2.2 (1) Asymptotically stable system. Monotonic step response, that is, real poles: K = 0.1.

(2) Very oscillative system. Poles close to the imaginary axis: K = 2.5.

(3) Unstable system. Poles in the right half plane: K = 3.

4

Page 125: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

(4) Asymptotically stable system. Oscillative step response, that is, complex poles in the left half plane: K = 0.5.

2.3 The inverse Laplace transform gives the step response

d1(t) = L−1{

β

1 + sT· 1s

}= β(1− e−t/T )

For the final value, we haved1(t)→ β, t→∞

The figure gives β = 10. At the time t = T , the system time constant, the step response has reached 63% of the finalvalue, that is,

d1(T ) = 0.63 · 10

The figure gives T = 3, which gives the total transfer function

G(s) = 101 + 3s

If we measure the signal d2(t) we introduce an additional time delay of LV time units. The total transfer function then

becomes

G(s) = 10e− LV s

1 + 3s

Answer:

G(s) = 10e− LV s

1 + 3s

2.4 Use the system description

G(s) = ω20

s2 + 2ζω0s+ ω20

In the first figure ω0 = 1 and ζ = 0.5.

a) For the systemG(s) = 1

s2 + as+ 1we have ω0 = 1 and ζ = 0.5a. The step response is more oscillative than in the case ζ = 0.5, that is, ζ < 0.5. Thisgives a < 1.

b) For the system

G(s) = b2

s2 + bs+ b2

we have ω0 = b and ζ = 0.5. The step response is in this case pure time scaling compared to the case ω0 = 1. Thefigures show that the step response is twice as fast as in the case ω0 = 1. This gives b = ω0 = 2.

2.5 The pairs of plots that belong to the same system will be written in the form pole-zero-letter–step-response-letter.Pole-zero diagram B has a single pole in the origin which gives a ramp as step response, that is, B–F. Pole-zero diagram Dalso has a pole in the origin which gives an infinitely growing step response, D–C. Pole-zero diagram F has complex poleswhich gives an oscillative step response, F–D. Pole-zero diagram A has a zero in the origin which gives final value zero,A–B. Pole-zero diagram C cannot be step response E, since two real poles and no zeros give no overshoot. Hence C–A,and step response E is the only alternative left for pole-zero diagram E.Answer: A–B, B–F, C–A, D–C, E–E, F–D.

2.6 a) Enter the systems. >> s = tf( ’s’ );>> GA = 1 / ( s^2 + 2*s + 1 );>> GB = 1 / ( s^2 + 0.4*s + 1 );>> GC = 1 / ( s^2 + 5*s + 1 );>> GD = 1 / ( s^2 + s + 1 );>> GE = 4 / ( s^2 + 2*s + 4 );

5

Page 126: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Compute and plot the step response. >> step( GA ); grid

Time (sec.)

Am

plitu

de

Step Response

0 5 10 150

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

The systems GB(s), GC(s), GD(s), and GE(s) can be simulated in a similar way. The values of Tr, Ts, and Mfor the different step responses can be found by a right click in the figure and selecting “Characteristics” and thenselecting the desired property. Use the “Properties. . . ” menu item (of the right click menu) to change the intervalfor the settling time. (The default interval is 2%, while we use 5% in the course.)

b) Compute the poles. >> pole( GA )ans =

-1-1

The other systems are handled in the same way.

c) The results from a) and b) can be summarized in the following table.

System Tr Ts M polesGA 3.37 4.74 0% −1,−1GB 1.21 13.7 52.7% −0.2± i0.98GC 10.5 14.6 0% −4.8,−0.2GD 1.65 5.29 16.3% −0.5± i0.87GE 0.824 2.64 16.3% −1± i1.73

Using this table we can draw the following conclusions. (i): The speed of the step response (mainly) depends onthe distance between the poles and the origin. Poles further away from the origin give a faster step response andshorter rise time. (ii): The damping of the system depends on the relationship between the imaginary part and thereal part of the poles. Poles with large imaginary part relative to the real part give a poorly damped (oscillatory)step response.Remark: We see that even though the distance to the origin is nearly the same in system GA and GB the risetime is almost 3 times faster in system B. Note that speed is not only rise time, also the settling time should beconsidered! Look at the following system

G(s) = ω20

s2 + 2ζω0s+ ω20

The poles of this system are given by s = ω0(−ζ± i√

1− ζ2) = ω0(− cosφ± i sinφ) where cosφ = ζ. The parameterζ is called relative damping and 0 ≤ ζ ≤ 1. We see that ω0 is the distance from the origin to the poles and inFigure 2.6a the step responses for different ζ are shown when ω0 is constant. We see clearly that the rise time isfaster when ζ is small but when ζ is small the settling time is big!

6

Page 127: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0 2 4 6 8 10 12 14 16 18 200

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

ω0 t

y

1.0

0.7

0.5

0.3

0.1

Figure 2.6a

2.7 Enter the system. Here we consider the caseα = 2, that is the system has a zero in −0.5.

>> s = tf( ’s’ );>> G1 = ( 2*s + 1 ) / ( s^2 + 2*s + 1 );

Plot the step response. >> step( G1, 10 ); grid

Time (sec.)

Am

plitu

de

Step Response

0 1 2 3 4 5 6 7 8 9 100

0.2

0.4

0.6

0.8

1

1.2

1.4

A zero located close to the origin on the negative real axis causes an overshoot in the step response. A zero on thepositive real axis causes the step response to initially move in the negative direction. This means that in some cases thezeros of the system can have significant influence in the system properties. Systems with zeros in the right half planenormally imply extra difficulties for the design of control systems.

2.8 The Laplace transform of a step is U(s) = 1s . The step response is hence given by

y(t) = L−1(G(s)1s

).

If G(s) is a rational function the inverse Laplace transform can be computed by first doing a partial fraction expansionand then using a transform table. When the system is available one can let the input u(t) be a step and measure y(t).

7

Page 128: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

2.9 a) The steady state value is 1.5.

b) The output signal almost reaches 1.9, which is slightly less than 0.4 over the final value. The overshoot is hence0.41.5 ≈ 26%.

c) Find the time points where the output is 10% (0.15) and 90% (1.35) of the steady state value. The rise time is thedifference between these values, here approximately Tr ≈ 1.5 s.

d) Find the earliest time such that the output then lies within ±5% of the steady state value. Here, the interval is[ 1.425, 1.575 ], and the settling time is Ts ≈ 7.8.

2.10 G1–C: G1 is poorly damped, which gives an oscillatory behavior.G2: Can be excluded since it is the only system having static gain 1

2 , and among the step responses there is always morethan one match for each of the present final values.G3–B: This case has the shortest rise time, and some overshoot due to the pair of complex poles. The static gain is 2.G4–A: The pole in −2 dominates, which gives slower step response than systems G3 and G5. The static gain is 1.G5–D: The dominating pole is in −3, which is slower than for G3 but faster than for G4. The static gain is 2.G6: Can be excluded due to instability.

2.11 a) The signals can be classified as

� Disturbances signal: Acid process flow (unknown pH and flow)

� Control signal: NaOH solution

� Measured and controlled signal: The pH of the outflow

b) A block diagram where the control strategy is based on feedback could look like Figure 2.11a

TankFΣ+NaOH

outflow pHref

Acid flow

Figure 2.11a

2.12 a) At steady state the inflow is equal to the outflow (constant volume). From mass balance

ρ∗q∗ = ρ∗1q∗1 + ρ∗2q

∗2

Assuming the densities are equal (ρ = ρ1 = ρ2) gives q∗ = q∗1 + q∗2 = 1 + 0.5 = 1.5 m3/min. From componentbalance for component A

q∗c∗A = q∗1c∗A,1 + q∗2c

∗A,2

which gives c∗A = 2.0 kmol/m3.

b) The amount of mass in the tank is given by ρV (assuming ρ is constant). The change in mass is given by the masscoming in subtracted by the mass going out of the tank

d(ρV )dt = ρ(qin − qout) (2.1)

where qin = q1 + q2 and qout = q. Assuming that the volume is constant gives d(ρV )dt which means

q1 + q2 = q (2.2)

8

Page 129: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

The amount of component A contained in the tank is given by V cA. The change is then given by

d(V cA)dt = q1cA,1 + q2cA,2 − qcA (2.3)

Constant V and (2.2) gives

VdcAdt = q1 (cA,1 − cA) + q2 (cA,2 − cA) (2.4)

The model (2.1), (2.3) is nonlinear since it contains products between variables. Assuming volumes and flows to beconstant gives a linear model.

c) Assume that all the other independent variables (q1, q2, cA,2) are constant. Take their values from a). Equation (2.4)then gives

VdcAdt = q∗1 (cA,1(t)− cA(t)) + q∗2

(c∗A,2 − cA(t)

)= −1.5cA(t) + cA,1(t) + 2

The equation can be writtendcAdt = −1.5cA(t) + 3.2

for t ≥ 0. The corresponding Laplace transform equation is

s(LcA)(s)− (LcA)(0) = −1.5(LcA)(s) + 3.21s

or(LcA)(s) = 1

s+ 1.5

(2 + 3.2

s

)= 2 1

s+ 1.5 + 3.2 1s+ 1.5

1s

which transforms back tocA(t) = 2e−1.5t + 3.2

1.5(1− e−1.5t)

Rearranging yields3.21.5 +

(2− 3.2

1.5

)e−1.5t = 2−

(2− 3.2

1.5

)(1− e

− t1

1.5

)where the sought constants can be identified: k0 = 2.0 kmol/m3, k1 = 0.13 kmol/m3, and τ = 1

1.5 = 0.67 min.

2.13 a) The equilibrium equation isyi = αxi

1 + (α− 1)xi(2.1)

Mass balance givesdMi

dt = Li−1 + Vi+1 − Li − Vi (2.2)

Component balance gives

d(Mixi)dt = Mi

dxidt + xi

dMi

dt = Li−1xi−1 + Vi+1yi+1 − Lixi − Viyi (2.3)

Combining (2.2)–(2.3) gives

Midxi

dt = −xi (Li−1 + Vi+1 − Li − Vi) + Li−1xi−1 + Vi+1yi+1 − Lixi − Viyi

= Li−1 (xi−1 − xi) + Vi+1 (yi+1 − xi) + Vi (xi − yi)(2.4)

The dynamic model for Mi(t) and xi(t) is described by (2.1), (2.2), and (2.4).

b) The stationary point for (2.2) gives L∗i−1 + V ∗i+1 − L∗i − V ∗i = 0. Introduce the difference variables

xi∆ = xi − x∗i xi+1,∆ = xi+1 − x∗i+1 yi∆ = yi − y∗iyi−1,∆ = yi−1 − y∗i−1 Li+1,∆ = Li+1 − L∗i+1 Vi−1,∆ = Vi−1 − V ∗i−1

Li∆ = Li − L∗i Vi∆ = Vi − V ∗i

9

Page 130: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

The assumption that the change of mass on the plate is zero gives

dMi∆

dt = 0

which means thatLi−1 + Vi+1 − Li − Vi = 0

this will simplify (2.4) toMi

dxidt = Li−1xi−1 + Vi+1yi+1 − Lixi − Viyi (2.5)

Linearization of (2.5) gives

M∗idxi∆

dt = L∗i−1xi−1,∆ + V ∗i+1yi+1,∆ − L∗i xi∆ − V ∗i yi∆

+ x∗i−1Li−1,∆ + y∗i+1Vi+1,∆ − x∗1Li∆ − y∗i Vi∆(2.6)

Linearization of (2.1) givesyi∆ = α

(1 + (α− 1)x∗i )2xi∆ (2.7)

The linearized model is described by (2.6)–(2.7).

Solution

2.14 Från blockdiagramet fås Y (s) = G2(s)[F2(s)Y (s) + G1(s)U(s) + F1(s)U(s)], vilket ger överföringsfunktionen Y (s)U(s) =

G2(s)(G1(s) + F1(s))1− F2(s)G2(s) .

2.15 D: En integrator vars stegsvar är en ramp. Ger 1. B: Nollställe i högra halvplanet vilket ger ett stegsvar som initialtgår åt fel håll. Ger 5. A: Polerna till A och B är samma, vilket ger samma relativa dämpning. Ger 2. C: Polerna harrelativ dämpning ζ = 0.15 vilket är mindre än alla andra. Ger 4. F: Polerna har relativ dämpning ζ = 1 och snabbhetω0 = 3. Inget annat system är så snabbt. Ger 3. E: Enda systemet kvar. Ger 6.Svar: A-2, B-5, C-4, D-1, E-6 and F-3

10

Page 131: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

3 Feedback Systems

3.1 a) To begin with, the transfer function for the tank system is derived. The mass balance equation is, assuming thatthe bottom area of the tank is 1 m2

h(t) = x(t)− v(t)that is (note that all initial conditions are zero when deriving transfer functions)

sH(s) = X(s)− V (s)

HenceH(s) = Gt(s)(X(s)− V (s))

whereGt(s) = 1

sThe block diagram becomes like in Figure 3.1a.

b) The transfer function for the valve isGv(s) = kv

1 + TsWith the input taken as a unit step signal, that is,

U(s) = 1s

it follows thatX(s) = kv

1 + Ts· 1s

The final value theorem giveslimt→∞

x(t) = lims→0

sX(s) = kv

The time constant T is the time it takes for the step response to reach 63% of its final value. From the plot itfollows that T = 5 and kv = 2, that is

Gv(s) = 21 + 5s

Gv(s)F (s)Σ Σ Gt(s)+e u x

+−

−href h

v

Figure 3.1a

c) By using the controller F (s), the closed loop system shown in Figure 3.1a is obtained. From the block diagram,the following equations are obtained:

E(s) = Href(s)−H(s)H(s) = Gt(s)

(F (s)Gv(s)E(s)− V (s)

)This leads to

H(s) = Gt(s)(Gv(s)F (s) [Href(s)−H(s)]− V (s)

)⇐⇒

H(s)(

1 +Gt(s)Gv(s)F (s))

= Gt(s)(Gv(s)F (s)Href(s)− V (s)

)⇐⇒

H(s) = Gt(s)Gv(s)F (s)1 +Gt(s)Gv(s)F (s)︸ ︷︷ ︸

Gc(s)

Href(s)−Gt(s)

1 +Gt(s)Gv(s)F (s)︸ ︷︷ ︸−Gv,h(s)

V (s)

11

Page 132: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

That the expression for the output is a sum over all inputs, with each term given by a rational transfer functionmultiplied by the input, is no coincidence; this will always be true of any transfer function between points in a blockdiagram with rational transfer functions and summation points. In particular, the output is a linear (dynamic)function of the inputs. This leads to a conclusion that will be used frequently hereafter: When computing thetransfer function from one input to the output, all other inputs may be set to zero. The reader is encouraged to trythis by taking Href(s) = 0 in the first equation above.Inserting the expressions for Gt(s) and Gv(s) in the equation above, it follows that Gv,h is given by

H(s)V (s) = − 1 + 5s

s(1 + 5s) + 2F (s)

and Gc byH(s)Href(s)

= 2F (s)s(1 + 5s) + 2F (s)

Assume F (s) = Fb(s)Fa(s) with Fb(s) and Fa(s) polynomials, then the characteristic polynomial becomes p(s) = s(1 +

5s)Fa(s) + 2Fb(s) in both cases.

d) Proportional feedbackF (s) = K

givesH(s)Href(s)

= 0.4Ks2 + 0.2s+ 0.4K

The closed loop poles are given bys2 + 0.2s+ 0.4K = 0

That iss = −0.1± i

√0.4K − 0.01 if K > 0.025

The closed loop poles belong to the pre specified region provided that |Re | > |Im | or

0.01 > 0.4K − 0.01

Hence K < 0.05.

e) When v is a unit step signal we haveV (s) = 1

s

The control error e = href − h = −h (href = 0) is given by

E(s) = −H(s) = s+ 0.2s2 + 0.2s+ 0.4K ·

1s

The final value theorem gives (the system is stable for K > 0)

limt→∞

e(t) = lims→0

sE(s) = 12K

f) A PI controller, that is,F (s) = KPs+KI

sgives

E(s) = s(s+ 0.2)s2(s+ 0.2) + 0.4(KPs+KI)

· 1s

when v is a unit step signal. The final value theorem gives (provided that the closed loop system is asymptoticallystable)

limt→∞

e(t) = lims→0

s(−H(s)) = 0

3.2 a) The closed loop poles (from Solution 3.1) are given by

s = −0.1± i√

0.4K − 0.01

K = 1 givess = −0.1± i

√0.39

12

Page 133: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) PD controlF (s) = KP +KDs

and using the expressions derived in Solution 3.1, this results in

H(s) = 2F (s)s(1 + 5s) + 2F (s)Href(s) = 0.4(sKD +KP)

s2 + (0.2 + 0.4KD)s+ 0.4KPHref(s)

The characteristic polynomial iss2 + (0.2 + 0.4KD)s+ 0.4KP = 0

Compare with the standard forms2 + 2ζω0s+ ω2

0 = 0

where ω0 denotes the fundamental frequency and ζ denotes the relative damping. Assume KP = 1 and determineKD so that ζ > 1/

√2. A comparison with the standard form then gives

ω0 =√

0.4

ζ = 0.2 + 0.4KD

2√

0.4>

1√2

which gives KD > 1.7.

3.3 The dynamics of the astronaut is given byF = ma

where m = 100, F is the control signal u and a = y. This gives the model

100y = u

andY (s) = 1

100s2U(s)

The control law is given byu = K1(r − y)−K1K2y = K1((r − y)−K2y)

orU(s) = K1(R(s)− Y (s)−K2sY (s))

The transfer function from r to e is given by

E(s) = s2 + 0.01K1K2s

s2 + 0.01K1K2s+ 0.01K1R(s)

When r(t) = t we haveR(s) = 1

s2

The final value theorem then gives (provided that K1 and K2 are chosen such that the closed loop is asymptoticallystable) (also note that the transfer function from r to e must have at least one zero at the origin for the final value toexist, but this is satisfied regardless of the choice of K1 and K2)

limt→∞

e(t) = lims→0

sE(s) = K2 < 1

The transfer function from r to y is given by

Gc(s) = Y (s)R(s) = 0.01K1

s2 + 0.01K1K2s+ 0.01K1

The standard form for the characteristic equation

s2 + 2ζω0s+ ω20 = 0

gives with ζ = 1/√

2 ≈ 0.7s2 +

√2ω0 + ω2

0 = 0

13

Page 134: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

A comparison with

s2 + 0.01K1K2s+ 0.01K1 = 0

gives ω0 = 0.1√K1. We hence obtain

K1 = 200K2

2

Answer: Choose K2 < 1 and K1 = 200/K22 .

3.4 We shall determine how the control error e(t) = yref(t)−y(t) depends on the disturbance signal fc. We can assume thatyref(t) = 0, since the size of the error as a function of fc is sought for.

E(s) = Yref(s)−G(s) · (Fc(s) + F (s)E(s))

where

G(s) = 1ms2 + ds

gives

E(s) = − G(s)1 +G(s)F (s) ·Fc(s)

fc(t) is a step disturbance, that is

Fc(s) = a

s

a) Proportional control, F (s) = K, gives

E(s) = − 1ms2 + ds+K

· as

Using the final value theorem it follows that (provided that K is chosen such that the closed loop is asymptoticallystable)

limt→∞

e(t) = lims→0

sE(s) = −a/K

b) Proportional-Integral control

F (s) = K1s+K2

s

gives

E(s) = − s

ms3 + ds2 +K1s+K2· as

The final value theorem in this case gives (provided that K1 and K2 are chosen such that the closed loop isasymptotically stable)

limt→∞

e(t) = lims→0

sE(s) = 0

3.5 a) Enter the system. >> s = tf( ’s’ );>> G = 0.2 / ( ( s^2 + s + 1 ) * ( s + 0.2 ) );

Generate a proportional regulator. >> F = 1;

Generate the closed loop system. >> Gc = feedback( F * G, 1 );

14

Page 135: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Compute and plot the step response. >> step( Gc, 30 ); grid

Time (sec.)

Am

plitu

de

Step Response

0 5 10 15 20 25 300

0.1

0.2

0.3

0.4

0.5

0.6

0.7

By trying some different values of KP the following behavior can be seen: For small values of KP the step responseis slow, well damped and the steady state error is large. For increasing KP the step response becomes faster butmore oscillatory, while the error is reduced. For large KP the amplitude of the oscillations increases over time, thatis, the closed loop system becomes unstable.

b) Generate a PI controller with KP = 1 andKI = 1.

>> KP = 1; KI = 1;>> F = KP + KI / s;

Plot the result. >> Gc = feedback( F * G, 1 );>> step( Gc, 50 ); grid

Time (sec.)

Am

plitu

de

Step Response

0 5 10 15 20 25 30 35 40 45 500

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

The following effects of the integrator can be found by trying some different values of KI. (i): The integrator inthe regulator eliminates the steady state error. (ii): A too small value of KI gives a large settling time while a toolarge value gives an oscillatory (finally unstable) closed loop system.

15

Page 136: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

c) Generate a PID controller with KP =1,KI = 1,KD = 2 and T = 0.1.

>> KP = 1; KI = 1; T = 0.1; KD = 1;>> FP = KP;>> FI = KI / s;>> FD = KD * s / ( s*T + 1 );>> F = FP + FI + FD;

Plot the result. >> Gc = feedback( F * G, 1 );>> step( Gc, 50 ); grid

Time (sec.)

Am

plitu

de

Step Response

0 5 10 15 20 25 30 35 40 45 500

0.5

1

1.5

Using the (approximate) derivative of the error in the regulator increases the damping of the closed loop system.Increasing KD too much, however, gives that an oscillation with higher frequency appears in the step response andfinally (approximately when KD > 65) the closed loop system becomes unstable.

3.6 a) The transfer function for the closed loop system is

Gc(s) = Go(s)1 +Go(s) = K(s+ 2)

s(s+ 1)(s+ 3) +K(s+ 2)

The characteristic equation is

s(s+ 1)(s+ 3) +K(s+ 2) = P (s) +KQ(s) = 0

that isP (s) = s(s+ 1)(s+ 3) Q(s) = s+ 2

� Starting points: ⇔ zeros of P (s) : 0,−1,−3End points: ⇔ zeros of Q(s) : −2

� Number of asymptotes: 2Directions: 1

2 [π + 2kπ] = ±π/2Intersection with the real axis: 1

2 [0 + (−1) + (−3)− (−2)] = −1

� Real axis: [−3, −2) and [−1, 0] belongs to the root locus

� Intersection with the imaginary axis: Set s = iω and solve the characteristic equation

iω(iω + 1)(iω + 3) +K(iω + 2) = −iω3 − 4ω2 + (3 +K)iω + 2K = 0

⇒ (−ω2 + 3 +K)ω = 0−4ω2 + 2K = 0

}⇒ ω = K = 0

(starting point)

16

Page 137: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−4 −3 −2 −1 1

Re

Im

Asymptote

−3

−2

−1

1

2

3

Asymptote

K ≈ 0.4186

Figure 3.6a

Re

−3 −2 −1 1

−3

−2

−1

1

2

3Im

Asymptotes

ω = − 2K = 4{

ω = 2K = 4{

−2/3

Figure 3.6b

This gives the root locus in Figure 3.6a.Answer: All poles are in the left half plane, that is, the closed loop system is asymptotically stable for all K > 0.For small values of K there are no oscillations and the speed is increasing with increasing K. For a certain valueof K the system becomes oscillating. The damping is decreasing with increasing K.

b) The transfer function for the closed loop system is

Gc(s) = Go(s)1 +Go(s) = K

s(s2 + 2s+ 2) +K

The characteristic equation readss(s2 + 2s+ 2) +K = 0

that isP (s) = s(s2 + 2s+ 2) Q(s) = 1

� Starting points: ⇔ zeros of P (s) : 0,−1± iEnd points: ⇔ There are no zeros of Q(s)

� Number of asymptotes: 3Directions: 1

3 [π + 2kπ] = π,±π/3Intersection of asymptotes: 1

3 [0 + (−1 + i) + (−1− i)] = −2/3

� Part of the real axis that belongs to the root locus: (−∞, 0]

� Intersection with the imaginary axis: Set s = iω and solve the characteristic equation

iω((iω)2 + 2iω + 2) +K = −iω3 − 2ω2 + 2iω +K = 0

⇒ (−ω2 + 2)ω = 0−2ω2 +K = 0

}⇒ ω = K = 0 or ω = ±

√2

(start point) K = 4

}

17

Page 138: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−7 −6 −5 −4 −3 −2 −1 1 2

−5

−4

−3

−2

−1

1

2

3

4

5

Re

ImAsymptote

Asymptote

ω = − 1.5K = 7.5{

ω = 1.5K = 7.5{K ≈ 1.1021

Figure 3.6c

This gives the root locus in Figure 3.6b.Answer: All poles are in the left half plane. That is, the system is asymptotically stable for 0 < K < 4. Thestep response is oscillating for all K. To begin with the system will be faster with increasing K. However, for Ksufficiently large the oscillating part is dominating. The damping will decrease with increasing K and for (K ≥ 4)the closed loop system is unstable.

c) The transfer function for the closed loop system is

Gc(s) = Go(s)1 +Go(s) = K(s+ 1)

s(s− 1)(s+ 6) +K(s+ 1)The characteristic equation is

s(s− 1)(s+ 6) +K(s+ 1) = P (s) +KQ(s) = 0

P (s) = s(s− 1)(s+ 6) Q(s) = s+ 1

� Starting points: ⇔ zeros of P (s) : 0, 1,−6End points: ⇔ zeros of Q(s) : −1

� Number of asymptotes: 3− 1 = 2Directions: 1

2 [π + 2kπ] = ±π/2Intersection of the asymptotes: 1

2 [0 + 1 + (−6)− (−1)] = −2

� Part of the real axis that belongs to the root locus: [−6, −1) and [0, 1]

� Intersection with the imaginary axis: Set s = iω and solve the characteristic equation:

iω(iω − 1)(iω + 6) +K(iω + 1) = −iω3 − 5ω2 + (K − 6)iω +K = 0

⇒ (−ω2 +K − 6)ω = 0−5ω2 +K = 0

}⇒ ω = K = 0

(start point)

}or ω =

√32

K = 7.5

This gives the root locus in Figure 3.6c.Answer: All poles are in the left half plane, that is, the closed loop system is asymptotically stable for K > 7.5.For small values on K the closed loop system is (as the open loop system) unstable. For K > 7.5 the closed loopsystem is stable and oscillating. As K is increasing from the critical value both the damping and the response speedare increasing (the time constant is always ≥ 1/2s), until they both are beginning to decrease. The damping isdecreasing with increasing K.

3.7 The transfer function for the closed loop system is obtained from

θ(s) = 1sθ(s) = 1

s· k

1 + sτ·K · (θref(s)− αsθ(s)− θ(s))

⇒G(s) = θ(s)

θref(s)= k ·Ks(1 + sτ) + k ·K(1 + αs) = 4K

s(s+ 2) + 4K(1 + αs)The characteristic equation is:

s(s+ 2) + 4K(1 + αs) = 0

18

Page 139: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−3 −2 −1 1

−2

−1

1

2

Re

Im

Asymptote

Asymptote

K = 0.25

Figure 3.7a

−3 −2 −1 1

−2

−1

1

2

Re

Im

Asymptote

Figure 3.7b

a) α = 0. The characteristic equation is then

s(s+ 2) + 4K = s2 + 2s+ 4K = 0

with the solutions = −1±

√1− 4K

This gives the root locus in Figure 3.7a.Answer: All poles are in the left half plane, that is, the closed loop system is asymptotically stable for all K > 0.

b) α = 1. The characteristic equation is then

s(s+ 2) + 4K(1 + s) = 0

that isP (s) = s(s+ 2) Q(s) = 4(1 + s)

� Starting points: ⇔ zeros of P (s): 0, −2End points: ⇔ zeros of Q(s): −1

� Number of asymptotes: 2− 1 = 1.Direction of asymptotes: 1

1 ·π, that is, the negative real axis.

� Part of the real axis that belongs to the root locus: (−∞, −2] and (−1, 0]

� Intersection with the imaginary axis: Set s = iω and solve the characteristic equation:

iω(iω + 2) + 4K(1 + iω) = −ω2 + (2 + 4K)iω + 4K = 0

⇒ (2 + 4K)ω = 0−ω2 + 4K = 0

}⇒ ω = K = 0

(start point)

This gives the root locus in Figure 3.7b.Answer: All poles are in the left half plane, that is, the closed loop system is asymptotically stable for all K > 0.

19

Page 140: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−6 −5 −4 −3 −2 −1 1

−2

−1

1

2

Asymptote

K = 3 + 0.5 27 K = 3 − 0.5 27

Re

Im

Figure 3.7c

c) α = 1/3. The characteristic equation is then

s(s+ 2) + 4K(1 + s/3) = P (s) +KQ(s) = 0

which givesP (s) = s(s+ 2) Q(s) = 4(1 + s/3)

� Starting points ⇔ zeros of P (s): 0, −2End points ⇔ zeros of Q(s): −3

� Number of asymptotes: 2− 1 = 1 Direction: 11 ·π , that is, the negative real axis

� Part of the real axis that belongs to the real axis (−∞, 3) and [−2, 0]

� Intersection with the imaginary axis. Set s = iω and solve the characteristic equation:

iω(iω + 2) + 4K(1 + iω/3) = −ω2 + (2 + 43K)iω + 4K = 0

⇒ (2 + 43K)ω = 0

−ω2 + 4K = 0

}⇒ ω = K = 0

(start point)

This gives the root locus in Figure 3.7c.Answer: All poles are in the left half plane, that is, the closed loop system is asymptotically stable for all K > 0.

d) K = 1. The characteristic equation becomes

s(s+ 2) + 4(1 + αs) = s2 + 2s+ 4 + 4αs = 0

that isP (s) = s2 + 2s+ 4 Q(s) = 4s

� Starting points ⇔ zeros of P (s): −1± i√

3End points ⇔ zeros of Q(s): 0

� Number of asymptotes: 2− 1 = 1Direction: 1

1 ·π, that is, the negative real axis

� Part of the real axis that belongs to the root locus: (−∞, 0)

� Intersection with the imaginary axis: s = iω solves the characteristic equation

−ω2 + 2iω + 4 + 4iωα = 0

⇒ ω(2 + 4α) = 0−ω2 + 4 = 0

}has no solution

(α < 0 is of no interest)

20

Page 141: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−3 −2 −1 1

−2

−1

1

2

Re

Im

Asymptote

α = 0.5

Figure 3.7d

To get further insights into the behavior of the closed loop system the intersection with the real axis is determined.That is, a real valued double root to the characteristic equation has to be determined

s2 + 2s+ 4 + 4αs = (s+ a)2 = s2 + 2as+ a2

⇒ 2a = 2 + 4αa2 = 4 ⇒ a = 2

α = 1/2

}This gives the root locus in Figure 3.7d.Answer: All poles are in the left half plane, that is, the closed loop system is stable for all α ≥ 0. From d) itfollows that the system will be more damped for larger values on α (compare b, c: in b) the system is not oscillatingfor any value on K). For α sufficiently large, the time constant can be arbitrary large. This is natural since theterm −αθ ·K (D-term) that appears in the input voltage of the motor reduces the velocity of the axis. The effect isas if the motor has been drained with thick oil. With a suitable viscosity α the system can be made fast and stableas in c). With α = 0 as in a) and K large enough, the system is not becoming faster just less damped.

3.8 a)ω(s)δref(s)

= G1(s) ·G2(s) = 10(s+ 1)(s+ 10)(s+ 4)(s− 3)

The open loop system is unstable (a pole in s = 3). Hence ω(t) is increasing when δref(t) is a step signal. Observe thatthe model is valid for small changes with respect to a large reference input θ0 for the pitch, and for predeterminedvalues on the static and the dynamic pressure.

b)ω(s) = G1(s) ·G2(s) ·K · (ωref(s)− ω(s))

gives

ω(s) = K ·G1(s) ·G2(s)1 +K ·G1(s) ·G2(s)ωref(s)

= 10K(s+ 1)(s+ 10)(s+ 4)(s− 3) + 10K(s+ 1)ωref(s)

The characteristic equation is(s+ 10)(s+ 4)(s− 3) + 10K(s+ 1) = 0

which givesP (s) = (s+ 10)(s+ 4)(s− 3) Q(s) = 10(s+ 1)

� Starting points: ⇔ zeros of P (s): −10, −4, 3End points: ⇔ zeros of Q(s): −1

� Number of asymptotes: 3− 1 = 2Directions: 1

2 (π + 2kπ) = ±π/2Intersection with the real axis: 1

3−1 [(−10) + (−4) + 3− (−1)] = −5

� Part of the real axis that belong to the root locus: [−10, −4] and (−1, 3]

21

Page 142: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−10 −8 −6 −4 −2 2 4

−10

−8

−6

−4

−2

2

4

6

8

10

Re

Im

−5

Asymptote

Asymptote

K ≈ 1.5163 K = 12

Figure 3.8a

� Intersection with the imaginary axis: s = iω solves the characteristic equation

(iω + 10)(iω + 4)(iω − 3) + 10K(iω + 1) =

= −iω3 − 11ω2 + (10K − 2)iω + 10K − 120 = 0

⇒ (−ω2 + 10K − 2)ω = 0−11ω2 + 10K − 120 = 0

}⇒ ω = 0

K = 12

}This gives the root locus in Figure 3.8a.Answer: All poles are in the left half plane, that is, the closed loop system is asymptotically stable for all K > 12.

c) The question is: Is there any K > 12 for which all poles are real valued? For K = 12 it is known that s = 0 is asolution to the characteristic equation. The other roots are given by

(s+ 10)(s+ 4)(s− 3) + 10 · 12(s+ 1) = s(s2 + 11s+ 118)

That is, the two remaining poles are

−112 ±

√(11

2 )2 − 118 = −5.5± 9.4i

which shows that they are complex for K > 12. The answer is hence no.

3.9 This text serves as a workaround for an obscure bug in LATEX.

1(s+1)(s+10)

K1

Σ+− ⇔ 1

(s+1)(s+10)+K1

⇒1

(s+1)(s+10)+K1

1s

K2

Σ+−

Figure 3.9a

a) The block diagram is given in Figure 3.9a. Hence, the characteristic equation is s ((s+ 1)(s+ 10) +K1)︸ ︷︷ ︸P (s)

+K2 = 0

Start points: 0 and the roots to s2 + 11s+ 10 +K1 = 0, that is, s = −5.5±√

5.52 − 10−K1

The roots are real when K1 ≤ 20.25. (I)The roots are complex when K1 > 20.25. (II)

22

Page 143: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

(I) � start points: 0, −5.5± α

� end points: missing

� asymptotes: 3: π3 , π,

5π3

intersection of the asymptotes: 13 (−11) = − 11

3

� parts of real axis: (−∞, −5.5− α], [−5.5 + α, 0]

The root locus is given in Figure 3.9b.

−15 −10 −5 0 5 10 15

−15

−10

−5

0

5

10

15

Real Axis

Imag

Axi

s

Root locus

Figure 3.9b

(II) � start points: 0, −5.5± iβ

� end points: missing

� asymptotes: as in (I)

� parts of real axis: (−∞, 0]

The root locus is given in Figure 3.9c

23

Page 144: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−15 −10 −5 0 5 10 15

−15

−10

−5

0

5

10

15

Real Axis

Imag

Axi

sRoot locus

Figure 3.9c

Imaginary axis crossings: put s = iω in the characteristic equation ⇒

iω(−ω2 + 11iω + 10 +K1) +K2 = 0 ⇔−iω3 − 11ω2 + 10iω +K1iω +K2 = 0 ⇒{

−ω3 + 10ω +K1ω = 0 (1)−11ω2 +K2 = 0 (2)

ω = 0 solution to (1) ⇒ in (2) K2 = 0.ω2 = 10 +K1 solution to (1) ⇒ −110− 11K1 +K2 = 0⇒ K2 = 11K1 + 110Answer: The closed loop system is asymptotically stable when 0 < K2 < 11K1 + 110

b) By using the inner feedback (K1 > 0) a larger value of K2 is allowed.

3.10 SetGo(s) = 1

(s+ 1)(s− 1)(s+ 5)With U(s) = F (s)E(s), the transfer function of the closed loop system becomes

Gc(s) = Go(s)F (s)1 +Go(s)F (s)

24

Page 145: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

a) Here, F (s) = K, so

Gc(s) = K

(s+ 1)(s− 1)(s+ 5) +K

The characteristic equation is(s+ 1)(s− 1)(s+ 5) +K = 0

which givesP (s) = (s+ 1)(s− 1)(s+ 5) Q(s) = 1

� Starting points: ⇔ Zeros of P (s): −1, 1, −5End points: ⇔ Zeros of Q(s): none

� Number of asymptotes: 3− 0 = 3Directions: 1

3 [π + 2kπ] = π, ±π/3Intersection point: 1

3 [−1 + 1 + (−5)] = −5/3

� Real axis: (−∞, −5] and [−1, 1] belongs to the root locus

� Intersection with the imaginary axis, set s = iω:

(iω + 1)(iω − 1)(iω + 5) +K = −iω3 − 5ω2 − iω +K − 5 = 0

⇐⇒{

(ω2 + 1)ω = 0−5ω2 +K − 5 = 0 ⇐⇒

{ω = 0K = 5

(A simple root!)

This gives the root locus in Figure 3.10a.

−7 −6 −5 −4 −3 −2 −1 1 2

−6

−4

−2

2

4

6

Re

Im

−5/3

Asymptotes

K ≈ 5.049 ⇒two poles in≈ 0.097

K = 5.0

Figure 3.10a

Answer: There exists at least one pole in the RHP. Hence, the system is not asymptotically stable for any valueof K.

b) Here, F (s) = K(1 + 0.5s). Hence

Gc(s) = K(1 + 0.5s)(s+ 1)(s− 1)(s+ 5) +K(1 + 0.5s)

The characteristic equation is(s+ 1)(s− 1)(s+ 5) +K(1 + 0.5s) = 0

which givesP (s) = (s+ 1)(s− 1)(s+ 5) Q(s) = 1 + 0.5s

� Starting points ⇔ Zeros of P (s): −1, 1, −5End points ⇔ Zeros of Q(s): −2

� Number of asymptotes: 3− 1 = 2Directions: 1

2 [π + 2kπ] = ±π/2Intersection point: 1

2 [−1 + 1− 5− (−2)] = − 32

25

Page 146: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−6 −5 −4 −3 −2 −1 1 2

−5

−4

−3

−2

−1

1

2

3

4

5

Re

ImAsymptote

Asymptote

K = 5.0K ≈ 5.1262

Figure 3.10b

� Real axis: [−5, −2) and [−1, 1] belongs to the root locus

� Intersection with the imaginary axis, set s = iω:

(iω + 1)(iω − 1)(iω + 5) +K(1 + 0.5iω) = 0

⇐⇒{−ω3 + ω(0.5K − 1) = 0−5ω2 − 5 +K = 0

⇐⇒{ω = 0K = 5 or

{ω2 = −1 , not real!K = 0

This gives the root locus in Figure 3.10b.Answer: The system is asymptotically stable (all poles in the LHP) if K > 5.

3.11 a) The closed loop system

Gc(s) =k

s(s+2)

1 + kas(s+2)(s+a)

= k(s+ a)s(s+ 2)(s+ a) + ka

has the characteristic equations(s+ 2)(s+ a) + ka = 0

Choose k = 6, and draw a root locus with respect to a. The characteristic equation can be written

s3 + 2s2 + a(s2 + 2s+ 6) = 0

that is,P (s) = s2(s+ 2) Q(s) = s2 + 2s+ 6

� Starting points: 0, 0, −2End points: −1± i

√5

� Number of asymptotes: 3− 2 = 1, direction: π.

� Parts of the real axis: (−∞, −2]

� Intersection with the imaginary axis: s = iω

6a− ω2(2 + a) + iω(2a− ω2) = 0

Im: ω(2a− ω2) = 0 ⇐= ω = 0 or ω2 = 2aRe: 6a− ω2(2 + a) = 0

ω = 0 ⇐= a = 0

ω2 = 2a ⇐= 2a− 2a2 = 0 ⇐= a = 0 or a = 1

Intersection points: s = 0, s = ±√

2

26

Page 147: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−3 −2 −1 1

−3

−2

−1

1

2

3

Re

Im

Asymptote

ω = 2a = 1{

ω = − 2a = 1{

(2)

Figure 3.11a

This gives the root locus in Figure 3.11a.Answer: The system is asymptotically stable for a > 1

b) For y to have a stationary value of 1 the system must first of all be stable. When the system is stable, the stationaryvalue will be 1 when r is a unit step since the system contains an integrator.Next, consider

ym(t) = sin(10t)⇒ yf(t) =∣∣∣∣ a

a+ 10i

∣∣∣∣ sin(10t+ ϕ)

(the expression for yf(t) is valid after a long time, that is, when the transient has vanished). The amplitude is givenby

A =∣∣∣∣ a

a+ 10i

∣∣∣∣ = 1√1 + 100

a2

Now, choose a as small as possible but a > 1 to maintain stability. The lowest amplitude is A ≈ 0.1.Answer: A = 0.1

3.12 When K is small the system has a real unstable pole, that is, the magnitude of the step response grows without boundand the step response has no oscillations ⇒ K = 4 corresponds to step response C.When K is larger we have an unstable complex-conjugated pole pair, that is, the magnitude of the step response growswithout bound and the step response is oscillative. ⇒ K = 10 corresponds to step response D.For even larger values of K all poles end up in the LHP. As K grows the step response becomes faster since thedominating poles move away from the origin. K = 18 corresponds to step response B and K = 50 to step response A.Answer: K Step

4 C10 D18 B50 A

3.13G(s) = sn−1 + b1s

n−2 + · · ·+ bnsn + a1sn−1 + · · ·+ an

= Tn−1(s)Nn(s)

With a proportional feedback the closed loop system becomes

Gc(s) = G(s)1 +KG(s) = Tn−1(s)

Nn(s) +KTn−1(s)

with the characteristic equationNn(s) +KTn−1(s) = 0

that is,P (s) = Nn(s) Q(s) = Tn−1(s)

27

Page 148: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

• Starting points: The zeros of Nn(s)End points: The zeros of Tn−1(s)

• Number of asymptotes: 1 since degNn(s)− deg Tn−1(s) = 1Direction: π

When K tends to infinity, one root approaches −∞, the remaining roots approaches the zeros of Tn−1(s). The zeros ofTn−1(s) are in the LHP according to the problem formulation. Hence, if K is large enough, the system is asymptoticallystable.

3.14 Since qout,∆(t) = 0 we get

ddth∆(t) = 1

A(qin,∆(t)− qout,∆(t)) = 1

Aqdam,∆(t− T )

= K

A(href,∆(t− T )− h∆(t− T ))

which givessH∆(s) = K

Ae−sT (Href,∆(s)−H∆(s))

The transfer function of the open loop system is hence

Go(s) = K

A· e−sT

s

Now draw the Nyquist curve:

• Big semi-circle in the RHP:s = Reiθ − π/2 < θ < π/2

Since Re s > 0 we have∣∣e−sT ∣∣ < 1, that is,

|Go(s)| < K

A· 1R

The large half circle is hence mapped onto the origin.

• Imaginary axis:|Go(iω)| = K

A· 1ω

argGo(iω) = −π2 − ωT

As ω goes from r to R, the gain monotonically decreases towards zero and the argument goes from −π/2 to −∞.The resulting Nyquist curve makes a spiral motion towards the origin. The first time the curve crosses the real axisis for ωT = π/2, that is, ω = π. The absolute value is then K/A

π .

• Small semi-circle to the right of the origin:

Go(reiω) ≈ K

A· 1r· e−iω

The small half circle is hence mapped into a large half circle in the RHP.

This gives the Nyquist path in Figure 3.14a. The system Go(s) has no poles in the RHP. According to the Nyquistcriterion, the closed loop system is asymptotically stable if the Nyquist curve does not enclose the point −1. In thiscase the condition reads

K/A

π< 1

Answer: K/A < π

3.15 The system G(s) has no poles in the RHP. The closed loop system is asymptotically stable if the Nyquist curve ofKGo(s) does not enclose the point −1. In the problem, Nyquist diagrams for G(s) are given. The axes must hence berescaled with a factor K.

28

Page 149: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Origin (i)

Large circle (iii)

Nyquist curve (ii)

Mirror image ofNyquist curve (ii)

Re

Im

Re

Im

ω decreases

KAπ

Origin (i)

Mirror image ofNyquist curve (ii)

Nyquist curve (ii)

Figure 3.14a

a) (i) Yes. (ii) Yes. (iii) No. (iv) Yes.

b) (i) Stable if 0.4K < 1, that is, K < 2.5.

(ii) Stable for K > 0.

(iii) Stable if 2K < 1, that is, K < 1/2.

(iv) Stable if 4K < 1 or 2K > 1, that is, K < 1/4 or K > 1/2.

3.16 a) G(iω) = 1iω gives

|G(iω)| = 1ω

argG(iω) = −90◦

b) G(iω) = 1−ω2 gives

argG(iω) = 1ω2 argG(iω) = −180◦

This gives the Nyquist curves in Figure 3.16a.

Re

Im

a)

Re

Im

b)

ω

ω

Figure 3.16a

3.17 a) Since G(iω) → 0, ω → ∞, we assume that the large half circle is mapped onto the origin. The small half circle ismapped onto the point 2. The point −1 is not encircled by the curve. This means that the closed loop system isstable if 1.5 ·K < 1. Hence K < 2/3.

b)

limt→∞

e(t) = lims→0

sE(s) = lims→0

s · 11 +KG(s) ·

1s

= 11 + 2K

for K < 2/3 according to a.

29

Page 150: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

c) The Nyquist criterion can also be applied toK

s·G(s)

as the open loop system. On the large half circle 1s ≈ 0 which means that it is mapped onto the origin even for

1s ·G(s). On the small half circle

s = r · eiθ − π

2 < θ <π

2we have G(s) ≈ 2 and

1s

= 1re−iθ

Hence, it is transformed by 1s ·G(s) to a large half circle in the RHP. Setting s = iω in 1

s gives the absolute value 1ω

and the argument −π/2. The Nyquist curve is turned 90◦ and “increased” by a factor 1ω . This gives the Nyquist

path in Figure 3.17a.Answer: The closed loop system is asymptotically stable if 3

2K < 1. This means that also in this case we haveK < 2/3.

Re

Im

−3/ω=−3/21.5/ω=0.15

Figure 3.17a

3.18 The systemG(s) = 1

s(1 + τs)is controlled by

u(t) = −Ky(t− T )

which gives the open loop systemGo(s) = Ke−sTG(s)

During self oscillations the open-loop gain is equal to −1:

Ke−iωTG(iω) = −1

that is,Ke−iωT · 1

ωe−iπ2

1√ω2τ2 + 1

e−i arctanωτ = e−iπ

ω = 1 gives {−T − π

2 − arctan τ = −π (1)K√τ2+1 = 1 (2)

K1 = 13K gives a self oscillations with ω = 0.5. This gives{

−T12 −

π2 − arctan τ

2 = −π (3)K1

0.5 ·√

τ24 +1

= 1 (4)

30

Page 151: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

The equations (1) - (4) give τ = 1.69 and hence

T = π

2 · arctan τ = 0.53

T1 = π − 2 arctan τ2 = 1.74

3.19 From the Nyquist curve it is seen that for ω = 1

argG(1i) = −135◦ |G(1i)| = 1/√

2

andargF (1i) = −45◦ |F (1i)| = K/

√2

This gives argF (1i)G(1i)) = −180◦. According to the Nyquist criterion, asymptotic stability is achieved if

|F (1i)G(1i)| = K/2 < 1 ⇒ K < 2

3.20 Since |G(iω)| does not tend to ∞ as ω → 0 the system does not have integrating factor for K = 0. Thus reject rootlocus no 2. Furthermore, since the gain can be increased arbitrarily without causing the Nyquist curve to encircle −1,that is, without making the closed loop system unstable, we reject root loci 3 and 4.Answer: Root locus no 1.

3.21 P ⇒ b0 = b2 = 0I ⇒ b0 = b1 = 0D ⇒ b1 = b2 = 0

3.22 a) The characteristic equation of the closed loop system is given by

(s2 + s+ 1)(s+ 0.2) +KP · 0.2 = 0

that is,P (s) = (s2 + s+ 1)(s+ 0.2) Q(s) = 0.2

Enter P (s) and Q(s). >> s = tf( ’s’ );>> P = ( s^2 + s + 1) * ( s + 0.2 );>> Q = 0.2;

Draw the root locus. Click in the figure todetermine the imaginary axis crossings.

>> rlocus( Q / P )

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

Real Axis

Imag

Axi

s

31

Page 152: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

When KP increases the two complex poles move towards the imaginary axis, that is, the closed loop system becomesmore oscillatory. Finally, for KP ≈ 6.2, the poles cross the imaginary axis and the closed loop system becomesunstable. This result is in accordance with Problem 3.5. For small values of KP the properties of the step responseare mainly determined by the real pole close to the origin. For larger values the complex poles start to dominateand when the complex poles cross the imaginary axis the amplitude of the oscillations in the step response increasesand the system becomes unstable.Note, however, that the root locus alone does not give sufficient information to tell how the stationary error changeswith the parameter.

b) The characteristic equation of the closed loop system using the PI controller with KP = 1 is given by

s((s2 + s+ 1)(s+ 0.2) + 0.2) +KI · 0.2 = 0

that is,P (s) = s(s3 + 1.2s2 + 1.2s+ 0.4) Q(s) = 0.2

Enter P (s) and Q(s). >> P = s * ( s^3 + 1.2*s^2 + 1.2*s + 0.4 );>> Q = 0.2;

Draw the root locus. Click in the figure todetermine the imaginary axis crossings.

>> rlocus( Q / P )

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−1.5

−1

−0.5

0

0.5

1

1.5

Real Axis

Imag

Axi

s

For small KI the response of the closed loop system is dominated by the poles on the real axis close to the origin.When KI increases the poles become complex and move towards the imaginary axis, that is, the closed loop systembecomes more oscillatory. Finally, for KI ≈ 1.5, the poles cross the imaginary axis, that is, the closed loop systembecomes unstable. As can be seen in Problem 3.5 a small value of KI, that is, a pole close to the origin, gives a slowstep response. When KI increases the dominating poles become complex and the step response becomes oscillatory.A large settling time will typically follow if the system is slow or have poor damping. Here, the large settling timefor small KI is due to the system being slow. That the steady state error is eliminated cannot easily be seen in theroot locus.

c) Using PID control with KP = 1,KI = 1 and T = 0.1 the characteristic equation of the closed loop system is givenby

(0.1s+ 1)(s(s2 + s+ 1)(s+ 0.2) + 0.2(s+ 1)) +KD · 0.2s2 = 0

that is,P (s) = (0.1s+ 1)(s4 + 1.2s3 + 1.2s2 + 0.4s+ 0.2) Q(s) = 0.2s2

Enter P (s) and Q(s). >> P = ( 0.1*s + 1 ) * ...( s^4 + 1.2*s^3 + 1.2*s^2 + 0.4*s + 0.2 );

>> Q = 0.2*s^2;

32

Page 153: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Draw the root locus. By changing the axesor using the function zoom the region of in-terest can be seen more clearly.

>> rlocus( Q / P )>> axis([ -2 2 -4 4 ])

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−4

−3

−2

−1

0

1

2

3

4

Real Axis

Imag

Axi

s

When KD increases the complex poles closest to the origin move towards the origin and and at the same time thedamping of the system is increased. When KD increases even more the second pair of complex poles moves towardsthe imaginary axis giving a high frequency oscillation which finally gives instability.

3.23 a) Enter the system and the regulator. Plotthe Nyquist curve of the open loop system.

>> s = tf( ’s’ );>> G = 0.2 / ( ( s^2 + s + 1 ) * ( s + 0.2) );>> F = 1;>> nyquist( F * G )

Real Axis

Imag

inar

y A

xis

Nyquist Diagrams

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

The Nyquist curve is “far away” from the point −1 for all frequencies and the step response of the closed loopsystem is well damped. As KP increases the Nyquist curve grows in size and for KP = 6.2 the Nyquist curvereaches −1 and thus is the limit of stability.

33

Page 154: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) Generate a PI controller. Plot the Nyquistcurve of the open loop system.

>> F = 1 + 1/s;>> nyquist( F * G )>> axis([ -2 2 -2 2 ])

Real Axis

Imag

inar

y A

xis

Nyquist Diagrams

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

For low frequencies the Nyquist curve is now far away from the origin since the integrating part makes |G(iω)|large for low frequencies. The Nyquist curve now passes closer to −1 which results in a more oscillatory closed loopsystem. The system becomes unstable around KI = 1.44.

c) Generate a PID controller. Plot the Nyquistcurve of the open loop system. Here withthe parameters KP = 1, KI = 1, KD = 2,and T = 0.1

>> F = 1 + 1/s + 2*s / ( 0.1*s + 1 );>> nyquist( F * G )>> axis([ -2 2 -2 2 ])

Real Axis

Imag

inar

y A

xis

Nyquist Diagrams

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

The Nyquist curve is now further away from −1 which corresponds to an improved damping of the closed loop system.The system becomes unstable around KD = 66.

34

Page 155: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

3.24 a) Enter the systems and the regulator. Makea Bode plot of the open loop system whenthe regulator and the system are put inseries. This gives ωc = 0.38, ωp = 1.1,ϕm = 94◦ and Am = 3.1.

>> s = tf( ’s’ );>> G = 0.4 / ( ( s^2 + s + 1 ) * ( s + 0.2 ) );>> F = 1;>> margin( F * G )

10−6

10−4

10−2

100

102

Mag

nitu

de (

abs)

10−2

10−1

100

101

102

−270

−225

−180

−135

−90

−45

0

Pha

se (

deg)

Bode DiagramGm = 3.1 (at 1.1 rad/sec) , Pm = 94.2 deg (at 0.377 rad/sec)

Frequency (rad/sec)

Plot the step response. >> Gc = feedback( F * G, 1 );>> step( Gc, 50 )

Time (sec.)

Am

plitu

de

Step Response

0 5 10 15 20 25 30 35 40 45 500

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

35

Page 156: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) Increase the gain in the regulator. Make aBode plot. The crossover frequency ωc hasincreased while ωp is the same, since onlythe amplitude curve is changed when thegain is changed. Both the gain and phasemargins have decreased.

>> F = 2.5;>> margin( F * G )

10−6

10−4

10−2

100

102

Mag

nitu

de (

abs)

10−2

10−1

100

101

102

−270

−225

−180

−135

−90

−45

0

Pha

se (

deg)

Bode DiagramGm = 1.24 (at 1.1 rad/sec) , Pm = 12.6 deg (at 0.99 rad/sec)

Frequency (rad/sec)

Plot the step response. The closed loop sys-tem is now much more oscillatory due to thereduced phase and gain margins.

>> Gc = feedback( F * G, 1 );>> step( Gc, 50 )

Time (sec.)

Am

plitu

de

Step Response

0 5 10 15 20 25 30 35 40 45 500

0.2

0.4

0.6

0.8

1

1.2

1.4

36

Page 157: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

c) Increase the gain to 3.1, that is, the value ofAm in a). Both the gain and phase marginare at the limit between what would give anstable or unstable closed loop system. Anyfurther increase of the gain will give an un-stable closed loop system.

>> F = 3.1;>> margin( F * G )

10−6

10−4

10−2

100

102

Mag

nitu

de (

abs)

10−2

10−1

100

101

102

−270

−225

−180

−135

−90

−45

0

Pha

se (

deg)

Bode DiagramGm = 1 (at 1.1 rad/sec) , Pm = 0.000321 deg (at 1.1 rad/sec)

Frequency (rad/sec)

Plot the step response. The output now os-cillates with constant amplitude.

>> Gc = feedback( F * G, 1 );>> step( Gc, 50 )

Time (sec.)

Am

plitu

de

Step Response

0 5 10 15 20 25 30 35 40 45 500

0.5

1

1.5

3.25 The top row gives a steady state error ⇒ KI = 0. Left column less oscillative than the right one ⇒ KD 6= 0.Answer: A–iii, B–i, C–iv, D–ii.

3.26 a) The motor transfer function is (from Solution 2.1))

θ(s)U(s) = G(s) = k0

s(s+ 1/τ)

37

Page 158: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Feedback controlU(s) = F (s)(θref(s)− θ(s))

where F (s) is the control law transfer function and θref is the reference signal. The closed loop transfer function isgiven by

Gc(s) = θ(s)θref(s)

= F (s)G(s)1 + F (s)G(s)

Proportional feedback F (s) = KP and G(s) according to above give

Gc(s) = KPk0

s2 + s/τ +KPk0

The poles of the closed loop system are given by

s2 + s/τ +KPk0 = 0

that is,

s = −1±√

1− 4τ2KPk0

(1) KP small ⇒ Both poles on the real axis, but one pole very close to the origin ⇒ Slow but not oscillatorysystem.

(2) KP = 1/(4τ2k0) ⇒ Both poles in −1/(2τ), that is, faster than in (1) but still no oscillations.

(3) KP large ⇒ Complex poles with large imaginary part relative to the real part, that is oscillative system.

b) The transfer function from the reference signal to the tracking error e = θref − θ is given by

E(s) = 11 + F (s)G(s)θref(s) = s(s+ 1/τ)

s(s+ 1/τ) +KPk0θref(s)

The reference signal is a step

θref(t) ={

0, t < 0A, t ≥ 0

which givesθref(s) = A

s

The final value theorem giveslimt→∞

e(t) = lims→0

s · s(s+ 1/τ)s(s+ 1/τ) +KPk0

· As

= 0

The reference signal is a ramp

θref(t) ={

0, t < 0At, t ≥ 0

which givesθref(s) = A

s2

The final value theorem gives (the closed loop is asymptotically stable for all KP according to a))

limt→∞

e(t) = lims→0

s · s(s+ 1/τ)s(s+ 1/τ) +KPk0

· As2 = A

KPk0τ

The error can be decreased by selecting KP large, but according to a) the system becomes very oscillative for largeKP.

c) PI controller

u(t) = KPe(t) +KI

∫ t

0e(τ) dτ

that isF (s) = KP +KI

1s

38

Page 159: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

gives

E(s) = 11 + F (s)G(s)θref(s) = s2(s+ 1/τ)

s2(s+ 1/τ) + k0(KPs+KI)θref(s)

When θref is a ramp according to b) we get

limt→∞

e(t) = lims→0

sE(s) = 0

Comment: The final value theorem can only be used when the denominator of G(s)U(s) has all zeros in the left halfplane or at the origin. G(s) is the system transfer function and U(s) is the input signal.

3.27 The transfer function for the loop gain is Go.The transfer function from the reference signal R to the output Y is obtained by using the block diagram and observingthat

Y = Go(R− Y )

Solving this equation for Y gives

Y = Go

1 +GoR

that is, the transfer function for the closed loop system is Gc = Go1+Go

.

3.28 a) The loop gain, Go, is FG.

b) The influence of the disturbance (N = 0) can be neglected. Use the solution to problem Solution 3.27. The transferfunction from R to Y is Gc = FG

1+FG , that is, Y = GcR.

c) The influence of the reference signal can be neglected. (R = 0). The block diagram gives

Y = FGE = −FG(Y +N)

which implies that the transfer function from N to Y is Gny = − FG1+FG .

d) The influence of the disturbance can be neglected (N = 0). The block diagram gives

E = R− Y = R− FGE

Solving for E givesE = 1

1 + FGR

that is, the transfer function from R to E is Gre = 11+FG .

3.29 a) The transfer function from reference signal to error signal is (see Solution 3.28d)

E = 11 + FG

R(s) = 11 + K

(s+1)(s+3)R(s) = (s+ 1)(s+ 3)

(s+ 1)(s+ 3) +KR(s)

r(t) step ⇒ R(s) = As . The steady state value of the error is given by the final value theorem

limt→∞

e(t) = lims→0

sE(s) = lims→0

(s+ 1)(s+ 3)(s+ 1)(s+ 3) +K

A = 3A3 +K

b) In order to make the steady state error equal to zero the regulator has to contain an integrator. Using, for example,F (s) = 1

s one gets

limt→∞

e(t) = lims→0

A

1 + F (s)G(s) = lims→0

A

1 + 1s

1(s+1)(s+3)

= 0

Notice though, that the integrating feedback normally has to be combined with proportional feedback.

39

Page 160: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

c) The transfer function from R to Y using F (s) = 1 is

Gc(s) = FG

1 + FG= 1

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

(s+ 2)2

The system has two poles in −2 and no zeros.

3.30 • The four step responses are characterized by, for example, that A and D have a steady state error, while C andB do not. Further, A shows better damping than D, and C shows better damping than B. It can also be noticed(although it is not as apparent as the other characteristics) that the error decays more slowly in C than in B.

• The four regulators are characterized by, for example, that regulators 1 and 4 don’t have any integral action.Regulator 2 has more integral action than 3, and regulator 4 gives better damping than 1.

• The derivative part in the regulator improves the damping, while integral action eliminates the steady state errorand reduces the damping. Besides, for small values of KI, the error will decay slowly to zero.

Answer: A–4, B–2, C–3, D–1.

GFΣ+Fc,in, Tc,in

TtTref

Ft,in, Tt,in

Figure 3.31a

3.31 a) See the block diagram in Figure 3.31a. There, the signals are classified as:

� Input Fc,in and Tc,in

� Output Tt

� Disturbance Ft,in and Tt,in

b) Assume prefect mixing in the tank. Mass balance for the tank

d(ρtVt)dt = ρt,inFt,in − ρtFt

Assume ρt,in = ρt and that ρt is constant which gives

d(ρtVt)dt = 0 = Ft,in − Ft ⇒ Ft = Ft,in

Assume that there are no heat losses to the surroundings. The energy balance for the tank is

d (ρtVtcpt (Tt − Tref))

dt= ρtFt,inc

pt,in(Tt,in − Tref)− ρtFtc

pt (Tt − Tref) + U(Tc − Tt) (3.1)

where U is a heat transfer constant. Assume that cpt,in = cpt is constant and that Tref is constant. This means that(3.1) can be simplified to

VtdTt

dt = Ft(Tt,in − Tt) + U

cpt ρt(Tc − Tt) (3.2)

Mass balance for the heating systemd(ρcVc)

dt = ρc,inFc,in − ρcFc

40

Page 161: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Assume ρc,in = ρc and that ρc is constant which gives Fc = Fc,in. Assume that there are no heat losses to thesurroundings. The energy balance for the heating system is

d (ρcVccpc (Tc − Tref))dt

= ρcFc,incpt,in(Tc,in − Tref)− ρcFcc

pc (Tc − Tref)− U(Tc − Tt) (3.3)

Assume that cpc = cpt,in is constant. This means that (3.3) can be simplified to

VcdTc

dt = Fc(Tc,in − Tc)− U

cpcρc(Tc − Tt) (3.4)

The dynamical model is described by (3.2) and (3.4).

c) Linearization of (3.2) and (3.4) (assuming ρc = ρt and cpc = cpt ) gives

V ∗tdTt∆

dt = −(F ∗t + U

cpt ρt

)Tt∆ + F ∗t Tt,in∆

+ U

cpt ρtTc∆ +

(T ∗t,in − T ∗t

)Ft∆

V ∗cdTc∆

dt = −(F ∗t + U

cpt ρt

)Tc∆ + F ∗c Tc,in∆

+ U

cpt ρtTc∆ +

(T ∗c,in − T ∗c

)Fc∆

d) With numerical values for the stationary points and assuming that Ft, Tt,in, and Tc,in is constant, the linearizedmodel is

dTt∆dt = −0.26Tt∆ + 0.16Tc∆ (3.5)

dTc∆dt = −3.6Tc∆ + 1.6Tt∆ + 200Fc∆ (3.6)

Taking the Laplace transform of (3.5) and (3.6) gives

sTt∆(s) = −0.26Tt∆(s) + 0.16Tc∆(s) (3.7)sTc∆(s) = −3.6Tc∆(s) + 1.6Tt∆(s) + 200Fc∆(s)

⇒ Tc∆(s) = 1.6s+ 3.6Tt∆(s) + 200

s+ 3.6Fc∆(s) (3.8)

Combining (3.7) and (3.8) gives

sTt∆(s) = −0.26Tt∆(s) + 0.256s+ 3.6Tt∆(s) + 32

s+ 3.6Fc∆(s)

⇒ Tt∆(s) = 32(s+ 3.675)(s+ 0.185)Fc∆(s)

e) The transfer function for the closed loop is

Gc(s) = 32Ks2 + 3.86s+ 0.68 + 32K

The characteristic equation iss2 + 3.86s+ 0.68 + 32K = 0

with the solutions = −1.93±

√1.932 − 0.68− 32K

This gives the root locus in Figure 3.31b.

3.32 a) The system Go(s) = −1s2+2s−3 has one pole in −3 and one pole in 1, hence the system is unstable.

41

Page 162: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

-3 -1-2

-1

1

Re

Im

K = 0.0952

Figure 3.31b

b) The closed loop is given by

Gc(s) = −Ks2 + 2s− 3−K

The poles of the closed loop are given bys = −1±

√1 + 3 +K

For K ≤ −3 the closed loop will have all its pole in the LHP.

3.33 Given y = µy+u and u = K(r−y) we have y = (µ−K)y+Kr. This system converges when the eigenvalues of (µ−K)are in the LHP, that is, when K > µ.

3.34

a) The closed loop system

−6 −5 −4 −3 −2 −1 0 1−1.5

−1

−0.5

0

0.5

1

1.5

Root Locus

Real Axis

Imag

inar

y A

xis

Figure 3.34a

42

Page 163: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Gc(s) = G(s)K1 +G(s)K = K(s+ 2)

(s+ 1)2 +K(s+ 2)

has the characteristic equation

(s+ 1)2 +K(s+ 2) = 0

which gives

P (s) = (s+ 1)2 Q(s) = s+ 2

• Starting points ⇐⇒ Zeros of P (s): -1,-1End points ⇐⇒ Zeros of Q(s): -2

• Number of asymptotes: 2− 1 = 1Direction: πIntersection point: −1− 1 + 2 = 0

• Real axis: (−∞,−2] belongs to the root locus

• Intersection with the imaginary axis, set s = jω:

(jω + 1)2 +K(jω + 2) = 0Im : ω(2 +K) = 0Re : −ω2 + 1 + 2K = 0

=⇒ ω = 0,K = −12

which does not meet K > 0.Intersection with the real axis, set s = jω:

(jω + a)2 = (jω + 1)2 +K(jω + 2)=⇒ (K = 0, a = 1), (K = 4, a = 3)

This gives the root locus in Figure 3.34a. The system is asymptotically stable. K = 4 (pole position −3) gives thefastest step response without fluctuations since it does not have any imaginary parts.

b) With a similar approach as in a), the closed loop system is

Gc(s) = G(s)F (s)1 +G(s)F (s)

where F (s) = 4 + KIs , G(s) = s+2

(s+1)2 . The characteristic equation is

1 + F (s)G(s) = s(s+ 1)2 + (4s+KI)(s+ 2) = 0

which gives

P (s) = s(s+ 1)2 + 4s(s+ 2) = s(s+ 3)2 Q(s) = KI(s+ 2)

• Starting points ⇐⇒ Zeros of P (s): 0,-3,-3End points ⇐⇒ Zeros of Q(s): -2

• Number of asymptotes: 3− 1 = 2Direction: π

2 ,3π2

Intersection point: 0−3−3+22 = −2

• Intersection with the imaginary axis, set s = jω:

jω(jω + 3)2 +KI(jω + 2) = 0Im : ω(−ω2 +KI + 9) = 0Re : −6ω2 + 2KI = 0

=⇒ (ω = 0,K = 0), (ω2 = KI + 9,KI = −544 < −9) : not real

which does not meet KI > 0.

43

Page 164: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 0.5−10

−8

−6

−4

−2

0

2

4

6

8

10

Root Locus

Real Axis

Imag

inar

y A

xis

Figure 3.34b

This gives the root locus in Figure 3.34b. The system is asymptotically stable.

c) The P-controller of a) gives a faster step response than the PI-controller of b) since the dominant pole [−2, 0] is slowerthan −3. However, there is the stationary error of P-controller, see Figure 3.34c

44

Page 165: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0 1 2 3 4 5 60

0.5

1

1.5

2

2.5

3

3.5

4

Step Response

Time (sec)

Am

plit

ud

e

K=4, P−controller

KP=4, K

I=4, PI−controller

Figure 3.34c

45

Page 166: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

4 Frequency Description

4.1 If we let u(t) and y(t) denote the actual temperature and the measured temperature, respectively, we can divide thetemperatures into their mean values and variations as follows:

u(t) = u0 + u(t)

andy(t) = y0 + y(t)

where u0 = y0 = 30 ◦C.The thermometer is modeled as the following first order linear time invariant dynamic system with

Y (s)U(s) = G(s) = a

s+ b

Sinceu(t) = A sin(ωt)

it follows that after the transients have vanished (that is, in steady state)

y(t) = |G(iω)|A sin(ωt+ φ)

whereφ = arg(G(iω)) = − arctan(ω/b)

From the relationship ω = 2π/T and from the figure the following is obtained:

1. ω = 2π0.314 · 60 rad/s = 0.33 rad/s

2. φ = −0.0560.314 · 2π rad = −1.12 rad

3. |G(iω)| = 0.92.0 = 0.45

Hencetan(φ) = −ω

b⇒ b = 0.33

2.066 = 0.16

and|G(iω)| = a√

ω2 + b2⇒ a = 0.16

Answer:G(s) = 0.16

s+ 0.16

4.2 The equationω = ψ

andT1 · ω = −ω +K1 · δ

give the transfer functionGs(s) = K1

s(1 + T1s)= 0.1s(1 + s/0.01)

The transfer function of the rudder machine is

Gr(s) = 11 + sT2

= 11 + s/0.1

and the controller has the transfer function

F (s) = K1 + s/a

1 + s/b= K

1 + s/0.021 + s/0.05

46

Page 167: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0.1

1

10

-270◦

-180◦

-90◦

0.001 0.01 0.1 1

ωc = 0.026

ωp = 0.06

|Go(i

ω)|

arg

Go(i

ω)

ω [rad/s]

Am

=4.1

m=

31.9

3◦

Figure 4.2a

a) K = 0.5 gives

Go(s) = F (s)Gr(s)Gs(s) = 0.05(1 + s/0.02)s(1 + s/0.01)(1 + s/0.05)(1 + s/0.1)

It thus follows that

|Go(iω)| =0.05

√1 + ( ω

0.02 )2

ω√

1 + ( ω0.01 )2

√1 + ( ω

0.05 )2√

1 + ( ω0.1 )2

with low frequency asymptote|Go(iω)| → 0.05

ω, ω → 0

andargGo(iω) = arctan ω

0.02 − 90◦ − arctan ω

0.01 − arctan ω

0.05 − arctan ω

0.1

The gain is drawn approximatively based on a known gain at some point of the low frequency asymptote,∣∣ 0.05

0.005∣∣ = 10,

and the breakpoints and slopes of the asymptotes:Frequency [rad/s] 0.01 0.02 0.05 0.1Slope −1 −2 −1 −2 −3

The phase shift is drawn based on a couple of samples:Frequency [rad/s] 0.005 0.01 0.02 0.04 0.08Phase −111◦ −125◦ −142◦ −163◦ −194◦

The Bode plot in Figure 4.2a gives: ωc = 0.026 rad/s, ϕm = 32◦, Am = 4.2.

b) The system starts to oscillate if K is chosen so that arg(Go(iωc)) = −180◦. This gives the crossover frequency ωc =ωp = 0.06 rad/s. This implies that the gain should be amplified 4.2 times. Therefore, choose K = 0.5 · 4.2 = 2.1.

ω = 2π/T ⇒ T = 2πωc

= 2π0.06 = 105 s

Answer: The period time will be 105 seconds, and K = 2.1.

c)Ψref(t) = A sin(αt)

givesΨ(t) = B sin(βt+ ϕ)

where A = 5◦, α = 0.02, β = α, B = A |Gc(iα)| and ϕ = argGc(iα). The transfer function for the closed loopsystem when K = 0.5 is

Gc(s) = Go(s)1 +Go(s)

47

Page 168: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

where|Go(i0.02)| = 1.44 argGo(i0.02) = −142◦

That isGo(i0.02) = −1.135− i0.886

which gives|Gc(i0.02)| = 1.44√

0.1352 + 0.8862= 1.61 ⇒ B = 8◦

andargGc(i0.02) = −142◦ + 180◦ − arctan(0.886

0.135) = −0.76 rad

Answer: B = 8◦, β = 0.02 rad/s and ϕ = −0.76 rad.

4.3 a) As ω → 0, |G(iω)| → ∞ and argG(iω) → −90◦. The gain is first decreasing (low frequencies). It then increases,and finally decreases again (approaching zero for high frequencies). The phase shift is increasing at low frequencies.As the frequency becomes higher the phase shift is positive in an interval until it decreases towards −90◦. Thisgives the plot in Figure 4.3a.

b) A system with a Bode plot as the one shown above must have one pole in the origin since argG(iω) → −90◦ asω → 0. Then two break points appear (up), since there is a positive phase shift. After that, there must be twobreak points (down), since the phase shift should approach −90◦. Hence, the plot in Figure 4.3b is possible.

10−2

10−1

100

101

−90◦−60◦−30◦

0◦30◦60◦

10−1 100 101 102 103 104 105

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Figure 4.3a

Re

Im

Figure 4.3b. Pole-zero diagram. Not accurate in scale; the diagram shall only be interpreted as a right to left ordering of poles andzeros, with the first pole at the origin.

4.4 From the final value of step response B (the only one greater than 1) and static gain in Bode gain C (the only onegreater than 1), the step response–Bode gain pair B–C follows. Step responses C and A have approximately the same

48

Page 169: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

overshoots but different fundamental frequencies. Bode gains B and D have equal resonance peaks but D has a lowerresonance frequency. This gives the combinations C–D and A–B. The remaining combination is D–A, which is a goodmatch with small overshoot (resonance peak) and final value (static gain) 1.

4.5 a) Enter the system and make a Bode plot. >> s = tf( ’s’ );>> GA = 1 / ( s^2 + 2*s + 1 );>> bode( GA )

Frequency (rad/sec)

Pha

se (

deg)

; Mag

nitu

de (

dB)

Bode Diagrams

−40

−30

−20

−10

0

10−1

100

101

−200

−150

−100

−50

0

Use, for example, curve handles and “Characteristics” in the right click menu to find static gain, bandwidth,resonance frequency, and resonance peak. The other systems are treated in the same way. The results can besummarized in the following table. (Note that gain values may be presented in dB20 in Matlab.)

System G(0) ωB ωr Mp

GA 1 0.64GB 1 1.5 1 2.5GC 1 0.21GD 1 1.27 0.7 1.15GE 1 2.54 1.4 1.15

b) Using the results in a) and in Problem 2.6, the following observations can be made. (i): The bandwidth of a systemis (approximately) inversely proportional to the rise time. High bandwidth implies a short rise time and hence afast system. (ii): The damping is inversely proportional to the height of the resonance peak. A large peak implieslow damping and large overshoot.

4.6 From the frequency responce interpretation of the transfer function (“a sinusoid in gives a sinusoid out”) and the inputbeing

u(t) = 2 sin(2t− 1/2)

it follows that the output isy(t) = 2 |G(i2)| sin(2t− 1/2 + argG(i2))

Here G(s) = e−2s

s(s+1) , and hence

|G(i2)| = 12√

22 + 1= 1

2√

5argG(i2) = −4− π

2 − arctan 2

49

Page 170: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

4.7 The input is a sinusoid with amplitude 1 and angular frequency ω = 2 rad/s.

a) 0.45 sin(2t− 1.1).(Gain:

∣∣∣ 1i2+1

∣∣∣ = 1√5 ≈ 0.45, phase: − arg(i2 + 1) ≈ −1.1 rad = −63◦.)

b) The system is unstable. Hence, the system output will tend to infinity, and the system will not reach a steadystate. To be more precise, the general form of the solution to the differential equation describing the system outputis y(t) = C0e

t + 1√5 sin(2t− π + arctan 2), and any initial state y(0) 6= 1√

5 sin(−π + arctan 2) will lead to a solutionthat tends to infinity. This will almost always be the case in practice.

c) 0.11 sin(2t− 2.4)(Gain:

∣∣∣ 1(i2+1)(i4+1)

∣∣∣ = 1√5√

17 ≈ 0.11, phase: − arg(i2 + 1)− arg(4i + 1) ≈ −2.4 rad = −139◦.)

d) 0.45 sin(2(t− 0.5)− 1.1) = 0.45 sin(2t− 2.1).Similar to problem a), with an extra time delay of 0.5 s.

4.8 a) To determine the phase difference, φ, given a diagram with two sinusoids, sin(ωt) and K sin(ωt+φ), one possibilityis to consider the time points when the two curves pass 0. Determine t1 and t2 such that

sin(ωt1) = 0K sin(ωt2 + φ) = 0

This gives that ωt1 = ωt2 + φ, that is,

φ = −ωt∆ = −2π radT

t∆ = − t∆T

2π rad

where t∆ = t2 − t1 and T is the common period time. Here, the last expression may be interpreted as the delayexpressed in parts ( t∆T ) of a whole revolution (2π). For example, consider the second graph where t∆ ≈ 0.18 s andT ≈ 1.25 s (which can either be read from the figure, or, in this problem, computed using ω = 5 rad/s). Hence,φ = − 0.18 s

1.25 s2π rad = −0.9 rad. This results in the table below, where the answer to part b is also included.

ω |G(iω)| argG(iω)1 1 = 0 dB20 −0.2 rad = −11◦5 0.8 = −1.9 dB20 −0.9 rad = −52◦10 0.5 = −6 dB20 −1.6 rad = −92◦20 0.2 = −14 dB20 −2.2 rad = −126◦

b) Just evaluate the decibel formula to obtain the values in the table above.

c) A Bode plot of the system is given in Figure 4.8a

0.010.02

0.050.10.2

0.51

-180◦

-90◦

0◦

0.5 1 2 5 10 20 50

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Figure 4.8a

50

Page 171: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

4.9 Answer: G1–B, G2–D, G3–A, G4–C, G5–E.

• The Bode plot B has static gain 1 and no resonance peak, and hence G1–B. It can also be seen that the Bode plot Bdecays by one decade (20 dB20) when the frequency increases by a factor of ten (“the slope is −1”) and that G1has one pole.

• The Bode plots A and C have both infinite gain for when the frequency tends to zero, that is, they correspond tosystems containing an integrator ⇒ systems G3 and G4. The Bode plot C decays more rapidly for high frequencies⇒ the relative degree (number of poles − number of zeros) is higher. Hence G3–A, G4–C.

• The Bode plots D and E have peaks⇒ systems G2 and G5. (For G2 the peak is caused by the zero where the curve“turns up” at ω = 1.) The Bode plot E has larger slope than D for high frequencies, that is, E corresponds to asystem with higher relative degree. G2 has one pole more than zeros, G5 has 2 poles, and hence G2–D, G5–E.

4.10 • In step response A and D the step responses tend to one, that is, they correspond to Bode gain A and C. Step responseD has larger overshoot, that is, it corresponds to Bode gain A, and consequently step response A corresponds toBode gain C. This gives the Bode gain–step response pairs A–D and C–A.

• Step response B has no overshoot, which implies that it corresponds to Bode gain D, which has no peak. This givesthe combination D–B.

• The remaining combination is B–C. Step response C has an overshoot which can be related to the peak in the Bodegain plot. It can also be seen that this pair belongs to the fastest system.

4.11 a) The system can be rewritten asG(s) = 1.7

(s+ 1)( s1.43 + 1)( s2 + 1)

It thus follows that|G(iω)| = 1.7

√1 + ω2

√1 +

1.43)2√1 +

(ω2)2

andargG(iω) = − arctanω − arctan ω

1.43 − arctan ω2

The gain is drawn approximatively based on a known gain at some point of the low frequency asymptote, |G(i0)| =1.7, and the breakpoints and slopes of the asymptotes:

Frequency [rad/s] 1 1.43 2Slope 0 −1 −2 −3

The phase shift is drawn based on a couple of samples:Frequency [rad/s] 0.1 0.5 1Phase −12.7◦ −59.9◦ −106.6◦

Frequency [rad/s] 2 3 10Phase −162.9◦ −192.4◦ −244◦

The bode plot in Figure 4.11a gives: ωc = 0.874 rad/s, ϕm = 83.8◦, Am = 5.14, and ωp = 2.51 rad/s.

b) The phase is −180◦ at ωp = 2.51 where the amplitude is 0.1946. To make the pH oscillate with constant amplitudeone has to choose K = 1

0.1946 = 5.14.

4.12 a) The phase is −180◦ at ωp = 0.334 where the amplitude is 0.1984. To keep the reactor stabile one has to chooseK ≤ 1

0.1984 = 5.04.

b) This is a lead-lag design task. The amplitude and phase of G at ωc,d = 0.1 is 0.6325 and −100◦. Thus we have aphase margin of 80◦ which is sufficient, and hence no lead controller is needed. To remove the steady-state errorwe need a lag controller with M =∞. This results in the controller structure

F (s) = Ks+ a

s︸ ︷︷ ︸Flag

51

Page 172: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0.010.02

0.050.10.2

0.512

-270◦

-180◦

-90◦

0◦

0.01 0.1 1 10

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Figure 4.11a

Chose a = 0.1ωc,d = 0.01 (a bigger value on a makes the error go to zero faster) and K = 1|G(iωc,d)Flag(iωc,d)| =

10.6325 = 1.58. This gives the controller F (s) = 1.58 s+0.01

s .

4.13 Ansätt G(s) = bs+a (med a > 0 och b > 0).

Utsignalen ges av (ekvation 4.2 i boken)

y(t) = |G(iω)| sin (ωt+ argG(iω)), ω = 2

|G(iω)| = b√ω2 + a2

= 2

argG(iω) = arg b− arg (iω + a) = − arctan ωa

= −π4 .

Och alltså för ω = 2 fås a = 2 och b = 4√

2, samt initialvärdety0 = 2 sin(0− π/4) = −

√2.

52

Page 173: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

5 Compensation

5.1 The compensator is constructed using lead-lag design. “Twice as fast” is interpreted as a doubling of the bandwidth,which, in turn, is approximated by a doubling of the gain crossover frequency. “Same damping” is interpreted asmaintaining the old phase margin, which is accomplished using a lead compensator in the controller. The error in staticreference following is controlled by adjusting the static gain of the open loop system, which is accomplished using alag compensator in the controller. Sensitivity to measurement disturbances is given by the complementary sensitivityfunction, 1− (1 +Go)−1. It is small where the open loop gain is small. Thus, to make it small at high frequencies, thehigh frequency gain of the controller should be kept as low as possible.First, the open loop system when F (s) = 1 ⇒ Go = G is examined in order to quantify the requirements.

G(s) = 0.4(s+ 0.1)(s+ 0.5)(s2 + 0.4s+ 4)

= 2(1 + s/0.1)(1 + s/0.5)(1 + 2 · 0.1 · s/2 + (s/2)2)

which implies that|G(iω)| = 2√

1 + ( ω0.1 )2

√1 + ( ω

0.5 )2√

(1− (ω2 )2)2 + 4 · 0.01(ω2 )2

with low frequency asymptote|G(iω)| → 2, ω → 0

andargG(iω) = − arctan ω

0.1 − arctan ω

0.5 − arctan2 · 0.1ω2

1− (ω2 )2

The gain is drawn approximatively based on a known gain at some point of the low frequency asymptote, 2 (at anypoint), and the breakpoints and slopes of the asymptotes:

Frequency [rad/s] 0.1 0.5 2Slope 0 −1 −2 −4

The system has two complex conjugated poles which implies that the amplitude curve has a resonance peak. Theapproximative amplitude curve must be modified at the resonance peak. An exact calculation of the gain gives

Frequency [rad/s] 1 1.5 2 2.5Gain 0.12 0.09 0.12 0.025

The phase curve is drawn based on a couple of samples:Frequency [rad/s] 0.01 0.1 1 1.5Phase −7◦ −57◦ −155◦ −177◦

Frequency [rad/s] 2 2.5 10Phase −253◦ −322◦ −354◦

The Bode plot in Figure 5.1a gives

ωc = 0.16 rad/s ϕm = 102◦ Am = 10.6

and henceωc,d = 0.32 rad/s ϕm,d = 102◦

The phase of G at the ωc,d is −108◦. Hence, in order to obtain the desired phase margin of 102◦ = −78◦ − (−180◦), aphase advance of approximately (−78◦)− (−108◦) = 30◦ is required. To this end, introduce a lead compensator in thecontroller:

Flead = Ns+ b

s+ bN

See the discussion of lead compensators in Glad&Ljung! To keep the high frequency gain of the controller as small aspossible, N should be chosen as small as possible. The desired phase advance is obtained with N = 3. This phase leadis obtained at the desired crossover frequency if

b = ωc,d√N

= 0.185

53

Page 174: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0.001

0.01

0.1

1

-360◦

-270◦

-180◦

-90◦

0◦

0.01 0.1 1 10

ωc = 0.16

ωc,d = 0.33

ωp = 1.6

-108◦

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Am

=10.8

m=

102.4

8◦

Figure 5.1a

The desired crossover frequency is obtained by adjusting the gain of the open loop system by introducing a factor, K,in the controller:

1 = K |Flead| · |G(i0.32)| = K√N · 0.52 ⇒ K = 1.11

WithF (s) = 3.33s+ 0.185

s+ 0.555and ωref(s) = A/s, where A is constant, it follows that (using the notation e(t) = ωref(t)− ω(t))

limt→∞

e(t) = lims→0

sE(s) = lims→0

s1

1 + F (s)G(s)A

s

= A

1 + 1.1 · 2 ·Flag(0) ≤ 0.05A.

This is equivalent toFlag(0) ≥ 8.63

If the low frequency gain of F (s) is increased approximately 9 times the stationary error will be smaller than 5%. Tothis end, introduce a lag (phase-retarding) compensator

Flag = s+ a

s+ aM

in the controller, where M should be kept as small as possible to avoid unneccessary high gain at low frequencies. Seethe discussion of lag compensators in Glad&Ljung! With M = 9 and a = 0.1ωc,d = 0.032 the desired low frequency gainincrease is obtained without altering the phase margin too much.This gives the controller

F (s) = K ·Flead(s) ·Flag(s) = 3.33(s+ 0.185)(s+ 0.555)

(s+ 0.032)(s+ 0.0036)

5.2 Let G denote the heat exchanger’s transfer function.

a) Draw the Bode plot using the given table. From the diagram in Figure 5.2a it follows that

ωc = 0.079 rad/s ϕm = 88◦ Am = 5.0

b) A proportional controller does not change the phase curve. According to Figure 5.2a, the phase curve crosses −130◦at the frequency 0.15 rad/s. A gain crossover at this frequency will yield exactly the required phase margin, andany higher crossover frequency will yield one that is too small.∗

∗The controller gain that yields the desired gain crossover frequency can be computed as

K =1

|G(0.15i)|=

10.525

= 1.9

54

Page 175: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0.1

0.20.3

0.50.7

1

0.525

-270◦

-180◦

-90◦

0◦

0.03 0.05 0.07 0.1 0.2 0.3 0.5

ωc = 0.079 ωp = 0.280.145

-130◦

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Am

=5.0

m=

88.1

3◦

Figure 5.2a

c) Twice as large crossover frequency is desired:

ωc,d = 0.29 rad/s ϕm,d = 50◦

At the frequency 0.29 rad/s the phase margin is approximately 0◦ (actually a little less, since ωp = 0.28 rad/s).Hence, a phase lead of 50◦ is needed. To this end, use a lead-compensator (using standard notation of parameters)with β = 0.13 (according to the diagram in Glad&Ljung) in order to achieve this. To obtain the maximum phaselead at the desired crossover frequency, let

τD = 1ωc,d√β

= 9.47

Finally, K is chosen so that ωc,d is obtained:

1 = K |FPD(iωc,d)| · |G(iωc,d)| ≈ K · 1√β· 1Am

K ≈√βAm = 1.83

Answer:F (s) = 1.83 (9.47s+ 1)

(0.13 · 9.47s+ 1)

5.3 a)G(s) = 20

s(1 + 2 · 0.1 · s150 + ( s

150 )2)which implies that

|G(iω)| = 20ω√

(1− ( ω150 )2)2 + 4 · 0.01 · ( ω

150 )2

with low frequency asymptote|G(iω)| → 20

ω, ω → 0

andargG(iω) = −90◦ − arctan 2 · 0.1 ·ω

(1− ( ω150 )2)

The gain is drawn approximatively based on a known gain at some point of the low frequency asymptote,∣∣ 20

20∣∣ = 1,

and the breakpoints and slopes of the asymptotes:Frequency [rad/s] 150Slope −1 −3

The system has two complex conjugated poles which implies that the amplitude curve has a resonance peak. Theapproximative amplitude curve must be modified at the resonance peak. An exact calculation of the gain gives

55

Page 176: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0.010.02

0.050.10.2

0.512

-270◦

-180◦

-90◦

10 20 50 100 200 500 1e + 03

ωcA = 20.4

ωcB = 15.2

ωp = 150

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

A

B

Am

=1.5

m=

88.4

2◦

Figure 5.3a

Frequency [rad/s] 100 150 200Gain 0.35 0.67 0.12

The phase curve is drawn based on a couple of samples:Frequency [rad/s] 10 50 100 150 200Phase −91◦ −94◦ −103◦ −180◦ −251◦

In addition, one can also use

argG(iω)→ −90◦, ω → 0argG(iω)→ −270◦, ω →∞

The Bode plot with the gain curve labeled “A” in Figure 5.3a gives

ωc = 20 rad/s ϕm = 88◦ Am = 1.5

b) If K would be chosen to the gain margin, Am = 1.5, the new gain margin would be 1. Thus, if

K = Am

2 = 0.75

the resulting gain margin becomes 2. With this amplification the final value theorem gives the ramp error

limt→∞

e(t) = lims→0

sE(s) = lims→0

1sKG(s) = 1

0.75 · 20 = 0.067

Note that the system is stable by construction (the new gain margin is greater than 1).

c) The new gain crossover frequency obtained in part b is 15 rad/s, see the gain curve labeled “B” in Figure 5.3a.The low frequency gain of F (s) must be increased at least 15 times. A lag-compensator with M = 15 can be used.Choose, according to the rule of thumb, a = 0.1 ·ωc,d, where ωc,d = 15, and hence a = 1.5.Answer:

F (s) = 0.75 · (s+ 1.5)(s+ 0.1)

5.4 We begin by drawing a Bode plot of the system.

G(s) = 10s(1 + s

10 )(1 + s100 )

which implies that|G(iω)| = 10

ω√

1 + ( ω10 )2√

1 + ( ω100 )2

56

Page 177: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0.01

0.1

1

10

0.49

-270◦

-180◦

-90◦

1 2 5 10 20 50 100 200

ωc,d = 12.6

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

ϕm

,d

28.7

4◦

Figure 5.4a

with low frequency asymptote|G(iω)| → 10

ω, ω → 0

andargG(iω) = −90◦ − arctan ω

10 − arctan ω

100

The gain is drawn approximatively based on a known gain at some point of the low frequency asymptote,∣∣ 10

1∣∣ = 10,

and the breakpoints and slopes of the asymptotes:Frequency [rad/s] 10 100Slope −1 −2 −3

The phase curve is drawn based on a couple of samples:Frequency [rad/s] 2 10 20 50 100Phase −102◦ −141◦ −165◦ −195◦ −219◦

In addition, one can also use

argG(iω)→ −90◦, ω → 0argG(iω)→ −270◦, ω →∞

From the Bode digram in Figure 5.4a it follows that ωc = 7.8 rad/s, ϕm = 47◦ and Am = 11. However, these values arenot used by the solution to this problem.Figure 5.4b (the figure can also be found in Glad&Ljung) gives that the overshoot is acceptable if ζ ≥ 0.58. Choose forinstance ζ = 0.6. This results in a desired phase margin ϕm,d = 60◦. According to Figure 5.4c (the figure can also befound in Glad&Ljung), this also implies a desired gain crossover frequency:

ω0Tr = 1.8 and ωc,d

ω0= 0.7 ⇒

ωc,d = 0.71.8Tr

= 0.71.80.1 = 12.6

At 12.6 rad/s a phase advance of approximately 30◦ is needed in order to get the desired phase margin. To this end,use a lead compensator (with the usual notation of parameters) with N = 4 and b = ωc,d/

√N = 6.3. K is adjusted to

get the desired gain crossover frequency:

1 = K |Flead(iωc,d)| · |G(iωc,d)| = K√N · 0.49 ⇒ K = 1.02

The transfer function from the reference input to the control error is given by

E(s) = 11 + F (s)G(s)θref(s)

57

Page 178: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

When θref(t) is a step signal, the final value theorem gives

limt→∞

e(t) = lims→0

sE(s) = 0

even without a lag compensator thanks to the integration in G. Here, the final value theorem may be used since thesystem by construction is stable (the phase margin is 60◦).In order to handle errors for ramp references, introduce a lag compensator (with the usual notation of parameters) inthe controller. Then |Flag(0)| = M , and if θref(t) = 10 · t, that is, if

θref(s) = 10s2

one obtainslimt→∞

e(t) = lims→0

sE(s) = lims→0

s1

1 + F (s)G(s)10s2 = 10

km ·K ·M< 0.1

which gives M > 10.1K = 9.8. Take M = 9.8 to avoid excessively high low frequency loop gain. According to the rule of

thumb, let a = 0.1 ·ωc,d = 1.26.Answer:

F (s) = 1.02 · 4 · s+ 6.3s+ 25 ·

s+ 1.26s+ 0.13

0 0.2 0.4 0.6 0.8 1

0

20

40

60

80

100

0 dB20

2 dB20

4 dB20

6 dB20

8 dB20

10 dB20

ζ

ϕm [◦]

M [%]

Mp

M

ϕm

Mp

Figure 5.4b. Relations between overshoot, M , phase margin, ϕm, resonance gain, Mp, and relative damping, ζ, for a second ordersystem with no zeros and static gain 1.

5.5 Notation. The notation “A – B – C” is used to say that the system with open loop Bode plot in row A has its closedloop Bode plot in row B, and its step response in row C.A good start is often to look at the static gain and the final value of the step responses. The static gain of the open loopsystem and the closed loop system are related as |Gc(0)| = |Go(0)|

|1+Go(0)| . Systems with the same static gain can then beseparated by looking at stability margins, resonance peek, overshoot, bandwidth, and speed. Three of the combinationsare easy to identify:A – E – C: Finite but non-zero open loop static gain matches non-zero closed loop static gain less than 1. Infinitestability margins matches step response without overshoot.B – C – E: Infinite open loop static gain matches closed loop static gain equal 1, which in turn matches a step responsethat settles at amplitude 1.C – A – B: Zero static open loop gain matches zero closed loop gain, which in turn matches a step response that settlesat amplitude 0.The remaining open loop Bode plots are D and E. These should be matched with the closed loop gain curves B andD, and step responses A and D. Both open loop Bode plots show a static gain near 1, which will make it hard (albeitpossible) to use that feature for identification. Easier is to approximately locate the (closed loop) resonance frequency,

58

Page 179: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0 0.2 0.4 0.6 0.8 1

0

1

2

3

4

ζ

ω0Tr

ωB/ω0

ωc/ω0

Figure 5.4c. Relations between gain crossover frequency, ωc, bandwidth, ωB, raise time, Tr, and relative damping, ζ, for a second ordersystem with no zeros and static gain 1.

which will be near the frequency where the Nyquist curve minimizes its distance to −1. That is, the magnitude shall benear 1, and the phase near −180◦ in the open loop Bode plot. This happens at a lower frequency in open loop Bode plotD than in E. The resonance peak in the closed loop gain curve B is located at a higher frequency than that in D. Finally,a higher resonance frequency gives faster oscillations in the step response, and the oscillations in step response A aremuch quicker than those in D. Alternatively the bandwidth’s relation to response speed may be used; the bandwidthis higher in closed loop B than in D, and step response A is quicker than D. Anyway, the last two combinations areD–D–D, E–B–A.

5.6G(s) = 10

s(1 + s20 )(1 + s

40 )(1 + s100 )

gives|G(iω)| = 10

ω√

1 + ( ω20 )2√

1 + ( ω40 )2√

1 + ( ω100 )2

with low frequency asymptote|G(iω)| → 10

ω, ω → 0

andargG(iω) = −90◦ − arctan ω

20 − arctan ω

40 − arctan ω

100

The gain is drawn approximatively based on a known gain at some point of the low frequency asymptote,∣∣ 10

10∣∣ = 1, and

the breakpoints and slopes of the asymptotes:Frequency [rad/s] 20 40 100Slope −1 −2 −3 −4

The phase curve is drawn based on a couple of samples:Frequency [rad/s] 10 20 50Phase −136◦ −173◦ −236◦

In addition, one can also use

argG(iω)→ −90◦, ω → 0argG(iω)→ −360◦, ω →∞

The Bode plot in Figure 5.6a gives that ωc = 8.9 rad/s, ϕm = 48◦ and Am = 3.9. However, it is only the gain crossoverfrequency which directly interests us here; an increase of the speed with a factor of two and a preserved damping implyωc,d = 18 rad/s and ϕm,d = ϕm. From the figure, we have ϕ∆ = argG(iωc) − argG(iωc,d) = 35◦. The required phase

59

Page 180: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0.01

0.1

1

10

0.371

-270◦

-180◦

-90◦

5 10 20 50 100 200

ωc = 8.9

ωc,d = 18

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

ϕ∆

=34.8

6◦

Figure 5.6a

lead is thus at least ϕ∆ + 6◦ = 41◦. To this end, use a lead compensator (with standard notation of the parameters)with β = 0.21 and τD = 1

ωc,d√β

= 0.12. K is adjusted to get the desired crossover frequency:

K |G(iωc,d)| · |Flead(iωc,d)| = 1 ⇒ K =√β

0.37 = 1.2

The transfer function from the reference input to the control error is given by

E(s) = 11 + F (s)G(s)θref(s)

When θref(t) is a step, the final value theorem gives

limt→∞

e(t) = lims→0

sE(s) = 0

even without a lag compensator thanks to the integration in G(s). Here, the final value theorem may be used since thesystem by construction is stable (the phase margin is positive).In order to handle errors for ramp references, introduce a lag compensator (with the usual notation of parameters) inthe controller. Then |Flag(0)| = 1/γ, and if θref(t) = 10 · t, that is, if

θref(s) = 10s2

one obtainslimt→∞

e(t) = lims→0

sE(s) = lims→0

s1

1 + F (s)G(s)10s2 = 10γ

km ·K< 0.01

which gives γ < 0.01K = 0.012. Take γ = 0.012 to avoid excessively high low frequency loop gain. According to therule of thumb, let τI = 10/ωc,d = 0.56.Answer:

F (s) = 1.2 0.12s+ 10.21 · 0.12s+ 1 ·

0.56s+ 10.56s+ 0.012

5.7 Based on the Bode plot we plot the Nyquist curve, see Figure 5.7a. The system is stable when the point −1 is notencircled by the Nyquist curve. This gives

K <15 or 1

0.6 < K <1

0.2

5.8 A time delay of T seconds changes the phase curve with −ωT rad at frequency ω. The amplitude curve is not affected.

60

Page 181: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

-5 1 -1 -0.6 -0.2

Re

Im

Re

Im

−205◦

−160◦

−155◦

Figure 5.7a. Nyquist curve in two scales. Left: small scale. Right: big scale.

a) The crossover frequency is ω = 1 rad/s and the phase margin is 0.698 rad. This gives the stability condition

0.698 rad− 1 rad/s ·T > 0

that is, T < 0.698 s.

b) Plot the Nyquist curve as in Figure 5.8a. The point −1 is not encircled if the phase is decreased at least 40◦ atω = 7 rad/s but not more than 80◦ at ω = 5 rad/s. This gives the following conditions

7 rad/s ·T > 40◦ = 0.698 rad and 5 rad/s ·T < 80◦ = 1.396 rad

that is, 0.1 s < T < 0.28 s.

-1-1.5

Re

Im

−100◦

ω = 5.0

−140◦

ω = 7.0

−220◦ω = 10.0

Figure 5.8a

5.9 a) The step response of GA is

y(t) = L−1{Y (s)} = kA

a(1− e−at)→ kA

a, t→∞

From the figure it is seen that kA/a = 0.5. At time t = 1/a we have

y(1/a) = kA

a(1− e−1) = 0.5 · 0.63 = 0.315 = y(2)

Thus a = 0.5, which gives kA = 0.25:GA(s) = 0.25

s+ 0.5

61

Page 182: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

which is rewritten to make apparent the amplitude and phase

GA(iω) = 0.25√ω2 + 0.25

e−i arctan 2ω

The corresponding Bode plot is shown in Figure 5.9a. To see how GA modifies the Bode plot of Gm, consider forinstance the frequency 0.1 rad/s. When computing the new gain, the logarithmic scale in the diagrams is used todo directly obtain the logarithm of the product of the two systems’ gains:

|Gm(0.1i)| = 100.15

|GA(0.1i)| = 10−0.31

|GA(0.1i)Gm(0.1i)| = 100.15 · 10−0.31 = 100.15+(−0.31) = 10−0.16

The new phase is obtained by adding the arguments of the two transfer functions:

argGm(0.1i) = −135◦

argGA(0.1i) = −11◦

argGA(0.1i)Gm(0.1i) = argGA(0.1i) + argGm(0.1i) = −146◦

Carrying out the procedure of “adding Bode plots” at a range of selected frequencies results in the Bode plot inFigure 5.9b, where Go = GAGm.

10-0.8

10-0.6

10-0.4

-90◦

-60◦

-30◦

0◦

10-2 10-1 100

|GA(i

ω)|

arg

GA(i

ω)

ω [rad/s]

Figure 5.9a

10-3

10-2

10-1

100

101

0.0473

-270◦

-180◦

-90◦

10-2 10-1 100

ωc = 0.078 ωc,d = 0.40

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Gm

Go

Gm

Go

ϕ∆

=67.8

4◦

Figure 5.9b

62

Page 183: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) In Figure 5.9b it can be seen that the crossover frequency is 0.078 rad/s. Hence, let ωc,d = 0.4 to obtain a 5 times asfast system. At the desired crossover frequency, the phase must be advanced by 68◦ to maintain the phase margin.To this end, employ two equal lead compensators (using standard notation of the parameters), each advancing thephase by 34◦; take N = 4, and b = ωc,d√

N= 0.2.

The controller gain is adjusted by the factor K to get the desired crossover frequency:

K |G(iωc,d)| · |Flead(iωc,d)|2 = 1 ⇒

K = 10.047 ·

√N

2 = 10.6

Answer:

F (s) = 10.6 ·(

4 (s+ 0.2)(s+ 0.2 · 4)

)2

5.10G(s) = 1

sG1(s)

gives

|G(iω)| = |G1(iω)|ω

argG(iω) = G1(iω)− 90◦

A P controller gives a phase margin of 40◦ when

argG(iω) = −140◦ ⇒ argG1(iω) = −50◦

10-2

10-1

0.0242

1/8.58

-180◦

-90◦

0◦

10-2 10-1 100 101 102

-50◦

-107◦

ωc,P = 0.52

ωc,d = 1.05

|G1(i

ω)|

arg

G1(i

ω)

ω [rad/s]

Figure 5.10a

From Figure 5.10a it is seen (although not easily) that this occurs at ωc,P = 0.52 rad/s, which is also the highest possiblegain crossover frequency possible to obtain with P control. The desired increase in speed by a factor of two is thusachieved by a new gain crossover ωc,d = 1.05 rad/s. Figure 5.10a gives

argG1(iωc,d) = −107◦ ⇒ argG(iωc,d) = −197◦

A desired phase margin of 40◦ requires that the phase be advanced by 57◦ + 6◦ = 63◦. To this end, employ a twoequal lead compensators (using standard notation of parameters), each advancing the phase by 32◦; take β = 0.31 andτD = 1

ωc,d√β

= 1.72. The controller gain is adjusted by the factor K to get the desired crossover frequency:

K |Flead(iωc,d)|2 · |G(iωc,d)| = 1 ⇒ K1

√0.312

0.0241.05 = 1 ⇒ K = 13.3

63

Page 184: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

In order to handle errors for ramp references, introduce a lag compensator (with the usual notation of parameters) inthe controller. Then |Flag(0)| = 1/γ, and |F (0)| = K/γ. To choose γ, consider the Laplace transform of the controlerror,

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

If r(t) = A · t (a ramp), that is, ifR(s) = A

s2

one obtains

limt→∞

e(t) = lims→0

sE(s) = lims→0

s1

1 + F (s)G1(s)/sA

s2 = lims→0

A

s+ F (s)G1(s)

= A

|F (0)| · |G1(0)|

This shows that the ramp error is inversely proportional to the static gain of the controller. According to Figure 5.10a,the highest possible controller gain when using a P controller and a phase margin of 40◦ is required, is 8.6. Hence, toreduce the ramp error to 1% of that of the P controller, the static gain of the new controller has to be at least 860.Therefore, take γ = K/860 = 0.0155, and, according to the rule of thumb, let τI = 10/ωc,d = 9.52.Answer:

F (s) = 13.3 1.72s+ 10.31 · 1.72s+ 1

9.52s+ 19.52s+ 0.0155

5.11 a) The Nyquist curve is drawn based on the following observations: First, as ω → 0, |G(iω)| increases and argG(iω)→−90◦. Then, as ω → ∞, |G(iω)| → 0 and argG(iω) decreases. We also have, ωc = 0.78 rad/s with argG(iωc) =−133◦, and finally ωp = 3.2 rad/s with |G(iωp)| = 0.091. The resulting Nyquist curve is shown in Figure 5.11a.

−0.091 1

Re

Im

ωc = 0.78

ωp = 3.2

133◦

Figure 5.11a

b) The gain margin is 1/ |G(iωp)| = 11, which is also the highest possible proportional gain that preserves closed loopasymptotic stability.

c) The Laplace transform of the control error is related to the reference as follows:

E(s) = 11 +KG(s)R(s)

Withr(t) = 10t ⇒ R(s) = 10

s2

and using the final value theorem (from b we have that the system is stable), this yields

limt→∞

e(t) = lims→0

sE(s) = 102 lims→0 sG(s)

64

Page 185: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

For small ω we haveG(s) ≈ 1

s⇒ sG(s)→ 1, s→ 0 ⇒ lim

t→∞e(t) = 5

d) Raising the gain curve in the Bode plot by K = 2 results in

ωc = 1.24 rad/s ϕm = 32◦

The closed loop system becomes unstable when the phase margin is eaten up by the phase lag of the delay,

arg e−iωT = −ωT

so in order to get an asymptotically stable closed loop system it is thus required that

ωcT < 32◦ ⇒ T <32◦

1.24 rad/s = 0.55 rad1.24 rad/s = 0.44 s

5.12 a) For this amplitude curve we cannot say anything about the stability since the system can contain an arbitrarilylarge time delay which could make the gain margin less than 1.

b) It is stable, since the gain is less than 1 for all frequencies; there is no risk that the Nyquist curve could encircle −1under these circumstances.

5.13 a) Enter the system and the regulator. Drawthe Bode plot. This gives ωc = 5 rad/s,ωp = 9.5 rad/s, Am = 3.5 and ϕm = 27◦.

>> s = tf( ’s’ );>> G = 725 / ...

( ( s + 1 ) * ( s + 2.5 ) * ( s + 25 ) );>> F = 1;>> margin( F * G )

−150

−100

−50

0

50

Mag

nitu

de (d

B)

10−2 10−1 100 101 102 103−270

−225

−180

−135

−90

−45

0

Phas

e (d

eg)

Bode DiagramGm = 10.8 dB (at 9.49 rad/sec) , Pm = 26.6 deg (at 4.99 rad/sec)

Frequency (rad/sec)

b) From a) we know that at ωc,d = 5 rad/s the phase margin is 27◦. In order to have ϕm ≥ 60◦ we need to increase thephase by approximately 40◦, including 6◦ extra to compensate for a future lag compensator. This is obtained usinga lead compensator (using standard notation of parameters) with β = 0.21. The phase compensation is located atthe correct frequency by taking τD = 1

ωc,d√β

= 0.43.

The controller gain is adjusted by the factor K to get the desired crossover frequency:

K · 1√β· |G(i5)| = K · 1√

0.21· 1 = 1 ⇒

K = 0.46

65

Page 186: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

The requirement e0 = 0, that is, no steady state error for a unit step reference signal, is achieved by incorporatinga lag compensator (using standard notation of parameters) with γ = 0, and, using the rule of thumb for the choiceof τI, we take τI = 10/5 = 2.

Generate a lead-lag regulator and make aBode plot of the open loop system. Both thecrossover frequency and the phase marginrequirements are satisfied.

>> wc = 5;>> b = 0.21;>> tD = 1 / ( wc * sqrt( b ) );>> K = sqrt( b ) / 1;>> Flead = ( tD * s + 1 ) / ( b * tD * s + 1 );>> g = 0;>> tI = 10 / wc;>> Flag = ( tI * s + 1 ) / ( tI * s + g );>> F = K * Flead * Flag;>> margin( F * G )

−150

−100

−50

0

50

Mag

nitu

de (d

B)

10−2 10−1 100 101 102 103−270

−225

−180

−135

−90

−45

Phas

e (d

eg)

Bode DiagramGm = 16.8 dB (at 17.5 rad/sec) , Pm = 62.6 deg (at 5.01 rad/sec)

Frequency (rad/sec)

Plot the step response of the closed loop sys-tem.

>> Gc = feedback( F * G, 1 );>> step( Gc, 10 )

0 1 2 3 4 5 6 7 8 9 100

0.2

0.4

0.6

0.8

1

1.2

1.4

Step Response

Time (sec)

Ampl

itude

66

Page 187: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

c) Compute the transfer function of the closedloop system for F (s) = 1. Draw the Bodeplot.

>> Gc1 = feedback( G, 1 );>> bode( Gc1 )

−150

−100

−50

0

50

Mag

nitu

de (d

B)

10−1 100 101 102 103−270

−225

−180

−135

−90

−45

0

Phas

e (d

eg)

Bode Diagram

Frequency (rad/sec)

Add the Bode plot of the compensatedclosed loop system to the previous figure.The curves of the compensated system aredash-dotted.

>> hold on>> bode( Gc, ’-.’ )>> hold off

−150

−100

−50

0

50

Mag

nitu

de (d

B)

10−1 100 101 102 103−270

−225

−180

−135

−90

−45

0

Phas

e (d

eg)

Bode Diagram

Frequency (rad/sec)

Comparing the two Bode plots we see that the main difference is that the height of the resonance peak has beenreduced, that is, the damping of the closed loop system has been increased due to the increased phase margin. Wealso see that the bandwidth is approximately the same, since we have not changed the gain crossover frequency.

d) Calculate the transfer function from the reference signal to the error:

E(s) = R(s)− F (s)G(s)E(s) ⇒ E(s) = 11 + F (s)G(s)R(s)

LetS(s) = 1

1 + F (s)G(s)

Enter the transfer function S. >> S = 1 / ( 1 + F * G );

67

Page 188: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Create a time vector between 0 and 30 withstep 0.1, and a reference signal vector r(t) =t.

>> t = ( 0 : 0.1 : 30 ).’;>> r = t;

Plot the result. Even though the steadystate error for a step reference signal is zero(due to γ = 0), the steady state error for aramp reference signal is non-zero.

>> y = lsim( S, r, t );>> plot( t, y )

0 5 10 15 20 25 300

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

5.14 The amplitude and phase at ω = 0.2 rad/s is 0.0162 and −140◦. We need a phase lift of 20◦ to obtain a phase margin of60◦. A lag part is needed to remove the steady state error. Hence we need 6◦ more in phase lift, all in all a 26◦ phase lift.This is obtain by employing lead and lag compensators (using standard notation of the parameters). First, N = 3 andb = ωc,d/

√N = 0.12 give the required phase lead at the desired gain crossover frequency. Then K = 1

0.0162√N

= 35.7achieves that gain crossover frequency. Finally, a = 0.1ωc,d = 0.02 and M =∞ remove the steady-state error.The resulting controller is:

F (s) = 35.7 · 3 s+ 0.12s+ 3 · 0.12

s+ 0.02s

5.15 a) Combining the system’s transfer function with the controller K, the loop gain becomes

Go(s) = 0.25K(τ1s+ 1)(τ2s+ 1)s

which leads to the error coefficients

e0 = 11 + lims→0Go(s) = 0, e1 = 1

lims→0 sGo(s) = 4K

provided that Gc is stable. The Bode plot shows that stability of Gc under proportional control may be evaluatedvia the gain margin Am, that is, Gc is stable if K < Am. The Bode plot gives Am = 4000, so the condition underwhich the error coefficients are defined is

K < 4000

b) The problem formulation suggests the use of a lead-lag compensator.Let ωc,d denote the desired gain crossover frequency 100 rad/s. The Bode plot gives |G(iωc,d)| = 5 · 10−4 andargG(iωc,d) = −175◦. To obtain the desired phase margin, a phase lead of ((−180◦) + 50◦ + 6◦) − (−175◦) = 51◦is needed, where 6◦ has been added to ensure that the phase margin is kept even if a lag compensator is used. Tothis end, introduce a lead compensator in the controller:

Flead = Ns+ b

s+ bN

68

Page 189: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

See the discussion of lead compensators in Glad&Ljung! To keep the high frequency gain of the controller as smallas possible, N should be chosen as small as possible. The desired phase advance is obtained with N = 8. Thisphase lead is obtained at the desired crossover frequency if

b = ωc,d√N

= 35.4

The desired crossover frequency is obtained by adjusting the gain of the open loop system by introducing a factor,K, in the controller:

1 = K |Flead(iωc,d)| · |G(iωc,d)| = K√N · 5 · 10−4 ⇒ K = 707

Since the system contains an integrator, the step error coefficient e0 is zero. The ramp error coefficient requrementis

e1 = 1lims→0 sF (s)G(s) < 0.001 ⇐⇒

4lims→0 F (s) < 0.001 ⇐⇒

4000 < lims→0

F (s)

but the controller KFlead doesn’t fulfill this requrement since

lims→0

KFlead(s) = 707

Hence, the static gain of the controller must be increased by the factor 4000707 = 5.7. To this end, introduce a lag

compensator in the controller,Flag = s+ a

s+ a/M

with M = 5.7 and a = 0.1ωc,d = 10 (see the discussion of lag compensators in Glad&Ljung!).The resulting controller is

F (s) = 707 · 8 s+ 35.4s+ 282.8 ·

s+ 10s+ 1.78

5.16 Systemet G(s) = 2s+1e

−0.25s regleras med en P-regulator med K = 1/√

2. Skärfrekvensen ωc ges av

1 = |KG(iωc)| =2K√ω2c + 1

⇒ 4K2 = ω2c + 1⇒ ωc =

√4K2 − 1 = 1.

Fasmarginalen ϕm ges av

ϕm = π + arg(KG(iωc)) = π − 0.25ωc − arctanωc =

= π − 0.25− arctan 1 = 3π − 14 ≈ 121◦.

Vi vill bestämma en lead-lag-regulator F (s) som ger dubbla skärfrekvensen och samma fasmarginal. Vid ωc,ny = 2 ärfasmarginalen

ϕm,ny = π + argG(2i) = π − 0.5− arctan 2 ≈ 88◦.

Det innebär att vi måste höja fasen med

∆ϕm = 121◦ − 88◦ + 6◦ = 39◦,

med 6◦ för lag-länk. Det ger

β = 1− sin(∆ϕm)1 + sin(∆ϕm) = 0.2, τD = 1

ωc,ny√β

= 1.1.

Då har vi Flead = 1+τDs1+βτDs .

För att få rätt skärfrekvens bestämmer vi ett K ′ så att

69

Page 190: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1 = |K ′Flead(iωc)G(iωc)| = 2K ′ 1√β(ω2

c,ny + 1)= 2K ′

√1

5β = 2K ′ ⇒ K ′ = 12

Det stationära felet måste vara mindre än 0.05 när referensen är ett steg. Vi lägger till en lag-länk Flag = 1+τIsτIs+γ , där

τI = 10ωc,ny

= 5 och γ bestäms så att

11 +K ′Flead(0)Flag(0)G(0) = 1

1 + 2K ′/γ ≤ 0.05⇒ γ ≤ 2K ′

19 = 0.05

5.17 a) Vi söker F (s) = Flead(s)Flag(s).

Vi börjar med den fasavancerande länken

Flead(s) = KτDs+ 1βτDs+ 1 .

Den nya skärfrekvensen är wc,d = 30 rad/s.Eftersom ϕm = 40◦ och ϕm = arg(F (iwc,d)G(iwc,d))+180◦ = arg(Flead(iwc,d))+arg(Flag(iwc,d))+arg(G(iwc,d))+180◦, så får vi arg(Flead(iwc,d)) = −140◦ − arg(Flag(iwc,d)) − arg(G(iwc,d)). Från bodediagrammet har viarg(G(iwc,d)) ≈ −180◦ och från tumregeln om fasretarderande länkar, vet vi att den minskar fasen med 6◦ förlämpliga parameterval. Alltså arg(Flead(iwc,d)) = −140◦ + 6◦ + 180◦ = 46◦ och β = 0.17. Med detta β får viτD = (wc,d

√β)−1 = 0.0812.

Vi väljer K så att wc,d = 30: |F (iwc,d)G(iwc,d)| = 1. Detta ger

|Flead(iwc,d)||Flag(iwc,d)||G(iwc,d)| = 1.

Från tumregeln följer |Flag(iwc,d)| ≈ 1, ochK√β

|k1||iwc,d(iwc,d + a)(iwc,d + b)| = 1,

vilket ger K = 395.17.Den fasretarderande länken ges av

Flag(s) = τIs+ 1τIs+ γ

,

och enligt tumregeln ska τI = 10/wc,d = 0.33. Vi vill välja γ så att statiska felet vid steginsignaler är noll. Enligtslutvärdesteoremet (slutna systemet är asymptotiskt stabilt, se ovan)

limt→∞

e(t) = lims→0

sE(s) = lims→0

s1

1 + Flead(s)Flag(s)G(s)1s,

vilket gerlims→0

(s+ a)(s+ b)(s+ c)(βτDs+ 1)(τIs+ γ)(s+ a)(s+ b)(s+ c)(βτDs+ 1)(τIs+ γ) +Kk1(τDs+ 1)(τIs+ 1) =

= abcγ

abcγ +Kk1.

Alltså ska vi välja γ = 0.Den resulterande regulatorn ges av

F (s) = Flead(s)Flag(s) = 395.170.0812s+ 10.0137s+ 1

0.33s+ 10.33s .

b) Den verkliga öppna loopen ges av F (s)G0(s) = F (s)G(s)e−Tds. Notera att |F (jw)G0(jw)| =|F (jw)G(jw)e−jTdw| = |F (jw)G(jw)||e−jTdw| = |F (jw)G(jw)|, medan arg(F (jw)G0(jw)) = arg(F (jw)G(jw)) −Tdw. Eftersom tidsfördröjningen bara påverkar fasen tittar vi på fasmarginalen. Regulatorn är designad såatt ϕm = 40◦ = 40◦

180◦π rad. Alltså ϕ0m = ϕm − Tdwc. Slutna systemet är stabilt om ϕ0

m > 0, vilket gerϕm − Tdwc > 0⇔ Td <

ϕmwc

= 0.0233 s.

c) Slutna systemets (Gc) snabbhet ges av dess bandbredd, vilken är wB ≈ 50 rad/s. Ett lågpassfilter Fr(s) = 11+τs

uppfyller |Fr(jw)| ≈ 1 för w < τ−1, medan för w > τ−1 avtar förstärkningen med lutning −1 i ett bodediagram.Approximativt gäller då att Fr bara reducerar hela systemets bandbredd om wB > τ−1, vilket ger τ > w−1

B = 150 .

70

Page 191: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

6 Sensitivity and Robustness

6.1 The sensitivity function is the transfer function from v to y. The block diagram gives

Y (s) = 11 + K

s(s+1)V (s) = s2 + s

s2 + s+K︸ ︷︷ ︸S(s)

V (s)

|S(iω)| = ω√ω2 + 1√

(K − ω2)2 + ω2

For ω = 1 we get

|S(1i)| =√

2√(K − 1)2 + 1

The amplitude of y(t) is less than the amplitude of v(t) if |S(1i)| < 1, that is,√

2√(K − 1)2 + 1

< 1 ⇔ 2 < (K − 1)2 + 1 K>0⇔ K > 2

6.2 Determine the upper limit of the relative model error

G∆(s) = G0(s)−G(s)G(s) = s ⇒ |G∆(iω)| = ω

The stability is then guaranteed if

|Gc(iω)| =∣∣∣∣ F (iω)G(iω)1 + F (iω)G(iω)

∣∣∣∣ < 1ω

∀ω

No steady state error for steps implies Gc(0) = 1 and the bandwidth ωB is thus defined by the smallest value thatsatisfies

|Gc(iω)| < 1√2, ω > ωB

The curve 1/ω crosses 1/√

2 at ω =√

2. Thus, the bandwidth must be less than√

2. However, the curve |Gc(iω)|asymptotically approaches a line with slope −20 dB20/decade, which implies that ωB cannot be arbitrarily close to

√2.

For example, if Gc is a first order system, then the breakpoint of the asymptote must be 1 rad/s if it shall coincidewith 1/ω. The first order system with that asymptote is 1

1+s/1 , which has a bandwidth of 1 rad/s. If Gc would be ahigher order system, the bandwidth could be made slightly higher, but the limited information about Gc excludes thispossibility.Answer: The maximum bandwidth is ωB = 1.

6.3 The disturbance is amplified when the magnitude of the sensitivity function exceeds one, that is, when∣∣∣∣ 11 +Go(iω)

∣∣∣∣ > 1

that is|1 +Go(iω)| < 1

which corresponds to the part of Go(iω) that is within a circle with center at −1 and radius 1, see Figure 6.3a.

6.4 Letg(ω) = 0.9√

1 + ω2

71

Page 192: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−1

Re

Im

Go

Figure 6.3a

denote the upper bound on the norm of the relative model error. Robustness condition:

|T (iω)| =∣∣∣∣ F (iω)G(iω)1 + F (iω)G(iω)

∣∣∣∣ < 1g(ω) ∀ω

Now,F (s)G(s) = s+ 10

s

1s+ 10 = 1

s⇒∣∣∣∣ F (iω)G(iω)

1 + F (iω)G(iω)

∣∣∣∣ =∣∣∣∣ 1iω + 1

∣∣∣∣ = 1√ω2 + 1

so the robustness condition becomes

∀ω : 1√ω2 + 1

<

√ω2 + 10.9 ⇔

∀ω : 0.9 < ω2 + 1

which is satisfied.Answer: Yes.

6.5 a) Using notation similar to that in Glad&Ljung, we have

G∆(s) = e−sT − 1

that is, G∆(iω) = cosωT − 1− i sinωT . This implies

|G∆(iω)| =√

2− 2 cosωT

and in particular

|G∆(iω)| ={

0, when cosωT = 12, when cosωT = −1

In Figure 6.5a, |G∆(iω)|−1 is plotted as a function of ωT .

b) The robustness criterion results in

∀ω :∣∣∣∣ F (iω)G(iω)1 + F (iω)G(iω)

∣∣∣∣ < 1|G∆(iω)|

Figure 6.5a therefore provides the answer.Answer: ∣∣∣∣ F (iω)G(iω)

1 + F (iω)G(iω)

∣∣∣∣ < 12

72

Page 193: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

0 5 10 15 20 25 301/√

2−

2co

T

ωT

Figure 6.5a

6.6 a) First identify the relative model error:

G0(s) = G(s) + G(s) = G(s)(

1 + G(s)G(s)

)that is,

G∆(s) = G(s)G(s)

The robustness criterion∀ω :

∣∣∣∣ 1G∆(iω)

∣∣∣∣ =∣∣∣∣G(iω)G(iω)

∣∣∣∣ > ∣∣∣∣ KG(iω)1 +KG(iω)

∣∣∣∣gives

∣∣G(iω)∣∣ < |iω(iω + 5) +K|

|Kiω(iω + 5)| = 225 ·

√(25/2− ω2)2 + 25ω2

ω2(ω2 + 25) =

= 225 ·

√ω4 + (25/2)2

ω2(ω2 + 25) =: g(ω)

Because g(ω) → 2/25 as ω → ∞ stability cannot be guaranteed when G(s) = 1. Also note that the requirementthat G0(iω)F (iω)→ 0 as ω →∞ fails, since G0(iω)→ 1, ω →∞.

b) When G(s) = α the closed loop system becomes

KG0(s)1 +KG0(s) = K(1 + αs(s+ 5))

s(s+ 5) +K(1 + αs(s+ 5))

with characteristic equations2(2 + 25α) + 5s(2 + 25α) + 25 = 0

Rouths algorithm gives the condition2 + 25α > 0 ⇔ α > −2/25

This is not contradictory since the robustness criterion is a sufficient but not necessary condition.

6.7 a) The characteristic equation can be determined for a generic nominal loop gain. Let

Go(s) = b(s)a(s)

denote the nominal loop gain. The true closed loop system becomes

Gc(s) =b(s)a(s)

αs+α

1 + b(s)a(s)

αs+α

= b(s)αa(s)(s+ α) + b(s)α = b(s)α

a(s)s+ (a(s) + b(s))α

73

Page 194: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

-2 -1 1

-1

1

Re

Im

ω =√

3, α = 3

ω = −√

3, α = 3

Asymptote

(2)

Figure 6.7a

and has the same root locus with respect to α as the open loop system

a(s) + b(s)a(s)s = Go + 1

s

has with respect to a proportional feedback. This can be used to draw the root locus using Matlab. However, todraw the root locus by hand, we use that here Go(s) = KG(s), so

b(s) = 4 a(s) = s(s+ 1)

which lets us identify the polynomials P and Q in the characteristic equation P (s) + αQ(s) = 0 as

P (s) = a(s)s = s2(s+ 1) Q(s) = a(s) + b(s) = s2 + s+ 4

� Starting points ⇒ zeros of P (s): 0 (double), and −1End points ⇒ zeros of Q(s): − 1

2 ± i√

152

� Number of asymptotes: 3− 2 = 1.Direction of asymptote: 1

1 ·π, that is, the negative real axis.

� Part of the real axis that belongs to the root locus: (−∞, −1].

� Intersection with the imaginary axis: Set s = iω and solve the characteristic equation:

−ω2(iω + 1) + α(−ω2 + iω + 4) = 0

Isolate real and imaginary parts: {−ω2(1 + α) + 4α = 0−ω3 + αω = 0

with solutions(α = 0, ω = 0 ) or (α = 3, ω = ±

√3 )

The root locus is shown in Figure 6.7a, from which the conclusion immediately follows.Answer: Asymptotically stable for α > 3.

b) Begin by identifying the relative model error:

G0(s) = G(s) α

(s+ α) = G(s)(

1 + α

(s+ α) − 1︸ ︷︷ ︸G∆(s)

)

Thus1

|G∆(iω)| =∣∣∣∣s+ α

−s

∣∣∣∣ =√ω2 + α2

ω=: f(ω)

74

Page 195: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

The robustness criterion ∀ω : |Gc(iω)| < f(ω) is fulfilled if the low frequency asymptote of f(ω) exceeds theresonance peak at ω = 2, where |Gc(i2)| = 2. This gives the condition

√4 + α2

2 > 2 α>0⇔

α >√

12

Answer: α >√

12

c) The robustness criterion gives a sufficient but not necessary condition, that is, the system can be stable even if thecriterion is not satisfied. In this case for 3 < α <

√12. With a root locus we obtain an exact characterization of

the stabilizing parameter values, that is, a necessary and sufficient condition.

6.8 It can be shown that both F (iω)G(iω) and F (iω)G0(iω) tend to 0 as ω → ∞. The robustness criterion guaranteesstability if

|Gc(iω)| < 1γω

since|G∆(iω)| < γω ⇒ 1

γω<

1|G∆(iω)|

The transfer function Gc has a resonance peak at ω = 1 with |Gc(i1)| = 35, which leads to the condition

35 < 1γ · 1 ⇔ γ <

135

Trivially, γ must also be positive.Answer: 0 ≤ γ < 1

35

6.9 The closed loop system becomes

Y (s) = V (s) +Go(s)(R(s)−N(s)− Y (s)) ⇒

Y (s) = Go(s)1 +Go(s) (R(s)−N(s)) + 1

1 +GoV (s)

where we can identifyT (s) = Go(s)

1 +Go(s) S(s) = 11 +Go(s)

Notice that S(s) + T (s) = 1. In the problem formulation we have Y (s) = S(s)V (s) since the other inputs are zero.Hence, for v(t) = sin t, we have

L−1 {SV } (t) = 1√2

sin(t− π

4 )

and thus for n(t) = sin t

Y (s) = −T (s)N(s) = −(1− S(s))N(s) = S(s)N(s)−N(s) ⇒

y(t) = 1√2

sin(t− π

4 )− sin(t)

6.10 a) PuttingG0(s) = G(s) 1

(s+ 1) = G(s)(1 +G∆(s))

givesG∆(s) = − s

s+ 1and

1G∆(s) = −s+ 1

s

75

Page 196: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) Enter the system and the regulator fromProblem 5.13.

>> s = tf( ’s’ );>> G = 725 / ...

( ( s + 1 ) * ( s + 2.5 ) * ( s + 25 ) );>> wc = 5;>> N = 5;>> b = wc / sqrt( N );>> K = 1 / sqrt( N );>> Flead = N * ( s + b ) / ( s + b * N );>> a = 0.1 * wc;>> Flag = ( s + a ) / s;>> F = K * Flead * Flag;

Enter the inverse relative model error andthe complementary sensitivity function ob-tained when G(s) is controlled by F (s) = 1.Plot the amplitude curve of the inverse rel-ative model error in the same diagram asthe amplitude curve of the complementarysensitivity function.

>> IDG = - ( s + 1 ) / s;>> T = feedback( 1 * G, 1 );>> bode( IDG, ’k-’, ...

T, ’k-.’ );

−150

−100

−50

0

50

100

Mag

nitu

de (

dB)

10−2

10−1

100

101

102

103

−270

−180

−90

0

90

180

270

Pha

se (

deg)

Bode Diagram

Frequency (rad/sec)

Since the absolute value of the complementary sensitivity function goes above the inverse relative model error overa frequency interval, we cannot guarantee that the closed loop system obtained when G0(s) is controlled by F (s) isasymptotically stable.

76

Page 197: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Enter the complementary sensitivity func-tion obtained when G(s) is controlled by thelead-lag regulator designed in Problem 5.13.Plot the amplitude curve of the inverse rela-tive model error in the same diagram as thethe amplitude curve of the complementarysensitivity function.

>> T = feedback( F * G, 1 );>> bode( IDG, ’k-’, ...

T, ’k-.’ );

−150

−100

−50

0

50

100

Mag

nitu

de (

dB)

10−2

10−1

100

101

102

103

−270

−180

−90

0

90

180

270

Pha

se (

deg)

Bode Diagram

Frequency (rad/sec)

In this case |T (iω)| stays below the inverse relative model error, and hence we can guarantee that the closed loopsystem obtained when the lead-lag regulator is applied to G0(s) will be asymptotically stable.

6.11 The transfer function between the reference and the error is the sensitivity function. When the reference signal is asinus the error signal will also be a sinus with the same frequency and with an amplitude modified by the gain of thetransfer function at that frequency, |S(0.1i)| = −20 dB20 = 0.1. This gives that the amplitude of the error is 0.2.

6.12 A way to see if the controller also stabilizes the system at 400 r/min is to look at the phase and amplitude margin of

F (s)G(s) = 35.7 · 3 s+ 0.116s+ 0.116 · 3

s+ 0.02s

0.02s+ 0.02

e−2s

1 + 20s

A bode plot of this system is given in Figure 6.12a were it can be seen that the phase margin is 9.54◦ and that theamplitude margin is 1.3. The closed loop system is stable but the margin is small.

6.13 The sensitivity function is given by

S(s) = 11 + F (s)G(s)

which in this case means

S(s) = (s+ 1)2

(s+ 1)2 +K

The demand that the amplification of the sensitivity function should be less than 1 at ω = 1 gives

|S(i1)| = 2√4 +K2

≤ 0.1

that is, K ≥√

396 ≈ 19.9.

To illustrate, the condition is verified in Matlab.

77

Page 198: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

10-1

100

101

-210◦

-180◦

-150◦

-120◦

-90◦

10-1 100

ωc = 0.26

ωp = 0.32

|GO(ι

ω)|

arg

GO(ι

ω)

ω [rad/s]

Am

=1.3

m=

9.6

7◦

Figure 6.12a

Enter the system and create the sensitivityfunction. Plot with a grid.

>> s = tf( ’s’ );>> G = 1 / ( s + 1 )^2;>> K = 20;>> S = minreal( 1 / ( 1 + K * G ) );>> bode( S );>> grid;

−30

−20

−10

0

10

Mag

nitu

de (

dB)

10−2

10−1

100

101

102

0

45

90

135

Pha

se (

deg)

Bode Diagram

Frequency (rad/sec)

6.14 a) Hitta Gc(s)

78

Page 199: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Härledning av överföringsfunktionen för det slutna systemet,

Gc(s) = Go(s)1 +Go(s)

= FG(s)1 + FG(s)

=3s+1s

1(s−1)(εs+1)

1 + 3s+1s

1(s−1)(εs+1)

= 3s+ 1s(s− 1)(εs+ 1) + 3s+ 1 .

Identifiera P (s) och Q(s)Skriv om nämaren till Gc(s) som

s(s− 1)(εs+ 1) + 3s+ 1 = ε(s3 − s2) + (s2 + 2s+ 1).

Detta ger

Q(s) = s3 − s2, P (s) = s2 + 2s+ 1.

Dock måste gradtalet för P (s) vara större än gradtalet för Q(s). Så är ej fallet. Vi hanterar detta genom att ritarotorten för K = 1/ε istället. Följaktligen blir

P (s) = s3 − s2, Q(s) = s2 + 2s+ 1.

Hitta startpunkterStartpunkter är de s där P (s) = 0. De är s1 = 0, s2 = 0 och s3 = 1.

Hitta ändpunkterÄndpunkter är de s där Q(s) = 0. De är s1 = −1, s2 = −1.

Antal asymptoterAntalet asymptoter är n−m = 1, där n är gradtalet för P (s) och m är gradtalet för Q(s).

Hitta riktningarAsymptotens riktning ges av

π

n−m= π.

Följaktligen kommer asymptoten ej att skära reella axeln.

Hitta eventuell skärning med imaginära axelnSätt in s = iω i P (s) +KQ(s) = 0 och lös ekvationen för reella ω och icke-negativa K. Vi får

P (iω) +KQ(iω) = −iω3 + ω2 −Kω2 + 2Kiω +K = 0⇒ ω = 0, K = 0 och ω =

√3, K = 3/2.

Bestäm de delar av reella axeln som tillhör rotortenDen del av reella axeln som tillhör rotorten är −∞ < s ≤ 1.

Rita rotortenSe figur 6.14a.Följaktligen så är det slutna systemet stabilt för K > 3/2⇒ 0 ≤ ε < 2/3.

Svar: 0 ≤ ε < 2/3.

b) Identifiera det relativa modellfeletEnligt definitionen så har vi

G0(s) = G(s)[1 + ∆G(s)].

79

Page 200: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−8 −7 −6 −5 −4 −3 −2 −1 0 1 2−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

Root Locus

Real Axis

Imag

inar

y Ax

is

Figure 6.14a

I vårt fall så är

G0(s) = 1(s− 1)(εs+ 1) = G(s)(1− εs

εs+ 1)⇒ ∆G(s) = −εsεs+ 1

Enligt robusthetskriteriet så är det slutna systemet stabilt om |T (iω)| < 1/|∆G(iω)| för alla ω. Den asymptotiskaamplitudkurvan för

1∆G(s) = 1 + s/(1/ε)

−s/(1/ε)har lutning −1 fram till ω = 1/ε och sedan lutning 0. Den har förstärkning 1 för frekvenser ω > 1/ε. Enligt figurenhar |T (iω)| förstärkning mindre än 1 för ungefär ω > 3, så olikheten är uppfylld om ε < 0.33.Svar: 0 ≤ ε < 0.33.

6.15 a) S(s) är överföringsfunktionen från störsignal till utsignal. För att undertrycka en störning av frekvens ω ska|S(iω)| < 1. −Gc(s) är överföringsfunktionen från mätbruset till systemets utsignal. För att undertrycka mätbrusav frekvens ω ska |Gc(iω)| < 1. Vi har följande samband mellan S(s) och Gc(s)

S(s) +Gc(s) = 11 +G0(s) + G0(s)

1 +G0(s) = 1.

På grund av detta samband så kan inte både S(s) och Gc(s) göras små oberoende av varandra. Således kan vi intebåde undertrycka störningen och mätbruset godtyckligt mycket samtidigt.

b) S(s) är stabil så vi kan använda slutvärdessatsen:

limt→∞

e(t) = lims→0

sE(s) = lims→0

sS(s)1s

= lims→0

S(s) = {nollställe i origo} = 0.

80

Page 201: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

7 Special Controller Structures

7.1 a) Derive the transfer function:

θ(s) = 1(1 + 30s)(1 + 3s)θm(s)

θm(s) = GR2(s)(1 + 10s) +GR2(s)W (s)

GR2(s) = K2 = 9 givesθ(s) = 0.9

(1 + s0.033 )(1 + s

0.33 )(1 + s)W (s) =: G(s)W (s)

Thus,|G(iω)| = 0.9√

1 + ( ω0.033 )2

√1 + ( ω

0.33 )2√

1 + ω2

with low frequency asymptote|G(iω)| → 0.9, ω → 0

andargG(iω) = − arctan ω

0.033 − arctan ω

0.33 − arctanω

The gain is drawn approximatively based on a known gain at some point of the low frequency asymptote, 0.9, andthe breakpoints and slopes of the asymptotes:

Frequency [rad/s] 0.033 0.33 1Slope 0 −1 −2 −3

The phase curve is drawn based on a couple of samples:Frequency [rad/s] 0.033 0.1 0.2 0.5 1.0Phase −52◦ −94◦ −123◦ −169◦ −205◦

0.010.020.050.10.20.5

12

1/K1

-210◦-180◦-150◦-120◦-90◦-60◦

0.02 0.03 0.050.07 0.1 0.2 0.3 0.5 0.7 1

ωp = 0.61

0.427

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Am

=50.5

2

19.2

8◦

Figure 7.1a

The Bode plot in Figure 7.1a gives that the gain crossover frequency and the phase margin are undefined, but wehave a gain margin:

ωp = 0.61 rad/s Am = 50.5

A gain margin of 2 is obtained whenK1 ·

150.5 = 1

2

81

Page 202: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

that is, K1 = 25.25. This results in a new gain crossover of 0.43 rad/s (and new phase margin of 19◦). To find thesteady state error, study how the Laplace transforms of the controll error relates to that of the reference:

E(s) = 11 +K1G(s)θref(s)

which with θref(s) = as gives

limt→∞

e(t) = lims→0

sE(s) = a

1 +K1 · 0.9= 0.042 · a

b) Without the internal feedback we get the transfer function defined by

θ(s) = 1(1 + s

0.033 )(1 + s0.1 )(1 + s

0.33 )W (s) =: G(s)W (s)

and thus|G(iω)| = 1√

1 + ( ω0.033 )2

√1 + ( ω

0.33 )2√

1 + ( ω0.1 )2

with low frequency asymptote|G(iω)| → 1, ω → 0

andargG(iω) = − arctan ω

0.033 − arctan ω

0.33 − arctan ω

0.1The gain is drawn approximatively based on a known gain at some point of the low frequency asymptote, 1, andthe breakpoints and slopes of the asymptotes:

Frequency [rad/s] 0.033 0.1 0.33Slope 0 −1 −2 −3

The phase curve is drawn based on a couple of samples:Frequency [rad/s] 0.033 0.1 0.2 0.4Phase −69◦ −134◦ −174◦ −212◦

0.010.020.050.10.20.5

12

1/K1

-210◦-180◦-150◦-120◦-90◦-60◦

0.02 0.03 0.050.07 0.1 0.2 0.3 0.5 0.7 1

ωp = 0.22

0.154

|G(i

ω)|

arg

G(i

ω)

ω [rad/s]

Am

=19.0

6

20.5

1◦

Figure 7.1b

The Bode plot in Figure 7.1b gives that, again, the gain crossover frequency and phase margin are undefined, butwe have a gain margin:

ωp = 0.22 rad/s Am = 19A gain margin of 2 is obtained when K1 · 1

19 = 12 , which leads to K1 = 9.5. This results in a new gain crossover of

0.15 rad/s (and a new phase margin of 21◦). As above, we get the controll error for step references:

limt→∞

e(t) = 11 + 9.5 · 1a = 0.095a

We conclude that due to the internal feedback, the system in a) is faster (higher bandwidth) as well as more precise(smaller stationary error).

82

Page 203: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

GvΣ Σ G

Ff

0 h

v

+

+

+

Figure 7.2a

7.2 Consider the block diagram in Figure 7.2a. The change in tank volume per time unit is given by

Addth(t) = x(t)− v(t)

or, equivalently,A · s ·H(s) = X(s)− V (s)

which givesH(s) = 1

As(X(s)− V (s))

Furthermore,X(s) = Gv(s)U(s)

whereGv(s) = 1

1 + s/2

a) We let the input u(t) be a function of v(t) only, that is,

U(s) = Ff(s)V (s)

The level h(t) as a function of v(t) then becomes

H(s) = 1As

(Gv(s)Ff(s)− 1)V (s)

If we chooseFf(s) = 1

Gv(s) = 1 + s/2

the level becomes independent of v(t), but to get the controller Stu uses, we remove the derivative term:

Ff(s) = 1

The level as a function of v(t) then becomes

H(s) = 1As

( 11 + s/2 − 1)V (s) = − 1

2A1

1 + s/2V (s)

With V (s) = 0.1/s this yields

H(s) = −0.12A

1s(1 + s/2) = −0.1

2A

(1s− 1

2 + s

)that is

h(t) = − 0.1A · 2(1− e−2t)

which gives the steady state error −0.05/A.

b) We now choose the input u(t) to be a function of both h(t) and v(t), that is, we add the term −Kh(t) to the controllaw from a). (See Figure 7.2b.) Thus

u(t) = −Kh(t) + v(t)

or, equivalently,U(s) = −KH(s) + V (s)

83

Page 204: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

GvΣKΣ Σ G

Ff

0 h

v

−+

+

+

+

Figure 7.2b

This gives

AsH(s) = Gv(s)(−KH(s) + V (s))− V (s)(As+KGv(s))H(s) = (Gv(s)− 1)V (s)

H(s)V (s) = −s/2

A/2 · s2 +As+K= −sA(s2 + 2s+ 2K/A)

To select K, we may compare∗s2 + 2s+ 2K/A = 0

with the standard equations2 + 2ζω0s+ ω2

0 = 0

which givesω2

0 = 2 ·K/A ζω0 = 1

To obtain approximately 5% overshoot we choose ζ = 0.707, and from√A/(2K) = ζ = 0.707

we get K = A. Hence,H(s)V (s) = −s

A(s2 + 2s+ 2)If v(t) is a step of amplitude 0.1, the final level becomes

limt→∞

h(t) = 0

that is, there will be no steady state error in the level for a step disturbance.

Gv

ΣGu

Ff

y

v

+

+

Figure 7.3a

7.3 a) A block diagram of the system is given in Figure 7.3a. The output is given by

Y = (Gv +GuFf)V

whereGu(s) = 2

s+ 3 Gv(s) = 3s+ 4

∗Note that any K > 0 results in a stable closed loop system, and that the steady state error computations below are independent of theparticular value of K. Hence, selecting K is not necessary for the solution of this problem.

84

Page 205: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Chose Ff such that (Gv +GuFf)V = 0:

Ff = −Gv

Gu= −3(s+ 3)

2(s+ 4)

Compute the controller. >> s = tf( ’s’ );>> Gu = 2 / ( s + 3 );>> Gv = 3 / ( s + 4 );>> F = - Gv / Gu;

b) If v(t) = 2 sinωt thenu(t) = 2 |Ff(iω)| sin(ωt+ argFf(iω))

The amplitude is then

A(ω) = 2 |Ff(iω)| = 2 · 32

√ω2 + 9ω2 + 16 ≤ 3

A(ω)→ 3, ω →∞

Gv

ΣGu

Ff

y

v

+

+ΣK

−1

Figure 7.3b

c) A block diagram of the system with both feedforward and feedback is shown in Figure 7.3b. The output is nowgiven by

Y = GvV + GuU = (Gv + GuFf)V − GuKY

whereGu(s) = b

s+ 3The transfer function from V to Y is given by

Y (s) = Gv + GuFf

1 + GuKV (s) =

3s+4 −

3b2(s+4)

1 +K bs+3

V (s)

= 3(1− b/2)(s+ 3)(s+ 4)(s+ 3) +Kb(s+ 4)V (s)

This is stable for K ≥ 0 and b ≥ 0. The final value theorem can therefore be used (with V (s) = 1s ):

limt→∞

y(t) = lims→0

sY (s) = lims→0

s3(1− b/2)(s+ 3)

(s+ 4)(s+ 3) +Kb(s+ 4) ·1s

= 9(1− b/2)12 + 4Kb

7.4 a) The output is given byY = (Gv +GuFf)V

whereGu(s) = 3

s+ 1 Gv(s) = 4(s+ 2)(s+ 5)

Chose Ff such that (Gv +GuFf)V = 0:

Ff(s) = −Gv(s)Gu(s) = − 4(s+ 1)

3(s+ 2)(s+ 5)

85

Page 206: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Create the system and the feedforward con-troller.

>> s = tf( ’s’ );>> Gv = 4 / ( s + 2 ) / ( s + 5 );>> Gu = 3 / ( s + 1 );>> F = - Gv / Gu;

b) The constant to replace Ff(s) is given by

Ff = Ff(0) = − 430

The output is then given by

Y (s) =(− 12

30(s+ 1) + 4(s+ 2)(s+ 5)

)V (s) = 40(s+ 1)− 4(s+ 2)(s+ 5)

10(s+ 1)(s+ 2)(s+ 5) V (s)

= −4s2 + 12s10(s+ 1)(s+ 2)(s+ 5)V (s)

Taking the Laplace transform of v(t) = −1 − 0.1t we get V (s) = − 1s −

0.1s2 . The final value theorem then gives

(verify that the system is stable)

limt→∞

y(t) = lims→0

s−4s2 + 12s

10(s+ 1)(s+ 2)(s+ 5)

(−1s− 0.1s2

)= 12

100 · (−0.1) = −0.012

Create the system with the controller andcreate the disturbance signal.

>> F = -4/30;>> G = F * Gu + Gv;>> t = ( 0 : 0.001 : 20 ).’;>> v = -1 - 0.1*t;>> lsim( G, v, t )

0 2 4 6 8 10 12 14 16 18 20−0.07

−0.06

−0.05

−0.04

−0.03

−0.02

−0.01

0

0.01

0.02

0.03Linear Simulation Results

Time (sec)

Am

plitu

de

c) With the P controller the output is given by

Y (s) = − 3(s+ 1)KY (s) +

(− 12

30(s+ 1) + 4(s+ 2)(s+ 5)

)V (s)

which means that

Y (s) =40(s+1)−4(s+2)(s+5)

10(s+1)(s+2)(s+5)

1 + 3Ks+1

V (s) = −0.4s2 + 1.2s(s+ 3K + 1)(s+ 2)(s+ 5)V (s)

86

Page 207: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Using the same disturbance, V (s) = − 1s −

0.1s2 , the final value theorem gives (verify that the system is stable)

limt→∞

y(t) = lims→0

s−0.4s2 + 1.2s

(s+ 3K + 1)(s+ 2)(s+ 5)

(−1s− 0.1s2

)= 1.2

(3K + 1) · 10 · (−0.1) = − 0.0123K + 1

Create the new closed loop system with dif-ferent values on K.

>> K = 1;>> Gc = minreal( G / ( 1 + K * Gu ) );>> lsim( Gc, v, t )

0 2 4 6 8 10 12 14 16 18 20−0.04

−0.03

−0.02

−0.01

0

0.01

0.02Linear Simulation Results

Time (sec)

Am

plitu

de

d) When only a P controller is used we have the following relationship between the disturbance and the output

Y (s) = − 3(s+ 1)KY (s) + 4

(s+ 2)(s+ 5)V (s)

which means that

Y (s) = 4(s+ 1)(s+ 2)(s+ 5)(s+ 3K + 1)V (s)

Again using the same disturbance, V (s) = − 1s −

0.1s2 , a careful inspection of Y (s) gives that there is no final value

of y, hence the final value theorem does not apply.∗ However, the possibility to simulate the system remains.

∗If it is assumed that the final value exists, a contradiction follows since then the final value theorem would apply, but give

limt→∞

y(t) = lims→0

s4(s + 1)

(s + 2)(s + 5)(s + 3K + 1)

(−

1s−

0.1s2

)= − lim

s→0

4(s + 1)(s + 2)(s + 5)(s + 3K + 1)

s + 0.1s

= −∞

87

Page 208: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Simulate the output. >> Gc = minreal( Gv / ( 1 + K * Gu ) );>> lsim( Gc, v, t )

0 2 4 6 8 10 12 14 16 18 20−0.35

−0.3

−0.25

−0.2

−0.15

−0.1

−0.05

0Linear Simulation Results

Time (sec)

Am

plitu

de

7.5 a) i) Y = G1G2(FrR− FyY )⇒ Y = G1G2Fr1 +G1G2Fy

R.

Svar: G1G2Fr1 +G1G2Fy

ii) Y = G2(D +G1FfD −G1FyY )⇒ Y = G2(1 +G1Ff )1 +G1G2Fy

D.

Svar: G2(1 +G1Ff )1 +G1G2Fy

a) Enligt boken (eller så inses det från överföringsfunktionen ovan) så elimineras d om Ff (s) = −1/G1(s). I detta

fallet alltså Ff (s) = −s2 + 2s+ 1s+ 2 .

(Detta val av Ff (s) kan dock ej implementeras eftersom det har deriverande verkan för höga frekvenser.) Föratt eliminera konstanta störningar räcker det att framkoppla med den statiska förstärkningen av Ff (s), d.v.s.Ff (0) = −1/2.

88

Page 209: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8 State Space Description

8.1 According to Solution 2.1 the differential equation for the motor is

θ + 1τθ = Ku

wherefRa + kakv

JRa= 1τ

kaJRa

= K

Introduce the state variables x1 and x2 according to

x1 = θ x2 = θ

This gives the state space equations

x1 = θ = x2

x2 = θ = −1τθ +Ku = −1

τx2 +Ku

In matrix form we get

x =(

0 10 −1/τ

)x+

(0K

)u

y =(1 0

)x

where xT =(x1 x2

).

8.2 We start with the differential equations`θ + g sin θ + z cos θ = 0

The state variablesx1 = θ x2 = θ

inputu = z

`and output

y = θ

gives the (nonlinear) state space description

x1 = x2 =: f1(x, u)

x2 = θ = −g`

sin θ − z

`cos θ = −ω2

0 sin x1 − u cosx1 =: f2(x, u)

where ω20 = g/`. We get that

∂f1

∂x=(0 1

)∂f1

∂u= 0

∂f2

∂x=(−ω2

0 cosx1 + u sin x1 0)

∂f2

∂u= − cosx1

Introduce x1∆ = x1 − π, x2∆ = x2, u∆ = u, and y∆ = y − π. Linearization around x1 = π, x2 = 0 and u = 0 gives

x1∆ = x2∆

x2∆ = ω20x1∆ + u∆

y∆ = x1∆

89

Page 210: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8.3 Introduce the state variablesx1 = y x2 = θ x3 = z

According to the figure, the variables are related as

X1(s) = Y (s) = 1s

(Ml(s) +K2X2(s))

X2(s) = θ(s) = 1s

(X3(s)−X1(s))

X3(s) = Z(s) = 1s

(K1I(s)−K2X2(s))

Inverse Laplace transformation gives, in the time domain,

x1(t) = K2x2(t) +Ml(t)x2(t) = −x1(t) + x3(t)x3(t) = −K2x2(t) +K1i(t)

In matrix notation this becomes

x(t) =

0 K2 0−1 0 10 −K2 0

x(t) +

00K1

i(t) +

100

Ml(t)

y(t) =(1 0 0

)x(t)

8.4 a)d3

dt3 y(t) + 6 d2

dt2 y(t) + 11 ddty(t) + 6y(t) = 6u(t)

The state variablesx1(t) = y x2(t) = y x3(t) = y

gives

x1(t) = x2(t)x2(t) = x3(t)

x3(t) = d3

dt3 y(t) = −6y(t)− 11y(t)− 6y(t) + 6u(t)

= −6x3(t)− 11x2(t)− 6x1(t) + 6u(t)

In matrix form we get

x(t) =

0 1 00 0 1−6 −11 −6

x(t) +

006

u(t)

y(t) =(1 0 0

)x(t)

b)d3

dt3 y(t) + d2

dt2 y(t) + 5 ddty(t) + 3y(t) = 4 d2

dt2u(t) + ddtu(t) + 2u(t)

If we introduce x1(t) = y(t) in the equation and collect all terms without differentiation on the right hand side weget

d3

dt3x1(t) + d2

dt2x1(t) + 5 ddtx1(t)− 4 d2

dt2u(t)− ddtu(t) = −3x1(t) + 2u(t)

that isddt

(d2

dt2x1(t) + ddtx1(t) + 5x1(t)− 4 d

dtu(t)− u(t))

= −3x1(t) + 2u(t)

Now introduce the expression within the parenthesis as a new state variable

x2(t) = d2

dt2x1(t) + ddtx1(t) + 5x1(t)− 4 d

dtu(t)− u(t)

90

Page 211: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

that isx2(t) = −3x1(t) + 2u(t) (8.1)

Repeating this procedure yieldsddt (

ddtx1(t) + x1(t)− 4u(t)) = x2(t)− 5x1(t) + u(t) (8.2)

and we can introducex3(t) = d

dtx1(t) + x1(t)− 4u(t)

that isx1(t) = x3(t)− x1(t) + 4u(t) (8.3)

Equation (8.1), (8.2), and (8.3) define the state space equations

x(t) =

−1 0 1−3 0 0−5 1 0

x(t) +

421

u(t)

y(t) =(1 0 0

)x(t)

c) Partial fraction expansion ofY (s) = 2s+ 3

s2 + 5s+ 6U(s)

givesY (s) = − 1

s+ 2U(s) + 3s+ 3U(s)

Introducing the state variablesX1(s) = − 1

s+ 2U(s) X2(s) = 3s+ 3U(s)

gives

x1(t) = −2x1(t)− u(t)x2(t) = −3x2(t) + 3u(t)

in the time domain. Furthermore, we havey(t) = x1(t) + x2(t)

In matrix form

x(t) =(−2 00 −3

)x(t) +

(−13

)u(t)

y(t) =(1 1

)x(t)

8.5 The impulse responseg(t) = 2e−t + 3e−4t

gives the transfer functionG(s) = 2

s+ 1 + 3s+ 4

The output can then be writtenY (s) = 2

s+ 1U(s)︸ ︷︷ ︸X1(s)

+ 3s+ 4U(s)︸ ︷︷ ︸

X2(s)

Defining the state variables as above gives

sX1(s) +X1(s) = 2U(s)sX2(s) + 4X2(s) = 3U(s)

which in time domain can be written as

x1(t) = −x1(t) + 2u(t)x2(t) = −4x2(t) + 3u(t)y(t) = x1(t) + x2(t)

91

Page 212: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8.6 The transfer function is given by

G(s) = C(sI −A)−1B

=(−1 2

)(s+ 2 −10 s+ 3

)−1(11

)= 1

(s+ 2)(s+ 3)(−1 2

)(s+ 3 10 s+ 2

)(11

)= s

(s+ 2)(s+ 3)

8.7

x(t) = Ax(t) +Bu(t)y(t) = Cx(t)

The state space equations have the general solution

x(t) = eA(t−t0)x(t0) +∫ t

t0

eA(t−s)Bu(s) ds

The input signal u is constant, that is, u(t) = u0, on the interval (t0, t0 + T ). This implies

x(t0 + T ) = eATx(t0) +(∫ t0+T

t0

eA(t0+T−s) ds)Bu0

whereeAT and

∫ t0+T

t0

eA(t0+T−s) ds B

are constant matrices.

8.8 a) Introduce the state variables x1 = h, x2 =∫ t

0 (href − h) dτ and x3 =∫ t

0 (href − h) dτ . This gives the followingexpressions for the control signals

u1 = href − x1 + x2

u2 = href − x1 + x3

by using these expressions we can eliminate u1 and u2 form h+ h = u1 + u2. This gives

x1 = −x1 + href − x1 + x2 + href − x1 + x3

By taking the Laplace transform on the expressions for x2 and x3 we obtain

X2(s) = Href(s)−H(s)s

X3(s) = Href(s)−H(s)s

Inverse Laplace transformation gives

x2 = href − x1

x3 = href − x1

In matrix notation this becomes

x(t) =

−3 1 1−1 0 0−1 0 0

x(t) +

211

href(t)

h(t) =(1 0 0

)x(t)

92

Page 213: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) The observability matrix is

O =

CCACA2

=

1 0 0−3 1 17 −3 −3

A vector which span the null space of a matrix must satisfy Ox = 0. 1 0 0

−3 1 17 −3 −3

0−11

=

000

This means in practise that you can’t say if it is u1 or u2 or a combination of the two which fills the tank.

c) With href = 0 and u1 = −h− n+∫ t

0 −h− ndτ we get

x2 = −x1 − nx3 = −x1

andx1 = −x1 − x1 − n+ x2 − x1 + x3

this gives in matrix form

x(t) =

−3 1 1−1 0 0−1 0 0

x(t) +

−1−10

n(t)

h(t) =(1 0 0

)x(t)

8.9 The controllability matrix is

S =(B AB

)=(

1 01 −1

)Since detS = −1 6= 0 the system is controllable and it is possible to control the system from the origin to xT =

(1 3

)within 4 seconds.

8.10 a) The controllability matrix becomes

S =(B AB A2B

)=

1 −2 4−1 3 −92 −6 18

and detS = 0 since rankS = 2. The controllable subspace is spanned by 1

−12

,

−23−6

The observability matrix is

O =

CCACA2

=

1 3 1.5−2 −3 −1.54 3 1.5

with detO = 0. Solving for the unobservable subspace

Ox = 0

gives (Gauss elimination)

x1+3x2+1.5x3=03x2+1.5x3=0

x1 =0

93

Page 214: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Introducing x3 = a gives x2 = −0.5a and xT =(0 −0.5a a

), that is, the silent (unobservable) subspace is spanned

by 0−12

b) The controllability matrix becomes

S =

0 0 04 −8 16−2 8 −32

with rankS = 2. The controllable subspace is spanned by, for example, 0

4−2

0−88

The observability matrix is

O =

0 3 03 −6 0−9 12 0

Solving for the unobservable subspace Ox = 0 gives

x =

00a

The unobservable subspace is spanned by 0

01

8.11 a)

x1 = −x1 + u ⇒ x1 = 1− e−t

x2 = 2x2 + u ⇒ x2 = 0.5(e2t − 1)

b) The system is not asymptotically stable since x2 → ∞ as t → ∞, but input-output stable because the transferfunction has its pole in the complex left hand plane.

c)

S =(

1 −11 2

)detS = 3

The system is controllable.

O =(

1 0−1 0

)detO = 0

The system is not observable. Ox = 0 has solutions

x =(

0a

)This implies that the second component of the state vector cannot be seen in the output.

d) Because the second component of the state vector has unconstrained growth and this is not reflected in the output,the system will finally collapse.

94

Page 215: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8.12

G(s) = C(sI −A)−1B

=(1 1

)(s− 1 1−2 s− 1

)−1(10

)= s+ 1

(s− 1)2 + 2

This gives poles in 1± i√

2 and zeros in −1.

8.13 a) For pendulum 1 we havez cos(φ1) + αφ1 = sin(φ1)

and for pendulum 2z cos(φ2) + φ2 = sin(φ2)

Linearization gives

z + αφ1 = φ1

z + φ2 = φ2

Consider z as an input to the system (the acceleration of the trolley ∼ the force applied to the system). Introducethe state variables

x1 = φ1 x2 = φ1 x3 = φ2 x4 = φ2

This gives the state space equations

x1 = x2

x2 = 1αx1 −

u

αx3 = x4

x4 = x3 − u

In matrix form

x =

0 1 0 0

1/α 0 0 00 0 0 10 0 1 0

x1x2x3x4

+

0−1/α

0−1

u

b) The controllability matrix becomes

S =

0 −1/α 0 −1/α2

−1/α 0 −1/α2 00 −1 0 −1−1 0 −1 0

detS = 1α2 (1− 1

α)2

Thus, the system is controllable except for the case α = 1, that is, when the two pendulums have the same lengths.If the pendulums have different lengths they react differently to the input, but if they have the same length thereis no possibility to act upon them separately using the input.

8.14 The figure givesX1(s) = 1

(s+ 1)U(s) ⇒ sX1(s) = −X1(s) + U(s)

andX2(s) = 1

(s+ 3)(U(s) +X1(s)) ⇒ sX2(s) = −3X2(s) + U(s) +X1(s)

Inverse Laplace transformation gives

x1 = −x1 + u

x2 = −3x2 + x1 + u

In matrix form this becomes

x =(−1 01 −3

)x+

(11

)u

y =(1 1

)x

95

Page 216: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

8.15 a) Mass balance gives

d (V cA)dt = V rA + qcA,in − qcA

d (V cB)dt = V rB + qcB

By using rA = −k1c3A and rB = −rA

3 the following expression is obtained

VdcAdt = −V k1c

3A + qcA,in − qcA

VdcBdt = V k1c

3A

3 − qcB

b) Linearization around c∗A, c∗B, and c∗A,in gives

ddt

(cA,∆cB,∆

)=(−q−3k1c

∗AV

V 0k1c∗A

−qV

)(cA,∆cB,∆

)+(qV0

)u

y =(0 1

)(cA,∆cB,∆

)8.16 a) Linjärisera systemet runt jämvikspunkten y(t) = y0. Stationärt innebär x = 0, alltså 0 = −y0u0 + v, eller u0 = v

y0.

Taylorutveckling av y = f(y, u) runt jämviktspunkten y = y0 + ∆y, u = u0 + ∆u, där alltså f(y0, u0) = 0 ger

y = ∆y = f(y0 + ∆y, u0 + ∆y)

≈ f(y0, u0) + ∂f(y0, u0)∂y

∆y + ∂f(y0, u0)∂u

∆u

= 0− u0∆y − y0∆u = − v

y0∆y − y0∆u.

b) Laplacetransformera det linjäriserade systemet från a).s∆Y (s) = − v

y0∆Y (s)− y0∆U(s), dvs.

∆Y (s) = −y20

y0s+v∆U(s) = G(s)∆U(s).

Det återkopplade systemet fås från

U(s) = F (s)(Y0 − Y (s))Y (s) = G(s)U(s)

vilket ger

Gc(s) = F (s)G(s)1 + F (s)G(s) =

K τis+1τis

−y20

y0s+v

1 +K τis+1τis

−y20

y0s+v

= −Ky20(τis+ 1)

(τis)(y0s+ v)−Kτisy20 −Ky2

0

= −Ky20(τis+ 1)

y0τis2 + vτis−Kτiy20s−Ky2

0.

Enligt t.ex. Routh’s algoritm, krav för stabilitet hos det återkopplade systemet är K < 0 samt att v −Ky20 > 0

vilket då är uppfyllt för alla v > 0 då τI > 0.

8.17 a) Systemet kan skrivas som

x = A(α)x+Bu

y = Cx

96

Page 217: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

där

x =[x1x2

]A(α) =

[1 0−2 α

]B =

[1−1

]C =

[0 1

]Egenvärdena av systemmatrisen A ges av lösningarna till den karakteristiska ekvationen

det (A(α)− sI) = det([

1 0−2 α

]− s

[1 00 1

])= det

([1− s 0−2 α− s

])= (1− s)(α− s) = 0

alltså s1 = 1 och s2 = α. Då egenvärdet s1 > 0 är systemet instabilt för alla α.OBS! Notera att

det(A(α))− sI) = 0⇔ det(sI −A(α)) = 0,

och att den senare formen är den som vi använt oftast i kursen för att räkna ut den karakteristiska ekvationen. Avekvivalensen följer att båda formerna är rätt.

b) Systemet är observerbart då observerbarhetsmatrisen

O =[

CCA(α)

]=[

0 1−2 α

]ej är singulär. Då

det([

0 1−2 α

])= 2 6= 0

är systemet observerbart för alla α.

c) Systemet är styrbart då styrbarhetsmatrisen

S =[B A(α)B

]=[

1 1−1 −2− α

]ej är singulär. Då

det([

1 1−1 −2− α

])= 1 · (−2− α)− (−1) = −1− α

är systemet styrbart precis då α 6= −1.

97

Page 218: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9 State Feedback

9.1 a) The control lawu = −Lx+ yref

gives the closed loop systemx = (A−BL)x+Byref

and the poles of the closed loop system are given by the eigenvalues of A−BL.

A−BL =(−2 −11 0

)−(

10

)(l1 l2

)=(−2− l1 −1− l2

1 0

)The characteristic equation is given by

det(sI −A+BL) = s2 + (2 + l1)s+ 1 + l2 = 0

Poles in {−3, −5 } implies that we will have the equation

(s+ 3)(s+ 5) = s2 + 8s+ 15 = 0

Identification of the coefficients givesl1 = 6 l2 = 14

This gives the control lawu = −6x1 − 14x2 + yref

Similarly, poles in {−10, −15 } givesl1 = 23 l2 = 149

corresponding to the control lawu = −23x1 − 149x2 + yref

One observes that the coefficients in the control law increase when the poles are placed further into the left halfplane. In a physical system, this means that larger forces are required to realize to the control law.

b) Employ an observer˙x(t) = Ax(t) +Bu(t) +K(y(t)− Cx(t))

whereK =

(k1k2

)By combining the differential equations for the system and the observer we obtain an equation for the estimationerror, x = x− x,

˙x = Ax+Bu−Ax−Bu−K(Cx− Cx) = (A−KC)xIf K is chosen so that A − KC gets eigenvalues in the complex left hand plane, then x(t) → 0 as t → ∞. It isdesirable that the estimation error approaches zero faster than the dynamics of the system. Thus, one should placethe eigenvalues of the observer to the left of the poles of the closed loop system, for example, in −20. Regarding theinfluence of the pole placement, placing the poles too far into the left half plane will make the observer unneccessarysensitive to measurement noise. The characteristic equation is given by

det(sI −A+KC) = s2 + (2 + k1)s+ 1− k2 = 0

Two poles in −20 corresponds to the equation

s2 + 40s+ 400 = 0

Identification of the coefficients givesk1 = 38 k2 = −399

The resulting observer becomes

˙x =(−2 −11 0

)x+

(10

)u+

(38−399

)(y −

(1 0

)x)

98

Page 219: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9.2 a) Introduce the state variablesx1 = z x2 = θ x3 = θ

The figure gives the state equations

X1(s) = 1sK2X2(s)

X2(s) = 1sX3(s)

X3(s) = 1sK1U(s)

Inverse Laplace transformation gives

x1(t) = K2x2(t) x2(t) = x3(t) x3(t) = K1u(t)

In matrix form we get

x(t) =

0 K2 00 0 10 0 0

x(t) +

00K1

u(t)

b) Since it is assumed that all states are measurable we apply a state feedback

u = −Lx+ yref

which gives the closed loop systemx = (A−BL)x+Byref

where

A−BL =

0 K2 00 0 1

−K1l1 −K1l2 −K1l3

The characteristic equation

det(sI −A+BL) = s3 +K1l3s2 +K1l2s+K2K1l1 = 0

All three poles in −0.5 implies that we will have the equation

(s+ 0.5)3 = s3 + 1.5s2 + 0.75s+ 0.125 = 0

Identification of the coefficients gives

l1 = 18K1K2

l2 = 34K1

l3 = 32K1

c) If only x1 is measurable we havey =

(1 0 0

)x

Employ the observer˙x(t) = Ax(t) +Bu(t) +K(y(t)− Cx(t))

where

K =

k1k2k3

The characteristic equation is

det(sI −A+KC) = s3 + k1s2 + k2K2s+ k3K2 = 0

To get a similar behavior as in a), the poles of the observer are placed to the left of the poles of the closed loopsystem, for example, in −2. This pole placement corresponds to the equation

s3 + 6s2 + 12s+ 8 = 0

Identification of the coefficients gives

k1 = 6 k2 = 12/K2 k3 = 8/K2

99

Page 220: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9.3 Introduce the state variablesx1 = θ x2 = ω

This gives the state equations

x =(

0 10 −1/τ

)x+

(0c1

)u+

(0c2

)T

a) The feedbacku = −Lx+ l0θref = −l1θ − l2ω + l0θref

gives

A−BL =(

0 1−c1l1 −(c1l2 + 1/τ)

)The characteristic equation

det(sI −A+BL) = s2 + (l2c1 + 1τ

)s+ c1l1 = 0

Poles in 1/τ(−1± i) corresponds to

(s+ 1− iτ

)(s+ 1 + iτ

) = s2 + 2τs+ 2

τ2 = 0

Identification of the coefficients givesl1 = 2

c1τ2 l2 = 1τc1

This gives the closed loop system

x =(

0 1−2/τ2 −2/τ

)x+

(0c1

)l0θref +

(0c2

)T

At steady state, that is, when x1 = x2 = 0, we should have θ = θref when T = 0. x1 = 0 implies that x2 = 0, andx2 = 0 then gives

−2τ2 x1 + c1l0θref = 0

so thatl0 = 2

c1τ2

The resulting control law becomesu = − 2

c1τ2 θ −1τc1

ω + 2c1τ2 θref

b) Introduce the integrated control error as an extra state:

x3 = θref − θ

The new state equations become

x =

0 1 00 −1/τ 0−1 0 0

x+

0c10

u+

0c20

T +

001

θref

Using the feedback lawu = −l1θ − l2ω − l3x3

we get the state derivative term 0c10

u =

0 0 0−c1l1 −c1l2 −c1l3

0 0 0

x

and hence the closed loop system

x =

0 1 0−c1l1 −1/τ − c1l2 −c1l3−1 0 0

x+

0c20

T +

001

θref

100

Page 221: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

The poles of the closed loop system are the eigenvalues of the “A” matrix, that is, they are given by the characteristicequation

det

−λ 1 0−c1l1 −1/τ − c1l2 − λ −c1l3−1 0 −λ

= 0

Writing out and changing sign yields

λ3 + (c1l2 + 1τ

)λ2 + c1l1λ− c1l3 = 0

Poles in { 1τ (−1± i), 1

τ (−2) } correspond to the equation

λ3 + 4τλ2 + 6

τ2λ+ 4τ3 = 0

where the coefficients may be identified as:

l1 = 6c1τ2 l2 = 3

c1τl3 = − 4

c1τ3

The resulting control law becomes (note that the static gain is 1 by construction, so there is no “l0” in this controller)

x3 = θref − θ

u = − 6c1τ2 θ −

3c1τ

ω + 4c1τ3x3

9.4 The feedback u = −Lx+ yref gives the closed loop system

x = (A−BL)x+Byref

with characteristic equations2 + (1 + l1 + l2)s+ l1 = 0

Poles in {−2, −3 } implies that we will have the equation

(s+ 3)(s+ 2) = s2 + 5s+ 6 = 0

Identification of the coefficients givesl1 = 6 l2 = −2

and the control law becomesu = −6x1 + 2x2 + yref

Introduce the observer˙x(t) = Ax+Bu(t) +K(y(t)− Cx(t))

It is desirable that the estimation error converges to zero faster than the dynamics of the system. Thus, we should placethe eigenvalues of the observer to the left of the poles of the closed loop system, for example, in −4. The characteristicequation of the observer is

s2 + (1 + k1 − k2)s+ k1 = 0and poles in −4 corresponds to the equation

s2 + 8s+ 16 = 0Identification of coefficients gives

k1 = 16 k2 = 9The complete system, that is, the closed loop system with reconstructed states, will have poles in {−2, −3 }, and theobserver will have poles in {−4, −4 }.

9.5 The system has the observability matrix

O =

1 0 0 00 1 1 10 0 1 30 0 0 4

that is, detO 6= 0. The system is observable and thus the poles of the observer may be placed arbitrarily.

101

Page 222: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9.6 The system is described in matrix form by

x(t) =

−2 1 01 −2 10 1 −2

x(t) +

100

u(t)

a) Arbitrary values of the states can be obtained if the system is controllable. The controllability matrix becomes

S =

1 −2 50 1 −40 0 1

and since detS = 1 the system is controllable and an arbitrary temperature profile can be obtained.

b) How the state decays depends on the poles of the closed loop system. Poles in −3 will yield the desired result. Theclosed loop system,

x = (A−BL)x+Byref

A−BL =

−2− l1 1− l2 −l31 −2 10 1 −2

has the characteristic equation

s3 + (6 + l1)s2 + (10 + 4l1 + l2)s+ 4 + 3l1 + 2l2 + l3 = 0

Poles in −3 implies that this coincide with the equation

(s+ 3)3 = s3 + 9s2 + 27s+ 27 = 0

Identification of the coefficients givesl1 = 3 l2 = 5 l3 = 4

Thus, the control law is given byu = −3x1 − 5x2 − 4x3 + yref

c) Check when the system is observable. The sensor at x1 corresponds to C =(1 0 0

), and results in

O =

0 0 1−2 1 05 −4 1

detO = 1

The sensor at x2 corresponds to C =(0 1 0

), and results in

O =

0 1 01 −2 1−4 6 −4

detO = 0

The sensor at x3 corresponds to C =(0 0 1

), and results in

O =

0 0 10 1 −21 −4 5

detO = −1

The system is hence observable when the sensor is placed at x1 or x3, but not with the sensor placed at x2. That is,the specifications may be fulfilled with the sensor placed at x1 or x3. If the sensor is placed at x1, the characteristicequation of the observer is given by

s3 + (6 + k1)s2 + (10 + 4k1 + k2)s+ 4 + 3k1 + 2k2 + k3 = 0

Placing the poles in −4 (which is somewhat faster than the nominal closed loop system) corresponds to the equation

(s+ 4)3 = s3 + 12s2 + 48s+ 64 = 0

Identification of coefficients givesk1 = 6 k2 = 14 k3 = 14

102

Page 223: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9.7 From Solution 9.2 we have the state space description

x(t) =

0 K2 00 0 10 0 0

x(t) +

00K1

u(t)

y(t) =(1 0 0

)x(t)

Introduce a reduced observer to estimate x3 from m2. The last row in the state space description implies

˙x3 = K1u+K(x3 − x3) = K1u+K(x2 − x3)

The estimation error becomes˙x3 = x3 − x3 = −Kx3

With a suitable choice of K, the estimation error can be made to decrease arbitrarily fast. To avoid differentiation ofx2 we introduce

z = x3 −Kx2

which impliesz = ˙x3 −Kx2 = −K(z +Kx2) +K1u

This gives

X3(s) = K1

s+KU(s) + K2s

s+KX2(s)

which results in the block diagram in Figure 9.7a.

1s + K

ΣK1

K

K

Σz

x2

u x3−

+

+

+

Figure 9.7a

9.8 a) The equations

T q = −q + k1u

Ah = q − v

with k1 = 1, T = 0.5 and A = 1 give, in state space form,(q

h

)=(−2 01 0

)(qh

)+(

20

)u+

(0−1

)v

The feedbacku = −l1q − l2h+ r

gives the closed loop system (q

h

)=(−2− 2l1 −2l2

1 0

)(qh

)+(

20

)r +

(0−1

)v

with characteristic equation(s+ 2 + 2l1)s+ 2l2 = s2 + (2 + 2l1)s+ 2l2 = 0

Comparison with the desired characteristic equation

(s+ 2)2 = s2 + 4s+ 4 = 0

givesl1 = 1 l2 = 2

103

Page 224: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) At steady state we have q = 0 and h = 0. With v = 0.1 and r = 0 we get

0 = −4q − 4h0 = q − 0.1

which gives h = −0.1.

c) In order to determine the feedforward controller we start from the description

Y (s) = G1(s)R(s) +H(s)V (s)

The state space description (q

h

)=(−4 −41 0

)(qh

)+(

20

)r +

(0−1

)v

y =(0 1

)(qh

)gives

H(s) = 1s2 + 4s+ 4

(0 1

)(s −41 s+ 4

)(0−1

)= − (s+ 4)

s2 + 4s+ 4and

G1(s) = 1s2 + 4s+ 4

(0 1

)(s −41 s+ 4

)(20

)= 2s2 + 4s+ 4

To eliminate v completely we shall choose the feedforward controller

R(s) = Ff(s)V (s)

whereFf(s) = − H(s)

G1(s)The computations above give

Ff(s) = (s+ 4)2 = 1

2s+ 2

Removing the differentiation term yields Ff(s) = 2 or

r = 2v

At steady state this gives

0 = −4q − 4h+ 4v0 = q − v

that is h = 0.

d) Because k1 6= 1 the feedback u = −q − 2h+ 2v gives, at steady state,

0 = −2(1 + k1)q − 4k1h+ 4k1v

0 = q − v

which givesh = k1 − 1

2k1v

Because k1 6= 1 we get a steady state control error. In order to determine when the expression for h is valid weconsider the stability. The characteristic equation

s2 + (2 + 2k1)s+ 4k1 = 0

has both roots in the complex left hand plane for k1 > 0, that is, the expression is valid for all k1 > 0.

104

Page 225: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

e) Introduce the integral of the height as a new state

z(t) =∫ t

0h(s) ds ⇒ z = h

With the state vectorx(t) =

(q(t) h(t) z(t)

)T

this gives

x =

−2 0 01 0 00 1 0

x+

2k100

u+

0−10

v

The state feedback u = −Lx gives

x =

−2− 2k1l1 −2k1l2 −2k1l31 0 00 1 0

x+

0−10

v

The third equation gives h = 0 at steady state, independent of k1 provided L stabilizes the system.

G1Σ

e−sT

ur Lx

−+

Figure 9.9a

9.9 The transfer function u to y is given by

Y (s) = C(sI −A)−1BU(s) = 1s2U(s)

In order to study the effect of the time delay we consider the block diagram in Figure 9.9a. The block diagram correspondsto the situation where the observer uses the measured input (not the computed input). To determine the effect of thetime delay, we study the loop gain, G1(s)e−sT , where G1(s) is the transfer function from U(s) to Z(s) = LX(s).The equation for the observer

˙x = Ax+Bu+K(y − Cx)

gives

X(s) = (sI −A+KC)−1(BU(s) +KY (s))

= (sI −A+KC)−1(BU(s) +K1s2U(s))

Using this together with Z(s) = LX(s) gives

Z(s) = G1(s)U(s)

= L(sI −A+KC)−1(B +K1s2 )U(s)

=(1 2

)(s+ 4 −14 s

)−1((01

)+(

44

)1s2

)U(s)

= 1 + 2ss2 U(s)

We shall analyze the stability using the Nyquist curve∗ for Go = G1(s)e−sT , that is,

G1(iω)e−iωT = 1 + i2ω−ω2 e−iωT

∗Using a Bode plot instead of the Nyquist curve would perhaps be more straightforward. However, for no particular reason, we use the Nyquistcurve here.

105

Page 226: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

The crossover frequency is obtained from

∣∣G1(iωc)e−iωcT∣∣ =

√1 + 4ω2

cω2

c= 1

orωc =

√2 +√

5

The phase of Go isarg(G1(iω)e−ωT

)= −π + arctan 2ω − ωT

In order to obtain a stable closed loop system it is required that

−π + arctan 2ωc − ωcT > −π

which givesT <

arctan 2ωc

ωc= 0.65 s

9.10 a) The observability matrix:

O =(

2 1−2 + a 0

)detO = 2− a

The system is observable (and the poles of the observer can be placed arbitrarily) when a 6= 2.

A−KC =(−1− 2k1 1− 2k2

1− k1 −2− k2

)We desire that the eigenvalues be {−5, −10 }. Use that the determinant is the product of the eigenvalues and thetrace∗ is the sum of the eigenvalues:

5k1 + 3k2 + 1 = 50−2k1 − k2 − 3 = −15

which givesk1 = −13 k2 = 38

b) The equation for the estimation error is

˙x(t) = (A−KC)x(t)−Kv(t)

The transfer function from v to x1 is

−C1(sI −A+KC)−1K = 13s− 12s2 + 15s+ 50

where C1 =(1 0

).

9.11 a) According to the initial value theorem we have that

y(0) = lims→∞

sG(s)U(s)

For a step input, that is, U(s) = 1/s, we get

y(0) = lims→∞

s · sG(s)U(s) = lims→∞

s(1− s/α)(1 + s

β )2 = −β2

α

Hence y(0) decreases as α decreases, that is, as the zero of the system approaches the origin.

b) No. This problem is caused by a RHP zero and it is impossible to move the zeros with state feedback.∗The trace of a matrix is the sum of its diagonal elements.

106

Page 227: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

9.12 A very fast closed loop system:

• implies that the poles are far into the LHP which implies a need for generating large input signals.

• easily becomes unstable in case of model uncertainties.

• becomes sensitive to measurement noise.

• has a sensitivity function with a large peak.

9.13 a) The system G(s) = C(sI −A+BL)−1B has poles where

det(sI −A+BL) = s2 + (5− l1 + 2l2)s+ 5 + 6l2 = 0

The poles in −2± i implies the characteristic equation

(s+ 2 + i)(s+ 2− i) = s2 + 4s+ 5 = 0

Identification of coefficients givesl1 = 1 l2 = 0

b) The closed loop system is given by

x(t) =(−2 1−1 −2

)x(t) +

(−12

)r(t)

y(t) =(1 1

)x(t)

The condition y(t) = 0 gives x1 + x2 = 0, and hence x1 = −x2. From the state equations we get

−2x1 + x2 − r = x1 + 2x2 − 2r ⇔−3x1 = x2 − r

Together with x1 + x2 = 0 we get x1 = −x2 = r/2 and

r = 2x1 = 2(−2x1 + x2 − r) = −5r

Since r(t) = eαt we have α = −5. Moreover, for y(t) to be zero for all t, the system must start in the initialcondition x1(0) = −x2(0) = r(0)/2.

9.14 a) Enter the transfer function and generate thestate space model.

>> s = tf( ’s’ );>> G = ss( 1 / ( s * ( s + 1 ) ) )a =

x1 x2x1 -1 -0x2 1 0

b =u1

x1 1x2 0

c =x1 x2

y1 0 1

d =u1

y1 0

Continuous-time model.

107

Page 228: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

We hence have the state space representation

x(t) =(−1 01 0

)x(t) +

(10

)u(t)

y(t) =(0 1

)x(t)

From the last equation we have x2(t) = y(t), that is, x2 is the motor angle. From the first equation we havex2(t) = x1(t), that is, x1 is the angular velocity.

b) Compute feedback gains. This time, thegain l0 is computed by explicitly construct-ing a system with l0 = 1 first, and then cor-recting by the inverse of that system’s staticgain. Note that if we don’t need l0, thisapproach simplifies to Gc = Gc0 / dcgain(Gc0 ). However, we do need l0 in order tocompute the control signal.

>> L = acker( G.a, G.b, [ -2.2 -2.2 ] );>> Gc0 = ss( G.a - G.b * L, G.b, G.c, 0 );>> l_0 = 1 / dcgain( Gc0 );>> Gc = l_0 * Gc0;

Calculate the step response and the corre-sponding control signal of the closed loopsystem. To calculate the control sig-nal magnitude use [ y, t, x ] = step(Gc ). The function step will in this case re-turn y, the output of the closed loop system,t the time vector, and x the states of thesystem. To compute the control signal, usethat u(t) = l0r(t) − Lx(t), where r(t) = 1.Then plot the result.

>> [ y, t, x ] = step( Gc, 10 );>> u = l_0 - x * L.’;>> plot( t, y, ’-’, ...

t, u, ’-.’ );>> grid

0 1 2 3 4 5 6 7 8 9 10−1

0

1

2

3

4

5

Compute a new feedback. This time, wecompute the gain l0 by using the formulafor the static gain of the system with l0 = 1(put s = 0 in the generic expression for thetransfer function).

>> L = acker( G.a, G.b, [ -1+i -1-i ] );>> l_0 = 1 / ( G.c * inv( -G.a + G.b*L ) * G.b );>> Gc = ss( G.a - G.b * L, G.b * l_0, G.c, 0 );

108

Page 229: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Calculate the step response and the corre-sponding control signal. Plot the result.

>> [ y, t, x ] = step( Gc, 10 );>> u = l_0 - x * L.’;>> plot( t, y, ’-’, ...

t, u, ’-.’ );>> grid

0 1 2 3 4 5 6 7 8 9 10−0.5

0

0.5

1

1.5

2

The step responses have approximately the same rise and settling times. By choosing the closed loop poles complex,and hence allowing a small overshoot in the step response, we have however reduced the maximum value of theinput signal significantly.

c) Case (i): Compute the feedback gain L, l0,and the closed loop system.

>> L = lqr( G.a, G.b, diag([ 0 1 ]), 1 );>> l_0 = 1 / ( G.c * inv( -G.a + G.b*L ) * G.b );>> Gc = ss( G.a - G.b * L, G.b * l_0, G.c, 0 );

Simulate the system and plot the result. >> [ y, t, x ] = step( Gc, 10 );>> u = l_0 - x * L.’;>> plot( t, y, ’-’, ...

t, u, ’-.’ );>> grid

0 1 2 3 4 5 6 7 8 9 10−0.2

0

0.2

0.4

0.6

0.8

1

1.2

109

Page 230: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Compute the closed loop poles. This time,via the eigenvalues of the “A” matrix.

>> eig( Gc.a )ans =

-0.8660 + 0.5000i-0.8660 - 0.5000i

Case (ii): Repeat, this time with largerweight on the motor angle.

>> L = lqr( G.a, G.b, diag([ 0 10 ]), 1 );>> l_0 = 1 / ( G.c * inv( -G.a + G.b*L ) * G.b );>> Gc = ss( G.a - G.b * L, G.b * l_0, G.c, 0 );

Simulate the system and plot the result.The step response is now significantly faster.

>> [ y, t, x ] = step( Gc, 10 );>> u = l_0 - x * L.’;>> plot( t, y, ’-’, ...

t, u, ’-.’ );>> grid

0 1 2 3 4 5 6 7 8 9 10−0.5

0

0.5

1

1.5

2

2.5

3

3.5

Compute the closed loop poles. This timeusing a dedicated command from the tool-box. The poles are now further awayfrom the origin and the relative damping isslightly reduced.

>> pole( Gc )ans =

-1.3532 + 1.1537i-1.3532 - 1.1537i

Case (iii): Repeat, this time with smallerweight on the motor angle.

>> L = lqr( G.a, G.b, diag([ 0 0.1 ]), 1 );>> l_0 = 1 / ( G.c * inv( -G.a + G.b*L ) * G.b );>> Gc = ss( G.a - G.b * L, G.b * l_0, G.c, 0 );

110

Page 231: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Simulate the system and plot the result.The step response is now much slower.

>> [ y, t, x ] = step( Gc, 10 );>> u = l_0 - x * L.’;>> plot( t, y, ’-’, ...

t, u, ’-.’ );>> grid

0 1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Compute the closed loop poles. We now gettwo real closed loop poles, where the pole in−0.34 causes the slow step response.

>> pole( Gc )ans =

-0.9420-0.3357

d) If we start from case (ii) and increase Q2 the closed loop system gradually becomes slower, since we put an increasingweight on the control signal magnitude. When we reach Q2 = 10 we get exactly the same result as for case (i).Since it is the “ratio” between Q1 and Q2 that determines the closed loop property we get the same feedback gainif we scale Q1 and Q2 by the same scalar.

e) Compute feedback gains, adjust static gain,and compute closed loop system.

>> L = lqr( G.a, G.b, diag([ 1 1 ]), 1 );>> l_0 = 1 / ( G.c * inv( -G.a + G.b*L ) * G.b );>> Gc = ss( G.a - G.b * L, G.b * l_0, G.c, 0 );

Simulate the system and plot the result.Then we also plot the states, x1 and x2, intwo different diagrams.

>> [ y, t, x ] = step( Gc, 10 );>> u = l_0 - x * L.’;>> plot( t, y, ’-’, ...

t, u, ’-.’ );>> grid>> figure>> subplot( 2, 1, 1 );>> plot( t, x(:,1) );>> grid; ylabel( ’x1’ );>> subplot( 2, 1, 2 );>> plot( t, x(:,2) );>> grid; ylabel( ’x2’ );

111

Page 232: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

0 1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

x1

0 1 2 3 4 5 6 7 8 9 100

0.2

0.4

0.6

0.8

1

x2

0 1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Increasing the weight on the angular velocity forces the motor to move slower, and then also the step responsebecomes slower.

9.15 Introduce the state variablesx1 = q x2 = y

This gives the state space description

x =(−0.05 00.05 −0.02

)x+

(10

)u

y =(0 1

)x

a) The system has the controllability matrix

S =(B AB

)=(

1 −0.050 0.05

)detS = 0.05

Thus, the system is controllable.

b) The control lawu = −Lx

gives the closed loop systemx = (A−BL)x

and the poles of the closed loop system is given by the eigenvalues of A−BL.

A−BL =(−0.05− l1 −l2

0.05 −0.02

)The characteristic equation is given by

det(sI −A+BL) = s2 + (0.07 + l1)s+ 0.001 + 0.02l1 + 0.05l2 = 0

Both poles in −0.1 implies that we shall have the equation

(s+ 0.1)2 = s2 + 0.2s+ 0.01 = 0

Identification of the coefficients givesl1 = 0.13 l2 = 0.128

This gives the control lawu = −0.13x1 − 0.128x2

112

Page 233: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

c) It is desirable that the estimation error converges to zero faster than the dynamics of the system. Thus, we shouldplace the eigenvalues of the observer to the left of the poles of the closed loop system. To avoid large amplificationof the measurement noise the poles of the observer should not be placed to far into the left hand plane.

d) Only y = x2 is measurable. Employ the observer

˙x(t) = Ax(t) +Bu(t) +K(y(t)− Cx(t))

whereK =

(k1k2

)The characteristic equation is

det(sI −A+KC) = s2 + (0.07 + k2)s+ 0.05k1 + 0.05k2 + 0.001

Both poles in −0.2 implies that we shall have the equation

s2 + 0.4s+ 0.04 = 0

Identification of the coefficients givesk1 = 0.45 k2 = 0.33

9.16 Are the specifications 1–4 fulfilled?

1. The bandwidth is ωB ≈ 1.1 < 5 which is seen from the gain curve of the closed loop system.The bandwidth requirement is not fulfilled.

2. Stability despite model errors and disturbances?We have Y (s) = κe−τsG(s)U(s) + E(s) instead of Y (s) = G(s)U(s). The factor κ thus represents the gainuncertainty, while the factor e−τs represents a phase uncertainty. These uncertainties are also present (with thesame magnitudes) in the loop gain Go = FG.Looking in the Nyquist curve of Go, where amplitudes near 1 are easiest to read, one can see that there is alwaysjust one intersection with |Go(iω)| = 1, independently of the present uncertainties in gain and phase. Thus thestability criterion based on the Bode plot applies.The uncertain phase lag is ωτ at the frequency ω. Thus the maximum negative phase lag occurs for τ∗ = 0.3 s.Next, we must find the worst case gain crossover frequency in order to see if the worst case phase lag causesinstability by reducing the phase margin below 0. Study the amplitude and phase curves for the loop gain Go(s).Since the phase of Go is decreasing, higher gain crossover will always be more critical since it both means a smallerphase margin to begin with, and also a bigger phase lag due to the worst case time delay.From the gain curve of Go it is clear that higher values of κ are more critical since those give the higher gaincrossovers. By very careful inspection of the gain curve, one can see that the most critical value, κ∗ = 1.1, leads toω∗c ≈ 2.3 rad/s < 3 rad/s, and ϕ∗m > 55◦.Combining the worst case κ (leading to the ω∗c and ϕ∗m above) with the worst case and τ∗ = 0.3 s results in a totalworst case phase margin of at least 55◦ − ω∗c τ∗ = 55◦ − 3 rad/s · 0.3 s = 55◦ − 0.9 rad ≈ 3◦ > 0. Thus the system isguaranteed to be stable.The system is stable despite the model errors.Remark: The robustness criterion ∀ω : |Q(iω)| < 1

|G(iω)| is sufficient but not necessary to show stability.

3. Both the Bode plot and the Nyquist curve of the loop gain tells us that the loop gain does not contain an integrationwhich could remove static errors. This implies the model errors will influence the static gain. The details of thisargument follow.With u = Frr − Fyy, the closed loop system is

Gc(s) = Fr(s)G(s)1 + Fy(s)G(s)

The real closed loop system is

G0c(s) = Fr(s)κe−τsG(s)

1 + Fy(s)κe−τsG(s)

113

Page 234: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Since the system is stable (see 2) the final value theorem gives the final value of the step response as

limt→∞

y0(t) = lims→0

s ·G0c(s) · 1

s= Fr(0)κG(0)

1 + Fy(0)κG(0)

which cannot be 1 for all possible values of κ.

The gain will be different from 1 for some possible value of κ.

4. If e(t) is measurement noise, then the complementary sensitivity function, T (s), should be checked. If e(t) isprocess noise, then the sensitivity function, S(s), should be checked. Both T (s) and S(s) have peaks > 1 at exactlyω = 10 rad/s, which implies the both measurement and process noise are amplified.

The (measurement) noise is amplified by the system.

9.17 a) The linearized system is given by

x =(

0 1−1 −3

)x+

(−11

)u =: Ax+Bu

Using the state feedback law u = −Lx = −l1x1 − l2x2 gives

x = A+B(−Lx) = (A−BL)x =(

l1 1 + l2−1− l1 −3− l2

)x

The poles of this closed loop system are given by the eigenvalues of A−BL, which are the roots of the characteristicpolynomial

P (s) = det(sI − (A−BL)) = det(s− l1 −1− l21 + l1 s+ 3 + l2

)= (s− l1)(s+ 3 + l2)− (1 + l1)(−1− l2)= s2 + (−l1 + l2 + 3)s− 2l1 + l2 + 1

To place the poles in {−2, −4 }, P (s) must be the polynomial

(s+ 2)(s+ 4) = s2 + 6s+ 8

This gives the system of equations

−l1 + l2 + 3 = 6−2l1 + l2 + 1 = 8

which has the solutionl1 = −4 l2 = −1

The state feedback law thus becomes u = −Lx = 4x1 + x2.

b) If only x2 is measured, the output equation is given by

y = x2 =(0 1

)x =: Cx

Given y (x2) and u, x1 can be estimated if the system is observable. The observability matrix becomes

O =(CCA

)=(

0 1−1 −3

)detO = 1

Hence the system is observable and x1 can be estimated using an observer.

It is essential that the input u is known since u is required in the observer design to get an asymptotically vanishingstate estimation error.

114

Page 235: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

c) If u is unknown but constant, we can introduce a third state x3 = u which has the dynamics x3 = 0. IntroducingzT =

(x1 x2 x3

), the system dynamics can be rewritten as

z =

0 1 −1−1 −3 10 0 0

z =: Az

y =(0 1 0

)z =: Cz

The observability matrix becomes

O =

CCACA2

=

0 1 0−1 −3 13 8 −2

detO = 1

(Tip: det(O) 6= 0 can be established without computing the determinant, by checking that the rows of O arelinearly independent.) The fact that the system is observable means that x1 (and also u) can be estimated frommeasurements of x2 using an observer of the form

˙z = Az +K(y − Cz) = (A−KC)z +Ky

where the observer gain K is selected so that the observer poles, that is, the eigenvalues of A−KC, are all in theleft half plane.

9.18 a) The system is described by

x =(

0 1−1 0

)x+

(01

)u+

(10

)w

A P controller corresponds to u = K(r − x1), this means that the closed loop system is given by

x =(

0 1−1−K 0

)x+

(0K

)r +

(10

)w

The poles to the closed loop system are given by

det(

s −11 +K s

)= 0

which leads to s2 + 1 + K = 0. The poles are pure complex and thus the system doesn’t have a well definedstationary error or speed of response.

b) A linear combination of r and x2 is given byu = l0r − l2x2

with this controller the closed loop is

x =(

0 1−1 l2

)x+

(0l0

)r +

(10

)w

The poles to the closed loop system are given by

det(s −11 s+ l2

)= 0

which means s2 + l2s+ 1 = 0. The poles can be placed with l2 as

s = −l22 ±√l22 − 4

4

We have that x = 0 at stationary which gives that x2 = −w and x1 = l0r − l2x2 if w = 0. If we select l0 = 1 thenthe stationary error will be zero. If w 6= 0 and l0 = 1 then there will be stationary error of size l2w.

115

Page 236: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

c) Introduce a new state x3 = w to estimate the unknown signal. The extended system is described by

x =

0 1 1−1 0 00 0 0

x+

010

u

y =(0 1 0

)x

Create an observer to estimate the states

˙x = (A−KC)x+Bu+Ky

the poles of the observer can be placed with

det(sI − (A−KC)) = 0

which gives s3 + k2s2 + (1 − k1)s − k3 = 0. Place the poles for example in −2, that is, seek the polynomial

s3 + 6s2 + 12s+ 8 = 0. Comparison gives

k1 = −11 k2 = 6 k3 = −8

Now, let u = l0r − l2x2 − l3x3. At stationary we have x3 = w = −x2, so with l3 = l2 we have x1 = l0r, and withl0 = 1 there will be no error.

9.19 a) Överföringsfunktionerna finnes genom:

i. X(s)G1(s)(U(s)−G2(s)X(s)) = G1(s)U(s)−G1(s)G2(s)X(s)⇒ X(s)(1 +G1(s)G2(s) = G1(s)U(s)⇒ X(s) = G1(s)

1+G1(s)G2(s)U(s)⇒ GX(s) = G1(s)

1+G1(s)G2(s)

ii. Y (s) = G− 4(s)U(s) +G3(s)X(s) = G4(s)U(s) +G3(s)GX(s)U(s)= (G4(s) + G1(s)G3(s)

1+G1(s)G2(s) )U(s)⇒ G(s) = G4(s) + G1(s)G3(s)

1+G1(s)G2(s)

b) Vi kan skriva G(s) = s+2s2 som

G(s) = s+ 2s2 = s+ 2

s2 + 0s+ 0 = b1s+ b2s2 + a1s+ a2

Detta kan nu skrivas enkelt på t.ex. styrbar kanonisk form:

x =(−a1 −a2

1 0

)x+

(10

)u =

(0 01 0

)︸ ︷︷ ︸

As

x+(

10

)︸︷︷︸Bs

u

y =(b1 b2

)x =

(1 2

)︸ ︷︷ ︸Cs

x

eller alternativt (det räcker med att svara med en korrekt form för att få full poäng) på observerbar kanonisk form:

x =(−a1 0−a2 0

)x+

(b1b2

)u =

(0 10 0

)︸ ︷︷ ︸

Ao

x+(

12

)︸︷︷︸Bo

u

y =(1 0

)︸ ︷︷ ︸Co

x

Ett system är en minimal realisation om det är både styrbart och observerbart. Därför måste styrbarhetsmatrisen(S) och observerbarhetsmatrisen (O) ha full rang.

detS = det(

[Bs AsBs])

= det([1 0

0 1

])= 1 6= 0

detO = det([ CsCsAs

])= det

([1 22 0

])= −4 6= 0

116

Page 237: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Alternativt om en observerbar kanonisk representation används:

detS = det(

[Bo AoBo])

= det([1 2

2 0

])= −4 6= 0

detO = det([ CoCoAo

])= det

([1 00 1

])= 1 6= 0

I båda fallen har styrbarhetsmatrisen och observerbarhetsmatrisen full rang, eftersom determianterna är skillda frånnoll. Därför är systemet en minimal realisation.

c) Med tillståndsåterkopplingen u(t) = −Lx(t) + l0r(t), blir tillståndsekvationen

x(t) = Ax(t) +Bu(t) = (A−BL)x(t) + l0r(t)

Polerna ges då av egenvärden till (A−BL), dvs. genom den karakteristiska ekvationen:

det(sI − (As −BsL)) = det([

s 00 s

]−([0 0

1 0

]−[10

] [l1 l2

] ))=

= det([

s+ l1 l2−1 s

])= s2 + l1s+ l2 = 0

Önskade poler i {−1,−1} ger följande karakteristiska ekvation:

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

Genom att identifiera kofficienter erhålles:l1 = 2 l2 = 1

Notera: Detta kunde även inses snabbt genom att uppmärksamma att för system skrivna på styrbar kanoniskform är koefficienterna i den önskade karakteristiska ekvationen samma som parametrarna li i L-matrisen föråterkopplingen.Systemet från r(t) är Y (s) = C(sI − (A − BL))−1Bl0R(s). Den statiska förstarkningen erhålles då s = 0, vilketmedför:

l0 = 1Cs(−As +BsL)−1Bs

= 12

På liknande sätt kan L och l0 erhållas om kanonisk observerbar form nyttjas, dvs. (Ao, Bo, Co). Då blir

L =[ 1

234]

l0 = 12

d) En observatör införs i systemet enligt:

x(t) = Ax(t) +Bu(t) +K(y(t)− Cx(t))

Polerna ges nu av egenvärden till (A−KC):

det(sI − (As −KCs)) = det([

s 00 s

]−([0 0

1 0

]−[k1k2

] [1 2

] ))=

= det([

s+ k1 2k2k2 − 1 s+ 2k2

])= s2 + (k1 + 2k2)s+ 2k1 = 0

Önskade poler i {−10,−10} till observatören ger följande karakteristiska ekvation:

(s+ 1)2 = s2 + 20s+ 100

Och genom koefficientidentifiering erhålles:

k1 = 50 k2 = −15 ⇒ K =[50 −15

]TPå likande sätt kan K erhållas om kanonisk observerbar form nyttjas. För system skrivna på observerbar kanoniskform är koefficienterna i den önskade karakteristiska ekvationen samma som parametrarna ki i K-matrisen förobservatören, dvs.

K =[20 100

]T

117

Page 238: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

11 Implementation

11.1 Inverse Laplace transformation of

U(s) = KNs+ b

s+ bNE(s)

gives the differential equationu(t) + bNu(t) = KNe(t) + bKNe(t) (11.1)

At time t− T we haveu(t− T ) + bNu(t− T ) = KNe(t− T ) + bKNe(t− T ) (11.2)

By replacing u(t) and e(t) in (11.1) and (11.2) with ∆tu(t) and ∆te(t), respectively, and then adding the equations weget

∆tu(t) + ∆tu(t− T ) + bNu(t) + bNu(t− T )= KN∆te(t) +KN∆te(t− T ) + bKNe(t) + bKNe(t− T )

Tustins formula12(∆tu(t) + ∆tu(t− T )) = 1

T(u(t)− u(t− T ))

now gives

2T

(u(t)− u(t− T )) + bN(u(t) + u(t− T ))

= 2TKN(e(t)− e(t− T )) + bKN(e(t) + e(t− T ))

Inserting the numerical values, K = 2, T = 0.1, N = 10 and b = 0.1, we get

20(u(t)− u(t− T )) + (u(t) + u(t− T ))= 400(e(t)− e(t− T )) + 2(e(t) + e(t− T ))

which gives

u(t) = 1921u(t− T ) + 402

21 e(t)−39821 e(t− T )

that isu(t) = 0.905u(t− T ) + 19.14e(t)− 18.95e(t− T )

11.2 a) Consider the differential equationy(t) = u(t)

during the sampling interval kT ≤ t < kT + T . The input is constant during the sampling interval, u(t) = uk,which gives

y(t) = uk

By integrating the left- and right-hand sides from t = kT to t = kT + T we get

y(kT + T )− y(kT ) =∫ kT+T

kT

uk dt = Tuk

With the notation yk+1 = y(kT + T ) and yk = y(kT ) this gives

yk+1 − yk = Tuk

118

Page 239: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

b) The feedbackuk = −Kyk

givesyk+1 = (1−KT )yk y0 = y0

that isyk = (1−KT )ky0

The closed loop system is asymptotically stable if

|yk| → 0, t→∞

This gives the condition|1−KT | < 1

or, equivalently, 0 < K < 2T .

11.3 a) Because the prefilter is linear, the signal prior to sampling may be written

y(t) = y0(t) + y1(t)

where y1(t) stems from the disturbance u1(t) = sinω2t. After all transients have disappeared, we get

y1(t) = A sin(ω2t+ Φ)

where

A = |G(iω2)| = 1√1 + (ω2T1)2

Φ = argG(iω2) = − arctanω2T1

Let us introduce the notation ω1 = ωs − ω2 where ωs denotes the sampling frequency, ωs = 2π/T . When y1(t) issampled with the sampling interval T , we get

y1(kT ) = A sin(ω2kT + Φ) = A sin((ωs − ω1)kT + Φ)= A sin(2kπ − ω1kT + Φ) = A sin(−ω1kT + Φ)= −A sin(ω1kT − Φ) = A sin(ω1kT + π − Φ)= A sin(ω1kT + ϕ)

that is

A = 1√1 + (ω2T1)2

ω1 = 2πT− ω2

ϕ = π + arctanω2T1

b) The bandwidth of the filter is obtained from the relation

|G(iωB)| = 1√1 + (ωBT1)2

= 1√2

which gives ωB = 1/T1. The signal u0 is in the interval 0 ≤ ω < π/T , and this gives the specification

π

T≤ 1T1

The limiting caseπ

T= 1T1

gives T1 = T/π. Inserting this in the expression for A in a), we get the answer

A = 1√1 + (ω2T/π)2

119

Page 240: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

11.4 PI-regulatorn ges avF (s) = K + K

TIs.

Regulatorn är alltsåTI u(t) = KTI e(t) +Ke(t).

Euler bakåt gerTI(u(t)− u(t− 1)) = KTI(e(t)− e(t− 1)) +Ke(t)

⇒ u(t) = u(t− 1) + KTI +K

TIe(t)−Ke(t− 1).

Vi i dentifierar K = TI = 1.

Svar: K = TI = 1.

11.5 a) Vi börjar med att skriva modellen på tillståndsform, x = f(x, u). Om tillståndsvektorn väljs som

x =

θzz

kan ekvationerna skrivas

x1 = Ku = f1(x, u)x2 = x3 = f2(x, u)

x3 = − m

m+ J/r2 g sin x1 + m

m+ J/r2x2K2u2 = f3(x, u)

Vid jämviktspunkten gäller f(x0, u0) = 0, vilket ger

x0 = [0 z0 0]T

u0 = 0,

för valfri konstant z0, då u0 = θ0 = z0 = 0 enligt uppgiften. Vi väljer z0 = 0 i fortsättningen. Jakobianerna blir

∂f

∂x=

0 0 00 0 1

− 57g cosx1

57K

2u2 0

∂f

∂u=

K0

107 K

2x2u

I jämviktspunkten får vi

A = ∂f

∂x(x0, u0) =

0 0 00 0 1− 5

7g 0 0

B = ∂f

∂u(x0, u0) =

K00

Beteckna 4x = x− x0 och 4u = u− u0. Det linjäriserade systemet ges då av

4x = A4x+B4u.

b) Om y = θ så y = Ku. För kT ≤ t < (k + 1)T , har vi

y(t) = Kuk.

Integrerar vi över samplingsintervallet fås

y(kT + T )− y(kT ) =∫ kT+T

kT

Kukdt = TKuk

Med y(kT ) = yk, fåsyk+1 = yk + TKuk.

120

Page 241: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

c) Med uk = −Kpyk, får vi yk+1 = (1−KpTK)yk.För asymptotisk stabilitet (yk → 0, k →∞) krävs |1−KpTK| < 1. Detta ger oss 0 < Kp <

2KT .

121

Page 242: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 243: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Introduktion tillControl System Toolbox 5.0

This version: August 2013

Page 244: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 245: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1 InledningDenna skrift är en kort inledning till hur MATLAB och Control System Toolbox (CST) används i kurserna i Reglerteknik.

2 SystemI Control System Toolbox finns datastrukturer för att hantera s k LTI-objects, dvs linjära tidsinvarianta system, på ettbekvämt sätt. Vi kommer inledningsvis främst att arbeta med system på överföringsfunktionsform, men senare även medsystem på tillståndsform. Ett objekt som representerar ett system på överföringsfunktionsform skapas med funktionen tf.Detta kan göras på två olika sätt, och det första alternativet visas i exemplet nedan.

Betrakta överföringsfunktionen

G(s) = 4s(s2 + 2s+ 4)

Mata in systemet och ge objektet namnetG. Argumenten till funktionen tf utgörs avradvektorer innehållande täljarens respektivenämnarens koefficienter.

>> G = tf( 4, [ 1 2 4 0 ] )

Transfer function:4

-----------------s^3 + 2 s^2 + 4 s

Med det andra alternativet kan man mata in överföringsfunktionen på symbolisk form genom att först skapa ett objektbestående av symbolen s. Därefter kan man t ex addera och multiplicera med denna symbol på samma sätt som görs medLaplace-variabeln s vid handräkning.

Skapa ett objekt bestående av symbolen s.Bilda överföringsfunktionen genom att användavanliga räkneoperationer.

>> s = tf( ’s’ );>> G = 4 / ( s * ( s^2 + 2*s + 4 ) )

Transfer function:4

-----------------s^3 + 2 s^2 + 4 s

En finess med överföringsfunktioner representerade som LTI-objekt är att man kan multiplicera och addera överföringsfunk-tioner på ett rättframt sätt.

Skapa en ny överföringsfunktion G2 genom attseriekoppla G(s) och överföringsfunktionen

1s+ 1

>> G2 = G * 1 / ( s + 1 )

Transfer function:4

-------------------------s^4 + 3 s^3 + 6 s^2 + 4 s

3 Poler och nollställenPoler och nollställen till överföringsfunktioner beräknas med funktionerna pole respektive tzero. Poler och nollställen kanäven ritas med funktionen pzmap.

1

Page 246: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Beräkna polerna tillG(s). Systemet har en reellpol i origo och två komplexa poler.

>> pole( G )

ans =

0-1.0000 + 1.7321i-1.0000 - 1.7321i

Beräkna nollställena till G(s). Eftersom täl-jaren i överföringsfunktionen är konstant sak-nar systemet nollställen.

>> tzero( G )

ans =

Empty matrix: 0-by-1

Rita in systemets poler och nollställen i detkomplexa talplanet. Poler markeras med kryssoch nollställen, i de fall de förekommer, mark-eras med ringar.

>> pzmap( G )>> axis([ -2 0 -2 2 ])

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

−1.5

−1

−0.5

0

0.5

1

1.5

2Pole−Zero Map

Real Axis

Imag

inar

y A

xis

4 ÅterkopplingI kursen behandlas återkopplade reglersystem enligt figur ??.

Σ F (s) G(s) Σ+U

+

+

R Y

V

Figure 1. Reglersystem

Med systembeskrivningenY (s) = G(s)U(s) + V (s)

och återkopplingenU(s) = F (s)(R(s)− Y (s))

ges det återkopplade systemet avY (s) = GC(s)R(s) + S(s)V (s)

2

Page 247: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

där

GC(s) = F (s)G(s)1 + F (s)G(s)

och

S(s) = 11 + F (s)G(s)

Överföringsfunktionerna för det återkopplade systemet kan beräknas med funktionen feedback.

Generera överföringsfunktionen för en propor-tionell regulator med förstärkning Kp = 0.7.

>> F = tf( 0.7 )

Transfer function:0.7

Beräkna överföringsfunktionen för det återkop-plade systemet.

>> Gc = feedback( F * G, 1 )

Transfer function:2.8

-----------------------s^3 + 2 s^2 + 4 s + 2.8

Beräkna känslighetsfunktionen. >> S = 1 / ( 1 + F * G )

Transfer function:s^3 + 2 s^2 + 4 s

-----------------------s^3 + 2 s^2 + 4 s + 2.8

I exemplet ovan hade vi kunnat beräkna Gc på motsvarande sätt som S beräknades, dvs Gc=F*G/(1+F*G). Med denna metodfår dock täljaren och nämnaren i Gc ett antal gemensamma faktorer som kan förkortas bort. Genom att använda funktionenfeedback undviks detta. De gemensamma faktorerna i det första alternativet kan elimineras genom att använda funktionenminreal(Gc) Testa själv och jämför.

5 Nyquistdiagram

Nyquistkurvor för en eller flera överföringsfunktioner ritas med funktionen nyquist. Eftersom funktionen nyquist graderaraxlarna automatiskt kan diagrammet ibland bli svårläst. Läsbarheten kan förbättras genom att man själv väljer axlarnasgradering med funktionen axis. Man kan få ut mycket information ur figuren genom att använda vänster respektive högermusknapp. Med vänster musknapp kan man t ex markera en punkt på kurvan och få ut motsvarande värde på ω samtnyquistkurvans värde i denna frekvens. Med höger musknapp får man en meny med olika operationer som kan göras medfiguren.

3

Page 248: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Rita nyquistkurvan för det öppna systemetdå systemet G(s) styrs med en proportionellåterkoppling med förstärkning KP = 0.7.Justera axlarnas gradering och markera punk-ten där nyquistkurvan passerar negativa delenav reella axeln.

>> nyquist( F * G )>> axis([ -1 1 -1 1 ])

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

System: untitled1 Real: −0.349 Imag: −0.000867 Frequency (rad/sec): −2

Nyquist Diagram

Real Axis

Imag

inar

y A

xis

6 Bodediagram

Bodediagram för en eller flera överföringsfunktioner ritas med funktionen bode. Även i detta fall kan man läsa av punkter ifiguren genom att markera med vänster musknapp. Med höger knapp får man en meny där man t ex kan välja att markerafrekvenserna där stabilitetsmarginalerna läses av.

4

Page 249: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Beräkna frekvensfunktionen för systemet G ochrita upp den i ett bodediagram. Notera att am-plitudkurvan graderas i decibel. Använd högermusknapp och lägg in rutnät i figuren samtmarkera var fas- och amplitudskärfrekvensernaligger.

>> bode( G )

−150

−100

−50

0

50

Mag

nitu

de (

dB)

10−1

100

101

102

−270

−225

−180

−135

−90

Pha

se (

deg)

Bode Diagram

Frequency (rad/sec)

För att bestämma skärfrekvenser samt fas- och amplitudmarginal kan man även använda funktionen margin, vilken förutomatt rita upp amplitud- och faskurvorna även skriver ut dessa värden. Gm och Pm betecknar amplitud- respektive fasmarginal.

Beräkna frekvensfunktionen för systemet G ochrita upp den i ett bodediagram.

>> margin( G )

−150

−100

−50

0

50

Mag

nitu

de (

dB)

10−1

100

101

102

−270

−225

−180

−135

−90

Pha

se (

deg)

Bode DiagramGm = 6.02 dB (at 2 rad/sec) , Pm = 50.3 deg (at 1.13 rad/sec)

Frequency (rad/sec)

För att t ex kunna göra jämförelser mellan två frekvensfunktioner kan dessa ritas i samma diagram.

5

Page 250: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Beräkna frekvensfunktionerna för systemen Goch G2.

>> bode( G, G2 )

−150

−100

−50

0

50

100

Mag

nitu

de (

dB)

10−2

10−1

100

101

102

−360

−270

−180

−90

Pha

se (

deg)

Bode Diagram

Frequency (rad/sec)

Skalan på frekvensaxeln kan väljas genom att som sista argument i funktionsanropet ange största och minsta frekvensvärdetmellan krullparenteser .

Beräkna frekvensfunktionen för systemet G från0.1 till 10 rad/s och rita upp den i ett bodedia-gram.

>> bode( G, { 0.1, 10 } )

−60

−40

−20

0

20

40

Mag

nitu

de (

dB)

10−1

100

101

−270

−225

−180

−135

−90

Pha

se (

deg)

Bode Diagram

Frequency (rad/sec)

6

Page 251: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

7 Simulering

7.1 Stegsvar

Den vanligaste typen av simulering är att beräkna ett systems stegsvar. Detta kan utföras med funktionen step, medvilken man både simulerar systemet och ritar dess stegsvar. I likhet med tidigare kan man läsa av enskilda värden ifiguren med vänster musknapp och få en meny med olika val med höger knapp. Genom att t ex välja Peak Responsefrån Characteristics markeras tidpunkt och värde för överslängen. Placera markören över punkten i diagrammet visastillhörande numeriska värden.

Antag att systemet G styrs med proportionell återkoppling med förstärkning Kp = 0.7.

Beräkna och rita upp det återkopplade sys-temets stegsvar. Markera stegsvarets översläng.

>> step( Gc )

0 1 2 3 4 5 6 70

0.2

0.4

0.6

0.8

1

1.2

1.4Step Response

Time (sec)

Am

plitu

de

I normalfallet väljs simuleringstiden automatiskt, men genom att ange ett extra argument kan man välja simuleringstidensjälv.

7

Page 252: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Beräkna det återkopplade systemets stegsvarunder femton sekunder och rita upp resultatet.

>> step( Gc, 15 )

Time (sec.)

Am

plitu

de

Step Response

0 5 10 150

0.2

0.4

0.6

0.8

1

1.2

1.4

7.2 Allmän insignal

För att simulera linjära system med allmänna insignaler kan man använda funktionen lsim(G,u,t). Indata till dennafunktion är ett (eller flera) system G, en insignalvektor u och en tidsvektor t.

Antag exempelvis att vi vill studera reglerfelet för det återkopplade systemet ovan då referenssignalen är en ramp. Vi vetatt sambandet mellan referenssignal och reglerfel ges av känslighetsfunktionen

E(s) = S(s)R(s)

där

S(s) = 11 + F (s)G(s)

Skapa en tidsvektor mellan 0 och 10 med steget0.1.

>> t = ( 0 : 0.1 : 10 ).’;

8

Page 253: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Simulera det återkopplade systemet då refer-enssignalen är en ramp med lutning 0.5. Re-glerfelet går i detta fall mot 0.71. Funktionenritar även insignalen, men den kan välja bortpå menyn som nås via höger musknapp.

>> lsim( S, 0.5*t, t )

0 1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8Linear Simulation Results

Time (sec)

Am

plitu

de

För att skapa sinus- och fyrkantsignaler kan funktionen gensig användas.

8 Rotort

För att avgöra hur rötterna till ekvationen

P (s) +KQ(s) = 0

rör sig i komplexa talplanet då K går från noll och mot oändligheten kan man rita ekvationens rotort med funktionen rlocus.Indata till funktionen är en överföringsfunktion med polynomet Q(s) som täljare och polynomet P (s) som nämnare. Medhöger musknapp kan man markera relevanta punkter i figuren, såsom t ex då rotorten passerar imaginäraxeln.

9

Page 254: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Rita upp rotorten för det återkopplade sys-temets karakteristiska funktion då systemet Gstyrs med en proportionell återkoppling. Mark-era där en av rötterna passerar imaginäraxeln.

>> rlocus( G )

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

−3

−2

−1

0

1

2

3

4

System: G Gain: 2.03 Pole: 0.00739 + 2.01i Damping: −0.00368 Overshoot (%): 101 Frequency (rad/sec): 2.01

Root Locus

Real Axis

Imag

inar

y A

xis

För att t ex kontrollera för vilken förstärkning polerna har viss dämpning kan man med höger musknapp lägga in ett nätvilket markerar polplaceringar med samma avstånd till origo respektive samma dämpning.

9 SISO Design ToolEtt ytterligare användbart verktyg är SISO Design Tool, vilket är ett användargränssnitt med vilket man enkelt kan studeraett system ur olika aspekter såsom stegsvar, bodediagram, poler och nollställen, etc. Verktyget SISO Design Tool startasgenom att skriva sisotool. Automatiskt kommer de skapade LTI-objekten att finnas tillgängliga för analys. I figuren nedanvisas ett exempel på vilka figurer som kan visas samtidigt. Testa dig fram!

10 TillståndsbeskrivningI Control System Toolbox finns även en datastruktur för att hantera system på tillståndsform

x(t) = Ax(t) +Bu(t)

y(t) = Cx(t)

För att skapa ett system på denna form används funktionen ss, med vilken man kan skapa ett system på tillståndsform frånbörjan eller konvertera ett system från överföringsfunktionsform.

10

Page 255: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

−6 −4 −2 0 2−4

−3

−2

−1

0

1

2

3

4

Real Axis

Root Locus Editor (C)

−150

−100

−50

0

50

G.M.: 6.02 dBFreq: 2 rad/secStable loop

Open−Loop Bode Editor (C)

10−1

100

101

102

−270

−180

−90

P.M.: 50.3 degFreq: 1.13 rad/sec

Frequency (rad/sec)

Figure 1. SISO Design Tool.

Överför systemet G till tillståndsform. >> G = ss( G )

a =x1 x2 x3

x1 -2 -1 -0x2 4 0 0x3 0 8 0

b =u1

x1 0.25x2 0x3 0

c =x1 x2 x3

y1 0 0 0.5

d =u1

y1 0

Continuous-time model.

11

Page 256: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Matriserna A,B,C och D i tillståndsbeskrivningen ingår nu i datastrukturen G. För att komma åt matriserna kan manreferera till dem direkt genom att skriva G.a, G.b etc.

Beräkna egenvärdena till matrisen A i till-ståndsmodellen

>> eig( G.a )

ans =

0-1.0000 + 1.7321i-1.0000 - 1.7321i

Denna möjlighet är användbar t ex när man skall beräkna polplacerande tillståndsåterkoppling på formen

u(t) = −Lx(t) + r(t)

vilket kan göras med funktionerna acker och place. Funktionen acker används med fördel när systemet har enbart eninsignal, medan place används för flervariabla reglerproblem.

Bestäm en tillståndsåterkoppling som placerardet återkopplade systemets poler i −2.

>> L = acker( G.a, G.b, [ -2 -2 -2 ] )

L =

16 8 1

Det återkopplade systemet

x(t) = (A−BL)x(t) +Br(t)

y(t) = Cx(t)

kan nu skapas t ex med funktionen ss.

Generera tillståndsbeskrivningen för detåterkopplade systemet. Kontrollera att polernaplacerats på önskat sätt.

>> Gc = ss( G.a - G.b * L, G.b, G.c, 0 );>> eig( Gc.a )

ans =

-2.0000-2.0000 + 0.0000i-2.0000 - 0.0000i

Det återkopplade systemets stegsvar kan nu beräknas och ritas upp med funktionen step.

12

Page 257: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Beräkna och rita upp det återkopplade sys-temets stegsvar.

>> step( Gc )

Time (sec.)

Am

plitu

de

Step Response

0 1 2 3 4 5 6 70

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

På detta sätt ser vi endast den utsignal som definieras av vektorn C. Vill vi studera samtliga tillstånd kan detta göras genomatt låta C vara en enhetsmatris med dimension lika med systemets ordningstal.

Skapa det återkopplade systemet på nytt, menmed samtliga tre tillstånd som utsignaler.

>> Gc = ss( G.a - G.b * L, G.b, eye(3), 0 );>> step( Gc )

−0.01

0

0.01

0.02

0.03

To:

Out

(1)

0

0.02

0.04

0.06

0.08

To:

Out

(2)

0 1 2 3 4 5 6 70

0.5

1

To:

Out

(3)

Step Response

Time (sec)

Am

plitu

de

För att beräkna linjärkvadratisk tillståndsåterkoppling kan funktionen lqr användas.

13

Page 258: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

11 Sammanfattning av kommandon11.1 Användbara kommandon i Control System Toolbox

tf System på överföringsfunktionsformss System på tillståndsformpole Polerstep Stegsvartzero Nollställenfeedback Återkopplingnyquist Nyquistdiagrambode Bodediagrambodemag Bodediagrammets amplitudkurvasigma Generalisering av bodemagmargin Bodediagram och stabilitetsmarginalerrlocus Rotortlsim Simulering med godtycklig insignalacker Polplacerande tillståndsåterkopplingplace Polplacerande tillståndsåterkopplinglqr Linjärkvadratisk tillståndsåterkopplingctrb Styrbarhetsmatrisobsv Observerbarhetsmatrisltiview Startar LTI Viewerpzmap Pol-nollställediagramminreal Förkortning av gemensamma faktorersisotool Grafiskt gränssnitt

11.2 Användbara MATLAB-kommandon

abs Absolutbeloppeig Egenvärdenconv Polynommultiplikationdet Determinantdiag Diagonalmatrisimag Imaginärdelinv Matrisinversreal Realdelroots Rötter till polynomgrid Nät i figurerhold Frysning av figurloglog Diagram i log-log skalaplot Diagram i linjär skalacd Byte av bibliotekdir Listning av bibliotekclear Radering av variabler och funktioner i arbetsminnetload Inläsning av variabler från filsave Lagring av variabler på filwho Listning av variabler i arbetsminnethelpdesk Startar HTML-baserad hjälpfunktion

14

Page 259: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

Liten reglerteknisk ordlistaThis version: August 2013

Page 260: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary
Page 261: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

1 Engelsk-svenskactuator ställdonamplitude amplitudattenuation dämpningbandwidth bandbreddbond graph bindningsgrafclosed loop system slutet systemcontrol law styrlagcontrollability styrbarhetcontroller regulatorconvolution faltningcorrelation analysis korrelationsanalyscredibility trovärdighetcrossover frequency skärfrekvensdamping dämpningdamping ratio relativ dämpningdescribing function beskrivande funktiondiscrete event systems händelseorienterade systemdistributed parameter models fördelade parametriska modellerdisturbance rejection störningsundertryckningeigenvalue egenvärdefeedback återkopplingfeedforward framkopplingflow flödegain förstärkninggain crossover frequency (amplitud)skärfrekvensgain margin amplitudmarginalimpulse response impulssvarinitial value begynnelsevärdeloop gain kretsförstärkning, öppna systemetlumped models aggregerade modellermagnitude amplitudobservability observerbarhetobserver observatöropen-loop system öppet system, kretsförstärkning

1

Page 262: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

overfit överanpassningovershoot överslängparsimonious sparsampeak frequency resonansfrekvenspeak resonance resonanstoppphase crossover frequency fasskärfrekvensphase lag fasretarderandephase lead fasavancerandephase margin fasmarginalramp function ramprank rangreset windup integratoruppvridningresonant frequency resonansfrekvensrise time stigtidroot locus (pl. loci) rotortsensitivity function känslighetsfunktionsensor givaresettling time insvängningstid, lösningstidsinusoidal sinusformadstability robustness stabilitetsrobusthetstate tillståndstate feedback tillståndsåterkopplingstatic gain statisk förstärkningsteady state stationärt tillståndstep function stegstep repsonse stegsvarsubspace underrumtime delay tidsfördröjningtransfer function överföringsfunktionunit step enhetstegunstable instabilvalidity giltighetwhitening filter blekningsfilter

2

Page 263: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

2 Svensk-engelsk(amplitud)skärfrekvens gain crossover frequencyaggregerade modeller lumped modelsamplitud amplitudeamplitud magnitudeamplitudmarginal gain marginbandbredd bandwidthbegynnelsevärde initial valuebeskrivande funktion describing functionbindningsgraf bond graphblekningsfilter whitening filterdämpning damping, attenuationegenvärde eigenvalueenhetsteg unit stepfaltning convolutionfasavancerande phase leadfasmarginal phase marginfasretarderande phase lagfasskärfrekvens phase crossover frequencyflöde flowframkoppling feedforwardfördelade parametriska modeller distributed parameter modelsförstärkning gaingiltighet validitygivare sensorhändelseorienterade system discrete event systemsimpulssvar impulse responseinstabil unstableinsvängningstid, lösningstid settling timeintegratoruppvridning reset windupkorrelationsanalys correlation analysiskretsförstärkning loop gain, open loop systemkänslighetsfunktion sensitivity function

3

Page 264: Reglerteknik AK med Utvalda Tentamenstal - KTH · PDF fileReglerteknik AK med Utvalda Tentamenstal Exercises Hints Answers Solutions Introduktion till Control System Toolbox Dictionary

observatör observerobserverbarhet observabilityramp ramp functionrang rankregulator controllerrelativ dämpning damping ratioresonansfrekvens peak frequencyresonansfrekvens resonant frequencyresonanstopp peak resonancerotort root locus (pl. loci)sinusformad sinusoidalslutet system closed loop systemskärfrekvens gain crossover frequencysparsam parsimoniousstabilitetsrobusthet stability robustnessstationärt tillstånd steady statestatisk förstärkning static gainsteg step functionstegsvar step repsonsestigtid rise timestyrbarhet controllabilitystyrlag control lawställdon actuatorstörningsundertryckning disturbance rejectiontidsfördröjning time delaytillstånd statetillståndsåterkoppling state feedbacktrovärdighet credibilityunderrum subspaceåterkoppling feedbacköppet system open-loop system, loop gainöveranpassning overfitöverföringsfunktion transfer functionöversläng overshoot

4