CTM:StateSpaceTutorial
StateSpaceTutorial
State-spaceequations
Controldesignusingpoleplacement
Introducingthereferenceinput
Obrverdesign
KeyMatlabcommandsudinthistutorial:acker,lsim,place,plot,rscale
Matlabcommandsfromthecontrolsystemtoolboxarehighlightedinred.
Non-standardMatlabcommandsudinthistutorialarehighlightedingreen.
State-spaceequations
Therearevte-spacereprentationisgivenbytheequations:
wherexisannby1vectorreprentingthestate(commonlypositionandvelocityvariablesinmechanical
systems),uisascalarreprentingtheinput(commonlyaforceortorqueinmechanicalsystems),ricesA(nbyn),B(nby1),andC(1byn)determinethe
attherearenfirst-orderdifferential
pacereprentationcanalsobeudforsystemswithmultipleinputsandoutputs(MIMO),butwewillonlyusingle-input,single-output(SISO)systemsinthetutorials.
/group/ctm/state/(第1/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
Tointroducethestatespacedesignmethod,wewilluthe
rentthrough
thecoilsinducesamagneticforcewhichcanbalancetheforceof
gravityandcautheball(whichismadeofamagneticmaterial)
elingofthissystemhasbeenestablishedinmanycontroltextbooks(includingAutomatic
,theventhedition).Theequationsforthesystemaregivenby:
wherehistheverticalpositionoftheball,iisthecurrentthroughtheelectromagnet,Vistheappliedvoltage,
Misthemassoftheball,gisgravity,Listheinductance,Ristheresistance,andKisacoefficientthat
plicity,wewillchoovaluesM=0.05Kg,K=
0.0001,L=0.01H,R=1Ohm,g=9.81m/c^tem感叹词英语 isatequilibrium(theballissuspendedin
midair)wheneverh=Ki^2/Mg(atwhichpointdh/dt=0).Welinearizetheequationsaboutthepointh=0.01m(wherethenominalcurrentisabout7amp)andgetthestatespaceequations:
where:isthetofstatevariablesforthesystem(a3x1vector),uistheinputvoltage(deltaV),and
y(theoutput),hesystemmatricesintoam-file.
A=[010
9800-2.8
00-100];
B=[0
0100];
C=[100];
Oneofthefirstt糯米粉的做法大全点心 hingsyouwanttodowiththestateequationsisfindthepolesofthesystem;thearethevaluesofswheredet(sI-A)=0,ortheeigenvaluesoftheAmatrix:
/group/ctm/state/(第2/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
poles=eig(A)
Youshouldgetthefollowingthreepoles:
poles=
31.3050
-31.3050-100.0000
Oneofthepolesisintheright-halfplane,whichmeansthatthesystemisunstableinopen-loop.
Tocheckoutwhathappenstothisunstablesystemwhenthereisanonzeroinitialcondition,addthefollowinglinestoyourm-file,
t=0:0.01:2;u=0*t;
x0=[0.00500];
[y,x]=lsim(A,B,C,0,u,t,x0);
h=x(:,2);%Delta-histheoutputofinterest
plot(t,h)andrunthefileagain.
/group/ctm/state/(第3/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
Itlookslikethedistancebetweentheballandtheelectromagnetwillgotoinfinity,butprobablytheballhitsthetableorthefloorfirst(andalsoprobablygoesoutoftherangewhereourlinearizationisvalid).
Controldesignusingpoleplacement
Let'ematicofafull-statefeedbacksystemisthefollowing:
Recallthatthecharacteristicpolynomialforthisclod-loopsystemisthedeterminantof(sI-(A-BK)).Since
thematricesAandB*Kareboth3by3matrices,gfull-state
dutheMatlabfunctionplacetofindthe
/group/ctm/state/(第4/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
controlmatrix,K,whichwillgivethedesiredpoles.
Beforeattemptingthismethod,ethe
criteriaforthecontrollerwerettlingtime<0.5candovershoot<5%,thenwemighttrytoplacethetwo
dominantpolesat-10+/-10i(atzeta=0.7or45degreeswithsigma=10>4.6*2).Thethirdpolewemight
placeat-50tostart,the
lsimcommandfromyourm-fileandeverythingafterit,thenaddthefollowinglinestoyourm-file,
p1=-10+10i;
p2=-10-10i;p3=-50;
K=place(A,B,[p1p2p3]);
lsim(A-B*K,B,C,0,u,t,x0);
Theovershootistoolarge(therearealsozerosinthetransferfunctionwhichcanincreatheovershoot;有趣的文字 you
donotethezerosinthestate-spaceformulation).Tryplacingthepolesfurthertothelefttoeifthetransientresponimproves(thisshouldalsomaketheresponfaster).
p1=-20+20i;
p2=-20-20i;p3=-100;
/group/ctm/state/(第5/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
K=place(A,B,[p1p2p3]);
lsim(A-B*K,B,C,0,u,t,x0);
tyou空桐 rtextbookforfurthersuggestionsonchoosingthedesiredclod-looppoles.
Comparethecontroleffortrequired(K)ral,thefartheryoumovethepoles,themorecontroleffortittakes.
Note:Ifyouwanttoplacetwoormorepolesatthesameposition,ua
functioncalledackerwhichworkssimilarlytoplace:
K=acker(A,B,[p1p2p3])
Introducingthereferenceinput
Now,wewilltakethecontrolsystemasdefinedaboveandapplyastepinput(wechooasmallvalueforthe
step,soweremainintheregionwhereourlinearizationisvalid).Replacet,uandlsiminyourm-filewiththefollowing,
/group/ctm/state/(第6/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
t=0:0.01:2;
u=0.001*ones(size(t));
lsim(A-B*K,B,C,0,u,t)
Thesystemdoesnottrackthestepwellatall;notonlyisthemagnitudenotone,butitisnegativeinsteadofpositive!
Recallth怎样让孩子爱上学习 eschematicabove,wedon'tcomparetheoutputtothereference;insteadwemeasureallthestates,
multiplybythegainvectorK,snoreason血压高可以喝酒吗 toexpect
thatK*inatethisproblem,wecansca华南农业大学排名 lethereferenceinputto
makeitequaltoK*x_alefactorisoftencalledNbar;itisintroducedasshowninthefollowingschematic:
/group/ctm/state/(第7/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
WecangetNbarfromMatlabbyusingthefunctionrscale(placethefollowinglineofcodeafterK=...).
Nbar=rscale(A,B,C,0,K)
ere
,ifwewanttofindtheresponofthesystemunder
statefeedbackwiththisintroductionofthereference,wesimplynotethefactthattheinputismultipliedbythisnewfactor,Nbar:
lsim(A-B*K,B*Nbar,C,0,u,t)
/group/ctm/state/(第8/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
andnowastepcanbetrackedreasonablywell.
Obrverdesign
Whenwecan'tmeasureallthestatesx(asiscommonlytheca),wecanbuildanobrvertoestimatethem,
whilemeasuringonlytheoutputy=magneticballexample,wewilladdthreenew,ematicisasfollows:
Theobrverisbasicallyacopyoftheplant;ithasthesameinputandalmostthesamedifferentialequation.
Anextratermcomparestheactualmeasuredoutputytotheestimatedoutput;thiswillcauthe
ordynamicsoftheobrveraregivenbythepolesof(A-L*C).
ewantthedynamicsoftheobrvertobemuchfaster
thanthesystemitlf,wenee销售英文怎么说 dtoplacethepolesatleastfivetimesfarthertotheleftthanthedominantpoles
nttouplace,weneedtoputthethreeobrverpolesatdifferentlocations.
op1=-100;
op2=-101;op3=-102;
Becauofthedualitybetweencontrollabilityandobrvability,wecanuthesametechniqueudtofind
thecontrolmatrix,butreplacingthematrixBbythematrixCandtakingthetransposofeachmatrix(consultyourtextbookforthederivation):
L=place(A',C',[op1op2op3])';
Theequationsintheblockdiagramabovearegivenfor
.Itisconventionaltowritethecombined
/group/ctm/state/(第9/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
equationsforthesystemplusobrverusingtheoriginalstatexplustheerrorstate:e=x-.Weuas
statefeedbacku=-littlebitofalgebra(consultyourtextbookformoredetails),wearriveatthecombinedstateanderrorequationswiththefull-statefeedbackandanobrver:
At=[A-B*KB*K
zeros(size(A))A-L*C];
Bt=[B*Nbarzeros(size(B))];
Ct=[Czeros(size(C))];
Toehowtheresponlookstoanonzeroinitialconditionwithnoreferenceinput,addthefollowinglines
callyassumethattheobrverbeginswithzeroinitialcondition,=vesusthattheinitialconditionfortheerroriqualtotheinitialconditionofthestate.
lsim(At,Bt,Ct,0,zeros(size(t)),t,[x0x0])
thatlsimgivesusxande;togetx-e.
weneedtocompute
/group/ctm/state/(第10/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
Zoomintoesomedetail:
Thebluesolidlineistheresponoftheballposition
ThegreensolidlineistheresponoftheballspeedTheredsolidlineistheresponofthecurrent
,thebluedottedlineistheestimatedstate,thegreendottedlineistheestimatedstate
.
;;
,thereddottedlineistheestimatedstate
Wecanethattheobrverestimatesthestatesquicklyandtracksthestatesreasonablywellinthesteady-state.
Theplotabovecanbeobtainedbyusingtheplotcommand.
/group/ctm/state/(第11/12页)2005-3-2320:29:37
CTM:StateSpaceTutorial
UrFeedback
Wewouldliketohearaboutsuggestionsyouhaveforimprovement,difficultiesyouha婴儿补铁 dwiththetutorials,errorsthatyoufound,edbackisanonymous.
SubmitFeedback
Ret
StateSpaceExamples
CruiControl|MotorSpeed|MotorPosition|BusSuspension|InvertedPendulumPitch
Controller|Ball&Beam
Tutorials
Basics|Modeling|PID|RootLocus|FrequencyRespon|StateSpace|DigitalControl|Examples
8/12/97CJC
/group/ctm/state/(第12/12页)2005-3-2320:29:37
本文发布于:2023-04-15 03:41:12,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/fan/89/831416.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |