16.30 topic 23: anti-windup - mit opencourseware · topic #23 16.30/31 feedback control systems...

13
Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems Anti-windup Notes developed in part from 16.30 Estimation and Con- trol of Aerospace Systems, Lecture 21: Lyapunov Stability Theory by Prof. Frazzoli

Upload: duonganh

Post on 02-Jul-2018

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Topic #23

16.30/31 Feedback Control Systems

Analysis of Nonlinear Systems

• Anti-windup

• Notes developed in part from 16.30 Estimation and Con­trol of Aerospace Systems, Lecture 21: Lyapunov Stability Theory by Prof. Frazzoli

Page 2: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Fall 2010 16.30/31 23–2

Nonlinear System Analysis

• Example: Car cruise control1

gF

mg

F

• Equation of motion in the direction parallel to the road surface:

dv m = Feng + Faero + Ffrict + Fg.

dt where

1 Faero = − ρCdAv · |v|,

2Fg = −mg sin(θ),

Ffrict = −mgCr cos(θ)sgn(v).

• Engine model 200 200

Tor

que T

[N

m]

0 20 40 60

n=1 n=2 n=3 n=4

n=5180 180

Tor

que T

[N

m]

160

140

160

140

120 120

0 100

200 400 600 100

Angular velocity � [rad/s] Velocity v [m/s] � � � �2 • Engine torque (at full throttle): Tω = Tm 1 − β ω

ωm − 1 ,

where ω = nr v = αnv, n is gear ratio, and r wheel radius.

• The engine driving force can hence be written as

Feng = αnT (αnv)u, 0 ≤ u ≤ 1.

1The example is taken from ˚ om and Murray: Feedback Systems, 2008Astr¨

November 21, 2010

Page 3: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

� � � � ��

� �� � � �� �

Fall 2010 16.30/31 23–3

Jacobian Linearization

• Any (feasible) speed corresponds to an equilibrium point.

• Choose a reference speed vref > 0, and solve for dv/dt = 0 with respect to u, assuming a horizontal road (θ = 0).

10 = αnT (αnv)u − ρCdAv

2 − mgCr2

i.e., 1ρCdAv

2 + mgCr u = 2 .

αnT (αnv)

• Linearized system (ξ = v − v, η = u − u):

d 1 ∂T (αnv) 1ξ = αn u− ρCdAv ξ + αnT (αnv) η

dt ∂vm m v

Adyn Bdyn

• Example: numerical values

• Let us use the following numerical values (all units in SI):

Tm = 190, β = 0.4, ωm = 420, α5 = 10, Cr = 0.01,

m = 1500, g = 9.81, ρ = 1.2, CdA = 0.79.

• For v = 25 (90 km/h, or 55 mph), we get u = 0.2497.

• The linearization yields:

Adyn = −0.0134, Bdyn = 1.1837

1.1837 ⇒ G(s) = s + 0.0134

November 21, 2010

Page 4: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Fall 2010 16.30/31 23–4

Cruise control design

• A proportional controller would stabilize the closed-loop system.

• Assume we want to maintain the commanded speed (cruise con­trol): we need to add an integrator.

• A PI controller will work, e.g.,

s + 1 C(s) = 1.5

s

• Linear control/model response to hill at specified angle between 5 and 25 sec

November 21, 2010

Page 5: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Function

Fall 2010 16.30/31 23–5

Nonlinear Simulation

• Check with BOTH linear AND nonlinear simulation

engine

f(u)

control 1

1.5s+1.5

s

control

1.5s+1.5

s

Trigonometric

sin

Transfer Fcn

Bdyn

s-Adyn

To Workspace

Car1 Signal Builder

Signal 1

Scope

Saturation Product

Integrator

1 s

Gain 4

-K-

Gain 3

-K-

Gain 2

-K-

Gain

-K-

Faero

f(u)

Constant 3

0

Clock

Add

1

vbar

1

ubar

-C­

ubar

vbar

v

vF

Fg

Ffrict

del V

November 21, 2010

Page 6: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Fall 2010 16.30/31 23–6

