Top Banner
44

Sliding Mode Manual

Apr 13, 2015

Download

Documents

Ashik Ahmed

manual to use sliding mode control. helps to learn and use sliding mode technique.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sliding Mode Manual

A Sliding Mode Control Matlab Toolbox

Christopher Edwards � Sarah K� Spurgeon

Control Systems ResearchDepartment of EngineeringUniversity of LeicesterLeicester LE� �RH

U�K�

Revised �������

Report No � ����

Abstract

This document serves as a manual for a suite of Matlab functions for designingsliding mode controllers for linear systems with bounded nonlinear uncertainty� Thealgorithms are described in detail elsewhere and in this document the emphasis is ondescribing the software which implements these ideas� A number of worked examplesare included to demonstrate di�erent facets of the design procedures together withdiaries of relevant Matlab sessions�

Page 2: Sliding Mode Manual

� An Introduction to Variable Structure Control

The focus of much of the research in the area of control systems theory duringthe seventies and eighties has addressed the issue of robustness � i�e� designingcontrollers with the ability to maintain stability and performance in the presenceof discrepancies between the plant and model� One nonlinear approach to robustcontroller design which emerged during this period is the Variable structure controlsystems methodology� Variable structure control systems evolved from the pioneer�ing work in Russia of Emel�yanov and Barbashin in the early ����s� The ideasdid not appear outside the Soviet Union until the mid ����s when a book by Itkis�� and a survey paper by Utkin � were published in English� Variable structuresystems concepts have subsequently been utilised in the design of robust regulators�model�reference systems� adaptive schemes� tracking systems and state observers�The ideas have successfully been applied to problems as diverse as automatic �ightcontrol� control of electrical motors� chemical processes� helicopter stability aug�mentation� space systems and robotics�

Variable structure control systems comprise a collection of di�erent� usually quitesimple� feedback control laws and a decision rule� Depending on the status of thesystem� a decision rule� often termed the switching function� determines which ofthe control laws is �on�line� at any one time� Unlike� for example� a gain�schedulingmethodology� the decision rule is designed to force the system states to reach� andsubsequently remain on� a pre�de�ned surface within the state�space� The dynam�ical behaviour of the system when con�ned to the surface is described as the idealsliding motion� The advantages of obtaining such a motion are twofold� �rstlythere is a reduction in order and secondly the sliding motion is insensitive to pa�rameter variations implicit in the input channels� The latter property of invariancetowards so�called matched uncertainty makes the methodology an attractive one fordesigning robust controllers for uncertain systems�

The following notation �which is explained in detail in ��� will be used throughout�IR and C will represent the �eld of real and complex numbers respectively and C�will represent the open left half of the complex plane� N ��� and R��� will denote thenull and range spaces of a matrix respectively and k � k will represent the Euclideannorm for vectors and the induced spectral norm for matrices�

� State�feedback Sliding Mode Control

��� Introduction

Consider the nth order linear time invariant system with m inputs given by

�x�t� � Ax�t� �Bu�t� ���

where A � IRn�n and B � IRn�m with � � m � n� Without loss of generality it canbe assumed that the input distribution matrix B has full rank� De�ne a switchingfunction s � IR� IRm to be

s�t� � Sx�t� ���

Page 3: Sliding Mode Manual

State�feedback Sliding Mode Control �

where S � IRm�n is of full rank and let S be the hyperplane de�ned by

S � fx � IRn � Sx � g ���

Suppose u�s�t�� x�t�� represents a variable structure control law where the changesin control strategy depend on the value of the switching function� It is natural toexplore the possibility of choosing the control action and selecting the switchingstrategy so that an ideal sliding motion takes place on the hyperplane� i�e� thereexists a time ts such that

s�t� � Sx�t� � for all t � ts � �

Suppose at time t � ts the systems states lie on the surface S and an ideal slidingmotion takes place� This can be expressed mathematically as Sx�t� � and �s�t� �S �x�t� � for all t � ts� Substituting for �x�t� from ��� gives

S �x�t� � SAx�t� � SBu�t� � for all t � ts ���

Suppose the matrix S is designed so that the square matrix SB is nonsingular �inpractise this is easily accomplished since B is full rank and S is a free parameter��The equivalent control� written as ueq� is de�ned to be the unique solution to thealgebraic equation ���� namely

ueq�t� � ��SB���SAx�t� ���

This represents the control action which is required to maintain the states on theswitching surface� The ideal sliding motion is then given by substituting the ex�pression for the equivalent control into equation ��� which results in a free motion

�x�t� ��In � B�SB���S

�Ax�t� for all t � ts and Sx�ts� � ���

It can be seen from equation ��� that the sliding motion is a control independentfree motion which depends on the choice of sliding surface� although the precisee�ect is not readily apparent� A convenient way to shed light on the problem is to�rst transform the system into a suitable canonical form� In this form the systemis decomposed into two connected subsystems� one acting in R�B� and the otherin N �S�� Since by assumption rank�B� � m there exists an orthogonal matrixTr � IR

n�n such that

TrB �

�B�

����

where B� � IRm�m and is nonsingular� Let z � Tx and partition the new coordi�

nates so that

z �

�z�z�

����

where z� � IRn�m and z� � IR

m� The nominal linear system ��� can then be writtenas

�z��t� � A��z��t� � A��z��t� ���

�z��t� � A��z��t� � A��z��t� �B�u�t� ����

Page 4: Sliding Mode Manual

State�feedback Sliding Mode Control �

which is referred to as regular form� Equation ��� is referred to as describingthe null�space dynamics and equation ���� as describing the range�space dynamics�Suppose the matrix de�ning the switching function �in the new coordinate system�is compatibly partitioned as

STTr �

�S� S�

�����

where S� � IRm��n�m� and S� � IR

m�m� Since SB � S�B� it follows that a neces�sary and su�cient condition for the matrixSB to be nonsingular is that det�S�� �� �By design assume this to be the case� During an ideal sliding motion

S�z��t� � S�z��t� � for all t � ts ����

and therefore formally expressing z��t� in terms of z��t� yields

z��t� � �Mz��t� �� �

where M � S��� S�� Substituting in equation ��� gives

�z��t� � �A�� �A��M � z��t� ����

and thus the problem of hyperplane design may be considered to be a state feedbackproblem for the system ��� where z��t� is considered to play the role of the controlaction� In the context of designing a regulator� the matrix governing the slidingmotion �A�� � A��M � must have stable eigenvalues� The switching surface designproblem can therefore be considered to be one of choosing a state feedback matrixM to stabilise the reduced order system �A��� A���� Because of the special structureof the regular form� it follows that the pair �A��� A��� is controllable if and onlyif �A�B� is controllable� It can be seen from equation ���� that S� has no directe�ect on the dynamics of the sliding motion and acts only as a scaling factor for theswitching function� The choice of S� is therefore somewhat arbitrary� A commonchoice however� which stems from the so�called hierarchical design procedure� is tolet S� � �B��� for some diagonal design matrix � � IRm�m which implies SB ��� By selecting M and S� the switching function in equation ���� it completelydetermined�

Several approaches have been proposed for the design of the feedback matrix Mincluding quadratic minimisation� eigenvalue placement and eigenstructure assign�ment methods �see Chapter in ���� These approaches will be discussed in thefollowing sections�

Example

A linearisation of the nonlinear equations of motion of an inverted pendulum aboutthe equilibrium point at the origin �x����� in ��� is given by

