Você está na página 1de 14

Department of Electrical Engineering

Electrical Machines

Faculty Member: Dr. Abdul Rehman Kashif

Dated:

Lab Engineer: Engr. Yasir Manzoor

Semester:

Spring, 2016

Lab Engineer: Engr. Waseem Abbas

Session:

BS-EE-13

LAB-6 DC Motor Modeling Using Simulink

Name

Reg. No.

Report
Marks / 10

Viva
Marks / 5

Total / 15

57 | P a g e

6.1 Objective
Objective of this experiment is

1. Modeling of DC motor in Simulink


2. How to model a physical system in Simulink

6.2 Procedure
6.2.1 Physical setup
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 translational motion. The
electric circuit of the armature and the free-body diagram of the rotor are shown in the
following figure:

Figure 6-1 Equivalent Model of DC motor

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 speed of the shaft
d(theta)/dt. We further assume a viscous friction model, that is, the friction torque is
proportional to shaft angular velocity.

The physical parameters for our example are:


(J)

moment of inertia of the rotor

0.01 kg.m^2

(b)

motor viscous friction constant

0.1 N.m.s

(Ke)

electromotive force constant

0.01 V/rad/sec

(Kt)

motor torque constant

0.01 N.m/Amp

(R)

electric resistance

1 Ohm

(L)

electric inductance

0.5 H

58 | P a g e

In general, the torque generated by a DC motor is proportional to the armature current


and the strength of the magnetic field. In this example we will assume that the magnetic field is
constant and, therefore, that the motor torque is proportional to only the armature current i by
a constant factor Kt as shown in the equation below. This is referred to as an armature
controlled motor.
The back emf, e, is proportional to the angular velocity of the shaft by a constant
factor Ke.
In SI units, the motor torque and back emf constants are equal, that is, Kt = Ke;
therefore, we will use K to represent both the motor torque constant and the back emf
constant.
6.2.2 Building the model with Simulink
This system will be modeled by summing the torques acting on the rotor inertia and
integrating the acceleration to give velocity. Also, Kirchoff's laws will be applied to the armature
circuit. First, we will model the integrals of the rotational acceleration and of the rate of change
of the armature current.

To build the simulation model, open Simulink and open a new model window. Then follow the
steps listed below.

Insert an Integrator block from the Simulink/Continuous library and draw lines to and from
its input and output terminals.
Label the input line "d2/dt2(theta)" and the output line "d/dt(theta)" as shown below. To
add such a label, double-click in the empty space just below the line.
Insert another Integrator block above the previous one and draw lines to and from its input
and output terminals.
Label the input line "d/dt(i)" and the output line "i".

59 | P a g e

Next, we will apply Newton's law and Kirchoff's law to the motor system to generate the
following equations:

The angular acceleration is equal to 1 / J multiplied by the sum of two terms (one positive, one
negative). Similarly, the derivative of current is equal to 1 / L multiplied by the sum of three
terms (one positive, two negative). Continuing to model these equations in Simulink, follow the
steps given below.

Insert two Gain blocks from the Simulink/Math Operations library, one attached to each of
the integrators.
Edit the Gain block corresponding to angular acceleration by double-clicking it and changing
its value to "1/J".
Change the label of this Gain block to "Inertia" by clicking on the word "Gain" underneath
the block.
Similarly, edit the other Gain's value to "1/L" and its label to "Inductance".
Insert two Add blocks from the Simulink/Math Operations library, one attached by a line to
each of the Gain blocks.
Edit the signs of the Add block corresponding to rotation to "+-" since one term is positive
and one is negative.
Edit the signs of the other Add block to "-+-" to represent the signs of the terms in the
electrical equation.

60 | P a g e

Now, we will add in the torques which are represented in the rotational equation. First, we
will add in the damping torque.
Insert a Gain block below the "Inertia" block. Next right-click on the block and select Format
> Flip Block from the resulting menu to flip the block from left to right. You can also flip a
selected block by holding down Ctrl-I.
Set the Gain value to "b" and rename this block to "Damping".
Tap a line (hold Ctrl while drawing or right-click on the line) off the rotational Integrator's
output and connect it to the input of the "Damping" block.
Draw a line from the "Damping" block output to the negative input of the rotational Add
block.
Next, we will add in the torque from the armature.

