Sie sind auf Seite 1von 9

10/5/2016

ControlTutorialsforMATLABandSimulinkAircraftPitch:StateSpaceMethodsforControllerDesign

Tips
TIPS

ABOUT

Effects

BASICS

SearchControlTutorials

HARDWARE

INDEX

NEXT

INTRODUCTION CRUISECONTROL MOTORSPEED

http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=ControlStateSpace

1/9

10/5/2016

ControlTutorialsforMATLABandSimulinkAircraftPitch:StateSpaceMethodsforControllerDesign
SYSTEM
MODELING
ANALYSIS

CONTROL
PID

AircraftPitch:StateSpaceMethodsfor
ControllerDesign
KeyMATLABcommandsusedinthistutorialare:ss,ctrb,rank,lqr,step

Contents

ROOTLOCUS

Controllability
FREQUENCY
STATESPACE
DIGITAL

Controldesignviapoleplacement
Linearquadraticregulation
Addingprecompensation

IntheAircraftPitch:SystemModelingpage.thestatespacemodeloftheplant
SIMULINK

wasderivedas

MODELING

(1)

CONTROL

(2)

wheretheinputiselevatordeflectionangle andtheoutputistheaircraftpitch
angle .Theaboveequationsmatchthegeneral,linearstatespaceform.
(3)

(4)
Forastepreferenceof0.2radians,thedesigncriteriaarethefollowing.
Overshootlessthan10%
Risetimelessthan2seconds
Settlingtimelessthan10seconds
Steadystateerrorlessthan2%

In this page we will apply a statespace controller design technique. In


particular, we will attempt to place the closedloop poles of the system by
designing a controller that calculates its control based on the state of the
http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=ControlStateSpace

2/9

10/5/2016

ControlTutorialsforMATLABandSimulinkAircraftPitch:StateSpaceMethodsforControllerDesign

system.

Controllability
Inordertoapplyourstatespacecontrollerdesigntechniquesweneedtofirst
verify an important property, controllability. The controllability property is
necessary to guarantee that we have the authority to drive the state of the
systemanywherewelike.Thiscorrespondstotheabilitytoplacetheclosed
looppolesofthesystemanywhereinthecomplexsplane.
Forthesystemtobecompletelystatecontrollable,thecontrollabilitymatrix
(5)
musthaverankn.Therankofamatrixisthenumberofindependentrows(or
columns).Thenumberncorrespondstothenumberofstatevariablesofthe
system.Addingadditionaltermstothecontrollabilitymatrixwithhigherpowers
ofthematrixAwillnotincreasetherankofthecontrollabilitymatrixsincethese
additionaltermswilljustbelinearcombinationsoftheearlierterms.
Since our controllability matrix is 3x3, the rank of the matrix must be 3. The
MATLABcommandrankcangiveyoutherankofthismatrix.Createanewm
file and enter the following commands. Running this mfile in the MATLAB
commandwindow,willproducethefollowingoutput.

A=[0.31356.70;0.01390.4260;056.70];
B=[0.232;0.0203;0];
C=[001];
D=[0];

co=ctrb(A,B);

Controllability=rank(co)

Controllability=
3

Therefore,oursystemiscompletelystatecontrollablesincethecontrollability
matrixhasrank3.

Controldesignviapoleplacement
http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=ControlStateSpace

3/9

10/5/2016

ControlTutorialsforMATLABandSimulinkAircraftPitch:StateSpaceMethodsforControllerDesign

Theschematicofafullstatefeedbackcontrolsystemisshownbelow(withD=
0).

where
K=controlgainmatrix

x=[alpha,q,theta]'=statevector

theta_des=reference(r)

delta=theta_desKx=controlinput(u)

theta=output(y)

Referringbacktothestatespaceequationsatthetopofthepage,weseethat
substitutingthestatefeedbacklaw =

Kxfor leadstothefollowing.
(6)
(7)

