Control Tutorials For MATLAB and Simulink - Cruise Control - Simulink Modeling
Control Tutorials For MATLAB and Simulink - Cruise Control - Simulink Modeling
TIPS ABOUT BASICS HARDWARE INDEX NEXT
SYSTEM
MODELING CruiseControl:SimulinkModeling
ANALYSIS
Contents
CONTROL
Physicalsetupandsystemequations
PID
Buildingthemodel
ROOTLOCUS
Openloopresponse
FREQUENCY
Physicalsetupandsystemequations
STATESPACE
DIGITAL Themodelofthecruisecontrolsystemisrelativelysimple.Ifitisassumed
thatrollingresistanceandairdragareproportionaltothecar'sspeed,then
the problem is reduced to the simple mass and damper system shown
SIMULINK
below.
MODELING
CONTROL
UsingNewton's2ndlaw,thegoverningequationforthissystembecomes:
(1)
where u is the force generated between the road/tire interface and can be
controlleddirectly.Forthisexample,let'sassumethat
m = 1000 kg
b = 50 N.sec/m
u = 500 N
Buildingthemodel
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=SimulinkModeling 1/6
2017-5-27 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling
Thissystemwillbemodeledbysummingtheforcesactingonthemassand
integratingtheaccelerationtogivethevelocity.OpenSimulinkandopena
newmodelwindow.First,wewillmodeltheintegralofacceleration.
(2)
toandfromitsinputandoutputterminals.
Label the input line "vdot" and the output line "v" as shown below. To
addsuchalabel,doubleclickintheemptyspacejustabovetheline.
Since the acceleration (dv/dt) is equal to the sum of the forces divided by
mass,wewilldividetheincomingsignalbythemass.
InsertaGainblock(fromtheMathOperationslibrary)connectedtothe
Integrator block input line and draw a line leading to the input of the
Gainblock.
Change the label of the Gain block to "inertia" by clicking on the word
"Gain"underneaththeblock.
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=SimulinkModeling 2/6
2017-5-27 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling
Now,wewilladdintheforceswhicharerepresentedinEquation(1).First,
wewilladdinthedampingforce.
Attach a Sum block (from the Math Operations library) to the line
leadingtotheinertiaGainblock.
ChangethesignsoftheSumblockto"+".
InsertaGainblockbelowtheInertiablock,selectitbysingleclickingon
it,andselectFlipfromtheFormatmenu(ortypeCtrlF)toflipitleftto
right.
Settheblock'svalueto"b"andrenamethisblockto"damping".
Tapaline(holdCtrlwhiledrawing)offtheIntegratorblock'soutputand
connectittotheinputofthedampingGainblock.
DrawalinefromthedampingGainblockoutputtothenegativeinputof
theSumBlock.
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=SimulinkModeling 3/6
2017-5-27 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling
Thesecondforceactingonthemassisthecontrolinput,u.Wewillapplya
stepinput.
InsertaStepblock(fromtheSourceslibrary)andconnectitwithaline
tothepositiveinputoftheSumBlock.
Toviewtheoutputvelocity,insertaScopeblock(fromtheSinkslibrary)
connectedtotheoutputoftheIntegrator.
Toprovideanappropriatestepinputof500attimeequalzero,double
clicktheStepblockandsettheStepTimeto"0"andtheFinalValueto
"u".
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=SimulinkModeling 4/6
2017-5-27 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling
Youcandownloadamodelfileforthecompletesystemhere,ccmodel.mdl.
Openloopresponse
Tosimulatethissystem,first,anappropriatesimulationtimemustbeset.
Select Parameters from the Simulation menu and enter "120" in the
Stop Time field. 120 seconds is long enough to view the openloop
response.
Thephysicalparametersmustnowbeset.Runthefollowingcommandsat
theMATLABprompt:
m = 1000;
b = 50;
u = 500;
Run the simulation (hit CtrlT or select Start from the Simulation menu).
When the simulation is finished, doubleclick on the Scope and hit its
autoscalebutton.Youshouldseethefollowingoutput.
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=SimulinkModeling 5/6
2017-5-27 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling
Observing the above, we would like to improve the response of the cruise
control system. The model created here will be employed for controller
PublishedwithMATLAB7.14
AllcontentslicensedunderaCreativeCommonsAttributionShareAlike4.0
InternationalLicense.
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=SimulinkModeling 6/6