Insert a Gain block attached to the positive input of the rotational Add block with a line.
Edit its value to "K" to represent the motor constant and Label it "Kt".
Continue drawing the line leading from the current Integrator and connect it to the "Kt"
block.

Now, we will add in the voltage terms which are represented in the electrical equation. First,
we will add in the voltage drop across the armature resistance.

Insert a Gain block above the "Inductance" block and flip it from left to right.
Set the Gain value to "R" and rename this block to "Resistance".
Tap a line off the current Integrator's output and connect it to the input of the "Resistance"
block.

61 | P a g e

Draw a line from the "Resistance" block's output to the upper negative input of the current
equation Add block.
Next, we will add in the back emf from the motor.

Insert a Gain block attached to the other negative input of the current Add block with a line.
Edit it's value to "K" to represent the motor back emf constant and Label it "Ke".
Tap a line off the rotational Integrator's output and connect it to the "Ke" block.
Add In1 and Out1 blocks from the Simulink/Ports & Subsystems library and respectively
label them "Voltage" and "Speed".
The final design should look like the example shown in the figure below.

6.2.3 Observation
Connect a dc voltage source at input (voltage) and a scope at output (speed), observe the
output at different voltage levels.

6.3 Lab Task 1


Students who have odd roll numbers will model Elevator while others will model Robotic
Arm.

62 | P a g e

SIMULINK Modeling Tasks


1- Elevator

1.1. Simulation model


We will use the following model to simulate the elevator system:
A basically closed loop system ensure that an ideal torque generator (Gain=10, Cut off
frequency 15 Hz) delivers the motor torque TM corresponding to the reference linear speed
vRef. The inputs for the simulation are the values of the speed vRef and of the mass of the
load Mu

1.2. Translating the simulation model in Simulink for steady state values of v
Using the libraries "Commonly used blocks", "Math operations" and "Sinks, draw the
following schematics corresponding exactly to the simulation model. At this point, the value
of each parameter is introduced as a constant.

Save the model as elevator0.mdl


Adjust the simulation time to 1s. Start simulation and verify that the resulting value of TM is
compatible with the value calculated in practice 1 (part 1.2). Test this compatibility for
different values of Mu and v.
1.3. Entering data from workspace.
The speed profile can be read by Simulink from the Matlab workspace using the "From
Workspace" block (Sources library). This block refers to an array that contains the
characteristic points of the profile:
For this profile:

we will define, in the Matlab command window (or in a M.file to be executed before
simulation), the following array :

>>v=[0,0;3,1.4;10,1.4;15,0;20,0;23,-1.4;30,-1.4;35,0;40,0];
v=
0
0
3.0000 1.4000
10.0000 1.4000
15.0000
0
20.0000
0
23.0000 -1.4000
30.0000 -1.4000
35.0000
0
40.0000
0
The "From Workspace" block linearly interpolates data between the given points.
Modify elevator0.mdl as follow and save it as elevator1.mdl:

Adjust the simulation time to 40s and start the simulation. The expected results are:

Compare with the results obtained in practice 1.

1.4. Structuring the model.


Using the command "Edit/Create Subsystem", modify the elevator model as follow and save
it as elevator2.mdl. Verify the content of each subsystem.

Perform the simulation with the same parameters than before. The results should be the same.
1.5. User Defined Functions.
Replace the 3 subsystems OmegaRef, TR and JM by 3 "Fcn" block from the library "UserDefined Functions".

Before simulation, each parameter has to be initialized:


Create the M.file init3.m :

Execute init3 in the Matlab command window and start the simulation from Simulink. The
results should be the same than before. Play with the value of Mu to compare the simulation
results with those obtained in practice 1.

2- Arm of robot

Using the following suggestions, draw the Simulink model of the system :

The "From Workspace" blocks omegaRef and P are initialized according to the M.file
init_Robot.m :

J is calculated using an "User Defined Function":

The fiction torque Tf is obtained from the "Coulombic and Viscous Friction" block :

The load torque (/xx') TL is calculated using an Embedded MATLAB Function:

The results of simulation should be the following, in accordance with the results obtained in
Practice 1.

Você também pode gostar