You are on page 1of 7

Automatic Control

LEEC

2021/2022 - 2nd Semester, P4

Speed Control of a DC Motor

Laboratory Guide

April 2022

1
1 Introduction
1.1 Objectives
The goal of this laboratory is to model, identify, and develop a feedback controller to control the
speed of DC motor with a load gear. The following topics will be covered:
1. Experimentally identify and validate the parameters of the model based on the step response and
frequency response of the system.

2. Design a speed controller to meet a given set of specifications using loop-shaping techniques.
3. Test the designed controller in simulation and ensure that the specifications are satisfied.
4. Implement the controller on the real device and evaluate the performance.

1.2 Organization, timeline, and evaluation


There are two kinds of questions: theoretical questions, marked as (T), and laboratory questions,
marked as (L). As a guideline, all theoretical questions should be solved before the laboratory sessions,
and the experiments should be completed during the sessions. The laboratory component will resort to
a matlab software package provided together with this guide.
A single-column report in pdf format with no more than 8 pages, together with the matlab code
developed to answer the questions, must be submitted through fenix in the designated dates (check the
course’s website).

1.3 Academic ethics code


All members of the academic community of the University of Lisbon (faculty, researchers, staff mem-
bers, students, and visitors) are required to uphold high ethical standards. Hence, the report submitted
by each group of students must be original and correspond to their actual work.

2
2 Dynamic Modeling
This section serves as an introduction to the lab work and describes the derivation of a simplified
model of a DC motor armature circuit and load gear. Figure 1 shows a schematic illustration of the
system.

nT=K
= KmniaI
<latexit sha1_base64="exaTkheiv4h6VixBPTCkK/tFE+k=">AAAB8HicbZDLSgMxFIbP1Futt6pLN8EiuCozpVC7EApuFDcV7EXaoWTSTBuaZIYkI5TSp3DjQhG3Po4738Z0Ooi3HwIf/zmHc/IHMWfauO6Hk1tZXVvfyG8WtrZ3dveK+wdtHSWK0BaJeKS6AdaUM0lbhhlOu7GiWAScdoLJxaLeuadKs0jemmlMfYFHkoWMYGOtO4nO0fVAoqtBseSW3VToL3gZlCBTc1B87w8jkggqDeFY657nxsafYWUY4XRe6CeaxphM8Ij2LEosqPZn6cFzdGKdIQojZZ80KHW/T8yw0HoqAtspsBnr37WF+V+tl5jwzJ8xGSeGSrJcFCYcmQgtfo+GTFFi+NQCJorZWxEZY4WJsRkV0hDqqd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sjjw6QafoHHmohhroGjVRC1F0jx7QE3p2ps6j8+K8rkZzTrZzjH7IefsEznCR0g==</latexit>

-
-
Jm
.
b!m
b!
<latexit sha1_base64="WEmwxx3ieoC7DXNyUSUIs9S0Mso=">AAAB7nicbZDLSgMxFIYz9VbrrerSTbAIrspMKdTuCm5cVrAXaIeSSc+0obkMSUYopQ/hxoUibn0ed76N6XQQbz8EPv5zDufkjxLOjPX9D6+wsbm1vVPcLe3tHxwelY9PukalmkKHKq50PyIGOJPQscxy6CcaiIg49KLZ9areuwdtmJJ3dp5AKMhEsphRYp3Vi4ZKwISMyhW/6mfCfyHIoYJytUfl9+FY0VSAtJQTYwaBn9hwQbRllMOyNEwNJITOyAQGDiURYMJFdu4SXzhnjGOl3ZMWZ+73iQURxsxF5DoFsVPzu7Yy/6sNUhtfhQsmk9SCpOtFccqxVXj1dzxmGqjlcweEauZuxXRKNKHWJVTKQmhmwmto1HNoBl8hdGvVwK8Gt/VKq5bHUURn6BxdogA1UAvdoDbqIIpm6AE9oWcv8R69F+913Vrw8plT9EPe2yeFKJAH</latexit>

Figure 1: Armature electric circuit and motor load gear

The following notation is used in the sequel:


• R - armature circuit resistance
• L - armature circuit inductance
• e(t) - back electromotive force (voltage)
• Ke - back-emf constant
• i(t) - armature circuit current
• ν(t) - input voltage
• ω(t) - angular speed of the motor shaft
• J - moment of inertia of the ensemble (motor+load gear)
• b - friction coefficient
• n(t) - motor torque
• Kn - current/torque constant