A �

���� �� �� ������� ������� ��� ������� ������ ������

� B �

����

���������

� ����

This system is not in regular form because the input enters the last two state�spaceequation� The following Matlab session performs the necessary transformationand identi�es the important sub�blocks�

Page 5: Sliding Mode Manual

State�feedback Sliding Mode Control

Session �� regfor

�� �A���A���B��Tr��regfor�A�B�

A�� �

���� ��

� � ���� � ��

����� ��� ����

A�� �

���

���

����

B� �

��� �

Tr �

���� �� ����

��� ���� ��

���� ���

��

Notice the transformation Tr is symmetric and in fact orthogonal� This is desirablefrom the numerical viewpoint�

��� Robust Eigenstructure Assignment

For the case of a scalar controlled problem� speci�cation of the �n � �� eigenvaluesassociated with the sliding mode will uniquely determine the matrixM of equation�� �� For multi�input systems this is not the case� In such a situation the avail�able degrees of freedom may be used to modally shape the system response by ajudicious choice of eigenvector form and�or ensure that the resulting closed�loopsystem is maximally robust to system parameter variations� However the eigenvec�tor corresponding to a given eigenvalue must lie in an allowable sub�space which isdetermined by the system matrix� the input matrix and the eigenvalue itself� Toevaluate robustness� a bound upon the individual eigenvalue sensitivities ci is givenby

maxfcig � ��V � � kV kkV ��k ����

Here ��V � denotes the condition number of the matrix V of right eigenvectors andis a measure of the orthogonality of the eigenvectors vi� The closer the eigenvectorsof a matrix are to being orthogonal� the smaller is the associated condition numberand the greater the robustness of the eigenvalue locations to changes in the elementsof the matrix� In robust eigenstructure assignment the feedback matrix is obtainedby assigning a set of linearly independent right eigenvectors corresponding to the

Page 6: Sliding Mode Manual

State�feedback Sliding Mode Control �

required eigenvalues such that the matrix of eigenvectors is as well�conditioned aspossible �x ���� in ���� This can be achieved via the Matlab command place�

Example

Here the use of robust pole placement will be demonstrated on a dc motor examplefrom x���� in��� The state and input distribution matrices are given by

A �

�� �� � ��� ���� �� �

� B �

��

� ����

Notice the system is already in regular form and the sliding motion will be a secondorder system� In the following session the reduced order sliding motion is assigneda pair of complex poles with damping ratio � � ��� and natural frequency wn � ��

Session �� rpp

zeta� ��

wn���

�� sp�roots��� ��zeta�wn wn�wn��

sp �

�� � ����i

�� � ����i

�� S�rpp�A�B�sp�

place� ndigits� ��

S �

� �� ����� ��

��

This compares with the �speci�c� analytic approach described in x���� ��� Noticethe hyperplane matrix S is returned in the original coordinate system� The trans�formation to regular form and the subsequent computations take place internallywithin the function�

��� Direct Eigenstructure Assignment

In the previous subsection� the additional degrees of freedom in the pole placementproblem for multi�input systems were used to minimise the condition number ofthe associated eigenvalues� If information is known about a desirable weightingof the system states for each mode� it is possible to choose a desired eigenvectorspeci�cation� Again this will not necessarily be achievable because it may not liewithin the prescribed allowable sub�space� details are given in x �� in ���

A numerical example using the approach appears later in x����

Page 7: Sliding Mode Manual

State�feedback Sliding Mode Control �

��� Quadratic Minimisation

Consider the problem of minimising the quadratic performance index

J ��

Z �

ts

x�t�TQx�t� dt ����

where Q is both symmetric and positive de�nite and ts is the time at which slidingmotion commences� The aim is to minimise equation ���� subject to the systemequation ��� under the assumption that sliding takes place� It is assumed thatthe state of the system at time ts� x�ts�� is a known initial condition and is suchthat x�t� � as t � �� The matrix Q from equation ���� is transformed andpartitioned compatibly with z so that

TrQTTr �

�Q�� Q��

QT�� Q��

����

and subsequently de�ne�Q � Q�� � Q��Q

���� Q�� ����

andv � z� �Q���� Q��z� ����

After some algebraic manipulation equation ���� may then be written in the newcoordinate system as

J ��

Z �

ts

zT��Qz� � vTQ��v dt ����

Recall the constraint equation may be written as

�z��t� � A��z��t� � A��z��t� �� �

Eliminating the z� contribution from equation �� � using equation ����� the modi�edconstraint equation becomes

�z��t� � �Az��t� �A��v�t� ����

where�A � A�� �A��Q

���� Q�� ����

The positive de�niteness of Q ensures that Q�� � � so that Q���� exists� and also

that �Q � � Furthermore� the controllability of the original �A�B� pair ensures thatthe pair � �A�A��� is controllable� The problem thus becomes that of minimising thefunctional ���� subject to the system ���� and thus can be interpreted as a standardlinear�quadratic optimal state�regulator problem� A more detailed description ofthis approach is given in x ���� in ���

Example

Consider once again the linearised equations of motion of an inverted pendulumgiven in ����� The following session designs a hyperplane for this system by min�imising a quadratic cost function�

Page 8: Sliding Mode Manual

State�feedback Sliding Mode Control �

Session �� lqcf

�� Q�diag��� � � ���

Q �

�� �S�E��lqcf�A�B�Q�

S �

��� �� ��� ��� �����

E �

������ � �����i

������ � �����i

������

Notice the hyperplane matrix S is returned in the original coordinate system and allthe transformations take place internally� The remainder of this section is devotedto the synthesis of a control law which will theoretically bring about ideal sliding�

��� State�feedback Control Laws

Of the many di�erent multivariable sliding mode control structures which exist theone that will be considered here is essentially that of Ryan Corless �� and maybe described as a unit vector approach� Consider an uncertain system of the form

�x�t� � Ax�t� � Bu�t� � f�t� x� u� ����

where the function f � IR� � IRn� IRm � IRm which represents the uncertaintiesor nonlinearities satis�es the so�called matching condition� i�e�

f�t� x� u� � B��t� x� u� ����

where � � IR� � IRn� IRm � IRm and is unknown but satis�es

k��t� x� u�k � k�kuk� ��t� x� ����

where � � k� � is a known constants and ���� is a known function� The proposedcontrol law comprises two components� a linear component to stabilise the nominallinear system� and a discontinuous component� Speci�cally

u�t� � ul�t� � un�t� ���

where the linear component is given by

ul�t� � ���� �SA �!S� x�t� ����

Page 9: Sliding Mode Manual

State�feedback Sliding Mode Control �

where ! � IRm�m is any stable design matrix and � � SB� The nonlinear compo�nent is de�ned to be

un�t� � ���t� x���� P�s�t�

kP�s�t�kfor s�t� �� ����

where P� � IRm�m is a symmetric positive de�nite matrix satisfying the Lyapunov

equationP�! �!

TP� � �I ����

and the scalar function ��t� x�� which depends only on the magnitude of the uncer�tainty� is any function satisfying

��t� x� � �k�kulk� ��t� x� � �� ��� k������ �� �

where � � is a design parameter� In this equation it is assumed that the scalingparameter has been chosen so that

k����� �

It can easily be established that any function satisfying equation �� � also satis�es

��t� x� � k��t� x� u�k� � ����

