Tuning both plant and controller parameters

We show in this short illutration how to design model structural parameters $\Pi$ and a controller C for performance augmentation.

Design model structural parameters stiffness k and friction c subject to bounds and 2nd-order transfer function feedback controller to minimize worst-case energy of z = [x, u], where x is the position of the mass and u is the control signal. The disturbance w affects velocity.

Contents

Mass-spring damper data

m = 4;                % mass
lk = 4;   rk = 12;    % stiffness k in [4, 12]
lc = 0.5; rc = 1.5;   % friction c in [0.5, 1.5]

Parametrize stiffness and friction variations

xk and xc in (-inf, inf) are mapped into [4, 12] and [0.5, 1.5], resp.

xk = realp('xk',1); % initialize at middle interval
xc = realp('xc',1); % initialize at middle interval
k = (rk-lk)/2*(xk^2-1)/(1+xk^2)+ (lk+rk)/2 ;  % stiffness parametrization
c = (rc-lc)/2*(xc^2-1)/(1+xc^2)+ (lc+rc)/2 ;  % friction  parametrization

Define augmented plant

Define augmented plant with inputs w and u and outputs z and u depending on structural parameters k and c

P = ss([0 1;-k/m -c/m] ,[0 0;1/m 1/m],[1 0;0 0;1 0],[0 0;0 1;0 0]) ;

Define controller structure and closed-loop architecture

C0 = ltiblock.tf('C0',2,2);
CL0 = lft(P,C0) ;

Solve $H_\infty$ problem with hinfstruct

op = hinfstructOptions('Display', 'iter');
[CL,gam] = hinfstruct(CL0, op);
Iter 1: Gain = 0.582, Progress = 14.7%
Iter 2: Gain = 0.506, Progress = 13.1%
Iter 3: Gain = 0.455, Progress = 9.97%
Iter 4: Gain = 0.419, Progress = 7.98%
Iter 5: Gain = 0.396, Progress = 5.5%
Iter 6: Gain = 0.384, Progress = 2.89%
Iter 7: Gain = 0.377, Progress = 1.84%
Iter 8: Gain = 0.372, Progress = 1.49%
Iter 9: Gain = 0.368, Progress = 0.994%
Iter 10: Gain = 0.366, Progress = 0.653%
Iter 11: Gain = 0.364, Progress = 0.387%
Iter 12: Gain = 0.363, Progress = 0.284%
Iter 13: Gain = 0.363, Progress = 0.17%
Iter 14: Gain = 0.362, Progress = 0.157%
Iter 15: Gain = 0.362, Progress = 0.0924%
Iter 16: Gain = 0.361, Progress = 0.047%
Iter 17: Gain = 0.361, Progress = 0.0342%
Iter 18: Gain = 0.361, Progress = 0.0298%
Iter 19: Gain = 0.361, Progress = 0.0176%
Iter 20: Gain = 0.361, Progress = 0.0128%
Iter 21: Gain = 0.361, Progress = 0.00671%
Iter 22: Gain = 0.361, Progress = 0.00556%
Iter 23: Gain = 0.361, Progress = 0.00358%
Iter 24: Gain = 0.361, Progress = 0.0019%
Iter 25: Gain = 0.361, Progress = 0.00159%
Iter 26: Gain = 0.361, Progress = 0.000875%
Iter 27: Gain = 0.361, Progress = 0.00065%
Final: Peak gain = 0.361, Iterations = 27

Recover physical parameters and controller

xkVal= CL.Blocks.xk.Value,  xcVal= CL.Blocks.xc.Value,
kopt = round( (rk-lk)/2*(xkVal^2-1)/(1+xkVal^2)+ (lk+rk)/2) ,
copt = round((rc-lc)/2*(xcVal^2-1)/(1+xcVal^2)+ (lc+rc)/2) ,
xkVal =

  258.1488


xcVal =

  282.7522


kopt =

    12


copt =

     1

Recover controller

Cfinal = tf( CL.Blocks.C0),
 
Transfer function:
-6.093 s^2 - 0.3981 s - 5.182
-----------------------------
    s^2 + 19.08 s + 1.171