Review

• (Jacobian) linearization:

• Find the desired equilibrium condition (state and control).

• Linearize the non-linear model around the equilibrium.

• Control design:

• Design a linear compensator for the linear model.

• If the linear system is closed-loop stable, so will be the nonlinear system—in a neighborhood of the equilibrium.

• Check in a (nonlinear) simulation the robustness of your design with respect to “typical” deviations.

November 21, 2010

Page 7: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Fall 2010 16.30/31 23–7

Effects of the saturation

• What if the slope is a little steeper (say 4.85 degrees)?

• What is wrong?

• Systems experiencing Integrator wind-up

• Once the input saturates, the integral of the error keeps increasing.

• When the error decreases, the large integral value prevents the controller from resuming “normal operations” quickly (the integral error must decrease first!) – so the response is delayed

• Idea: once the input saturates, stop integrating the error (can’t do much about it anyway!)

November 21, 2010

Page 8: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Fall 2010 16.30/31 23–8

Anti-windup Logic

• One option is the following logic for the integral gain:

K ′ KI if the input does not saturate; = I 0 if the input saturates

• Another option is the following:

• Compare the actual input and the commanded input.

• If they are the same, the saturation is not in effect.

• Otherwise, reduce the integral error by a constant times the dif­ference.

uint = Ki (e + Kaw(sat(u) − u)) dt

• With this choice, under saturation, the actuator/commanded differ­ence is fedback to the integrator to so that eact = sat(u) − u tends to zero

• Implies that the controller output is kept close to saturation limit.

• The controller output will then change as soon as the error changes sign, thus avoiding the integral windup.

• If there is no saturation, the anti-windup scheme has no effect.

November 21, 2010

Page 9: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Fall 2010 16.30/31 23–9

Anti-windup Scheme

engine

f(u)

control 1

1.5s+1.5

s

Trigonometric Function

sin

Transfer Fcn 3

1.5

s

Transfer Fcn 2

1.5

1

Transfer Fcn

Bdyn

s-Adyn

To Workspace

Car2 Signal Builder

Signal 1

Scope

Saturation Product

Integrator

1 s

Gain 4

-K-

Gain 3

-K-

Gain 2

-K-

Gain 1

-K-

Gain

-K-

Faero

f(u)

Constant 3

0 Constant 1

-C-

Constant

vbar Clock

Add

ubar

ubar

vbar

vF

Fg

Ffrict

• Response to a 4.85 degree slope

• Anti-windup compensator avoids the velocity overshoot by preventing the error buildup in the integral term

November 21, 2010

Page 10: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Fall 2010 16.30/31 23–10

Anti-windup Summary

• Anti-wind up schemes guarantee the stability of the compensator when the (original) feedback loop is effectively opened by the satura­tion.

• Prevent divergence of the integral error when the control cannot keep up with the reference.

• Maintain the integral errors “small.”

November 21, 2010

Page 11: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

Fall 2010 16.30/31 23–11

Code: Car Setup

set(0, 'DefaultAxesFontSize', 12, 'DefaultAxesFontWeight','demi')set(0, 'DefaultTextFontSize', 12, 'DefaultTextFontWeight','demi')set(0,'DefaultAxesFontName','arial')set(0,'DefaultAxesFontSize',12)set(0,'DefaultTextFontName','arial')

clear all%close all% Parameters for defining the system dynamicstheta=0;gear=5;alpha = [40, 25, 16, 12, 10]; % gear ratiosTm = 190; % engine torque constant, Nmwm = 420; % peak torque rate, rad/secbeta = 0.4; % torque coefficientCr = 0.01; % coefficient of rolling frictionrho = 1.2; % density of air, kg/mˆ3A = 2.4; % car area, mˆ2Cd = 0.79/A; % drag coefficientg = 9.8; % gravitational constantm=1500; % massv=25;

% Compute the torque produced by the engine, Tmomega = alpha(gear) * v; % engine speedtorque = Tm * ( 1 − beta * (omega/wm − 1)ˆ2 );F = alpha(gear) * torque;