and therefore ��t� x� is greater in magnitude than the matched uncertainty occurringin equation ����� It is straightforward to verify that V �s� � sTP�s guaranteesquadratic stability for the switching states s and in particular

�V � �sTs � ��kP�sk ����

This control law guarantees that the switching surface is reached in �nite timedespite the disturbance or uncertainty and once the sliding motion is attained it iscompletely independent of the uncertainty� The relationship between the controllaw in ��������� and the original description of Ryan Corless is described in x�����in ���

The following session considers the inverted pendulum from Session � and constructsthe components of the control law described in ���� � �����Session �� contl

�� Phi����

�� �L�P�Lam��contl�A�B�S�Phi�

L �

�� ��� ���� � ������ � ����

P �

���

Lam �

� ���

��

Page 10: Sliding Mode Manual

State�feedback Sliding Mode Control �

Thus far only regulation problems have been considered� In practise tracking prob�lems are often encountered whereby �usually� the output of the system is requiredto follow a pre�de�ned reference signal� One approach is to use a model�followingsliding mode control law� In this situation a state error system is formed betweenthe plant states and the ideal model states and a sliding mode �regulation�like� con�trol law is designed to force the error system to zero �x � �� in ���� In the followingsection an integral action based method is considered for output tracking�

��� Output Tracking with Integral Action

Consider the development of a tracking control law for the nominal linear system

�x�t� � Ax�t� �Bu�t� ����

y�t� � Cx�t� ����

which is assumed to be square� In addition� for convenience� assume the matrix pair�A�B� is in regular form� The control law described here utilises an integral action

methodology� Consider the introduction of additional states xr � IRp satisfying

�xr�t� � r�t�� y�t� ����

where the di�erentiable signal r�t� satis�es

�r�t� � " �r�t��R� � �

with " � IRp�p a stable design matrix and R a constant demand vector� Augmentthe states with the integral action states and de�ne

#x �

�xrx

�� ��

The associated system and input distribution matrices for the augmented system

are

#A �

� �C A

�and #B �

�B

�� ��

and assuming the pair �A�B� is in regular form� the pair � #A� #B� is in regular form�The proposed controller seeks to induce a sliding motion on the surface

S � f#x � IRn�p � S#x � Srrg � ��

where S � IRm��n�p� and Sr � IRp�p are design parameters which govern thereduced order motion� Partition the hyperplane system matrix as

n

m

S ��S� S�

� � �

and the system matrix

#A �

n

m�

#A��#A��

#A��#A��

�ln

lm

� ��

Page 11: Sliding Mode Manual

State�feedback Sliding Mode Control �

and assume � � S #B is nonsingular� If a controller exists which induces an idealsliding motion on S and the augmented states are partitioned as

#x �

�x�x�

�� ��

where x� � IRn and x� � IR

m� then the ideal sliding motion is given by

�x��t� � � #A�� � #A��M �x��t� ��#A��S

��� Sr � Br

r�t� � ��

where M � S��� S� and Br ��Ip n�p

�T� In order for the hyperplane design

methods described earlier to be valid� it is necessary for the matrix pair � #A��� #A���to be completely controllable� Necessary conditions on the original system are that�A�B�C� is completely controllable and has no invariant zeros at the origin �x � ��in ����

The development that follows mirrors the approach in x��� where ! is any stabledesign matrix� The overall control law is then given by

u � ul�#x� r� � un�#x� r� � ��

where the discontinuous vector

un�s� r� �

���c�uL� y����

P��S�x�Srr�kP��S�x�Srr�k

if S#x �� Srr

otherwise� ��

where P� is a symmetric positive de�nite matrix satisfying

P�! �!TP� � �I ���

The positive scalar function which multiplies the unit vector component can beobtained from arguments similar to those in in x���� It follows that� in terms of theoriginal coordinates

un�#x� r� � L#x� Lrr � L �r �r ����

with gains de�ned as

L � �����S #A � !S� ����

Lr � ���� �!Sr � S�Br� ����

L �r � ���Sr �� �

The parameter Sr can take any value and does not a�ect the stability of the closedloop system� One common choice is to let Sr � for simplicity� Another option�which has been found to give good results with practical applications� is to chooseSr so that at steady state the integral action states are zero in the absence of anyuncertainty �x���� in ����

This session repeats the design aircraft design study in x �� in �� which uses integralaction and a hyperplane calculated using direct eigenstructure assignment� Thesystem triple given below represents the longitudinal motion of of an aircraft at

Page 12: Sliding Mode Manual

State�feedback Sliding Mode Control ��

��� Mach and the outputs correspond to �ight path angle and pitch angle

A �

������ ��� �� ��� ����� ���� � ������ ���� �� ���� ��� ���� ��� ���

� B �

������

� �

C �

�� � �

�����

First the augmented system represented by �Aa�Ba� is constructed� The commandeigbuil is then used to form the matrix which contains the information identifyingthe eigenvector components which are to be speci�ed and the associated desiredvalues� For more details of the design and closed�loop simulations see x �� in ���

Session �� intac eigbiul and dea

�� �Aa�Ba��intac�A�B�C�

Aa �

�� ��

��

��� � �

�� ����� ��� � ���

� ���� �� ��

��

��

Ba �

�� nocomp���

�� specent�eigbuil�����nocomp�

Eigenvector � �Real Part�

Enter position of specified entry � to terminate�

Followed by the value of specified entry

Enter position �

Enter associated value

Enter position �

Enter associated value �

Enter position

���������������������������������������������������

Page 13: Sliding Mode Manual

State�feedback Sliding Mode Control ��

Eigenvector � �Imaginary part�

Enter position of specified entry � to terminate�

Followed by the value of specified entry

Enter position �

Enter associated value

Enter position �

Enter associated value �

Enter position

���������������������������������������������������

Eigenvector �

Enter position of specified entry � to terminate�

Followed by the value of specified entry

Enter position �

Enter associated value �

Enter position �

Enter associated value

Enter position �

Enter associated value

Enter position

���������������������������������������������������

Eigenvector �

Enter position of specified entry � to terminate�

Followed by the value of specified entry

Enter position �

Enter associated value

Enter position �

Enter associated value �

Enter position

���������������������������������������������������

Eigenvector �

Enter position of specified entry � to terminate�

Followed by the value of specified entry

Enter position �

Enter associated value �

Enter position �

Enter associated value

Page 14: Sliding Mode Manual

State�feedback Sliding Mode Control ��

Enter position �

Enter associated value

Enter position

���������������������������������������������������

specent �

NaN NaN NaN NaN NaN

NaN NaN NaN NaN NaN

� �

� NaN �

NaN � NaN

NaN NaN NaN NaN NaN

NaN NaN NaN NaN NaN

�� lambda����� �� �� �� ���

lambda �

��� �� �� �� ��

�� �S�V��dea�Aa�Ba�specent�lambda���

S �

�� ��� ����� ��� ���� ��� ���

���� ����� �� �� ���� ���� ���� ����

V �

�� �� ��� ���� ���� ����

���� ���

� ���� ����

� � � ����� � �����

� ��� � ����� ��� �����

������ ������ ���� � �� ����

� �� ����� ���� ����� �� �

��

The vector V represents the achieved eigenstructure� Notice when only two elementshave been speci�ed in an eigenvector the requirements have been achieved exactly�This is not the case for the two eigenvectors in which three elements were speci�ed�This is to be expected as a maximum of m entries can be speci�ed exactly�

