1AdvancedModel-Based-SystemDesignLecture7:MultiLoopControlLecture7:Multi-LoopControlPostProcessing2Resultsfrompreviousmodel.Generatorcurrentnotcontrolledandchangeswithbatteryvoltage(whichchangedwithmotortorquerequest).Copyright2009Rose-HulmanInstituteofTechnology.2MoreControlFun•Formthelastsimulation,wenoticethatthegeneratorcurrentiswhateveritis,anditchangesasthebatteryvoltagechanges.3•Let’saddanotherfeedbacklooptocontrolthecurrent.•Notethatthethrottleincreasesordecreasestheenginepower.•Moreenginepowerproducesmoregeneratorgppgcurrent.•Lessenginepowerproduceslessgeneratorcurrent.ClassicFeedback-Again•Wecanthinkoftheresultofthesystemcreatedinlecture6asaplantwheretheinputsignalistheenginethrottleandthe4inputsignalistheenginethrottleandtheoutputisthegeneratorcurrent.•Bychangingthethrottlesignal,wecancontrolthegeneratorcurrent.Copyright2009Rose-HulmanInstituteofTechnology.3ChargingCurrentControl5•ModifytheStateflowchartasshownnext.•NotethattheEngineThrottleoutputhasbeendeletedfromStateflow.TdltSttflttilld•TodeleteaStateflowoutput,youwillneedtousetheModelExplorer.(ToolsandthenExplorefromtheStateflowmenus.)6Lineadded.Lineadded.Copyright2009Rose-HulmanInstituteofTechnology.47EngineOff–NochargeStartengine.Lineadded.Startchargingwhentheenginehasreachedtheappropriatespeed.ControllerModifications•ModificationstotheSimulinkportioncontrollerareshownonthenextslide.•Notethatwearekeepingtheproportional8pgppfeedbackloopthatholdstheenginespeedconstantat1800rpm.•Weareaddingasecondproportionalfeedbackloopthatholdsthegeneratorcurrentconstant.•Thissecondloopassumesthatthetwoloopsppareindependentandthatthefirstloopdoesholdtheenginespeedconstant.Copyright2009Rose-HulmanInstituteofTechnology.59Enlargementsofvariouspartsareshownonthenexttwoslides.10Copyright2009Rose-HulmanInstituteofTechnology.611ChargingCurrent•ThesignalforthechargingcurrentcomingoutoftheStateflowchartisastepfunction.•Toproduceacontrolledrateofchange,thedesiredcurrentsignalispassedthrougharatelimiterthat12currentsignalispassedthrougharatelimiterthathasaslewrate±50.•ThesignaloutofStateflowisasteepthatgoesfrom0to50A.•Thesignaloutoftheratelimiterisasignalthatgoesfrom0to50Ain1secondfrom0to50Ain1second.•Wewillusetheratelimitertocontroltherateatwhichthedesiredchargingcurrentchanges.Copyright2009Rose-HulmanInstituteofTechnology.7SaturationBlock•Theoutputoftheerroramplifiercanbealargesignalandeitherpositiveornegative13negative.•Wehavedefinedourthrottlesignaltobebetween0(nothrottle)and1(fullthrottle).•Thesaturationblockisusedtolimitthethrottlesignaltoappropriatevalues.•Thepropertiesofthesaturationandratelimiterblockareshownonthenextslide.ComponentSettings14•Runthesimulationandobservethethrottleandgeneratorcurrentsignals.Copyright2009Rose-HulmanInstituteofTechnology.815Constantchargingcurrent.Constantenginerpm.Oscillationinthrottlecontrol.CurrentControl•Weseealotofproblemswiththeenginethrottlesignal.•Wewilladdressthemoneatatimeandseeif16wecanfixtheproblems,orifachangeisrequiredinthedesignofthephysicalsystem.•First,wewilladdressproblemsinthethrottlesignal.Thegeneratorcurrentisconstant,butwenoticenoiseandoscillationsontheenginethrottlesignal.•Wewillreducethegainofthecurrentcontrolfeedbackloop.Copyright2009Rose-HulmanInstituteofTechnology.9ReducetheGain17Changedto0.1.(Justguessing.)18Whatisgoingonhere?Oscillationreduced.here?Copyright2009Rose-HulmanInstituteofTechnology.10CurrentControl•Wehavereducedtheoscillationsinthethrottlesignalalittlebit.Wewillcallitgoodfornowandfixafewotherproblemsfirst19fornowandfixafewotherproblemsfirst.•Iftheproblemstillpersists,wewilladdressitlater.•Wewillzoominonthespikeinthethrottlesignalthatoccurswhenwefirststarttheengineandcommencecharging.20Thecurrentrampsupaftertheenginespeedhasreached1800.Thisiscorrect.Thethrottleiswronghere.ThereshouldtbthttlilWantthethrottletorampuphere,aftertheenginehasreachedacertainspeed.notbeathrottlesignalwhentheenginerpmistoolow.Copyright2009Rose-HulmanInstituteofTechnology.1121(3)Sinceactualcurrentislessthandesiredcurrentofzerothe(2)Generatorcurrentisnegativebecauseitusesbatterypowertospeedupandstarttheengine.currentofzero,thecontrolloopincreasesthethrottle.(1)Duringthistime,Stateflowsetsthedesiredcurrenttozero.ChargingCurrentControl•Weseethatthedesiredgeneratorcurrentiszerobuttheactualgeneratorcurrentisnegative.•Becausetheactualcurrentislessthandesired,the22,currentcontrolfeedbackloopincreasesthethrottle.Thisisincorrectbecausetheengineisnotyeton.•Weneedtodisablethethrottleuntiltheenginereachesthedesiredspeed.•CreateanotherStateflowoutputcalledpThrottle_Enable.•ModifytheStateflowdiagramasshownnext.•ModifytheControllerasshownnext.Copyright2009Rose-HulmanInstituteofTechnology.1223Lineadded.Lineadded.Disablethefeedbackwhenwewanttostopchargingtostopcharging.Lineadded.Enablethefeedbacklooponcetheenginehasreachedthedesiredoperatingspeed.24Modified.Modified.Modified.Modified.Copyright2009Rose-HulmanInstituteofTechnology.1325Bigspike.Thiscan’tbegood.Zoomin.26Theproblemwherethethrottlewasnon-zerobeforetheenginewasuptospeedhasbe