Backstepping Design of VS Control for Nonlinear Friction: Examples

Harry G. Kwatny

Drexel University

Carole Teolis

Techno-Sciences, Inc.

Mike Mattice

U. S. Army, ARDEC

Introduction

This notebook documents the computations for the Example in the paper "Variable Structure Control of Systems with Uncertain Nonlinear Friction," by Kwatny, Teolis and Mattice, to appear Automatica.

Setup

<< ProPac`

k = 10;
f = {omega1, k (theta2 - theta1) - omega1/2, omega2, 
          k (theta1 - theta2) -  omega2/2};
g = {0, 0, 0, 1};
h = theta1;

f // MatrixForm

Df = {0, -(1 + Exp[-(omega1/ .02)^2]/10) Sign[
                omega1]/10, 0, -Sign[omega2]/10};

Df // MatrixForm

{T1, T2} = 
        Chop[SISONormalFormTrans[f, g, 
            h, {theta1, omega1, theta2, omega2}]];

InvTrans = 
        InverseTransformation[{theta1, omega1, theta2, omega2}, {x1, x2, x3, 
            x4}, T1];

{fnew, gnew, hnew} = 
        Chop[TransformSystem[f, g, 
            h, {theta1, omega1, theta2, omega2}, {x1, x2, x3, x4}, T1, 
            InvTrans]];

fnew // MatrixForm

gnew // MatrixForm

{ff, gg, hh} = 
        Chop[TransformSystem[f + Df, g, 
            h, {theta1, omega1, theta2, omega2}, {x1, x2, x3, x4}, T1, 
            InvTrans]];

ff // MatrixForm

gg // MatrixForm

Example: VS Control of Motor and Load
b=5 (1+10 Abs[x4]+100 Abs[x3]+500 Abs[x2])

1st Nominal Subsystem

f1 = {x2, 0};
g1  =  {0, 1};
h1 = {x1};
{rho1, s1}  =  
        SlidingSurface[f1, g1, h1, {x1, x2}, {1}];

ctrlbnds  =  {{-1, 1}};
Q  =  {{1}};
vsc1 = 
        SwitchingControl[rho1, s1, ctrlbnds, Q, 
          SmoothingFunctions[x_] -> {Tanh[x/ .1]}];

2nd Nominal Subsystem

f2 = {x2, x3, 0};
g2 = { 0, 0, 1};
h2  =  {x3 - vsc1[[1]]};
{rho2, s2}  =  
        SlidingSurface[f2, g2, h2, {x1, x2, x3}, {4}];

ctrlbnds  =  {{-5, 5}};
Q  =  {{1}};
vsc2 = 
        SwitchingControl[rho2, s2, ctrlbnds, Q, 
          SmoothingFunctions[x_] -> {Tanh[x/ .1]}];

{T1, T2} = 
        Chop[SISONormalFormTrans[f2, g2, h2, {x1, x2, x3}]];

3rd Nominal Subsystem

f3 = fnew;
g3 = gnew;
h3 = 
        Chop[SetAccuracy[{x4 - vsc2[[1]]}, 4], 
          10^(-4)];

{rho, alpha, ro, control} = 
        IOLinearize[f3, g3, h3, {x1, x2, x3, x4}];

Coefficient[
      Truncate[alpha[[1]], {x1, x2, x3, x4}, 1], {x1, x2, x3, 
        x4}]

b = 
        5 (1 + 10 Abs[x4] + 100 Abs[x3] + 250 Abs[x2]);

{rho3, s3}  =  
        SlidingSurface[f3, g3, h3, {x1, x2, z3, x4}, {16}];

ctrlbnds  =  {{-b, b}};
Q  =  {{1}};
vsc3 = 
        SwitchingControl[rho3, s3, ctrlbnds, Q, 
          SmoothingFunctions[x_] -> {Tanh[x/ .04]}];

Simplify[vsc3]

Numerical Simulation

Eqns = 
        MakeODEs[{x1, x2, x3, x4}, ff + gg vsc3[[1]], t];
InitialConds = {x1[0] == 0.2, x2[0] == 0.2, x3[0] == 0, 
          x4[0] == 0};

VSsols = NDSolve[Join[Eqns, InitialConds],{x1[t], x2[t], x3[t], x4[t]},{t, 0, 3},AccuracyGoal -> 2,PrecisionGoal -> 1,MaxStepSize -> 4/60000,MaxSteps -> 60000];

Plot[Evaluate[{x1[t]} /. VSsols],{t, 0, 2},PlotRange -> All,AxesLabel -> {"t", "θ1"}];
Plot[Evaluate[{x2[t]} /. VSsols],{t, 0,  2},PlotRange -> All,AxesLabel -> {"t", "ω1"}];
Plot[Evaluate[{x3[t]} /. VSsols],{t, 0,  2},PlotRange -> All,AxesLabel -> {"t", "x3"}];
Plot[Evaluate[{x4[t]} /. VSsols],{t, 0,  2},PlotRange -> All,AxesLabel -> {"t", "x4"}];

ReplacementRules = 
        Inner[Rule, {x1, x2, x3, x4}, {x1[t], x2[t], x3[t], x4[t]}, 
          List];
Control = vsc3[[1]] /. ReplacementRules;
Plot[Evaluate[{Control} /. VSsols], {t, 0, 2}, 
        AxesLabel -> {"t", "u"}];

gr1=Plot[Evaluate[{x1[t]} /. VSsols],{t, 0, 2},PlotRange -> All,AxesLabel -> {"t", "θ1"}];
gr2=Plot[Evaluate[{x2[t]} /. VSsols],{t, 0,  2},PlotRange -> All,AxesLabel -> {"t", "ω1"},PlotStyle -> Dashing[{0.05, 0.05}]];
Show[gr1, gr2, 
      AxesLabel -> {"t", "θ1,ω1"}]

Plot[
        Evaluate[{(20 x1[t] + x2[t] + 2 x3[t])/20}  /.  VSsols], {t, 
          0,  2}, PlotRange -> All, 
        AxesLabel -> {"t", "θ2"}];
Plot[
        Evaluate[{(20 x2[t] + x3[t] + 2 x4[t])/20} /.  VSsols], {t, 
          0,  2}, PlotRange -> All, 
        AxesLabel -> {"t", "ω2"}];

Numerical Simulation 2

Eqns = 
        MakeODEs[{x1, x2, x3, x4}, ff + gg vsc3[[1]], t];
InitialConds = {x1[0] == 0.2, x2[0] == 0. , x3[0] == 0, 
          x4[0] == 0};

VSsols = NDSolve[Join[Eqns, InitialConds],{x1[t], x2[t], x3[t], x4[t]},{t, 0, 3.9},AccuracyGoal -> 2,PrecisionGoal -> 1,MaxStepSize -> 4/60000,MaxSteps -> 60000];

Plot[Evaluate[{x1[t]} /. VSsols],{t, 0, 2},PlotRange -> All,AxesLabel -> {"t", "θ1"}];
Plot[Evaluate[{x2[t]} /. VSsols],{t, 0,  2},PlotRange -> All,AxesLabel -> {"t", "ω1"}];
Plot[Evaluate[{x3[t]} /. VSsols],{t, 0,  2},PlotRange -> All,AxesLabel -> {"t", "x3"}];
Plot[Evaluate[{x4[t]} /. VSsols],{t, 0,  2},PlotRange -> All,AxesLabel -> {"t", "x4"}];

ReplacementRules = 
        Inner[Rule, {x1, x2, x3, x4}, {x1[t], x2[t], x3[t], x4[t]}, 
          List];
Control = vsc3[[1]] /. ReplacementRules;
Plot[Evaluate[{Control} /. VSsols], {t, 0, 3}, 
        AxesLabel -> {"t", "u"}];

gr1=Plot[Evaluate[{x1[t]} /. VSsols],{t, 0, 2},PlotRange -> All,AxesLabel -> {"t", "θ1"}];
gr2=Plot[Evaluate[{x2[t]} /. VSsols],{t, 0,  2},PlotRange -> All,AxesLabel -> {"t", "ω1"}];
Show[gr1, gr2, 
      AxesLabel -> {"t", "θ1,ω1"}]

gr3 = 
        Plot[Evaluate[{(20 x1[t] + x2[t] + 2 x3[t])/20}  /.  
              VSsols], {t, 0,  2}, PlotRange -> All, 
          AxesLabel -> {"t", "θ2"}, 
          PlotStyle -> Dashing[{0.025, 0.025}]];
gr4 = 
        Plot[Evaluate[{(20 x2[t] + x3[t] + 2 x4[t])/20} /.  
              VSsols], {t, 0,  2}, PlotRange -> All, 
          AxesLabel -> {"t", "ω2"}, 
          PlotStyle -> Dashing[{0.025, 0.025}]];

\(Show[gr1, gr3, 
      AxesLabel -> {"t", \*""(Subscript[θ, 1]), (Subscript[θ, 2])""}]\)

\(Show[gr2, gr4, 
      AxesLabel -> {"t", \*""(Subscript[ω, 1]), (Subscript[ω, 2])""}]\)