Basedontheabove,matrixABKdeterminestheclosedloopdynamicsofour
system.Specfically,therootsofthedeterminantofthematrix[sI(ABK)]
aretheclosedlooppolesofthesystem.Sincethedeterminantof[sI(ABK)
]isathirdorderpolynomial,therearethreepoleswecanplaceandsinceour
systemiscompletelystatecontrollable,wecanplacethepolesanywherewe
like.RecallfromtheIntroduction: StateSpace Methods for Controller Design
page.thata"poleplacement"techniquecanbeusedtofindthecontrolgain
matrixKtoplacetheclosedlooppolesinthedesiredlocations.Notethatthis
feedback law presumes that all of the state variables in the vector x are
measured, even though is our only output. If this is not the case, then an
observerneedstobedesignedtoestimatetheotherstatevariables.
http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=ControlStateSpace

4/9

10/5/2016

ControlTutorialsforMATLABandSimulinkAircraftPitch:StateSpaceMethodsforControllerDesign

Weknowfromtheabovethatwecanplacetheclosedlooppolesofthesystem
anywhere we would like. The question then that is left is, where should we
placethem?Ifwehaveastandardfirstorsecondordersystem,wethenhave
relationships that directly relate pole locations to characteristics of the step
responseandcanusetheserelationstoplacethepolesinordertomeetour
givenrequirements.Thisprocessbecomesmoredifficultifwehaveahigher
ordersystemorzeros.Withahigherordersystem, one approach is to place
thehigherorderpoles510timesfarthertotheleftinthecomplexplanethan
thedominantpoles,therebyleadingthemtohavenegligiblecontributiontothe
transientresponse.Theeffectofzerosismoredifficulttoaddressusingapole
placement approach to control. Another limitation of this poleplacement
approach is that it doesn't explicitly take into account other factors like the
amountofrequiredcontroleffort.

Linearquadraticregulation
WewilluseatechniquecalledtheLinearQuadraticRegulator(LQR)method
to generate the "best" gain matrix K, without explicitly choosing to place the
closedloop poles in particular locations. This type of control technique
optimallybalancesthesystemerrorandthecontroleffortbasedonacostthat
thedesignerspecifiesthatdefinestherelativeimportanceofminimizingerrors
and minimimizing control effort. In the case of the regulator problem, it is
assumedthatthereferenceis zero. Therefore, in this case the magnitude of
the error is equal to the magnitude of the state. Please consult your control
textbook for details. To use this LQR method, we need to define two
parameters:thestatecostweightedmatrix(Q)andthecontrolweightedmatrix
(R).Forsimplicity,wewillchoosethecontrolweightedmatrixequalto1(R=1),
andthestatecostmatrix(Q)equaltopC'C.EmployingthevectorCfromthe
outputequationmeansthatwewillonlyconsiderthosestatesintheoutputin
defining our cost. In this case, is the only state variable in the output. The
weightingfactor(p)willbevariedinordertomodifythestepresponse.Inthis
case,Risascalarsincewehaveasingleinputsystem.
Now we are ready to find the control matrix (K) employing the MATLAB
command lqr. We will first let the weighting factor (p) equal 2. Add the
following commands to your mfile and run it in the MATLAB command
window.

p=2;
Q=p*C'*C
R=1;
http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=ControlStateSpace

5/9

10/5/2016

ControlTutorialsforMATLABandSimulinkAircraftPitch:StateSpaceMethodsforControllerDesign

[K]=lqr(A,B,Q,R)

Q=
000
000
002
K=
0.503452.86451.4142

Note the structure of the weighting matrix Q and the resulting gain matrix K.
Referringtotheclosedloopstateequationsgivenaboveassumingacontrol
lawwithnonzeroreference, =

Kx,wecanthengeneratetheclosed

loop step response by adding the following commands to your mfile and
runningitintheMATLABcommandwindow.Notethattheresponseisscaled
tomodelthefactthatthepitchanglereferenceisa0.2radian(11degree)step.
Thestepresponseshownbelowshouldthenbegenerated.

sys_cl=ss(AB*K,B,C,D);
step(0.2*sys_cl)
ylabel('pitchangle(rad)');
title('ClosedLoopStepResponse:LQR');

