0% found this document useful (0 votes)
143 views22 pages

QNET Exp2 Position PDF

This document provides instructions for a laboratory experiment on controlling the position of a DC motor using a PID controller. It includes: 1) An overview of the DC motor system and its components. 2) Four pre-lab assignments to model the open-loop system, analyze its properties, derive the closed-loop transfer function with a given controller, and design control gains. 3) An in-lab session where students will configure the hardware, implement the PID controller experimentally, and analyze the results. The objective is for students to design a closed-loop control system to regulate the DC motor's position based on its mathematical model.

Uploaded by

Sadot Daz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views22 pages

QNET Exp2 Position PDF

This document provides instructions for a laboratory experiment on controlling the position of a DC motor using a PID controller. It includes: 1) An overview of the DC motor system and its components. 2) Four pre-lab assignments to model the open-loop system, analyze its properties, derive the closed-loop transfer function with a given controller, and design control gains. 3) An in-lab session where students will configure the hardware, implement the PID controller experimentally, and analyze the results. The objective is for students to design a closed-loop control system to regulate the DC motor's position based on its mathematical model.

Uploaded by

Sadot Daz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Quanser NI-ELVIS Trainer (QNET) Series:

QNET Experiment #02:


DC Motor Position
Control

DC Motor Control Trainer (DCMCT)

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.

Regarding the Gray Boxes:

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

3. DCMCT Plant Presentation

3.1. Component Nomenclature


As a quick nomenclature, Table 1, below, provides a list of the principal elements
composing the DC Motor Control Trainer (DCMCT) system. Every element is located and
identified, through a unique identification (ID) number, on the DCMCT plant represented in
Figure 1.

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

Figure 1 DCMCT Components

3.2. DCMCT Plant Description


The DCMCT system consists of a DC motor equipped with a servo motor driving a disc
load. The motor input is a voltage with a range of ±24V. The motor has an encoder that
measures its position, a digital tachometer that measures its speed, and a current sensor to
measure the actual current being fed into the motor.

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 ⎠.

The mechanical equations describing the torque of the motor are


⎛ d2 ⎞
Tm( t ) = Jeq ⎜⎜ 2 θm( t ) ⎟⎟ [3]
⎜⎝ d t ⎟⎠
and
Tm( t ) = Kt I ( t )
, m [4]
where Tm, Jeq, ωm, Kt, Km, and Im are described in Table 2. This model does not take into
account friction or damping.

Symbol Description Unit


Vm Motor terminal voltage V
Rm Motor terminal resistance Ω
Im Motor armature current A
Kt Motor torque constant N.m/A
Km Motor back-electromotive force constant. V/(rad/s)
ωm Motor shaft angular velocity rad/s
Tm Torque produced by the motor N.m
Jeq Motor armature moment of inertia and load moment of kg.m2
inertia
Table 2 DC Motor Model Parameters

4.1. Pre-Lab Exercise #1: Open-loop Modeling


Derive the open-loop transfer function, G(s), that represents the DC motor angular position
with respect to the input voltage using equations [1], [2], [3], and [4]. The block diagram is
shown in Figure 2.

Revision: 01 Š Page: 3
DCMCT Position Control Laboratory Manual

Figure 2 Open-loop Transfer Function Diagram of Motor Position

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]
.

4.2. Pre-Lab Exercise #2: System Type


The transfer function developed in Exercise 4.1 is a mathematical representation of the DC
motor shaft position and will be used to design a controller. Before designing the control
system that will be implemented on the QNET-DCMCT module, the capability of the

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.

Figure 3 DC Motor Position Unity Feedback System

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]
.

The Laplace transform of the error is


[s7]
and becomes

[s8]

after subsituting [s6] into [s7] and simplifying. After inserting the open-loop model [s5]
into [s8] the error expression becomes

[s9]
.

The final-value theorem


[s10]
can be used because the system s⋅E(s) is stable, that is, all its poles are in the left-hand
plane except for a single pole sitting at the origin. Applying the unit step and evaluating
the final-value of the error