The associated control law which includes feed�forward terms for both the referenceand its derivative can be obtained as shown below� The hyperplane is �rst scaledso that � � I� and the two range�space poles are selected to be at ���

Session �� contlia

�� S�inv�S�Ba��S

S �

Page 15: Sliding Mode Manual

State�feedback Sliding Mode Control �

��� ��� ����� ��� ����� �

��� ���� ���� �� ���� �

�� �L�Lr�Lrdot�Sr�Lam�P��contlia�A�B�C�S����eye����

L �

����� ����� � �� �� ���� �� �� �

��� ����� ���� ��� � ����� ��� ���

Lr �

�� � ��

� � � �

Lrdot �

����� ��

� � ���

Sr �

����� ��

� � ���

Lam �

P �

��

��

��

The following session reconstructs the case study from Chapter � in �� and designsa state feedback output tracking controller utilising integral action for the furnacesystem linearisation

A �

��������� ���� ��� ������� ����� ��� �

����� ���� ������ �������� ����� ������ �� ��

� B �

����

����

� ��� � ��

C �

����� ����� ����� ���

����� ������ ������ ��

�����

The robust pole placement method has been chosen for the design of the switchingfunction� Once the matrix S has been calculated the �feedback� gain matrix M iscomputed �this is easily accomplished in this case since the system is in regular form�and the system matrix governing the reduced order sliding motion �A�� � A��M �is formed� The condition number of the associated eigenvectors is also computedpurely for pedagogical purposes to verify that a robust design has been achieved�

Page 16: Sliding Mode Manual

State�feedback Sliding Mode Control ��

Session � intac and rpp

�� sp����� ���� ��������j ��������j��

�� �Aa�Ba��intac�A�B�C��

�� S�rpp�Aa�Ba�sp�

place� ndigits� ��

S �

��� �� ������ ������ � ��

�� ��� ����� ����� � �

�� M�inv�S���������S�������

M �

�� ��� ����� �����

���� ��� ����� �����

�� A���Aa���������

A�� �

���� ���

��� � ��

���� ���

�� �����

�� A���Aa���������

A�� �

��� ���

���� ��

� ��

�� �

�� eig�A���A���M�

ans �

���

����

���� � ��i

���� � ��i

�� �V�D��eig�A���A���M��

�� cond�V�

ans �

������

��

The condition number of the eigenvectors is reasonably small indicating that thedesign is relatively robust with respect to unmatched uncertainty�

Page 17: Sliding Mode Manual

Output Based Hyperplane Design ��

Up to this point it has been assumed that all the states are available for use in thecontrol law� This hypothesis will be dropped in the remaining sections�

� Output Based Hyperplane Design

Consider the linear system in ��� and suppose that only the measured outputs

y�t� � Cx�t� ����

where C � IRp�n are available� One strategy is to restrict the class of slidingsurfaces and control laws to those which require only output information� Recentwork has isolated the class of systems for which this approach is applicable and adesign framework has been proposed for synthesising appropriate sliding surfacesand control laws �x�� in ���� Here the case when there are more outputs thaninputs is considered since� in the square case� no design freedom exists in terms ofselecting the dynamics of the sliding motion� Two assumptions will be made�

A�� the Markov parameter CB is full rank

A�� any invariant zeros of �A�B�C� are in the C�

These assumptions will be central to the output feedback based sliding mode controland observer methods used here� The following lemma provides a canonical formfor the system triple �A�B�C� which will be used in the subsequent analysis�

Lemma � Let �A�B�C� be a linear system with p � m and rank �CB� � m� Then

a change of coordinates exists so that the system triple with respect to the new

coordinates has the following structure�

a� the system matrix can be written as

A �

�A�� A��

A�� A��

�where A�� � IR

�n�m���n�m� ����

and the sub�block A�� when partitioned has the structure

A�� �

�� Ao

�� Ao��

Ao��

Am��

Ao�� Am

��

� ����

where Ao�� � IR

r�r� Ao�� � IR

�n�p�r���n�p�r� and Ao�� � IR

�p�m���n�p�r�

for some r � and the pair �Ao��� A

o��� is completely observable� Further�

more the invariant zeros of the system are the r eigenvalues of Ao���

b� the input distribution matrix has the form

B �

�B�

�where B� � IR

m�m and is nonsingular ���

Page 18: Sliding Mode Manual

Output Based Hyperplane Design ��

c� the output distribution matrix has the form

C �� T

�where T � IRp�p and is orthogonal ����

Example

The following session considers the inverted pendulum example from ���� and as�sumes that only the �rst three states are measured� This session considers a changeof coordinates which puts the system triple into the output�feedback canonical form�

Session �� outfor

�� �Ac�Bc�Cc�Tc�r��outfor�A�B�C�

Ac �

����� ����� �����

� ��� �

� � � ��� �����

Bc �

����

Cc �

��

��

Tc �

��� � �

��

��

r �

��

Notice r � which indicates that the system �A�B�C� does not have any invariantzeros�

Under the premise that only output information is available� the switching functionmust be of the form

s�t� � FCx�t� ����

Page 19: Sliding Mode Manual

Output Based Hyperplane Design ��

where F � IRm�p� Suppose a controller exists which induces a stable sliding motionon the surface

S � fx � IRn � FCx � g ����

For a unique equivalent control� to exist the matrix FCB � IRm�m must have fullrank� this implies that rank�CB� � m since rank�F � � m� Therefore in all theanalysis which follows it can be assumed without loss of generality that the systemis already in the canonical form of Lemma �� Let

p�m

m�

F� F��� FT

�� �

then the matrix which de�nes the switching function can be written as

FC ��F�C� F�

�where

C� ���p�m���n�p� I�p�m�

�����

In this way FCB � F�B� and in particular the square matrix F� is nonsingular�The canonical form of Lemma � can be viewed as a special case of the �regular form�normally used in sliding mode controller design and therefore arguing as in x��� thereduced order sliding motion is governed by a free motion with system matrix

As�� � A�� �A��F

��� F�C� ����

De�ne K � F��� F� then the problem of designing a suitable hyperplane is equivalentto an output feedback problem for the system �A��� A��� C��� It is well establishedthat invariant zeros play an important part in the sliding motion and� in particular�any invariant zeros of �A�B�C� must appear in the sliding mode dynamics whenonly output information is used� Intuitively� if the original system has invariantzeros then by Lemma � the eigenvalues of Ao

�� must appear in the spectrum of As��

and so the poles of A�� � A��KC� cannot be assigned arbitrarily by choice of K�To this end partition the matrices A�� and Am

�� as

A�� �

�A���

A���

�and Am

�� �

�Am���

Am���

�����

where A��� � IR�n�m�r��m and Am

��� � IR�n�p�r���p�m� and form a new sub�system

represented by the triple � #A��� A���� #C�� where

#A�� �

�Ao�� Am

���

Ao�� Am

��

�and #C� �

��p�m���n�p�r� I�p�m�

�����

As a result it can be shown that the spectrum of As�� contains the invariant zeros

of �A�B�C� and in particular

��A�� � A��KC�� � ��Ao��� �� #A�� �A���K #C�� ����

�For comprehensive details see Chapter � in Utkin ����

Page 20: Sliding Mode Manual

Output Based Hyperplane Design ��

It follows directly that for a stable sliding motion the invariant zeros of the system�A�B�C� must lie in the open left half plane and the triple � #A��� A���� #C�� mustbe stabilisable with respect to output feedback�� It can be shown that if the pair�A�B� is completely controllable then the pair � #A��� A���� is completely control�lable� the pair � #A��� #C�� is completely observable by construction and thus if thetriple � #A��� A���� #C�� satis�es the Kimura�Davison conditions� output feedback poleplacement methods can be used to place the poles appropriately�

It is well established in the static output feedback literature that if the Kimura�Davison conditions are not satis�ed by the nominal triple� the system can be aug�mented by an appropriately dimensioned compensator� Speci�cally let

�xc�t� � Hxc�t� �Dy�t� ���

where the matrices H � IRq�q and D � IRq�p are to be determined� De�ne a newhyperplane in the augmented state space� formed from the plant and compensatorstate spaces� as

Sc � f�x� xc� � IRn�q � Fcxc � FCx � g ����

where Fc � IRm�q and F � IRm�p� De�ne D� � IR

q��p�m� and D� � IRq�m as�

D� D�

�� DT ����

If the the input distribution matrix is partitioned conformably as

A��� �

�A����

A����

�ln�p�r

lp�m����

then it can be shown �x��� in ��� that a parametrisation of the compensator is

H � Ao�� � LoAo

�� �� �

D� � Am��� � LoAm

�� � �Ao�� � LoAo

���Lo ����

D� � A���� � LoA���� ����

where Lo � IR�n�p�r���p�m� is any gain matrix so that Ao�� � LoAo

�� is stable�Let K be any state feedback matrix for the controllable pair � #A��� A���� so that#A�� �A���K is stable and partition the state feedback matrix so that

n�r�p

p�m�

K� K�

�� K

����

and de�ne

K � K� � K�Lo ����

Kc � K� ����

If r � de�ne a new dynamical system by

�zr�t� � Ao��zr�t� � Ao

��xc�t� � �Am��� �Ao

��Lo�x���t� �A���x��t� ���

�The phrase �stabilisable with respect to output feedback� will indicate that for the linear system�A�B�C� there exists a �xed gain K such that the matrix A� BKC is stable�

Page 21: Sliding Mode Manual

Output Based Hyperplane Design �

and augment ��� with ��� to form a new compensator

��xc�t� � �H�xc�t� � �Dy�t� ����

where

�H �

�Ao�� Ao

��

H

�and �D �

��Am

��� �Ao��L

o� A���

D� D�

�TT

If

�x �

��xcTTy

�����

then the sliding surface Sc can be written as f�x � IRn � S�x � g where

S � F��m�r Kc K Im

�����

A control law to induce a sliding motion on the sliding surface Sc is given by

u�t� � L�x�t� � un�t� �� �

where L is de�ned in x��� of �� and un�t� is the scaled unit�vector law in �����

Example

The following session calculates a compensator based output dependant slidingmode controller� The canonical form from Session � underpins the synthesis andthe speci�ed poles obtained from Session � are used to specify part of the slidingmode dynamics�

Session � comrobs

�� �Hhat�Dhat�S�L�P��comrobs�A�B�C�

Enter � pole for the error dynamics ��

Enter � pole for sliding motion ��������������j �������������j �������

Enter � pole for the range space dynamics ��

place� ndigits� ��

place� ndigits� ��

Hhat �

��

Dhat �

������ ��� �

S �

��� ����� ������ �

L �

� ���� ��� ��� ����� � �����

Page 22: Sliding Mode Manual

Sliding Mode Observers ��

P �

���

��

This example is consider in greater detail in x����� in ���

� Sliding Mode Observers

Despite fruitful research and development activity in the area of variable structurecontrol theory� relatively few authors have considered the application of the un�derlying principles to the problem of observer design� Consider the nominal linearsystem subject to a class of uncertainty described by

�x�t� � Ax�t� �Bu�t� �D��t� y� u� ����

y�t� � Cx�t� ����

where A � IRn�n� B � IRn�m� C � IRp�n� D � IRn�q with q � p n and thematrices B�C and D are of full rank� The function ��t� y� u� is assumed to beunknown but bounded by a known function� It is further assumed that the statesof the system are unknown and only the signals u�t� and y�t� are available�

The objective is to synthesise an observer to generate a state estimate �x�t� suchthat the error

e�t� � �x�t� � x�t� ����

tends to zero despite the presence of the uncertainty� Furthermore the intention isto induce a sliding motion on the surface in the error space

So � fe � IRn � Ce � g ����

The particular observer structure that will be considered can be written in the form

��x�t� � A�x�t� �Bu�t� � GlCe�t� � Gn� ����

where Gl� Gn � IRn�p are appropriate gain matrices and � represents a discontinu�

ous switched component to induce a sliding motion on So�

Consider the dynamical system given in ���� and ���� and assume that

� rank�CD� � q

� the invariant zeros of �A�D�C� lie in the C��

It can be shown �x����� in ��� that under these assumptions there exists a linearchange of coordinates x �� Tx such that in the new coordinate system

�x��t� � A��x��t� � A��x��t� �B�u�t� ���

�x��t� � A��x��t� � A��x��t� �B�u�t� �D���t� y� u� ����

y�t� � x��t� ����

Page 23: Sliding Mode Manual

Sliding Mode Observers ��

where x� � IR�n�p�� x� � IRp and the matrix A�� has stable eigenvalues� Thefreedom of choice associated with A�� depends on the number of invariant zeros of�A�B�C�� The coordinate system above will be used as a platform for the designof a sliding mode observer� Consider a dynamical system of the form

��x��t� � A���x��t� �A���x��t� �B�u�t�� A��ey�t� ����

��x��t� � A���x��t� �A���x��t� �B�u�t�� �A�� �As���ey�t� � kD�k� �� �

�y�t� � �x��t� ����

where As�� is a stable design matrix and ey � �y � y� The discontinuous vector � is

de�ned by

� �

����t� y� u� P�ey

kP�eykif ey ��

otherwise����

where P� � IRp�p is a Lyapunov matrix for As

�� satisfying

P�As�� � �A

s���

TP� � �I ����

and the scalar function ��t� y� u� is chosen so that

k��t� y� u�k ��t� y� u� ����

If the state estimation errors are de�ned as e� � �x� � x� and e� � �x� � x� then itis straightforward to show

�e��t� � A��e��t� ����

�ey�t� � A��e��t� �As��ey�t� � kD�k� �D���t� y� u� ���

Furthermore the nonlinear error system in ���� � ��� is quadratically stable and asliding motion takes place on the surface So de�ned in ����� The dynamical systemin ���� � ���� may thus be regarded as an observer for the system in ���������� Itfollows that if the linear gain

Gl � T���

A��

A�� �As��

�����

and the nonlinear gain

Gn � kD�kT��

�Ip

�����

then the observer given in ���� � ���� can be written in terms of the original coor�dinates in the form of �����

Example

The following session places the aircraft system

A �

������

�� ���� �� � ��� �� � ��� ����

���� ����� ��� ����� �� ���

Page 24: Sliding Mode Manual

Sliding Mode Observers ��

B �

������

��� �������� �������

� C �

���� � �� � � �

from x����� in �� in the canonical form for observer design under the assumptionthat the matrix which distributes the uncertainty is D � B�

Session ��� obsfor

