Escolar Documentos
Profissional Documentos
Cultura Documentos
Thisexampleshowshowtousenumericaloptimizationtotuningthe
OpenModel
controllerparametersofanonlinearsystem.Inthisexample,wemodela
CE152MagneticLevitationsystemwherethecontrollerisusedto
positionafreelylevitatingballinamagneticfield.Thecontrolstructureforthismodelisfixedandtherequired
controllerperformancecanbespecifiedintermsofanidealizedtimeresponse.
Earnshaw'sTheorem
Earnshaw'stheoremprovedthatitisnotpossibletoachievestablelevitationusingstatic,macroscopic,classical
electromagneticfields.HowevertheCE152systemworksaroundthisbycreatingapotentialwellaroundthepointat
whichtheballistobesuspended,therebycreatinganoninversesquarelawforce.Thisisachievedbyaninductive
coilthatgeneratesatimevaryingelectromagneticfield.Theelectromagneticfieldiscontrolledthroughtheuseof
feedbacktokeeptheballattherequiredlocation.
open_system('maglev_demo')
ModelDescription
Themagneticlevitationsystemisanonlineardynamicsystemwithoneinputandoneoutput.Doubleclickthe
MagneticLevitationPlantModeltoopenthissubsystem.Theinputvoltageisappliedtoacoilthatcreatesthe
electromagneticfield.TheoutputvoltageismeasuredbyanIRreceiverandrepresentsthepositionoftheballinthe
magneticfield.Thediagrambelowoutlinesthissystem.
Thephysicalsystemconsistsofaball(withmass0.00837kg)whichisundertheinfluenceofthreeforces:
Themagneticfieldproducedbyaninductivecoil.ThisismodeledbythePoweramplifierandcoilblockinthe
Simulinkmodel.Theinputtotheinductorisavoltagesignalandtheoutputacurrent.Theforcefromthecoil
dependsonthesquareofthecurrent,theairgapbetweenthecoilandtheball,andthephysicalpropertiesofthe
ball.Thisproducesanupwardactingforceontheball.
Thegravitationalforceactingdownwards
Adampingforcewhichactsinadirectionoppositetothevelocityatanyinstantoftime
ThesethreeforcescausetheresultingmotionoftheballandaremodeledinSimulinkasshown.
open_system('maglev_demo/MagneticLevitationPlantModel')
Nonlinearitiesarisingfromsaturationofthecoilandchangesindynamicsoutsidethelimitsofthemagneticfieldare
alsomodeledintheSimulinkModel.Astheforcefromthecoildecaysaccordingtoaninversesquarelawlarger
voltagesarerequiredthefurthertheballisfromthecoil.Thecontrolsignalisscaledtoaccountforthisandthe
scalingisincludedintheControlsignalscalingblocks.
ControlProblemDescription
Therequirementforthecontrolleristhatitbeabletopositiontheballatanyarbitrarylocationinthemagneticfieldand
thatitmovetheballfromonepositiontoanother.Theserequirementsarecapturedbyplacingstepresponsebounds
onthepositionmeasurement.Specificallywerequirethefollowingconstraintsontheball:
Positionconstraint:within20%ofthedesiredpositioninlessthan0.5second
SettlingTimeConstraint:within2%ofthedesiredpositionwithin1.5second
TomeetthecontrolrequirementsweimplementaProportionalIntegralDerivative(PID)controller.Forconveniencethe
controllerusesanormalizedpositionmeasurementwitharangefrom0to1,representingthebottommostandtop
mostpositionsoftheballrespectively.
SimulinkDesignOptimizationandnumericaloptimizationisideallysuitedtotunethePIDcoefficientsbecause:
Thesystemdynamicsarecomplexenoughtorequireeffortandtimeforanalysisifweapproachtheproblemusing
conventionalcontroldesigntechniques.
Thecontrollerstructureisfixed
Wehaveknowledgeofthestepresponsewerequirefromthesystem.
SettingConstraintValues
Giventhestepresponsecharacteristicwedesire,itissimpletospecifytheupperandlowerboundsoftheresponse.
DoubleclickthePositionConstraintblockintheMagneticLevitationPlantModelsubsystemtoview
constraintsonthepositionoftheball.Theconstraintlinesmaybemovedusingthemouse.
YoucanlaunchResponseOptimizationToolusingtheAnalysismenuinSimulink,orthesdotoolcommandin
MATLAB.YoucanlaunchapreconfiguredoptimizationtaskinResponseOptimizationToolbyfirstopeningthemodel
andbydoubleclickingontheorangeblockatthebottomofthemodel.FromtheResponseOptimizationTool,press
thePlotModelResponsebuttontosimulatethemodelandshowhowwelltheinitialdesignsatisfiesthedesign
requirements.
DefiningTunedParameters
WeselectthePIDcontrollerparameterstotunebyopeningtheDesignVariableseditor,asshownbelow
RunningtheOptimization
Afterspecifyingtheoptimizationparametersandtherequiredstepresponseboundswestarttheoptimizationby
pressingtheOptimizebuttonfromtheResponseOptimizationTool.Duringoptimization,theplotsareupdatedwith
thepositionoftheballforeachiterationandthedarkcurveshowsthefinaloptimizedtrajectoryoftheball(asshown
below).
VerifyingtheResults
Oncewecompletetheoptimization,itisimportanttovalidatetheresultsagainstotherstepsizes.Asuccessful
parameteroptimizationshouldbeabletoprovidegoodcontrolforallstepssizesclosetothetunedstepsizeof1.
Stepsizesfrom.7to1shouldbetestedtoconfirmthecontroller'sperformance.Thefollowingplotshowsthe
responsetoastepinputfrom0to0.85at0.1seconds.
Conclusion
Theverificationstepshowsthatcontroller'sperformancesatisfiestherequirementsspecifiedandthetunedparameter
valuesaresuitableforcontrol.Thetunedparameterscouldbeusedtoprovidebaselineperformanceagainstwhich
othercontrolschemescanbecompared,orabaselineforcontrollersfordifferentoperatingregions.
%Closethemodel
bdclose('maglev_demo')