QNET Exp2 Position PDF
QNET Exp2 Position PDF
Student Manual
DCMCT Position Control Laboratory Manual
Table of Contents
1. Laboratory Objectives.........................................................................................................1
2. References...........................................................................................................................1
3. DCMCT Plant Presentation.................................................................................................1
3.1. Component Nomenclature...........................................................................................1
3.2. DCMCT Plant Description..........................................................................................2
4. Pre-Lab Assignments...........................................................................................................2
4.1. Pre-Lab Exercise #1: Open-loop Modeling.................................................................3
4.2. Pre-Lab Exercise #2: System Type..............................................................................4
4.3. Pre-Lab Exercise #3: Closed-loop Transfer Function.................................................7
4.4. Pre-Lab Exercise #4: Peak Time and Overshoot.........................................................8
5. In-Lab Session...................................................................................................................13
5.1. System Hardware Configuration................................................................................13
5.2. Experimental Procedure.............................................................................................13
Revision: 01 Page: i
DCMCT Position Control Laboratory Manual
1. Laboratory Objectives
The objective of this experiment is to design a closed-loop control system that regulates the
position of the DC motor. The mathematical model of a DC motor is reviewed and its
physical parameters are identified. Once the model is verified, it is used to design a
proportional-integral-derivative, or PID, controller.
The gray boxes present in the instructor manual are not intended for the students as
they provide solutions to the pre-lab assignments and contain typical experimental results
from the laboratory procedure.
2. References
[1] NI-ELVIS User Manual
[2] DCMCT User Manual
[3] QNET Experiment #01: DC Motor Speed Control
ID # Description ID # Description
1 DC Motor 3 DC Motor Case
2 Motor Encoder 4 Disc Load
Table 1 DCMCT Component Nomenclature
Revision: 01 Page: 1
DCMCT Position Control Laboratory Manual
It is assumed that the QNET system is properly configured as dictated in Reference [1].
4. Pre-Lab Assignments
This section must be read, understood, and performed before you go to the laboratory
session.
There are three pre-lab assignments that need to be completed before the in-lab session. The
first exercise is deriving the open-loop model of the DC motor position. In Pre-Lab
Exercise 4.2, a simple feedback system is used to analyze some properties of the DC motor
system. The closed-loop system using a given controller is to be derived in Pre-Lab
Exercise 4.3 and its control gains are designed to meet certain specifications in the last
assignment (i.e. Pre-Lab Exercise 4.4).
Before beginning the exercises, the elecrical and mechanical equations describing a DC
motor are summarized and the model paramater used are given. For the various parameters
Revision: 01 Page: 2
DCMCT Position Control Laboratory Manual
defined in Table 2, the electrical equations describing the open-loop response of the DC
motor are
V m ( t ) − R m I ( t ) − E emf ( t ) = 0 [1]
m
and
Eemf( t ) = Km ⎛⎜⎜ θm( t ) ⎞⎟⎟
d
[2]
⎝ dt ⎠.
Revision: 01 Page: 3
DCMCT Position Control Laboratory Manual
Solution:
Combine the mechanical equations by substituting the Laplace transform of equation [4]
into the Laplace of [3] and solving for current Im(s)
[s1]
.
Substituting the above equation and the Laplace of [2] into the Laplace transform of [1]
gives
[s2]
.
The open-loop transfer function, denoted G(s), of the DC motor is found by solving for
θm(s)/Vm(s):
[s3]
.
Revision: 01 Page: 4
DCMCT Position Control Laboratory Manual
position of the motor, θm(t), to track a reference position, θr(t), will be investigated.
Show that the unity feedback system shown in Figure 3 is a Type 1 system. That is, for a
unit step input
1
θr( s ) = [4]
s ,
show that that the closed-loop system in Figure 3 has zero steady-state error. Note that G(s)
is the open-loop transfer function of the DC motor, i.e. G(s) = θm(s)/Vm(s).
HINT: Calculate the error transfer function E(s) and find the steady-state error using the
final-value theorem.
Revision: 01 Page: 5
DCMCT Position Control Laboratory Manual
Solution:
The closed-loop unity feedback transfer function using Figure 3 is
[s4]
where
[s5]
.
is the open-loop model found in Exercise 4.1 in [s3]. Solving for θm(s) in [s4] gives
[s6]
.
[s8]
after subsituting [s6] into [s7] and simplifying. After inserting the open-loop model [s5]
into [s8] the error expression becomes
[s9]
.
[s11]
gives
[s12]
This is a type 1 system because it has zero steady-state error for a reference step input.
Revision: 01 Page: 6
DCMCT Position Control Laboratory Manual
Find the closed-loop transfer function using G(s) found in Exercise 4.1 and the PV control
law in [5]. Figure 4 may be used as a guide.
HINT: Refrain from subsituting the open-loop transfer function G(s) until then final form
of the closed-loop expression has been reached.
Revision: 01 Page: 7
DCMCT Position Control Laboratory Manual
Solution:
Substitute the control law Vm(s) given in [5] into the open-loop model [s3]
, [s13]
and solve for θm(s) to get the general closed-loop transfer function
[s14]
.
The closed-loop transfer function is finalized by inserting open-loop model [s3] into
expression [s14], resulting in
[s15]
.
As shown in Exercise 4.2, the steady-state error of the closed-loop system is already zero.
Thus the fourth specification, at least theoretically, is already satisfied. The settling time
will be adjusted in the laboratory session.
Revision: 01 Page: 8
DCMCT Position Control Laboratory Manual
The peak time and overshoot of the closed-loop response need to satisfy the specifcations
given in Table 3. The closed-loop transfer function using the PV controller, attained in
Exercise 4.3, is a 2nd order system of the form
2
ωn
H( s ) = 2 [6]
s 2 + 2 ζ ωn + ωn
where ωn is the natural frequency and ζ is the damping ratio. The peak time and overshoot
of H(s) is
π
tp =
ω 1 − ζ2 [7]
n
and
⎛− πζ ⎞
⎜ ⎟
⎜⎜ 2 ⎟⎟
Mp = e ⎝ 1−ζ ⎠ [8]
,
where 0 ≤ ζ <1.
The PV control gains are now to be designed. First, the natural frequency and damping ratio
must be expressed in terms of the control gains and the DC motor parameters. The
minimum damping ratio and natural frequency needed to meet the time peak and overshoot
specifications in Table 3 can be calculated using equations [7] and [8]. Finally given that
the minimum damping ratio and natural frequency is known and by solving for the Kp and
Kv gains in the ωn and ζ expressions derived, the PV gains needed to attain this desired
closed-loop response can be found.
Find the natural frequency expression ωn(Kp) and the damping ratio equation ζ(Kp,Kv) that
results in the the closed-loop transfer function you found in Exercise 1.3 being equal to
H(s) given in [6].
Revision: 01 Page: 9
DCMCT Position Control Laboratory Manual
Solution:
The closed-loop system in [s15] maps to H(s) in [6] by setting the natural frequency to
[s16]
[s17]
.
Find the minimum damping ratio required to satisfy the overshoot requirement in Table 3
using expression [8]. Then using ζmin and peak time expression [7], find the minimum
natural frequency needed to satisfy the peak time specification given in Table 3. Express
both in terms of the model parameters and evaluate them numerically using the DC motor
model parameters in Table 4.
Revision: 01 Page: 10
DCMCT Position Control Laboratory Manual
Solution:
Using equation [8], an overshoot of Mp can be achieved by having a damping ratio
satisfying the inequality
[s18]
.
The damping ratio must be this or larger for the first peak to overshoot less than or equal
to 5%.
Using relationship [7], the time of the first peak of the response is less than tp when the
the natural frequency ωn satisfies
[s20]
.
[s21]
,
using damping ratio [s19] and expression [s20].
Find the control gains needed to meet the specifications using the expressions found in the
first part of this exercise and using the minimum damping ratio and natural frequency
calculated above. Express Kp and Kv in terms of the model parameters, ωn, and ζ, and give
the numerical result of the control gains.
Revision: 01 Page: 11
DCMCT Position Control Laboratory Manual
Solution:
Solving for Kp in equation [s16], the proportional gain must satisfy
[s22]
,
resulting in
[s23]
,
after subsituting the minimum natural frequency found in [s21] and the DC motor
parameters in Table 4.
[s24]
and using damping ratio [s19] results in the velocity gain having to be at least
[s25]
.
For a DC motor plant with the parameters in Table 4, the peak time and overshoot of the
closed-loop response will meet the specifications in Table 3 given that the proportional
gain and the velocity gain satisfy the [s23] and [s25], respectively.
Revision: 01 Page: 12
DCMCT Position Control Laboratory Manual
5. In-Lab Session
Before beginning the lab session, ensure the system is configured as follows:
QNET DC Motor Control Trainer module is connected to the ELVIS.
ELVIS Communication Switch is set to BYPASS.
DC power supply is connected to the QNET DC Motor Control Trainer module.
The 4 LEDs +B, +15V, -15V, +5V on the QNET module should be ON.
The sections below correspond to the tabs in the VI, shown in Figure 5. Please follow the
steps described below:
Step 1. Read through Section 5.1 and go through the setup guide in Reference [2].
Step 2. Run the VI controller QNET_DCMCT_Lab_02_Position_Control.vi shown in
Figure 5.
Revision: 01 Page: 13
DCMCT Position Control Laboratory Manual
Step 3. In the previous laboratory, Reference [3], the three DC motor parameters given
below were identified for a particular DCMCT unit:
(1) Motor Electrical Resistance (Rm) – An electrical property of a motor. It
describes the motor's response to a given voltage and determines the amount of
current able to flow through the motor.
(2) Motor Torque Constant (Kt) – Describes the torque a motor generates and
is directly proportional to the current going through the motor. Note that the
electromotive force constant, Km, is equal to the motor torque constant Kt.
(3) Moment of Inertia (Jeq) – The moment of inertia of the disc load and the
motor shaft.
The three model parameters found in the last laboratory, Reference [3], may not
represent the current DCMCT module being used accurately because a different
QNET unit may be being used. For this reason, the model fitting procedure is
redone to verify that the parameters in the transfer function developed in
Exercise 4.1 represents the actual system.
Step 4. Select the Model Fitting tab that loads the VI shown in Figure 6 and continue
with the laboratory.
Revision: 01 Page: 14
DCMCT Position Control Laboratory Manual
Step 5. As depicted in Figure 6, the scope displays the simulation of the motor speed
response, generated using the mathematical model developed in the last
laboratory, and the actual motor speed response, measured using the tachometer
sensor. The QNET motor is being driven by the signal generator. The Acquire
Data button stops the VI and continues to the next step of the laboratory. Also
in the top panel shown in Figure 6 is the simulation time readout, the sampling
rate, and the RT LED that indicates if real-time is being held.
Slow down the sampling rate if the RT LED is either RED or flickering
between GREEN and RED. For the new sampling rate to take effect, stop this
controller by clicking on the Acquire Data button and return to the Model
Fitting tab to reload this sub-VI.
Step 6. Enter the parameters Rm and Kt into the model variables that were derived in the
DC motor speed control laboratory, Reference [3]. Select the Update Model
button and notice that the simulation on the plot changes because it is
simulating the system using the model with new parameters.
Step 7. If there is a large discrepancy between the plots then a different QNET-
DCMCT module is being used than the system used to perform the parameter
estimation in the previous speed control laboratory. Adjust the motor torque
Revision: 01 Page: 15
DCMCT Position Control Laboratory Manual
constant, Kt, the motor resistance, Rm, and the inertia parameter, Jeq, until the
simulated response begins to match the actual response.
Remember to click on the Update Model button after changing a model
parameter for the changes to take effect in the simulation.
Step 8. Once the simulation matches the actual response well, record the final Jeq, Kt,
and Rm used in Table 5 and click on the Acquire Data button to proceed to the
control design.
Step 9. The Controller Design tab should now be selected. As shown in Figure 7, the
Motor Model block is the transfer function representing the open-loop system,
the proportional and velocity compensators together compose the PV control
system, as in Pre-Lab Exercise 4.3. By default, the reference input signal is a
step of 90 degrees and the resulting closed-loop step response is shown in the
top-right corner. The natural frequency and damping ratio are indicated above
the plot. Further, the closed-loop poles are plotted on the s-plane in the middle
graph of the VI and the locations of the poles are also given directly above the
graph. Note that the locations of the poles is directly related to the damping
ratio and natural frequency, which effects the resulting closed-loop response.
Revision: 01 Page: 16
DCMCT Position Control Laboratory Manual
Step 10. The two control knobs in Figure 7 change the proportional gain, Kp, and the
velocity gain, Kv, of the controller. Vary the gains Kp and Kv as listed in Table 6
and record the Controller Performance changes.
Revision: 01 Page: 17
DCMCT Position Control Laboratory Manual
Step 11. Re-calculate the minimum control gains in Pre-Lab Exercise 4.4 needed to
meet the specifications in Table 3 based on the model parameters of the current
DCMCT module, recorded previously in Table 5. Record the PV control gains
in Table 7.
Step 12. Enter the minimum PV control gains calculated above in the Kp and Kv knobs in
the Control Design VI shown in Figure 7. The resulting response should meet
the specifications in Table 3 but some fine-tuning may be needed. The settling
time was not accounted for in the design, thus the gains may have to fine-tuned
to meet the settling time requirement. Once the controller gains yield a closed-
loop response that meets the required specifications, enter the Kp and Kv gains
used in the last row of Table 6 along with the resulting response time-domain
properties.
Step 13. Select the Controller Implementation tab to load the VI shown in Figure 8. The
controller designed is now to be implemented on the actual QNET DC motor
system. The scope in Controller Implementation VI, as shown in Figure 8,
plots the simulated motor position from the mathematical model using the
parameters enterred and the actual closed-loop position of the motor measured
by the encoder.
Revision: 01 Page: 18
DCMCT Position Control Laboratory Manual
Step 14. Ensure the proportional and velocity gains designed to meet the specifications ,
recorded in Table 7, are set in the CONTROLLER GAINS panel shown in
Figure 8. The function generator in the DESIRED POSITION panel is used to
generate the reference position. Set the commanded position signal to a square
signal with an amplitude of 90 degrees at 0.1 Hertz.
Implement the controller for the same system on which the model was
obtained. This ensures the controller is not based on a model that may not
represent your motor.
Step 15. Record the resulting control performance properties of the actual measured
motor position – peak time, overshoot, settling time, and steady-state error – in
Table 8. If needed, use the zoom tools in the top-left corner of the scope to view
a closeup of the plots.
Revision: 01 Page: 19
DCMCT Position Control Laboratory Manual
Step 16. Did the actual DC motor measurement meet all the specifications in Table 3? If
not, give the specifications that were not met and provide an explanation why
the PV control designed does not result in the desired properties when
implemented on the actual system.
Solution:
The model and control system does not take into account any type of friction
of damping. The steady-state error on the actual system may not be zero due
to the Coulomb friction, or stiction, present in the actual system.
Similarly, the overshoot on the actual system may be zero or less than the
simulation because the model does not consider viscous damping. Energy is
lost in the actual mechanical system through vibrations giving a response that
is more dampened then the model would predict.
Step 17. Change the amplitude, frequency, and/or type of reference signal (sine,
sawtooth, and square) and observe the behaviour of the responses.
Step 18. Stop the controller implementation by clicking on the Acquire Data button and
this will send you to the Mathematical Model tab. Shut off the PROTOTYPING
POWER BOARD switch and the SYSTEM POWER switch at the back of the
ELVIS unit. Unplug the module AC cord. Finally, end the laboratory session by
selecting the Stop button on the VI.
Revision: 01 Page: 20