�� �Ac�Bc�Cc�Tc��obsfor�A�B�C�

Enter � desired stable sliding mode pole�s� ��

place� ndigits� ��

Ac �

�� ����� �� ������� �����

�� ����� ��� �� �

����� �� � � � �� ���

��� � ��� ��� ���� ���

Bc �

���� ���

��� ����

� �

Cc �

� �

Tc �

����� �� ������ �����

� ��

� �

��

Notice in this example because no invariant zeros are present the dynamics associ�ated with the upper left element �which govern the sliding motion� can be placedarbitrarily�

The next session uses the same example and computes the observer gains fromequations ���� and �����

Page 25: Sliding Mode Manual

Sliding Mode Observers �

Session ��� disobs

�� �Gl�Gn�P��disobs�A�B�C�

Enter � desired stable sliding mode pole�s� ��

place� ndigits� ��

Enter � output estimation error pole�s� ��� ���� ��� ���

Gl �

� �

��� �� ���� ��

�� � ���� �� ���

� ��� ��� ���� ���

���� � ���� ��

Gn �

�� ��

� �� �� ������

�� ��

� �� ��

� � �� ������

P �

���

����

����

�� eig�A�Gl�C�

ans �

��

��

���

����

��

��

Another observer� introduced by Walcott �Zak ��� considers the special case whenthe uncertainty is matched i�e� when D � B� They propose the observer structuregiven by

�z�t� � Az�t� � Bu�t� �GCe�t� � B�o ����

where z represents an estimate of the true states x� and e � z � x is the stateestimation error� The output error feedback gain matrix G is chosen so that theclosed loop matrix A� � A�GC is stable and has a Lyapunov matrix P satisfying

Page 26: Sliding Mode Manual

Sliding Mode Observers ��

bothPA� � AT

� P � �Q �� �

for some positive de�nite design matrix Q and the structural constraint

PB � CTFT ����

for some nonsingular matrix F � IRm�p� The discontinuous vector �o is given by

�o �

���o�t� y� u�

FCekFCek if Ce ��

otherwise����

where �o�t� y� u� is a scalar function which bounds the uncertainty� The observergiven in ���� may be viewed as a Luenberger observer with an additional nonlinearterm� It can be shown �x�� in ��� that assumptions A� and A� relating to thetriple �A�B�C� are necessary and su�cient conditions for the existence of such anobserver which is insensitive to matched uncertainty and induces a sliding motionon

Sw � f e � IRn � FCe � g ����

The original formulation of Walcott �Zak required the use of symbolic manipu�lation to synthesise the matrices G and P which completely de�ne the observer�More recently an analytic solution has been proposed based on the canonical formdescribed in ��������� An appropriate choice of G is that given in ���� and anappropriate choice of

F � �P�B��T ����

This session considers the same example as Session �� but this time computes aWalcott� �Zak observer�Session ��� wzobs

�� �G�F��wzobs�A�B�C�

Enter � desired stable sliding mode pole�s� ��

place� ndigits� ��

Enter � desired output estimation error pole�s� ��� ����� ��� ���

G �

� �

��� �� ���� ��

�� � ����� �� ���

� ��� ��� ���� ���

���� �� ���� ��

F �

� � ��� ��

�� ����� �

��

Page 27: Sliding Mode Manual

Sliding Mode Observers ��

In the special case of a square system an even more explicit solution can be obtained�This does not require the attainment of the canonical form ��� � ���� explicitly andin certain circumstances produces an observer with better numerical properties�

This �nal session consider the furnace system from ���� and computes a Walcott��Zak observer as in x��� in ��� The observer is computed in two ways� �rst usingthe square system approach and secondly using the generic method� The numericalproperties of the two resulting error systems are compared�

Session ��� sqobs

�� �G�F��sqobs�A�B�C�

Enter � real stable poles for the output error system ��� ���

G �

���� �����

��� �����

����� �����

���� ����

F �

�� �

�� ���

�� �V�D��eig�A�G�C��

�� cond�V�

ans �

���� �

�� �G�F��wzobs�A�B�C�

The system has � stable invariant zero�s�

Enter � desired output estimation error pole�s� ��� ���

G �

���� �����

��� �����

����� �����

���� ����

F �

�� �

�� ���

�� �V�D��eig�A�G�C��

�� cond�V�

Page 28: Sliding Mode Manual

Summary ��

ans �

���� �

��

It can be seen that the square system approach has in this case furnished eigenvec�tors with better conditioning�

� Summary

This document has described a collection ofMatlab m�les which have been devel�oped to design sliding mode controllers for linear systems with bounded nonlinearuncertainty� The algorithms are described in detail elsewhere and indeed this doc�ument is best viewed as an addendum to ��� Here the emphasis is on describingthe software and providing examples of its use�

References

�� C� Edwards and S�K� Spurgeon� Sliding Mode Control� Theory and Applications�Taylor Francis� �����

�� U� Itkis� Control Systems of Variable Structure� Wiley� New York� �����

�� E�P� Ryan and M� Corless� Ultimate boundedness and asymptotic stability of aclass of uncertain dynamical systems via continuous and discontinuous control�IMA Journal of Mathematical Control and Information� ������� �� ��� �

� V�I� Utkin� Variable structure systems with sliding modes� IEEE Transactions

on Automatic Control� ����������� �����

�� V�I� Utkin� Sliding Modes in Control Optimization� Springer�Verlag� Berlin������

�� B�L� Walcott and S�H� �Zak� Combined observer�controller synthesis for uncer�tain dynamical systems with applications� IEEE Transactions on Systems� Man

and Cybernetics� ������� � �����

Page 29: Sliding Mode Manual

� Appendix Toolbox Commands

comrobs

Purpose

To generate a compensator based output sliding mode controller

Syntax

Hhat�Dhat� S� L� P� Lam� T ��comrobs�A�B�C�

Description

Generates a compensator and the associated components of the slidingmode control law for the triple �A�B�C�� In order for this to be possibleconditions A� and A� need to be satis�ed� These are checked during theexecution� If n� m� p and r are the number of states� inputs� outputs andinvariant zeros respectively� then� provided the approach is applicable� theuser is prompted to supply three vectors�

� an n � p � r dimensional vector which represents the poles of theestimation error system� �In the notation of x�� the speci�ed polesare assigned to the matrix H from �� � via pole placement��

� an n �m � r dimensional vector which constitute the poles of thesliding motion� �In the notation of x�� the gain matrixK is computedso that the eigenvalues of � #A�� � A���K� are the speci�ed values��

� anm dimensional vector which will be used to assign the poles whichgovern the range space dynamics� �In the notation of x�� the matrix! will be built from the speci�ed poles��

The matrices Hhat� Dhat which are returned are the compensators� stateand input distribution matrices respectively� S is the matrix which de�nesthe switching function� L is the linear feedback component in the controllaw� P is a Lyapunov matrix which scales the switching function andLam represents the gain which pre�multiplies the unit vector componentin the nonlinear control� The orthogonal matrix T is obtained from thecanonical form for output feedback design from x� and is used to scale theoutputs�

Algorithm

First the canonical form for output feedback design is obtained and thecomponents that constitute the triple � #A��� A���� #C�� are identi�ed� Areduced order linear observer structure is then obtained in conjunctionwith a state feedback gain for the pair � #A��� A����� This e�ectively pa�rameterises both the compensator matrices and the switching function�The approach is described in detail in x�� in ���

Page 30: Sliding Mode Manual

Appendix� Toolbox Commands ��

contl

Purpose

This assembles the components of the state feedback unit vector controllaw

Syntax

L�P� Lam��contl�A�B� S� Phi�

Description

The pair �A�B� constitutes the state and input distribution matrices of thesystem and S represents a previously designed matrix which de�nes theswitching function� If the system has m inputs� then Phi is a stable m�mmatrix which will govern the linear part of the range space dynamics� Thefunction returns a matrix L which constitutes the linear state feedbackcomponent of the control law� the matrix Lyapunov matrix P which scalesthe hyperplane and Lam which is the gain which pre�multiplies the unitvector component in the nonlinear control law�

Algorithm

The control law is the unit vector control structure of Ryan Corless ���Details of the components are given in ���������� The justi�cation of theformula appears in x����� in ���

Page 31: Sliding Mode Manual

Appendix� Toolbox Commands �

contlia

Purpose

This assembles the components of the state feedback unit vector controllaw in the case when integral action is employed for tracking purposes

Syntax

L�Lr� Lrdot� Sr� Lam�P ��contlia�A�B�C�S� Phi� Sr�L�Lr� Lrdot� Sr� Lam�P ��contlia�A�B�C�S� Phi�

Description

The triple �A�B�C� constitutes the state� input and output distributionmatrices of the system� The matrix S represents a previously designedmatrix which de�nes the augmented state component of the switchingfunction and the parameter Sr represents the reference dependant com�ponent of the switching function� If the system has m inputs then Phi is astable m�m matrix which will govern the linear part of the range spacedynamics� The function returns the controller parameters in the casewhere integral action is employed to provide tracking and all the statesare available for use in the control law� L represents the linear augmentedstate feedback gain and Lr and Ldot represent feed�forward gains for thereference and derivative of the reference respectively� The symmetric posi�tive de�nite matrix P is the Lyapunov matrix which scales the hyperplaneand Lam is the gain associated with the unit vector component�If only �ve right hand arguments are supplied the reference dependantcomponent of the switching function Sr is calculated so that� in the nom�inal case� the steady state value of the integral action states tend to zero�

Algorithm

The control law is the unit vector control structure described in � ����� ��Details of the construction� particularly with regard to the choice of Sr �is given in x���� in ���

See also

dea� lqcf� rpp

Page 32: Sliding Mode Manual

Appendix� Toolbox Commands ��

dea

Purpose

Hyperplane design using so�called direct eigenstructure assignment � i�e�specifying both the sliding mode poles and elements of the associatedeigenvectors

Syntax

S�dea�A�B� specent� lambda�S� V ��dea�A�B� specent� lambda�S�dea�A�B� specent� lambda� nocomp�S� V ��dea�A�B� specent� lambda� nocomp�

Description

The pair �A�B� constitutes the state and input distribution matrices of thesystem� When four right hand arguments are supplied� the vector lambdarepresents the n�m speci�ed sliding mode eigenvalues which must be real�n and m represent the number of states and inputs respectively�� Then� �n�m� matrix specent indicates the position and value of the desiredeigenvector entries� Elements of the eigenvector which can take arbitraryvalues are indicated by NaN�s� Thus the �rst column of specent is thedesired eigenvector associated with the �rst element in lambda etc� Thefunction returns the matrix S which de�nes the switching function� If twoleft hand arguments are provided an n��n�m� matrixV is returned whichrepresents the attained eigenvectors� If complex eigenvalues are desired��ve right hand arguments must be supplied and the scalar nocomp de�nesthe number of pairs of complex conjugate poles� Again the vector lambdade�nes the desired sliding mode poles� the �rst �i � � �i � �� nocomp�entries contain the real parts of the complex conjugate poles and the�rst �i �i � �� nocomp� contain the imaginary parts� Likewise the �rst�i � � �i � �� nocomp� columns of specent are associated with the realparts of the complex eigenvectors and the �rst �i �i � �� nocomp� areassociated with the imaginary parts�

Algorithm

The algorithm is that described in Appendix B�� in ��� For implemen�tation purposes� the variable specpos in Appendix B�� is obtained fromspecent by interrogating the user about the speci�ed elements using theMatlab command isnan�

See also

eigbuil

Page 33: Sliding Mode Manual

Appendix� Toolbox Commands ��

disobs

Purpose

Calculates the gains of a sliding mode observer which is insensitive to aparticular class of uncertainty

Syntax

Gl�Gn� P���disobs�A�D�C�

Description

The pair �A�C� represents the state and output distribution matrix ofthe system and D represents a distribution matrix which describes thechannels in which the uncertainty occurs� It is assumed that if n and prepresent the number of states and outputs respectively� then D is n� qwhere q � p� The function returns the linear gain Gl and non�linear gainGn along with the Lyapunov matrix P� which constitutes a discontinuousobserver� For the theory to be valid both C and D should be full rank�the Markov parameter CD must be full rank and any invariant zeros oftriple �A�D�C� must lie in the C�� During the computations a prompt isgiven for a vector of dimension n� p� r where r the number of invariantzeros of �A�D�C�� This vector speci�es the desired stable poles of thesliding motion� In addition the user is prompted for p stable real poleswhich form part of the state estimation error dynamics�

Algorithm

The function puts the given system in the canonical form for observerdesign described in ��������� The gains are constructed from equations���� and ���� and from solving the Lyapunov equation ����� For detailssee x��� in ���

See also

sqobs� wzobs

Page 34: Sliding Mode Manual

Appendix� Toolbox Commands ��

eigbuil

Purpose

Forms the matrix which determines the speci�ed components within eacheigenvector for use in the design of a hyperplane by direct eigenstructureassignment

Syntax

specent�eigbuil�n�m�specent�eigbuil�n�m� nocomp�

Description

The scalar n is the size of the state space vector and m is the number ofinputs� If three right hand arguments are presented then nocomp is thenumber of complex pairs of eigenvalues that make up the desired polesfor the sliding motion� The function returns a matrix of size n� �n�m�whose columns indicate the position and value of the speci�ed elementsin the associated eigenvector� The user is prompted for the position andvalues of the speci�ed entries eigenvector by eigenvector� The remainingentries in the appropriate columns of specent are �lled automatically byNaN�s�

See also

dea

Page 35: Sliding Mode Manual

Appendix� Toolbox Commands �

intac

Purpose

Calculates the augmented state and input distribution matrices for de�signing a control law incorporating integral action

Syntax

Aa�Ba��intac�A�B�C�

Description

For the system represented by the triple �A�B�C� the augmented stateand input distribution matrices Aa and Ba as in � ��� If this approach isnot applicable because of the presence of any invariant zeros of �A�B�C� atthe origin� empty matrices are returned and an appropriate error messageis displayed�

See also

contlia

Page 36: Sliding Mode Manual

Appendix� Toolbox Commands ��

lqcf

Purpose

Hyperplane design using a quadratic cost function

Syntax

S�lqcf�A�B�Q�S�E��lqcf�A�B�Q�

Description

For a given system represented by the state and input distribution ma�trices �A�B� the function returns a matrix S which de�nes the switchingfunction by minimising the cost function

J �

Z �

ts

xTQxdt