[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

4.3. Pre-Lab Exercise #3: Closed-loop Transfer Function


The position of the DC motor is to regulated to a desired setpoint position using a
proportional-velocity (PV) controller, as shown in Figure 4. The control enters in the input
voltage of the DC motor and has the structure
Vm( s ) = −Kp ( θm( s ) − θr( s ) ) − Kv s θm( s ) [5]
,
where Kp>0 is the proportional control gain and Kv>0 is the velocity control gain. This is
very similar to the more common proportional-derivative (PD) controller which, instead,
feeds-back the derivative of the error and not only the derivative of the position (i.e. the
velocity). The PV controller is preferable in this case because it simplifies the peak time
and overshoot calculations, which are done in the next exercise, and still results in good
performance.

Figure 4 PV Control Loop

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]
.

4.4. Pre-Lab Exercise #4: Peak Time and Overshoot


The goal is for the angle of the disk load that is connected to the motor shaft to track a user-
commanded angular position. The PV controller will be designed to result in a closed-loop
response that yields to the specifications given in Table 3. This desired response is to be
achieved by tuning the control gains Kp and Kv.

Response Property Symbol Requirement Unit


Peak time tp < 0.150 s
Overshoot Mp < 5.00 %
Settling time ts < 0.25 s
Steady-state error ess 0 deg
Table 3 Control Specifications

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]

and the damping ratio to

[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.

Symbol Description Value Unit


Rm Motor terminal resistance 2.50 s
Kt Motor torque constant 0.020 N⋅m/A
Km Motor back-electromotive force constant 0.020 V/(rad/s)
Jeq Motor armature moment of inertia and load
2.00E-005 kg⋅m2
moment of inertia.
Table 4 Model Parameter Values for Exercise 4.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 minimum damping ratio needed for an overshoot of Mp=0.05 is


. [s19]

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]
.

The minimum natural frequency to achieve a peak time of tp=0.15 seconds is

[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.

Solving for Kv in expression [s17] gives

[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

5.1. System Hardware Configuration


This in-lab session is performed using the NI-ELVIS system equipped with a QNET-
DCMCT board and the Quanser Virtual Instrument (VI) controller file
QNET_DCMCT_Lab_02_Position_Control.vi. Please refer to Reference [2] for the setup
and wiring information required to carry out the present control laboratory. Reference [2]
also provides the specifications and a description of the main components composing your
system.

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.

5.2. Experimental Procedure

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

Figure 5 Overview of QNET-DCMCT Position Control Laboratory VI

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

Figure 6 Model Fitting

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.

Model Fitted Parameter Measured Unit


Value
Rm 3.12 Ω
Kt 0.0295 N⋅m/A
Jeq 1.93E-005 kg.m2
Table 5 Model Fitted Parameters

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

Figure 7 Controller Design

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

Kp Ki Peak Max. Over- Setting Steady-State


(V/rad) (V.s/rad) Time (s) shoot (%) Time (s) Error (%)
0.5 0.0025 0.237 16.40 0.560 0.0
1.00 0.0025 0.155 30.59 0.520 0.0
2.00 0.0025 0.106 44.49 0.560 0.0
1.00 0.01 0.161 21.89 0.490 0.0
1.00 0.0200 0.173 12.95 0.390 0.0
1.00 0.1000 0.889 -0.04 0.530 0.0
1.80 0.0550 0.150 4.85 0.230 0.0
Table 6 Controller Performance

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.

Control Gain Minimum Value to meet Unit


Specifications
Kp 1.71 V/rad
Kv 0.052 V/(rad.s)
Table 7 Required PV control gains for current DCMCT unit to meet specifications

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

Figure 8 PV Controller Implementation

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

Specification Measured Unit


Value
Peak time 0.15 s
Overshoot 0.0 %
Settling time 0.2 s
Steady-state error 3.0 deg
Table 8 Actual Closed-Loop Performance

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

You might also like