% Compute the external forces on the vehicleFr = m * g * Cr; % Rolling frictionFa = 0.5 * rho * Cd * A * vˆ2; % Aerodynamic dragFg = m * g * sin(theta); % Road slope forceFd = Fr + Fa + Fg; % total deceleration

ubar=(Fa+Fr)/(F)vbar=v;

dTdv=Tm*(−2*beta*(alpha(gear)*vbar/wm−1)*(alpha(gear)/wm))Adyn=(alpha(gear)*dTdv*ubar−rho*Cd*A*vbar)/m;Bdyn=F/m;

Hillangle=4; % non−saturating anglesim('cruise control')figure(4);subplot(211);plot(Car1(:,5),Car1(:,[2]),'LineWidth',2);xlabel('Time');ylabel('Speed')title(['Hill response, angle=',num2str(Hillangle)])subplot(212);plot(Car1(:,5),Car1(:,[4]),'LineWidth',2);xlabel('Time');ylabel('Throttle')

figure(1);subplot(211);plot(Car1(:,5),Car1(:,[1 2]),'LineWidth',2);xlabel('Time');ylabel('Speed')legend('NL','Lin','Location','SouthEast');title(['Hill response, angle=',num2str(Hillangle)])subplot(212);plot(Car1(:,5),Car1(:,[3 4]),'LineWidth',2);xlabel('Time');ylabel('Throttle')

Antiwindup gain=0; % us esame code with and without AWupHillangle=4.85;sim('cruise control awup')figure(2);subplot(211);plot(Car2(:,5),Car2(:,[1 2]),'LineWidth',2);xlabel('Time');ylabel('Speed')legend('NL','Lin','Location','SouthEast');title(['Hill response, angle=',num2str(Hillangle)])subplot(212);plot(Car2(:,5),Car2(:,[3 4]),'LineWidth',2);xlabel('Time');ylabel('Throttle')

Car2 no AW=Car2;

Antiwindup gain=5; sim('cruise control awup') figure(3);

November 21, 2010

Page 12: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

Fall 2010 16.30/31 23–12

75 subplot(211); 76 plot(Car2(:,5),Car2(:,[1 2]),'LineWidth',2);xlabel('Time');ylabel('Speed') 77 legend('NL','Lin','Location','SouthEast'); 78 title(['Hill response, angle=',num2str(Hillangle),' With Anti−windup gain=',num2str(Antiwindup gain)]) 79 subplot(212); 80 plot(Car2(:,5),Car2(:,[3 4]),'LineWidth',2);xlabel('Time');ylabel('Throttle') 81

82 figure(5); 83 subplot(211); 84 plot(Car2 no AW(:,5),Car2 no AW(:,[6 7]),Car2 no AW(:,5),10*Car2 no AW(:,[8]),'LineWidth',2);xlabel('Time');yla 85 legend('sat(u)','u','10*e {vel}','Location','NorthEast'); 86 axis([4 20 −0.5 5]) 87 title(['Hill response no AW']) 88 subplot(212); 89 plot(Car2(:,5),Car2(:,[6 7]),Car2(:,5),10*Car2(:,[8]),'LineWidth',2);xlabel('Time');ylabel('Windup error') 90 legend('sat(u)','u','10*e {vel}','Location','NorthEast'); 91 title(['Hill response with AW']) 92 axis([4 20 −0.5 5]) 93

94 print −dpng −r300 −f1 AW1.png 95 print −dpng −r300 −f2 AW2.png 96 print −dpng −r300 −f3 AW3.png 97 print −dpng −r300 −f4 AW4.png 98 print −dpng −r300 −f5 AW5.png

November 21, 2010

Page 13: 16.30 Topic 23: Anti-windup - MIT OpenCourseWare · Topic #23 16.30/31 Feedback Control Systems Analysis of Nonlinear Systems • Anti-windup • Notes developed in part from 16.30

MIT OpenCourseWarehttp://ocw.mit.edu

16.30 / 16.31 Feedback Control Systems Fall 2010

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.