adaptive control with matlab simulation - admat'15

28
Adaptive Control with MATLAB Simulation ADMAT’15 Vinay Pandey Department of Electronics and Electrical Engineering Indian Institute of Technology Guwahati April 12, 2015 1 / 28

Upload: others

Post on 28-Jan-2022

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control with MATLAB SimulationADMAT’15

Vinay Pandey

Department of Electronics and Electrical EngineeringIndian Institute of Technology Guwahati

April 12, 2015

1 / 28

Page 2: Adaptive Control with MATLAB Simulation - ADMAT'15

Introduction

Adaptive control method is used for control of dynamic systems,which have unknown or varying uncertain parameters. e.g.

Robot manipulatorsAircraft and rocket controlPower systemsChemical process etc.

The basic idea is to estimate the uncertain plant parameterson-line based on the measured system signal, and use them incontrol input computation.

2 / 28

Page 3: Adaptive Control with MATLAB Simulation - ADMAT'15

Approaches for Adaptive Control

There are two main approaches for constructing adaptive controllers:

Model Reference Adaptive Control (MRAC)

Parameters in MRAC systems are updated so as to minimize thetracking errors between the plant output and reference modeloutput.

Self tuning controller (STC)

Parameters in STC systems are updated so as to minimize thedata-fitting error in input-output measurement.

3 / 28

Page 4: Adaptive Control with MATLAB Simulation - ADMAT'15

Model Reference Adaptive Control

Figure: MRAC

4 / 28

Page 5: Adaptive Control with MATLAB Simulation - ADMAT'15

Design of Adaptation Mechanism in MRAC

Main approaches generally used for the design of adaptive laws are:

MIT rule

Use of Lyapunov stability theory

Use of input/output analysis of systems, small-gain theorem,passivity theory, positive real functions, Kalman-Yakubovichlemma etc.

5 / 28

Page 6: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for Linear First Order System

Plant:

y = −ay + bu (1)

Reference model:

ym = −amym + bmr (2)

Controller:

u = θ1r − θ2y (3)

Closed Loop Plant:

y =−ay + bθ1r − bθ2y (4)

Ideal parameters for perfect model following: θ∗1 = bmb and θ∗2 = am−a

b

6 / 28

Page 7: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for Linear First Order System: Error System

Error:

e = y − ym (5)

Parameter Error:

θ1 = θ1 − θ∗1 and θ2 = θ2 − θ∗2 (6)

Error system: closed loop plant -reference model

e = −ay + bθ1r − bθ2y + amym − bmr

e = amy − amy − ay + bθ1r − bθ2y + amym − bmr

e = −ame + b

[

θ1 −bm

b

]

r − b

[

θ2 −am − a

b

]

y

e = −ame + b [θ1 − θ∗1 ] r − b [θ2 − θ∗2 ]y

e = −ame + bθ1r + bθ2y (7)

7 / 28

Page 8: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for Linear First Order System: Adaptive LawDesign

Lyapunov Function:

V(e, θ1, θ2) =e2

2+

bθ21

2γ+

bθ22

2γ(8)

Differentiating V and using adaptive laws as:

˙θ1 = −γre and ˙θ2 = −γye (9)

gives,

V = −ame2 (10)

8 / 28

Page 9: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for General nth-order Linear System

Plant:

x = Ax + Bu (11)

Reference model:

xm = Amxm + Bmr (12)

Controller:

u = Mr − Lx (13)

Closed Loop Plant:

x = (A − BL)x + BMr

x = Ac(θ)x + Bc(θ)r (14)

Ideal parameters for perfect model following: Ac(θ∗) = Am andBc(θ∗) = Bm

9 / 28

Page 10: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for General nth-order Linear System: Error System

Error:

e = x − xm (15)

Parameter Error:

θ = θ − θ∗ (16)

Error system: closed loop plant -reference model

e = Ax − BLx + BMr − Amxm − Bmr

e = Amx − Amx + Ax − BLx + BMr − Amxm − Bmr

e = Ame + (A − BL − Am)x + (BM − Bm)r

e = Ame + (Ac(θ)− Am)x + (Bc(θ)− Bm)r

e = Ame + (Ac(θ)− Ac(θ∗))x + (Bc(θ)− Bc(θ

∗))r

e = Ame + Ψ(x,r)θ (17)

10 / 28

Page 11: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for General nth-order Linear System: AdaptiveLaw Design

Lyapunov Function:

V(e,θ) = γeT Pe + θT θ (18)

where P ∈ Rn×n is the solution of Lyapunov equation

ATmP + PAm = −Q, with Q being a symmetric, positive definite

matrix.Differentiating V and using adaptive laws as:

˙θ = −γΨTPe (19)

gives,

V = −γeTQe (20)

11 / 28

Page 12: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for a Nonlinear System