where Q is a symmetric positive de�nite matrix of the same order asthe state space and ts is the time at which the sliding motion begins�In the coordinates of the regular form� and thinking of the hyperplanedesign problem as a state feedback problem for a certain subsystem� thequadratic minimisation problem becomes a conventional well�posed LQRproblem which can be solved using the standard control system toolboxroutines�

Algorithm

Regular form is �rst established and a further series of transformationsestablishes the cost function ���� and the reduced order system matrix����� In this form the problem becomes a standard Linear QuadraticRegulator problem which is solved using the routines from the ControlSystem Toolbox� Details are given in x � �� in ���

Page 37: Sliding Mode Manual

Appendix� Toolbox Commands ��

obsfor

Purpose

Performs the necessary state transformations to put a system triple intothe canonical form for observer design

Syntax

Ac�Dc�Cc� T c��obsfor�A�D�C�

Description

Here the matrices A and C represent the state and output distributionmatrices respectively and D is a matrix which describes the channelsin which the uncertainty acts� The function returns the nominal triple�A�D�C� in the canonical form used in the construction of the observergains given in ��������� In order for this to be possible CD must befull rank and any invariant zeros of the triple �A�D�C� must be in theC�� Checks are made during the execution of the function to verify theseconditions� If the number of columns of D is less than the number ofrows of C then some �exibility exists in choosing the eigenvalues of thesliding motion� In this case the user is prompted to supply an appropriatenumber of stable poles� The state transformation matrix to induce thisform is given in Tc�

Algorithm

The canonical form for output feedback sliding mode control is �rst estab�lished� A further transformation using all the available degrees of freedomis made to achieve the canonical form in ��������� For further details seex����� in ���

Page 38: Sliding Mode Manual

Appendix� Toolbox Commands ��

outfor

Purpose

Performs the necessary state transformation to put a system triple intothe canonical form for output feedback design

Syntax

Af�Bf�Cf� T can� r��outfor�A�B�C�

Description

For the system represented by the triple �A�B�C� the function computes�where possible� the canonical form for output feedback design� This re�quires that assumptions A� and A� are valid� If these are found not tohold then the function returns empty matrices� The variable r representsthe number of invariant zeros of the system �A�B�C�� The matrix Tcanrepresents the coordinate transformation necessary to bring about thecanonical form�

Algorithm

Details of the state�space transformations are given in x�� in ���

See also

comrob

Page 39: Sliding Mode Manual

Appendix� Toolbox Commands ��

regfor

Purpose

Transforms a given state and input distribution matrix into regular form

Syntax

A��� A��� B�� T r��regfor�A�B�

Description

For the system with state and input distribution matrices A and B thefunction returns the sub�matrices and the orthogonal transformation ma�trix that brings about the regular form described in ���������

Algorithm

A QR factorisation is �rst obtained for the input distribution matrix �the required transformation is then obtained by reordering the rows� Theapproach is described in more detail in x �� in ���

Page 40: Sliding Mode Manual

Appendix� Toolbox Commands ��

rpp

Purpose

Hyperplane design using pole placement with robust eigenstructure as�signment

Syntax

S � rpp�A�B� sp�

Description

For the system represented by the state and input distribution matricesA and B the function calculates the matrix S which de�nes the switchingfunction using robust eigenstructure assignment� If n and m representthe number of states and inputs respectively then sp is a vector of ordern�m containing the desired eigenvalues� Any complex eigenvalues in thevector sp must appear in consecutive complex conjugate pairs and theeigenvalues cannot be placed with multiplicity greater than the numberof inputs�

Algorithm

Regular form is �rst achieved then the modi�ed pole placement commandvplace is utilised �which relies on the Control System Toolbox routineplace�� For details see Appendix B�� in ���

See also

dea

Page 41: Sliding Mode Manual

Appendix� Toolbox Commands

sqobs

Purpose

Calculates the gain matrices for a Walcott� �Zak observer in the specialcase of a square system

Syntax

G�F ��sqobs�A�B�C�

Description

For the system represented by the triple �A�B�C� this function produces aWalcott� �Zak observer for the special case of square systems i�e� when thenumber of inputs equals the number of outputs� Necessary and su�cientconditions for the observer to exist are that assumptions A� and A� aresatis�ed� The arguments returned are the linear gain matrixG along withthe matrix F which scales the switching function� During the executionthe user is prompted for a vector of order p containing stable real poles�where p is the number of outputs�� These are assigned to form a subsetof the poles of the state estimation error system�

Algorithm

The design is made from regular form rather than from the observer canon�ical form� The explicit solution is described in x����� in ���

See also

wzobs� disobs

Page 42: Sliding Mode Manual

Appendix� Toolbox Commands �

vplace

Purpose

Performs pole placement with robust eigenstructure assignment

Syntax

K�vplace�A�B� sp�

Description

For the system represented by the state and input distribution matrix Aand B this function returns a state feedback matrix K which assigns tothe closed loop the poles contained in the vector sp� This command isa modi�cation of the control system tool box command pole placementroutine place and performs an initial transformation to remove any re�dundant columns of the input distribution matrix�

Algorithm

An initial QR factorisation of the input distribution matrix is made andany redundant columns are removed before invoking the place commandfrom the Control System Toolbox �see Appendix B�� in �� for details��

Page 43: Sliding Mode Manual

Appendix� Toolbox Commands �

wzobs

Purpose

Computes the gains for a Walcott� �Zak observer

Syntax

G�F ��wzobs�A�B�C�

Description

For the system represented by the triple �A�B�C�� this function calculatesthe gains for a Walcott� �Zak observer� Necessary and su�cient conditionsfor the observer to exist are that assumptions A� and A� are satis�ed� Thearguments returned are the linear gain matrix G along with the matrix Fwhich scales the switching function� During the computations a promptis given for a vector of dimension n�p�r where n the number of states� pis the number of outputs and r the number of invariant zeros of �A�B�C��This vector allows the user to specify the assignable poles in the top leftsub�block of the observer canonical form� The user is prompted for avector of order p containing stable real poles� These poles are assigned toform a subset of the poles of the state estimation error system�

Algorithm

The function puts the given system in the canonical form for observerdesign described in ��������� The gains are constructed from equations���� and ����� For details see x�� in ���

See also

sqobs

Page 44: Sliding Mode Manual

Appendix� Toolbox Commands �

comrobs generates a compensator based output sliding mode controller

contl assembles the components of the state feedback unit vector controllaw

contlia assembles the components of the state feedback unit vector con�trol law in the case when integral action is employed for trackingpurposes

dea hyperplane design using direct eigenstructure assignment

disobs calculates the gains of a sliding mode observer which is insensitiveto a particular class of uncertainty

eigbuil form the matrix which determines the speci�ed components withineach eigenvector for use in the design of a hyperplane by directeigenstructure assignment

intac calculates the augmented state and input distribution matrices fordesigning a control law incorporating integral action

lqcf hyperplane design using a quadratic cost function

output performs the necessary state transformations to put a system tripleinto the canonical form for observer design

obsfor performs the necessary state transformation to put a system tripleinto the canonical form for output feedback design

regfor transforms a given state and input distribution matrix into regularform

rpp hyperplane design using pole placement with robust eigenstructureassignment

sqobs calculate the gain matrices for a Walcott� �Zak observer in the specialcase of a square system

vplace pole placement with robust eigenstructure assignment

wzobs computes the gains for a Walcott� �Zak observer

Table �� Summary of Matlab commands