You are on page 1of 5

Lab 1: Modeling and identification of DC motor

Equipment: LEGO MINDSTORM sets Bluetooth adaptor clamp protractor

Background topics: Modeling of Electromechanical system


Time constant of first order system
Matlab/Simulink
Function of equipment above

Laboratory objectives
Introduce students to measuring the time constant of a first order system and experimentally determine
the model (transfer function) of system.

Laboratory activities

1. Modelling from experimental tests – parameter Estimation


2. Model verification of first order system.

Lab deliverables
Complete the pages in the deliverable section and submit it into ANGEL before you leave the lab
today. The electronic version of the lab deliverable can be downloaded from ANGEL.

Background
A DC motor can be modelled as

Figure 1

𝑑𝑖𝑎 𝑑𝜃𝑚
𝑣𝑎 (𝑡) = 𝑅𝑎 𝑖𝑎 (𝑡) + 𝐿𝑎 + 𝐾𝑒
𝑑𝑡 𝑑𝑡
𝑑𝜃𝑚 𝑑2 𝜃
𝐾𝑡 𝑖𝑎 (𝑡) − 𝑇(𝑡) − 𝑏 𝑑𝑡 = 𝐽𝑚 𝑑𝑡 2
Where
La = armature winding inductance = negligible
Ra = armature winding resistance
Ke = back emf constant
Kt = motor torque constant
Jm = mass moment of inertia of the rotor of the motor
b = viscous-friction coefficient of the rotor of the motor = negligible
T(t) = load applied on the motor shaft of the motor (such as coulomb friction, weight lifted by the
motor)

So for a motor with zero load (i.e. T(t) = 0), the transfer function from the applied voltage va(t) to
the motor speed m(t) can be simplified as a first order system:
1
𝜔𝑚 (𝑠) 𝐾𝑒
=
𝑉𝑎 (𝑠) 𝐽 𝑅
𝑚 𝑎
𝐾𝑡 𝐾𝑒 𝑠 + 1

For first order system with standard format:

𝑎
𝐺(𝑠) =
𝑠 + 1
Given a step input
𝑢(𝑡) = 𝑏 ∗ 𝑢𝑠 (𝑡)

The step response is plotted below:

The LEGO Mindstorm brick is the controller to the accessory motors. It must be plugged into the
computer using the USB cable in order to control with MATLAB/Simulink. Bluetooth is also
used to communicate with the brick and sensors. If connecting a motor is desired, connect to
ports A, B, or C. The sensors will be connected using ports 1, 2, 3 and/or 4. (See image on next
page)

USB Port
Ports A, B, and C

Power
ON

Ports 1, 2, 3, and 4

Activity 1. Identify the time constant and the model (transfer function) of LEGO motor

1. Open Matlab 2014a.


2. Download the “lab1_1.mdl” file from ANGEL to your P drive. DO NOT open it directly
from Angel. Make sure “Save as” in P-drive.
3. Connect LEGO brick to the USB port of computer, and connect one LEGO motor to the
LEGO brick as shown below. This motor is referred as “base motor”.
4. Open “lab1_1.mdl” file from Matlab/Simulink. Set the “Base motor” and “Base Encoder”
blocks’ port in “lab1_1.mdl” to the port you connected the motor.
5. Turn on the LEGO brick by pressing the orange button. You need to do this every time
before you run the experiment.
6. Follow step 3 instruction in “Hardware Setup” manual.
7. Run the model in Simulink.
8. Plot the angular velocity data in Matlab and save the data using the following command:
“plot(speed(:,1),speed(:,2))”
“save XXX.mat speed”
The data was saved in the current working directory of Matlab.
9. Record the steady state value (s.s.) and time constant () of the speed response. The step
input to the motor has the default (also the maximal) magnitude of 100 (LP). Here LP
represents the unit power/voltage to the lego motor.
𝑎
10. Derive the transfer function of the motor only 𝐺(𝑠) = 𝑠+1 following this relation:
𝑠.𝑠. 𝑑𝑒𝑔/𝑠
a. 𝑎 = 100 𝐿𝑃
b. 𝑠𝑝𝑒𝑒𝑑(𝑡 = ) = 63.2% ∗ 𝑠. 𝑠.
11. Build “claw+motor” following the “Claw Construction Manual”.
12. Attach the prebuilt “claw+motor” to the base motor and repeat steps 4 to 7. You must
build a spacer like the one shown in the circle below. You can hold the base motor
yourself or attach it to the side of the brick.
13. Remove the “claw+motor” and spacer from the base motor. Close “lab1_1.mdl” in
Simulink but keep the hardware connection.

You might also like