Consider a class of affine single input single output (SISO) nonlinearsystem as:

x = f (x,θ) + g(x,θ)u

y = h(x) (21)

Differentiate the output equation till you get the input u

yr = p(x,θ) + q(x,θ)u

(22)

12 / 28

Page 13: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for a Nonlinear System: Control input

Feedback Linearization1 is used to find the control input as

u =1

q(x,θ)(−p(x,θ) + v) (23)

For a tracking problem, v is the control signal to be designed usingthe required trajectory (yd) information as

v = yrd + λr(y

(r−1)d − y(r−1)) + ........+ λ1(yd − y) (24)

where constants λ1, ...,λr can be chosen such thatsr + λrsr−1 + ... + λ1 yields a Hurwitz Polynomial.

1H. K. Khalil,“Nonlinear System," Prentice Hall, 1996.

13 / 28

Page 14: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for a Nonlinear System: Estimation model design

The system (21) can be written in the regressor form2 as

x = ωT(x,u)θ (25)

The observer based estimation model3 for the system (25) is given as

˙x = A(x − x) + ωT(x,u)θ (26)

Here A ∈ Rn×n is a Hurwitz matrix.

2G. Tao,“Adaptive Control Design and Analysis," John Wiley & Sons, Inc., NY, USA, 2003.

3K. S. Narendra, A. M. Annaswamy,“Stable Adaptive Systems," Dover Publications, 2005.

14 / 28

Page 15: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for a Nonlinear System: Adaptive law design

Defining state estimation error as x = x − x, and parameter error asθ = θ − θ. Using (26)-(25) gives the error system as

˙x = Ax + ωT(x,u)θ (27)

Using Lyapunov stability4 analysis adaptive law for θ is derived as

V(x, θ) = xTPx + θT θ (28)

where P ∈ Rn×n is the solution of Lyapunov equation

AT P + PA = −Q, with Q being a symmetric, positive definite matrix.Differentiating V and using the adaptive law as

˙θ =−ω(x,u)Px (29)

gives

V(x, θ) = −xTQx (30)

4J.-J. E. Slotine, W. Li,“Applied Nonlinear Control," Prentice Hall, Englewood Cliffs (N.J.), 1996.

15 / 28

Page 16: Adaptive Control with MATLAB Simulation - ADMAT'15

Adaptive Control Design for a Nonlinear System: Control input redesigned

Using certainty equivalence principle, the control input in (23) isreconstructed as

u =1

q(x, θ)(−p(x, θ) + v) (31)

where,

v = yrd + λr(y

(r−1)d − y(r−1)) + ........+ λ1(yd − y) (32)

16 / 28

Page 17: Adaptive Control with MATLAB Simulation - ADMAT'15

Example: Single link robot arm driven by brushed DC motor

Adaptive control design for 1-link robot arm driven by a brushedDC-motor

+

R

+

L

GJ

v(t)

I(t)

B0

l,ml

m0,r0

kbkt

Figure: Model of 1-link robot arm driven by a brushed DC-motor

17 / 28

Page 18: Adaptive Control with MATLAB Simulation - ADMAT'15

Single link robot arm driven by brushed DC motor: System Dynamics

The system comprises of mechanical and electrical subsystems withdynamics given as

Mq(t) + Bq(t) + N sin q(t) = I(t)

LI(t) + RI(t) + kb q(t) = v(t) (33)

where:

M = (J/kt) + (m1l2/3kt) + (m0l2/kt) + (2m0r20/5kt), is the lumped

inertia.

N = (m1lG/2kt) + (m0lG/kt), is the lumped load

B stands for friction coefficient

I(t) is the rotor armature current

q(t) is the angular position, and

v(t) is the control input voltage

18 / 28

Page 19: Adaptive Control with MATLAB Simulation - ADMAT'15

Single link robot arm driven by brushed DC motor

Table: Electromechanical system constants

Symb. Description Value Unit

J motor inertia 1.625 × 10−3 kg − m2/radr0 radius of the load 0.02 m

l link length 0.3 m

R rotor resistance 5.0 Ω

L rotor inductance 25 × 10−3 H

m0 load mass 0.45 kgml link mass 0.5 kg

G gravity constant 9.81 kg − m/s2

B0 viscous friction coefficient 16.25 × 10−3 N − m − s/radkt torque constant of motor 0.90 N − m/A

kb back-emf constant 0.90 N − m/A

19 / 28

Page 20: Adaptive Control with MATLAB Simulation - ADMAT'15

Single link robot arm driven by brushed DC motor: State Space basedModeling

Considering x1 = q, x2 = q, x3 = I as state variables and u = v(t) asinput, the complete system dynamics can be represented in thestate-space form as

x1 = x2

x2 = θ2 sin x1 − Bθ1x2 + θ1x3

x3 = c1x2 + c2x3 + c0u