Armature Circuit
The input voltage ν(t) can be related to the current i(t) and the voltage e(t) through the equation
di(t)
ν(t) = Ri(t) + L + e(t). (1)
dt
Considering that the back-emf voltage e(t) is proportional to the angular speed ω(t), such that e(t) =
Ke ω(t) and under the assumption that R >> L, the current i(t) is approximately given by
ν(t) − Ke ω(t)
i(t) = . (2)
R

Electrical and Mechanical Systems Combined


The angular motion of the motor shaft is governed by
J ω̇(t) = −bω(t) + n(t) (3)
where the torque n(t) is proportional to the applied current, such that n(t) = Kn i(t).
2.1. (T) Using the previous expressions, show that the simplified dynamic model of the dc motor takes
the form of a first-order system, with transfer function given by
Ω(s) a
G(s) = = k0 , (4)
V (s) s+a
where Ω(s) and V (s) are the Laplace transforms of ω(t) and ν(t), respectively. Write expressions
of k0 and a as functions of the mechanical and electrical constants J, b, R, Ke , and Kn .

3
3 1st Lab Session - System Identification
The main goal of this laboratory session is to experimentally identify and validate the parameters of
the system
a
G(s) = k0 ,
s+a
using data collected for the step response and frequency response of the system. Complete the questions
3.1 and 3.2 before the 1st lab session. The questions marked with (L) should be completed during the
1st laboratory session. Question 3.5 may be completed after the 1st lab session.
3.1. (T) Show that, in the time domain, the step response of G(s) takes the form ω(t) = k0 (1 − e−at ).
Determine the steady-state response, i. e. ω(t → ∞), and ω(t = a1 ). Reason about a method to
identify the system parameters k0 and a from the step response of the system.
3.2. (T) Determine the asymptotic Bode diagram for G(s) and discuss the simplifications. Reason
about a method to identify the system parameters k0 and a from the frequency response of the
system. Suggestion: reason on how to select a collection of frequencies to determined the low and
high frequency asymptotes of the magnitude plot and how these are related to the parameters k0
and a.

Experiments Preparation

Figure 2: Simulink model for system identification

• In the lab computer, login with the user alunos.


• Open Matlab 2015a. In the command window, run the instructions
>> login controlo
>> gXXX
where XXX stands for your group number.
• Check the type of board that connects your computer to the dc motor (metallic plug for PCI,
blue plastic plug for MIO).
• Open the corresponding simulink model for system identification,
dc motor sys id PCI16E4.slx or dc motor sys id MIO16E4.slx (see Fig. 2). Check the
contents of the model. The model interfaces with the motor by sending input voltage com-
mands and receiving angular velocity measurements from the tachometer.

4
• Each motor is shared by two computers. Before running an experiment, check the physical
switch in the workbench to select your computer and turn on the power supply.
• Back to the simulink model, you can change between step and sine wave inputs by double-
clicking the virtual switch. A tuning knob allows you to change the frequency of the sine
wave.
• The model also includes a transfer function that simulates the motor response. After identi-
fying the model parameters, you can update this transfer function and compare the real and
simulated responses in a scope. A variable ScopeData is also saved to the workspace.
• The scope shows a virtual oscilloscope where you can check input and output signals. You
can also use the cursor option to create data tips, draw horizontal lines, and inspect specific
values of signals present in the scope.

3.3. (L) Observe and register the time response of the system to a step of amplitude 1V . From the
time response, obtain estimates for the values of the parameters k0 e a of the transfer function
G(s). Describe and justify the method adopted to obtain these estimates.
3.4. (L) Determine the magnitude of the frequency response |G(jω)|dB for a set of frequencies within
the range [a/10, 5a], where a takes the value estimated in 3.3. Suggestion: create a table of the
following form and register for each frequency the measured amplitudes and the corresponding gain
values in dB.
Table 1: Frequency response results

frequency(Hz) amplitude (V) gain (dB)


1
2
3
4
5
6

3.5. (L) Sketch the Bode magnitude plot using the collected data. Determine the low and high fre-
quency asymptotes (recall that the system under consideration is a 1st-order system). From these
asymptotes, obtain estimates for the values of the cutoff frequency and low-frequency gain.

5
4 2nd and 3rd Laboratory Sessions - Loop Shaping Control De-
sign
For the 2nd and 3rd laboratory sessions, you are expected to design a feedback controller using loop
shaping and experimentally test and validate the resulting control system.

4.1. (T) Loop Shaping Design


Consider the closed-loop system shown in Figure 3, where G(s) is the identified system and K(s)
is the controller to be designed.

