您好,欢迎访问三七文档
1AdvancedModel-Based-SystemDesignLecture12:Lecture12:SystemInitializationShiftingLogicSystemInitialization•Wenowhaveavehiclethatwecandrivewithmanualacceleratorandbrakepedals.•Withmostvehiclesyoucannotjustjump2•Withmostvehicles,youcannotjustjumpinandpresstheacceleratorpedalanddriveaway.Thefollowingusuallyoccurs–Youturnthekeytostartthevehicle.–Thevehiclegoesthroughacomponentcheck.–Thevehiclesystemsareenabled.–Youmustthenshiftthevehicleoutofparkintoforwardorreverse.Copyright2009Rose-HulmanInstituteofTechnology.2SystemInitialization•WewilladdaparallelStateflowcharttogothroughthevehiclestartupandshiftingprocedures3procedures.•ThisStateflowchartwillenablethecharge-controlStateflowchartthatcontrolstheengine-generatorchargingsystem.•WewillstartwithmodelLecture12_Model0,whichwillbepassedoutinclass.SystemInitialization•First,wewilladdaswitchtothedriverblockthatsimulatesthekeyswitchofaconventionalvehicle.4•Ourvehicledoesnothaveastarter,soallweneedisanoff-onswitch.•Wewilluseamanualswitchtoswitchthesignalbetween0and1.•WewilladdthistotheDriverControllsbus,and_,thissignalwillgodirectlytothecontroller.•WewillNamethesignalVehicle_Key.Copyright2009Rose-HulmanInstituteofTechnology.3DriverSubsystem5Controller•Next,wewilladdasecondStateflowchart.•TheonlyinputstothischartwillbetheVehicle_Keysignalandaclock,whichisthesameclockasusedforthechargecontroller6sameclockasusedforthechargecontroller.•Thischarthasasingleoutput,whichistheVehicle_Readysignal.•Thevalueofthissignalisinitializedtozeroandwillremainzerountilwecheckthestatusofthebatterymotorgeneratorandenginebattery,motor,generator,andengine.•WewillalsoaddavariablecalledStatefordebuggingpurposes.•AddaStateflowchartasshown:Copyright2009Rose-HulmanInstituteofTechnology.4ControllerModifications7Controller•ThecontentsofthechartonlychecktoseethestatusoftheVehicle_Keyswitch.•Notethat,forthemoment,thevehicle_KeyswitchonlytellsthevehicletoturnonItisnot8switchonlytellsthevehicletoturnon.Itisnotcapableofturningthevehicleoff.•(Wewillimplementthislaterbecauseweneedtodoacontrolledshut-downprocedure.)•ThebeginningoftheStartup_and_Shiftingchartareshownnext:areshownnext:Copyright2009Rose-HulmanInstituteofTechnology.5Controller9Thereisanerrorinthisdiagram.Somethingwasleftout.Youmayfinditlater…Controller•TheCharge_ControllerStateflowchartmustalsobemodified.•Wewanttospecifythattheengineandgeneratornotbeenableduntiluntilthe10generatornotbeenableduntiluntiltheStartup_and_Shiftingchartcheckoutallofthecomponentsandsignalsthatthevehicleisready.•WewillneedtoaddtheVehicle_Readysignalasaninputtothischartaninputtothischart.Copyright2009Rose-HulmanInstituteofTechnology.6Controller•ModifytheCharge_Controllerchartasshown:11Charge_Controller•WewilladdanexitconditiontotheinitializationstateoftheCharge-ControllerStateflowchartthatwillnotallowthe12Stateflowchartthatwillnotallowthevehicletoenterthenormalcharge/dischargecycleuntilthevheicleisready.•Notethatthismodificationdoesnotffaddresstheissueofagracefulshutdown.Copyright2009Rose-HulmanInstituteofTechnology.7ChargeController13Thisstatetransitionguardadded.BatteryModel•Nextwewilladdastartuphandshakeforthebatteryandsomeoperationaldetails.•Thebatteryhasacontrolsignalthatmustbesenttoitandastatussignalthatitsendstoindicateitsstate14statussignalthatitsendstoindicateitsstate.•Thebatteryhasaninternalcontactor.Whenthecontactorisopen,thebatteryvoltageiszeroandthepackisdisconnectedfromthesystem.•Whenthecontactorisclosed,thebatteryisconnectedtothesystem(motorandgeneratorinourcase)andtheoutputltithtiditdbdlvoltageisthatindicatedbyourmodel.Copyright2009Rose-HulmanInstituteofTechnology.8BatteryModel•ConnectCommand–Inputsignalreceivedbythebattery–1–Closethecontactor.15–0–OpenContactor.•PackState–outputsignalsentbytheBattery–0–Unavailable–1–Idle–2–Disconnected(ContactorOpen)–3–Precharging–4–Connected(ContactorClosed).BatteryModel•Thebatterymodelneedstobemodifiedasfollows–TheConnectCommandmustbeaddedaspartoftheControl_Signalsbus.–Aswitchisaddedtothemodelsothatthebatteryvoltageisswitchedbetweenzeroandthemodelvoltagedependingonthevalueofsignal“ConnectCommand.”–Whenthebatteryreceivestheaconnectcommandof1aftera3seconddelaythe16–Whenthebatteryreceivestheaconnectcommandof1,aftera3seconddelay,thecontactorswitchwillcloseandthebatteryvoltagewillbeequaltothemodelvoltage.–Iftheconnectcommandgoestozero,thecontactorshouldopenimmediately.•AdiagnosticoutputshouldbeaddedthatcontainsthePackstatesignal.Thepackstatesignalshouldhavethefollowingvaluesdependingonthestateofthebatterymodel:–2–Thecontactorisopen,thebatteryisdisconnected,andthebatteryvoltageiszerozero.–3–Duringthethreeseconddelaywhenthebatteryisconnecting.–4–Thecontactorisclosed.Thebatteryisconnected,andthevoltageisequaltothemodeledvoltage.Copyright2009Rose-HulmanInstituteofTechnology.9BatteryModel•TheStartup_and_ShiftingControllermustbemodifiedasfollows:–AfterVehicle_Key=1,thecontrollermustissuethe17connectcommand.–Beforeproceedingtothenextstate,thecontrollerwaitsforthePackstatetoEqual4.–Ifthepackstatedoesnotgoto4,donotproceedanddonotallo
本文标题:MBSD2 Lecture 12 System Initialization, Shifting L
链接地址:https://www.777doc.com/doc-3327086 .html