Sei sulla pagina 1di 6

10/29/2016

ControlTutorialsforMATLABandSimulinkMotorSpeed:SystemModeling

Tips
TIPS

ABOUT

Effects

BASICS

SearchControlTutorials

HARDWARE

INDEX

NEXT

INTRODUCTION CRUISECONTROL MOTORSPEED

http://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed&section=SystemModeling

1/6

10/29/2016

ControlTutorialsforMATLABandSimulinkMotorSpeed:SystemModeling
SYSTEM
MODELING

DCMotorSpeed:SystemModeling

ANALYSIS

KeyMATLABcommandsusedinthistutorialare:tf,ss
CONTROL

Contents

PID

Physicalsetup
ROOTLOCUS
FREQUENCY
STATESPACE
DIGITAL

SIMULINK

Systemequations
Designrequirements
MATLABrepresentation

Physicalsetup
A common actuator in control systems is the DC motor. It directly provides
rotary motion and, coupled with wheels or drums and cables, can provide

MODELING
CONTROL

translational motion. The electric equivalent circuit of the armature and the
freebodydiagramoftherotorareshowninthefollowingfigure.

For this example, we will assume that the input of the system is the voltage
source(V) applied to the motor's armature, while the output is the rotational
speedoftheshaftd(theta)/dt.Therotorandshaftareassumedtoberigid.We
further assume a viscous friction model, that is, the friction torque is
proportionaltoshaftangularvelocity.
Thephysicalparametersforourexampleare:
(J)momentofinertiaoftherotor0.01kg.m^2
(b)motorviscousfrictionconstant0.1N.m.s

http://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed&section=SystemModeling

2/6

10/29/2016

ControlTutorialsforMATLABandSimulinkMotorSpeed:SystemModeling

(b)motorviscousfrictionconstant0.1N.m.s
(Ke)electromotiveforceconstant0.01V/rad/sec
(Kt)motortorqueconstant0.01N.m/Amp
(R)electricresistance1Ohm
(L)electricinductance0.5H

Systemequations
Ingeneral,thetorquegeneratedbyaDCmotorisproportionaltothearmature
currentandthestrengthofthemagneticfield.Inthisexamplewewillassume
that the magnetic field is constant and, therefore, that the motor torque is
proportionaltoonlythearmaturecurrentibyaconstantfactorKtasshownin
theequationbelow.Thisisreferredtoasanarmaturecontrolledmotor.
(1)
The back emf, e, is proportional to the angular velocity of the shaft by a
constantfactorKe.
(2)
InSIunits,themotortorqueandbackemfconstantsareequal,thatis,Kt=Ke
therefore,wewilluseK to represent both the motor torque constant and the
backemfconstant.
Fromthefigureabove,wecanderivethefollowinggoverningequationsbased
onNewton's2ndlawandKirchhoff'svoltagelaw.
(3)
(4)

1.TransferFunction
Applying the Laplace transform, the above modeling equations can be
expressedintermsoftheLaplacevariables.
(5)
(6)
We arrive at the following openloop transfer function by eliminating I(s)
between the two above equations, where the rotational speed is considered
theoutputandthearmaturevoltageisconsideredtheinput.

http://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed&section=SystemModeling

3/6

10/29/2016

ControlTutorialsforMATLABandSimulinkMotorSpeed:SystemModeling

theoutputandthearmaturevoltageisconsideredtheinput.
(7)

2.StateSpace
In statespace form, the governing equations above can be expressed by
choosingtherotationalspeedandelectriccurrentasthestatevariables.Again
thearmaturevoltageistreatedastheinputandtherotationalspeedischosen
astheoutput.
(8)

(9)

Designrequirements
Firstconsiderthatouruncompensatedmotorrotatesat0.1rad/secinsteady
stateforaninputvoltageof1Volt(thisisdemonstratedintheDCMotorSpeed:
SystemAnalysispagewherethesystem'sopenloopresponseissimulated).
Since the most basic requirement of a motor is that it should rotate at the
desiredspeed,wewillrequirethatthesteadystateerrorofthemotorspeedbe
less than 1%. Another performance requirement for our motor is that it must
accelerate to its steadystate speed as soon as it turns on. In this case, we
wantittohaveasettlingtimelessthan2seconds.Also,sinceaspeedfaster
than the reference may damage the equipment, we want to have a step
responsewithovershootoflessthan5%.
In summary, for a unit step command in motor speed, the control system's
outputshouldmeetthefollowingrequirements.
Settlingtimelessthan2seconds
Overshootlessthan5%
Steadystateerrorlessthan1%

MATLABrepresentation
1.TransferFunction
We can represent the above openloop transfer function of the motor in
MATLABbydefiningtheparametersandtransferfunctionasfollows.Running
thiscodeinthecommandwindowproducestheoutputshownbelow.
http://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed&section=SystemModeling

4/6

10/29/2016

ControlTutorialsforMATLABandSimulinkMotorSpeed:SystemModeling

J=0.01;
b=0.1;
K=0.01;
R=1;
L=0.5;
s=tf('s');
P_motor=K/((J*s+b)*(L*s+R)+K^2)

P_motor=

0.01

0.005s^2+0.06s+0.1001

Continuoustimetransferfunction.

2.StateSpace
We can also represent the system using the statespace equations. The
following additional MATLAB commands create a statespace model of the
motor and produce the output shown below when run in the MATLAB
commandwindow.

A=[b/JK/J
K/LR/L];
B=[0
1/L];
C=[10];
D=0;
motor_ss=ss(A,B,C,D)

motor_ss=

a=
x1x2
x1101
x20.022

http://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed&section=SystemModeling

5/6

10/29/2016

ControlTutorialsforMATLABandSimulinkMotorSpeed:SystemModeling

b=
u1
x10
x22

c=
x1x2
y110

d=
u1
y10

Continuoustimestatespacemodel.

The above statespace model can also be generated by converting your


existing transfer function model into statespace form. This is again
accomplishedwiththesscommandasshownbelow.

motor_ss=ss(P_motor);

PublishedwithMATLAB7.14

AllcontentslicensedunderaCreativeCommonsAttributionShareAlike4.0
InternationalLicense.

http://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed&section=SystemModeling

6/6

Potrebbero piacerti anche