y = x1 (34)

where c0 = 1/L, c1 = −kb/L, c2 = −R/L, B = B0/Kt, θ1 = 1/M,θ2 = −N/M.

Here parameters θ1 and θ2 are uncertain, because of theunknown and sudden changes in the load properties.

20 / 28

Page 21: Adaptive Control with MATLAB Simulation - ADMAT'15

Single link robot arm driven by brushed DC motor: Control Input Design

Computation of control input by feedback linearization:

y = x1

y = x2

y = θ2sinx1 − Bθ1x2 + θ1x3

y3 = θ2x2cosx1 − Bθ1θ2sinx1 + B2θ21x2 − Bθ2

1x3 + θ1c1x2

+ θ1c2x3 + θ1c0u (35)

Equating y3 to virtual control signal v(t), gives the control input as

u =1

θ1c0[v − θ2x2cosx1 − Bθ1θ2sinx1 + B2θ2

1x2 − Bθ21x3

+ θ1c1x2 + θ1c2x3] (36)

21 / 28

Page 22: Adaptive Control with MATLAB Simulation - ADMAT'15

Single link robot arm driven by brushed DC motor: Estimation and ErrorModel

Rewriting plant (34) in regressor form

x =

x2 0 00 −Bx2 + x3 sin x1

c1x2 + c2x3 + c0u 0 0

1θ1

θ2

(37)

Estimation model:

˙x = A(x − x) +

x2 0 00 −Bx2 + x3 sin x1

c1x2 + c2x3 + c0u 0 0

1

θ1

θ2

(38)

Using above, the error equation can be deduced as,

˙x = Ax +

x2 0 00 −Bx2 + x3 sin x1

c1x2 + c2x3 + c0u 0 0

1θ1

θ2

(39)

22 / 28

Page 23: Adaptive Control with MATLAB Simulation - ADMAT'15

Single link robot arm driven by brushed DC motor: Adaptive Law Design

Using equation (29) for adaptive law,

˙θ =−ω(x,u)Px (40)

1˙θ1˙θ2

=

(

x2 0 c1x2 + c2x3 + c0u0 −Bx2 + x3 00 sin x1 0

)(

p1 p4 p7

p2 p5 p8

p3 p6 p9

)[

x1

x2

x3

]

(41)

˙θ1 = ˙θ1 = (x3 − Bx2) ∗ [p2 p5 p8] ∗ [x1 x2 x3]′

˙θ2 = ˙θ2 = sinx1 ∗ [p2 p5 p8] ∗ [x1 x2 x3]′; (42)

Final control input:

u =1

θ1c0

[v − θ2x2cosx1 − Bθ1θ2sinx1 + B2θ21x2 − Bθ2

1x3

+ θ1c1x2 + θ1c2x3] (43)

23 / 28

Page 24: Adaptive Control with MATLAB Simulation - ADMAT'15

Methods for Solving ODE’s: Euler’s Method

Euler’s method is a numerical procedure for solving ordinarydifferential equations (ODEs) with a given initial value.

Ordinary differential equation:

x(t) = f (t, x), x(t0) = x0 (44)

Select a step size .Euler’s Method:

xn+1 = xn + f (tn, xn)

tn+1 = tn + (45)

24 / 28

Page 25: Adaptive Control with MATLAB Simulation - ADMAT'15

Methods for Solving ODE’s: Runge-Kutta 4th order method (RK4)

Runge-Kutta 4th order method does the same thing as Euler’smethod with a high accuracy.

Ordinary differential equation:

x(t) = f (t, x), x(t0) = x0 (46)

Select a step size .RK4 Method:

k1 = f (tn, xn)

k2 = f (tn +

2, xn +

1

2k1)

k3 = f (tn +

2, xn +

1

2k2)

k4 = f (tn +, xn + k3) (47)

xn+1 = xn +1

6(k1 + 2k2 + 2k3 + k4)

tn+1 = tn + (48)

25 / 28

Page 26: Adaptive Control with MATLAB Simulation - ADMAT'15

Runge-Kutta 4th order method (RK4): An Example

Problem:

dy

dt= 3e−t − 0.4y, y(0) = 5 (49)

Find y(3), using = 1.5.

26 / 28

Page 27: Adaptive Control with MATLAB Simulation - ADMAT'15

Simulation: Values used

= 0.001

A =

−1 0 00 −2 00 0 −1

θ1 = 15.7 and 10.6, θ2 = −36 and − 34.7

θ1(1) = 7, θ2(1) =−32

λ1 = 30,λ2 = 15,λ3 = 15

Q = 120 ∗ I

Reference input: yd =−2(e−0.6t − 1)sin(1.8π)t

27 / 28

Page 28: Adaptive Control with MATLAB Simulation - ADMAT'15

THANK YOU

28 / 28