r e ⌫ !
K(s) G(s)
<latexit sha1_base64="5kzC0MTp8KJRDGyuXk8xT4B+i5U=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBahp5KIUI8FLx5bsB/QhrLZTtq1m03Y3Qgl9Bd48aCIV3+SN/+N2zYHbX0w8Hhvhpl5QSK4Nq777RS2tnd294r7pYPDo+OT8ulZR8epYthmsYhVL6AaBZfYNtwI7CUKaRQI7AbTu4XffUKleSwfzCxBP6JjyUPOqLFSSw3LFbfmLkE2iZeTCuRoDstfg1HM0gilYYJq3ffcxPgZVYYzgfPSINWYUDalY+xbKmmE2s+Wh87JlVVGJIyVLWnIUv09kdFI61kU2M6Imole9xbif14/NeGtn3GZpAYlWy0KU0FMTBZfkxFXyIyYWUKZ4vZWwiZUUWZsNiUbgrf+8ibpXNc8t+a1biqNah5HES7gEqrgQR0acA9NaAMDhGd4hTfn0Xlx3p2PVWvByWfO4Q+czx/VT4zc</latexit>
<latexit

<latexit sha1_base64="T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TggRp6WFPOJO0ZZjgdhopi4XE68BZXWX1wT5VmgbwzcUhdgWeS+Yxgk1nXdX0+qdbshp0L/QWngBoU6k6q7+NpQCJBpSEcaz1y7NC4CVaGEU6XlXGkaYjJAs/oKEWJBdVukt+6RGepM0V+oNInDcrd7xMJFlrHwks7BTZz/buWmf/VRpHxL92EyTAyVJLVIj/iyAQo+ziaMkWJ4XEKmCiW3orIHCtMTBpPJQ+hnQutoNUsoO18hdC/aDh2w7lt1jr1Io4ynMAp1MGBFnTgBrrQAwJzeIAneLaE9Wi9WK+r1pJVzBzDD1lvn2uRjiM=</latexit>

Figure 3: Closed-loop system.

k1 s + z
Let the transfer function for the controller be given by K(s) = . Determine values for
s z
the parameters k1 ∈ R+ and z ∈ R+ such that the closed-loop system is stable and satisfies the
following requisites:
i) Zero steady-state error.
ii) Positive gain margin G+
M greater or equal to 20 dB.
iii) Phase margin PM greater or equal to 80o .
iv) |K(jω)G(jω)|dB < −10 dB for ω > 10a.
Justify your answer by plotting the Bode diagram of K(jω)G(jω). Explicitly indicate the gain and
phase margin and the barrier defined by requisite iv). Suggestion: you can use the Matlab GUI
ControlSystemDesigner to design a controller that meets the requisites.
4.2. (T) Explain why requisite iv) has the effect of limiting the energy of the actuation signal.
4.3. (T) Time Delay Margin
Suppose that there is a time delay τ > 0 in the transmission of information between the controller
K(s) and the system G(s). Determine the range of values for τ such that the closed-loop system
continues to be stable. What is the effect on the tolerated delay of changing the phase margin PM
and the crossover frequency of K(jω)G(jω)?

Experiments Preparation
• Open the simulink model dc motor control MIO16E4.slx or dc motor control PCI16E4.slx,
depending on the interface board of your computer (see Fig. 4).
• Check the contents of the model. Compared with the model used for system identification,
the current model includes a feedback loop for both the real and simulated models.
• As in the previous simulink model, a scope shows a virtual oscilloscope where you can check
a number of signals. A variable ScopeData is also saved to the workspace.

4.4. (L) With the parameters k1 and z computed in 4.1., run experiments and evaluate the step response
of the closed-loop system. Compare the response of the real system with that of the simulated
system and discuss the differences.
4.5. (L) Considering again the step response, check the effect of changing k1 and z on:
• the overshoot and peak time of the output signals y and y sim,
• the limit values and energy of the actuation signals u and u sim.
Discuss the connection between the peak time and the crossover frequency of K(jω)G(jω). Discuss
the connection between the overshoot and the phase margin. Suggestion: you can also check what
happens to the root locus as you change the controller parameters.

6
Figure 4: Simulink model for velocity control

4.6. (L) Time delay


Use once again the simulink model dc motor control MIO16E4.slx or
dc motor control PCI16E4.slx, according to the interface board of your computer. To test the
effect of introducing a time delay between the controller and the controller, you can manually change
the switch so that the delayed signal passes through to the system input. Warning: always start
by testing the simulated system and checking that it does not become unstable, before changing
the switch and adding the delay in the real system.
Observe and comment the effect of the time delay on the performance of the system. Tune the
parameters k1 and z (if needed) to guarantee that a delay τ = 0.02 s does not destabilize the
closed-loop system. What is the trade-off for tolerating such a delay?

You might also like