Experiment No. 5
Modeling a DC Motor in Simulink
Simulation Lab
Section: Saturday 2:00-5:00pm

Instructor: Ashraf Rimawi
Teaching Assistant: Dalal Hamdan
Student Name: Haitham Da’ana
Student ID: 1121331

Date: 22/10/16

Table of Contents:

1.	Abst                                               -                                                   Page (3)
2.	Introduction                                                    -                                                      Page (3)
3.	Procedure & Results Discussion                  -                                                      Page (4)
4.	Conclusion                                                       -                                                      Page(13)
5.	References                                                       -                                                      Page(14)

Abstract:
The aim of this experiment was to simulate and model a DC Motor in Simulink, and to observe how the motor operates when some of its parameters change independently of others using graphs and plot of its torque-speed characteristics, and other performance parameters, and to use Matlab functions and features to export the Model into a state-space Matrix or a transfer function that can be used to describe the system through a set of first order differential equations.[1]

Introduction:
DC Motors consist mainly of Stator, rotor, commutator, and Brushes, and is used to convert Electrical Energy to Kinetic Energy through the means of electromagnetism, and we can easily model it into Simulink, which is an add-on product to MATLAB, provides an interactive, graphical environment for modeling, simulating, and analyzing of dynamic systems. It enables rapid construction of virtual prototypes to explore design concepts at any level of detail with minimal effort. For modeling, Simulink provides a graphical user interface (GUI) for building models as block diagrams. It includes a comprehensive library of pre-defined blocks to be used to construct graphical models of systems using drag-and-drop mouse operations. The user is able to produce an “up-and-running” model that would otherwise require hours to build in the laboratory environment. It supports linear and nonlinear systems, modeled in continuous-time, sampled time, or hybrid of the two. Since students learn efficiently with frequent feedback, the interactive nature of Simulink encourages you to try things out, you can change parameters “on the fly” and immediately see what happens, for “what if” exploration. Lastly, and not the least, Simulink is integrated with MATLAB and data can be easily shared between the programs.[2]

Theory:
The DC Motor block represents the electrical and torque characteristics of a DC motor using the following equivalent circuit model:00

Figure.1
You specify the equivalent circuit parameters for this model when you set the Model parameterization parameter to By equivalent circuit parameters. The resistor R corresponds to the resistance you specify in the Armature resistance parameter. The inductor L corresponds to the inductance you specify in the Armature inductance parameter. 
The block models motor inertia J and damping λ for all values of the Model parameterization parameter. The resulting torque across the block is:

Procedure & Results:
Simulink was opened, block diagram of the DC Motor was drawn in Simulink as follows in the figure below:

1.	Parameters of the were entered in the MATLAB prompt window, scope was placed at the angular velocity output to observe the speed characteristic of the DC Motor, along with the Electrical DC Power Input (STEP FUNCTION).
The parameters that were entered intially were as follows:
J=0.2*10^-3kg.m^2 | b=0.001 | K=0.2 | R=0.5Ω | L=10mH | V=150V
2.	We ran the simulation at first when there is no load and the following plot appeared on the scope:

3.	A constant Load was added using a constant block in Simulink to the current sum input and torque was varied accordingly and at each try, output of the scope was observed and recorded as follows

When Torque was equal to 0.2 N.m output was as follows:

When Torque was equal to 0.4 N.m output was as follows:

When Torque was equal to 0.6 N.m output was as follows:

When Torque was equal to 0.8 N.m output was as follows:

When Torque was equal to 1 N.m output was as follows:

When Torque was equal to 1.2 N.m output was as follows:

speed characteristics of the Motor were observed when Torque changes with the Resistance of the motor being fixed, here we headed to step two!
Step 2:
The motor characteristics were observed and recorded using the scope on different resistances with varying load torques in each value of the resitance:
When Resistance was equal to 2ohm the output was as follows:

For R=4

For R=6

For R=8

Step 3: R was kept constant at 0.5ohm, Input Power was changed to 50, 100, 180, 220 and each time simulation was run for T=0.2~1.2N.m, output of scope was recorded and observed.
For V=50

For V=100

For V=180

For V=220

Step 4: damping factor of system was kept constant at 0.001, constant torque was removed and replaced by a varying load, using signal builder function in SIMULINK, after this was done, J(moment of interia) was varied to specific values and at each value model was run and output on the scope was observed and recorded.

Results:

For J=0.05*10^-3

For J=1*10^-3

For J=5*10^-3

For J=10*10^-3

Step 5: In the end of this experiment, the model was extracted into the MATLAB, and this was done by using input and output connection blocks in simulink, In block was placed as the input which replaced the step function, and out connection block replaced the scope as follows:

The model file was saved as motormodel.mdl, after that at MATLAB prompt, the following command was entered to create the linear model of the system

The resulting linear model of the system was as follows:

Result Discussion:
After we done this experiment we observed how it was easy to change variables of the system and observe the characteristics of the output of the Model, for example when we when the load torque was added this affected the speed of the motor, each time we increase the load torque the speed shrinks, and increasing resistance reduces the load torque, but when voltage is increased the speed of the motor increases!

Conclusion:
Our results came as expected, and were accurate, we were able to learn how to use Simulink and to build models onto it, and simulate it and to generate linear model of the model system onto matlab which helps us estimate the behaviour and characteristics that the system model might show, all that with the help of Matlab.

References:
[1] https://www.mathworks.com/help/ident/ug/what-are-state-space-models.html
[2]https://ewh.ieee.org/r1/ct/sps/PDF/MATLAB/chapter8.pdf