Examinationoftheabovedemonstratesthattheresponseistooslow.Wecan
tunetheperformanceofoursystemtobefasterbyweightingtheimportanceof
the error more heavily than the importance of the control effort. More
http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=ControlStateSpace

6/9

10/5/2016

ControlTutorialsforMATLABandSimulinkAircraftPitch:StateSpaceMethodsforControllerDesign

specifically,thiscanbedonebyincreasingtheweightingfactorp.Aftersome
trialanderror,wesettleonavalueofp=50.Modifythecodeofyourmfileas
follows and then run at the command line to produce the following step
response.

p=50;
Q=p*C'*C;
R=1;
[K]=lqr(A,B,Q,R)
sys_cl=ss(AB*K,B,C,D);
step(0.2*sys_cl)
ylabel('pitchangle(rad)');
title('ClosedLoopStepResponse:LQR');

K=
0.6435169.69507.0711

Examination of the above demonstrates that the rise time, overshoot, and
settlingtimearesatisfactory.However,thereisalargesteadystateerror.One
way to correct this is by introducing a precompensator (Nbar) to scale the
overalloutput.

Addingprecompensation
Unlikeotherdesignmethods,thefullstatefeedbacksystemdoesnotcompare
the output to the reference instead, it compares all states multiplied by the

http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=ControlStateSpace

7/9

10/5/2016

ControlTutorialsforMATLABandSimulinkAircraftPitch:StateSpaceMethodsforControllerDesign

the output to the reference instead, it compares all states multiplied by the
controlmatrix(Kx)tothereference(seetheschematicshownabove).Thus,
weshouldnotexpecttheoutputtoequalthecommandedreference.Toobtain
the desired output, we can scale the reference input so that the output does
equal the reference in steady state. This can be done by introducing a
precompensatorscalingfactorcalledNbar.Thebasicschematicofourstate
feedbacksystemwithscalingfactor(Nbar)isshownbelow.

WecaneasilyfindNbarfromtheMATLABfunctionrscale.m.Sincerscale.mis
a userdefined function, you need to copy and save the function to your
directory. For further assistance in using userdefined functions, refer to the
functionpage.Afteryouhavesavedtherscale.mfiletoyourdirectory,modify
thecodeofyourmfileasfollowsandrunitintheMATLABcommandwindow.

p=50;
Q=p*C'*C;
R=1;
[K]=lqr(A,B,Q,R);
Nbar=rscale(A,B,C,D,K)

Nbar=
7.0711

Adding the following code and rerunning your mfile will then generate the
responseshownbelow.

sys_cl=ss(AB*K,B*Nbar,C,D);
step(0.2*sys_cl)
ylabel('pitchangle(rad)');
title('ClosedLoopStepResponse:LQRwithPrecompensation');
http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=ControlStateSpace

8/9

10/5/2016

ControlTutorialsforMATLABandSimulinkAircraftPitch:StateSpaceMethodsforControllerDesign

Nowthesteadystateerrorhasbeeneliminatedandalldesignrequirements
aresatisfied.
NotethattheprecompensatorNbar employed above is calculated based on
themodeloftheplantandfurtherthattheprecompensatorislocatedoutsideof
the feedback loop. Therefore, if there are errors in the model (or unknown
disturbances) the precompensator will not correct for them and there will be
steadystateerror.Youmayrecallthattheadditionofintegralcontrolmayalso
be used to eliminate steadystate error, even in the presence of model
uncertainty and step disturbances. For an example of how to implement
integralcontrol in the state space setting, see the DC Motor Position: State
Space Methods for Controller Design page. The tradeoff with using integral
control is that the error must first develop before it can be corrected for,
therefore, the system may be slow to respond. The precompensator on the
otherhandisabletoanticipitatethesteadystateoffsetusingknowledgeofthe
plant model. A useful technique is to combine the precompensator with
integralcontroltoleveragetheadvantagesofeachapproach.

PublishedwithMATLAB7.14

AllcontentslicensedunderaCreativeCommonsAttributionShareAlike4.0
InternationalLicense.

http://ctms.engin.umich.edu/CTMS/index.php?example=AircraftPitch&section=ControlStateSpace

9/9

Das könnte Ihnen auch gefallen