You are on page 1of 43

© 2011 Quanser Inc., All rights reserved.

Quanser Inc.
119 Spy Court
Markham, Ontario
L3R 5H6
Canada
info@quanser.com
Phone: 1-905-940-3575
Fax: 1-905-940-3576

Printed in Markham, Ontario.

For more information on the solutions Quanser Inc. offers, please visit the web site at:
http://www.quanser.com

This document and the software described in it are provided subject to a license agreement. Neither the software nor this document may be
used or copied except as specified under the terms of that license agreement. All rights are reserved and no part may be reproduced, stored in
a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior
written permission of Quanser Inc.

Acknowledgements
Quanser, Inc. would like to thank the following contributors:

Dr. Hakan Gurocak, Washington State University Vancouver, USA, for his help to include embedded outcomes assessment, and

Dr. K. J. Åström, Lund University, Lund, Sweden for his immense contributions to the curriculum content.

QNET DCMCT Workbook - Student Version 2


Contents
1 Introduction 4

2 Modeling 5
2.1 Background 5
2.2 Modeling Virtual Instrument 6
2.3 Lab 1: Bump Test [60 min] 7
2.4 Lab 2: Model Validation [45 min] 8
2.5 Results 8

3 Speed Control 9
3.1 Background 9
3.2 Speed Control Virtual Instrument 10
3.3 Lab 1: Qualitative PI Control [30 min] 10
3.4 Lab 2: PI Control According to Specifications [60 min] 11
3.5 Lab 3: Set-Point Weight [15 min] 12
3.6 Lab 4: Tracking Triangular Signals [20 min] 12
3.7 Results 13

4 Position Control 14
4.1 Background 14
4.2 Position Control Virtual Instrument 16
4.3 Lab 1: Qualitative PD Control [30 min] 16
4.4 Lab 2: PD Control according to Specifications [60 min] 17
4.5 Lab 3: Response to Load Disturbance [60 min] 18
4.6 Results 19

5 System Requirements 20
5.1 Overview of Files 20
5.2 Modeling Laboratory VI 20
5.3 Speed Control Laboratory VI 20
5.4 Position Control Laboratory VI 21

6 Lab Report 25
6.1 Template for Content (Modeling) 25
6.2 Template for Content (Speed Control) 26
6.3 Template for Content (Position Control) 27
6.4 Tips for Report Format 28

QNET DCMCT Workbook - Student Version v 1.0


1 INTRODUCTION
The DC Motor Control Trainer is shown in Figure 1.1. The system consists of a direct-current motor with an encoder
and an inertia wheel on the motor shaft. The motor is driven using a pulse-width modulated (PWM) power amplifier.
The power to the amplifier is delivered using the QNET power cable from a wall transformer and the encoder is
powered by the ELVIS unit. Signals to and from the system are available on a header and on standard connectors
for control via a Data Acquisition (DAQ) card. The control variable is the voltage to the drive amplifier of the system
and the output is either the wheel speed or the angle of the wheel. Disturbances can be introduced manually by
manipulating the wheel or digitally through LabVIEWr .

Figure 1.1: QNET DC motor control trainer (DCMCT)

There are three experiments: modeling, speed control, and position control. The experiments can be performed
independently.

Topics Covered

• Modeling a DC motor experimentally

• PID Control

• Position control
• Speed control

• Disturbance rejection

Prerequisites
In order to successfully carry out this laboratory, the user should be familiar with the following:

• Transfer function fundamentals, e.g. obtaining a transfer function from a differential equation.
• Using LabVIEWr to run VIs.

QNET DCMCT Workbook - Student Version 4


2 MODELING
2.1 Background

2.1.1 Bump Test

The bump test is a simple test based on the step response of a stable system. A step input is given to the system
and its response is recorded. As an example, consider a system given by the following transfer function:
Y (s) K
= (2.1)
U (s) τs + 1
The step response shown in Figure 2.1 is generated using this transfer function with K = 5 rad/V.s and τ = 0.05 s.

Figure 2.1: Input and output signal used in the bump test method

The step input begins at time t0 . The input signal has a minimum value of umin and a maximum value of umax . The
resulting output signal is initially at y0 . Once the step is applied, the output tries to follow it and eventually settles at
its steady-state value yss . From the output and input signals, the steady-state gain is
∆y
K= (2.2)
∆u
where ∆y = yss − y0 and ∆u = umax − umin . In order to find the model time constant, τ , we can first calculate where
the output is supposed to be at the time constant from:

y(t1 ) = 0.632yss + y0 (2.3)

Then, we can read the time t1 that corresponds to y(t1 ) from the response data in Figure 2.1. From the figure we
can see that the time t1 is equal to:
t1 = t0 + τ (2.4)

QNET DCMCT Workbook - Student Version v 1.0


From this, the model time constant can be found as:

τ = t1 − t0 (2.5)

2.1.2 Model Validation

When the modeling is complete it can be validated by running the model and the actual process in open-loop. That
is, the open-loop voltage is fed to both the model and the actual device such that both the simulated and measured
response can be viewed on the same scope. The model can then be adjusted to fit the measured motor speed by
fine-tuning the modeling parameters.

See Wikipedia for more information on electric motor, mathematical model, transfer function, and LTI system theory.

2.2 Modeling Virtual Instrument


Applying a voltage to the DC motor and examining its angular rate is investigated in the laboratory. The model
simulation is ran in parallel with the actual system to allow for model tuning and validation. The LabVIEW virtual
instrument for modeling is shown in Figure 2.2. Figure 2.3 shows the graphs-view of the VI, which is used to take
measurements.

Figure 2.2: LabVIEW VI for modeling QNET DC motor

QNET DCMCT Workbook - Student Version 6


Figure 2.3: QNET DCMCT Modeling VI: sample response in Measurement Graphs

2.3 Lab 1: Bump Test [60 min]


1. Ensure the QNET DCMCT Modeling VI is open and configured as described in Section 5.2. Make sure the
correct Device is chosen.
2. Run the QNET_DCMCT_Modeling.vi. The DC motor should begin spinning and the scopes on the VI should
appear similarity as shown in Figure 2.2.
3. In the Signal Generator section set
• Amplitude = 2.0 V
• Frequency = 0.40 Hz
• Offset = 3.0 V
4. Once you have collected a step response, click on the Stop button to stop running the VI.
Note: If the motor begins to stick when the command voltage is low (1 V), decrease the Amplitude value in
the Signal Generator to 1.5 V to increase the value of the command voltage when the signal is low.
5. Attach the responses in the Speed (rad/s) and Voltage (V) graphs. See the QNET VI LabVIEW Hints section
in the QNET User Manual for information on how to export a chart or graph to the clipboard.
6. Select the Measurement Graphs tab to view the measured response, similarly as depicted in 5.2.
7. Use the responses in the Speed (rad/s) and Voltage (V) graphs to compute the steady-state gain of the DC
motor. See Section 2.1.1 for details on how to find the steady-state gain from a step response. Finally, you
can use the Graph Palette for zooming functions and the Cursor Palette to measure data. See the LabVIEW
help for more information on these tools.
8. Based on the bumptest method, find the time constant. See Section 2.1.1 for details on how to find the time
constant of the step response.

QNET DCMCT Workbook - Student Version v 1.0


9. Enter the steady-state gain and time constant values found in this section in Table 1. These are called the
bumptest model parameters.

2.4 Lab 2: Model Validation [45 min]


1. Ensure the QNET DCMCT Modeling VI is open and configured as described in Section 5.2. Make sure the
correct Device is chosen.
2. Run the QNET_DCMCT_Modeling.vi. You should hear the DC motor begin running and the scopes on the VI
should appear similarity as shown in Figure 7.
3. In the Signal Generator section set:

• Amplitude = 2.0 V
• Frequency = 0.40 Hz
• Offset = 3.0 V
4. In the Model Parameters section of the VI, enter the bumptest model parameters, K and τ , that were found in
Section 2.3. The blue simulation should match the red measured motor speed more closely.
5. Attach the Speed (rad/s) and Voltage (V) chart responses from the Scopes tab.

6. How well does your model represent the actual system? If they do not match, name one possible source for
this discrepancy.
7. Tune the steady-state gain, K, and time constant, tau, in the Model Parameters section so the simulation
matches the actual system better. Enter both the bumptest and tuned model parameters in Table 1.

2.5 Results

Description Symbol Value Unit


Section 2.3: Bumptest Modeling
Motor steady-state gain Ke,b rad/s
Motor time constant τe,b s
Section 2.4: Model Validation
Motor steady-state gain Ke,v rad/s
Motor time constant τe,v s

Table 1: QNET DCMCT Modeling results summary

QNET DCMCT Workbook - Student Version 8


3 SPEED CONTROL
3.1 Background
The speed of the DC motor is controlled using a proportional-integral control system. The block diagram of the
closed-loop system is shown in Figure 3.1.

Figure 3.1: DC Motor PI closed-loop block diagram

The transfer function representing the DC motor speed-voltage relation in Equation 3.1 is used to design the PI
controller. The input-output relation in the time-domain for a PI controller with set-point weighting is

ki (r − y)
u = kp (bsp r − y) + (3.1)
s
where kp is the proportional gain, ki is the integral gain, and bsp is the set-point weight. The closed loop transfer
function from the speed reference, r, to the angular motor speed output, ωm , is

K(kp bsp s + ki
Gω,r (s) = (3.2)
τ s2 + (Kkp + 1)s + Kki

The standard desired closed loop characteristic polynomial is

s2 + 2ζω0 + ω02 (3.3)

where ω0 is the undamped closed loop frequency and ζ is the damping ratio. The characteristic equation in 3.2,
i.e. the denominator of the transfer function, can match the desired characteristic equation in 3.3 with the following
gains:
−1 + 2 ζ ω0 τ
kp = (3.4)
K
and
ω2 τ
ki = 0 (3.5)
K

Large values of ω0 give large values of controller gain. The damping ratio, ζ, and the set-point weight parameter,
bsp , can be used to adjust the speed and overshoot of the response to reference values.

There is no tachometer sensor present on the QNET DC motor system that measures the speed. Instead the
amplifier board has circuitry that computes the derivative of the encoder signal, i.e. a digital tachometer. However to
minimize the noise of the measured signal and increase the overall robustness of the system, the first-order low-pass
filter
ωmeas
ωm =
Tf s + 1
is used. Parameter Tf is the filter time constant that determines the cutoff frequency and ωmeas is the measured
speed signal.

QNET DCMCT Workbook - Student Version v 1.0


3.2 Speed Control Virtual Instrument
Tracking a square wave with various PD gains are discussed in the laboratory as well as the effects of set-point
weighting and integrator windup. The steady-state errors due to triangular references are also assessed. The
virtual instrument for speed control is shown in Figure 3.2.

Figure 3.2: Virtual instrument for DC motor speed control

3.3 Lab 1: Qualitative PI Control [30 min]


1. Ensure the QNET_DCMCT_Speed_Control.vi is open and configured as described in Section 5.3. Make sure
the correct Device is chosen.
2. Run the QNET_DCMCT_Speed_Control.vi. The motor should begin rotating and the scopes should look sim-
ilar as shown in Figure 3.2.
3. In the Signal Generator section set:
• Signal Type = 'square wave'
• Amplitude = 25.0 rad/s
• Frequency = 0.40 Hz
• Offset = 100.0 rad/s
4. In the Control Parameters section set:
• kp = 0.0500 V.s/rad
• ki = 1.00 V/rad
• bsp = 0.00
5. Examine the behaviour of the measured speed, shown in red, with respect to the reference speed, shown in
blue, in the Speed (rad/s) scope. Explain what is happening.

QNET DCMCT Workbook - Student Version 10


6. Increment and decrement kp by steps of 0.005 V.s/rad.

7. Look at the changes in the measured signal with respect to the reference signal. Explain the performance
difference of changing kp .

8. Set kp to 0 V.s/rad and ki to 0 V/rad. The motor should stop spinning.


9. Increment the integral gain, ki, by steps of 0.05 V/rad. Vary the integral gain between 0.05 V/rad and 1.00
V/rad.
10. Examine the response of the measured speed in the Speed (rad/s) scope and compare the result when ki is
set low to when it is set high.
11. Stop the VI by clicking on the Stop button.

3.4 Lab 2: PI Control According to Specifications


[60 min]

3.4.1 Pre-Lab Exercises

1. Using the equations outlined in the Peak Time and Overshoot section of the QNET Practical Control Guide,
calculate the expected peak time, tp , and percent overshoot, PO, given the following Speed Lab Design (SLD)
specifications:
• ζ = 0.75
• ω0 = 16.0 rad/s

Optional: You can also design a VI that simulates the DC motor first-order model with a PI control and have
it calculate the peak time and overshoot.

2. Calculate the proportional, kp , and integral, ki , control gains according to the model parameters found in
Section 2 and the SLD specifications.

3.4.2 In-Lab Experiment

1. Ensure the QNET_DCMCT_Speed_Control.vi is open and configured as described in Section 5.3. Make sure
the correct Device is chosen.
2. Run the QNET_DCMCT_Speed_Control.vi. The motor should begin spinning and the scopes should look
similar as shown in Figure 3.2.
3. In Signal Generator set:

• Signal Type ='square wave'


• Amplitude = 25.0 rad/s
• Frequency = 0.40 Hz
• Offset = 100.0 rad/s
4. In the Control Parameters section, enter the SLD PI control gains found in Step 2and make sure bsp = 0.

5. Stop the VI when you collected two sample cycles by clicking on the Stop button.

6. Capture the measured SLD speed response. Make sure you include both the Speed (rad/s) and the control
signal Voltage (V) scopes.

7. Measure the peak time and percentage overshoot of the measured SLD response. Are the specifications
satisfied?

QNET DCMCT Workbook - Student Version v 1.0


8. What effect does increasing the specification ζ have on the measured speed response? How about on the
control gains? Use the damping ratio equation given in the Peak Time and Overshoot section of the QNET
Practical Control Guide for more help if needed.
9. What effect does increasing the specification w0 have on the measured speed response and the generated
control gains? Use the natural frequency equation found in the Peak Time and Overshoot section of the QNET
Practical Control Guide for more help if needed.

3.5 Lab 3: Set-Point Weight [15 min]


1. Ensure the QNET_DCMCT_Speed_Control.vi is open and configured as described in Section 5.3. Make sure
the correct Device is chosen.
2. Run the QNET_DCMCT_Speed_Control.vi. The motor should begin rotating.
3. In the Signal Generator section set:
• Signal Type = 'square wave'
• Amplitude = 25.0 rad/s
• Frequency = 0.40 Hz
• Offset = 100.0 rad/s
4. In the Control Parameters section set:
• kp = 0.050 V.s/rad
• ki = 1.50 V/rad
• bsp= 0.00
5. Increment the set-point weight parameter bsp in steps of 0.05. Vary the parameter between 0 and 1.
6. Examine the effect that raising bsp has on the shape of the measured speed signal in the Speed (rad/s) scope.
Explain what the set-point weight parameter is doing.
7. Stop the VI by clicking on the Stop button.

3.6 Lab 4: Tracking Triangular Signals [20 min]


1. Ensure the QNET_DCMCT_Speed_Control.vi is open and configured as described in Section 5.3. Make sure
the correct Device is chosen.
2. Run the QNET_DCMCT_Speed_Control.vi. The motor should begin rotating.
3. In Signal Generator set:
• Signal Type = 'triangular wave'
• Amplitude = 50.0 rad/s
• Frequency = 0.40 Hz
• Offset = 100.0 rad/s
4. In the Control Parameters section set:
• kp = 0.20 V.s/rad
• ki = 0.00 V/rad
• bsp = 1.00
5. Compare the measured speed and the reference speed. Explain why there is a tracking error.

QNET DCMCT Workbook - Student Version 12


6. Increase ki to 0.1 V/rad and examine the response. Vary ki between 0.1 V/rad and 1.0 V/rad.

7. What effect does increasing ki have on the tracking ability of the measured signal? Explain using the observed
behaviour in the scope.

8. Stop the VI by clicking on the Stop button.

3.7 Results

Description Symbol Value Unit


Section 3.4: PI Control Design
Model gain used K rad/s
Model time constant used τ s
Proportional gain kp V/(rad/s)
Integral gain ki V/rad)
Measured peak time tp s
Measured percent overshoot PO %

Table 2: QNET DCMCT Speed Control results summary

QNET DCMCT Workbook - Student Version v 1.0


4 POSITION CONTROL
4.1 Background
Control of motor position is a natural way to introduce the benefits of derivative action. In this experiment a proportional-
integral-derivative controller is designed according to specifications. The closed-loop PID control block diagram is
shown in Figure 4.1.

Figure 4.1: DC Motor PI closed-loop block diagram

The two-degree of freedom PID transfer function inside the PID block in Figure 4.1 is
∫ t
u = kp (bsp r(t) − y(t)) + ki (r(τ ) − y(τ )) dτ + kd (bsd ṙ(t) − ẏ(t)) (4.1)
0

where kp is the position proportional control gain, kd is the derivative control gain, ki is the integral control gain, bsp
is the set-point weight on the reference position r(t), and bsd is the set-point weight on the velocity reference of r(t).

The dotted box labeled Motor in Figure 4.1 is the motor model in terms of the back-emf motor constant km , the
electrical motor armature resistance Rm , and the equivalent moment of inertia of the motor pivot Jeq . The direct
disturbance applied to the inertial wheel is represented by the disturbance torque variable Td and the simulated
disturbance voltage is denoted by the variable Vsd .

4.1.1 PD Control Design

The behaviour of the controlling the motor position is first analyzed using a PD control. By setting ki = 0 in the PID
control equation Equation 4.1 and taking its Laplace transform, the PD transfer transfer function is
u = kp (r − y) + kd s(bsd r − y) (4.2)

Combining the position process model


Θm (s) K
=
Vm (s) s(τ s + 1)
with the PD control Equation 4.2 gives the closed-loop transfer function of the motor position system
K (kp + bsd kd s)
Gθ,r (s) =
τ s2 + (1 + K kd ) s + K kp

Similarly to the speed control laboratory, the standard characteristic function shown in Equation 3.3 can be achieved
by setting the proportional gain to
ω2 τ
kp = 0 (4.3)
K

QNET DCMCT Workbook - Student Version 14


and the derivative gain to
−1 + 2 ζ ω0 τ
kd = . (4.4)
K

4.1.2 Response to Load Disturbance

Next, the behaviour of the PID closed-loop system when it is subjected to a disturbance is examined. The block
diagram shown in Figure 4.2 represents the load disturbance to position response when bsp and bsd in the PID in
Equation 4.1 are both set to 1.

Figure 4.2: PID closed-loop block diagram to a load disturbance input

The closed-loop disturbance to position transfer function is


τs
Gθ,T (s) = (4.5)
Jeq (τ s3 + (1 + K kd ) s2 + K kp s + K ki )

Given a step disturbance with an amplitude of Td0


Td0
Td (s) =
s
the steady-state angle of the closed-loop system is
( )
θss = Td0 lim Gθ,T (s)
s→0

The steady-state angle of the PD control, that is when ki = 0 in 4.5, is


τ Td0
θss_P D = ,
Jeq Kkp

and the steady-state angle with integral action is

θss_P ID = 0.

Thus when the system is subjected to a disturbance, a constant steady-state error is observed when using the
PD control system. However, the disturbance is rejected when integral control is used and the steady-state angle
eventually goes to zero.

PID control design involves using the standard characteristic equation for a third-order system

(s2 + 2ζω0 + ω02 )(s + p0 ) = s3 + (2ζω0 + p0 )s2 + (ω02 + 2ζω0 p0 )s + ω02 p0 (4.6)

where ω0 is the natural frequency, ζ is the damping ratio, and p0 is a zero. The characteristic equation of the closed-
loop PID transfer function, i.e. the denominator of the transfer function 4.5, is
Kkd + 1 2 Kkp Kki
s3 + s + s+ (4.7)
τ τ τ

QNET DCMCT Workbook - Student Version v 1.0


The PID characteristic equation 4.7 matches 4.6 using the proportional gain
ω0 τ (ω0 + 2ζp0 )
kp =
K
the derivative gain
−1 + 2ζω0 τ + p0 τ
kd =
K
and the integral gain
ω02 p0 τ
ki =
K

By varying the zero location, p0 , the time required by the closed-loop response to recover from a disturbance is
changed.

4.2 Position Control Virtual Instrument


Tracking a reference position square wave using PID control is first examined in this laboratory. Then, disturbance
effects using PD and PID are studied through direct manual interaction or a simulated using a control switch in the
VI. The LabVIEW virtual instrument for position control is shown in Figure 4.3.

Figure 4.3: Virtual instrument for DC motor position control

See Wikipedia for more information on motion control, control theory and PID.

4.3 Lab 1: Qualitative PD Control [30 min]


1. Make sure the QNET_DCMCT_Position_Control.vi is open and configured as described in Section 5.4. Make
sure the correct Device is chosen.

QNET DCMCT Workbook - Student Version 16


2. Run the QNET_DCMCT_Position_Control.vi. The DC motor should be rotating back and forth and the scopes
on the VI should appear similarity as shown in Figure 4.3.
3. In the Signal Generator section set:
• Amplitude = 2.00 rad
• Frequency = 0.40 Hz
• Offset = 0.00 rad
4. In the Control Parameters section set:
• kp = 2.00 V/rad
• ki = 0.00 V/rad
• kd = 0.00 V.s/rad
5. Change the proportional gain, kp, by steps of 0.25 V/rad. Try the following gains: kp = 0.5, 1, 2, and 4 V/rad.
6. Examine the behaviour of the measured position (red line) with respect to the reference position (blue line) in
the Position (rad) scope. Explain what is happening.
7. Describe the steady-state error to a step input.
8. Increment the derivative gain, kd, by steps of 0.01 V.s/rad.
9. Look at the changes in the measured position with respect to the desired position. Explain what is happening.
10. Stop the VI by clicking on the Stop button.

4.4 Lab 2: PD Control according to Specifications


[60 min]

4.4.1 Pre-Lab Exercises

1. Using the equations in the Peak Time and Overshoot section of the QNET Practical Control Guide, calculate
the expected peak time, tp , and percentage overshoot, P O, given
• ζ = 0.60
• ω0 = 25.0 rad/s
• p0 = 0.0
Optional: You can also design a VI that simulates the DC motor first-order model with a PD control and have
it calculate the peak time and overshoot.
2. Calculate the proportional, kp , and derivative, kd , control gains according to the model parameters found in
Section 2.4 and the specifications above.

4.4.2 In-Lab Experiment

1. Make sure the QNET_DCMCT_Position_Control.vi. is open and configured as described in Section 5.4. Make
sure the correct Device is chosen.
2. Run the QNET_DCMCT_Position_Control.vi. You should see the DC motor rotating back and forth.
3. In the Signal Generator section set:
• Amplitude = 2.00 rad
• Frequency = 0.40 Hz

QNET DCMCT Workbook - Student Version v 1.0


• Offset = 0.00 rad
4. In the Control Parameters section, set the PD gains found in Step 2 in Section 4.4.1.
5. Capture the position response found in the Position (rad) scope and and control signal used in the Voltage (V)
scope.
6. Measure the peak time and percentage overshoot of the measured position response. Are the specifications
satisfied?
7. What effect does changing the specification zeta have on the measured position response and the generated
control gains? See the Peak Time and Overshoot section of the QNET Practical Control Guide for more help.
8. What effect does changing the specification ω0 have on the measured position response and the generated
control gains? See the Peak Time and Overshoot section of the QNET Practical Control Guide for more help.
9. Stop the VI by clicking on the Stop button.

4.5 Lab 3: Response to Load Disturbance [60 min]

4.5.1 Pre-Lab Exercises

1. In the Response to Load Disturbance section of the QNET Practical Control Guide, the load disturbance to
motor position closed-loop PID block diagram is found. Consider the same regulation system, r = 0, when
bsp = 1 and bsd = 1 and show the block diagram representing the simulated disturbance to motor position
closed-loop interaction (in this case Td = 0).
2. Find the closed-loop PID transfer function describing the position of the motor with respect to the simulated
disturbance voltage: Gθ,Vsd (s) = Θ(s)/Vsd (s).
3. Find the steady-state motor angle due to a simulated disturbance step of Vsd = Vsd0 /s.
4. A step of Vsd = Vsd0 /s with Vsd0 = 3 V is added to the motor voltage to simulate a disturbance torque. Evaluate
the steady-state angle of the motor when a PD controller is used with the gains kp = 2 V/rad and kd = 0.02
V.s/rad. Then, calculate the steady-state angle when using a PID controller with the gains kp = 2 V/rad, kd =
0.02 V.s/rad, and ki = 1 V/rad/s.
Optional: You can also design a VI that simulates the DC motor first-order model with a PID control and a
step disturbance and examine the steady-state angle obtained from the response.

4.5.2 In-Lab Experiment

1. Make sure the QNET_DCMCT_Position_Control.vi. is open and configured as described in Section 5.4. Make
sure the correct Device is chosen.
2. Run the QNET_DCMCT_Position_Control.vi. You should see the DC motor rotating back and forth.
3. In the Signal Generator section set:
• Amplitude = 0 rad
• Frequency = 0.40 Hz
• Offset = 0 rad
4. In the Control Parameters section set:
• kp = 2.0 V/rad
• ki = 0.0 V/(rad.s)
• kd = 0.02 V.s/rad

QNET DCMCT Workbook - Student Version 18


5. Apply the disturbance by clicking on the Disturbance toggle switch situated below the Signal Generator.

6. Examine the effect of the disturbance on the measured position. Attach a response of the motor position when
the disturbance is applied, record the obtained steady-state angle, and compare it to the value estimated in
Step 4.
7. Turn OFF the Disturbance switch

8. In the Control Parameters section set:


• kp = 2.0 V/rad
• ki = 2.0 V/(rad.s)
• kd = 0.02 V.s/rad

9. Apply the disturbance by clicking on the Disturbance toggle switch.

10. Examine the effect of the disturbance on the measured position. Explain the difference of the disturbance
response with the integral action added and compare to the result you obtained in Step 4.

11. Stop the VI by clicking on the Stop button.

4.6 Results

Description Symbol Value Unit


Section 4.4: PD Control Design
Model gain used K rad/s
Model time constant used τ s
Proportional gain kp V/rad
Derivative gain kd V/(rad/s)
Measured peak time tp s
Measured percent overshoot PO %
Section 4.5: Response to Disturbance
Measured PD steady-state error θss,P D rad
Measured PID steady-state error θss,P ID rad

Table 3: QNET DCMCT Position Control results summary

QNET DCMCT Workbook - Student Version v 1.0


5 SYSTEM REQUIREMENTS
Required Hardware

• NI ELVIS II
• Quanser QNET DC Motor Control Trainer (DCMCT). See QNET DCMCT User Manual ([2]).

Required Software

• NI LabVIEWr 2011 or later


• NI DAQmx 9.3.5 or later
• NI LabVIEW Control Design and Simulation Module 2011 or later
• ELVIS II Users: ELVISmx 4.3 or later (installed from ELVIS II CD).

 Caution: If these are not all installed then the VI will not be able to run! Please make sure all the software and
hardware components are installed. If an issue arises, then see the troubleshooting section in the QNET DCMCT
User Manual ([2]).

5.1 Overview of Files

File Name Description


QNET DCMCT User Manual.pdf This manual describes the hardware of the QNET DC Mo-
tor Control Trainer system and how to setup the system
on the ELVIS.
QNET DCMCT Workbook (Student).pdf This laboratory guide contains pre-lab questions and lab
experiments demonstrating how to design and implement
controllers on the QNET DCMCT system LabVIEWr .
QNET_DCMCT_Modeling.vi Run DC motor in open-loop.
QNET_DCMCT_Speed_Control.vi Control speed of DC motor load using a proportional-
integral (PI) compensator.
QNET_DCMCT_Position_Control.vi Control position of DC motor load using a proportional-
integral-derivative (PID) compensator.

Table 4: Files supplied with the QNET DCMCT Laboratory.

5.2 Modeling Laboratory VI


The DCMCT Modeling VI, shown in Figure 5.1 and Figure 5.2, runs the DC motor in open-loop and plots the corre-
sponding speed and input voltage responses. This VI can be used to take speed and voltage measurements of the
responses, as illustrated in Figure 5.2, and runs a simulation of the DC motor in parallel. Table 5 lists and describes
the main elements of the QNET-DCMCT Modeling virtual instrument front panel. Every element is uniquely identified
through an ID number and located in figures 5.1 and 5.2.

5.3 Speed Control Laboratory VI


In the QNET DCMCT Speed Control VI, a proportional-integral compensator is used to control the speed of the
motor. The PI control also includes set-point weight. Table 6 lists and describes the main elements of the QNET-

QNET DCMCT Workbook - Student Version 20


Figure 5.1: QNET-DCMCT Modeling virtual instrument.

DCMCT Speed Control virtual instrument user interface. Every element is uniquely identified through an ID number
and located in Figure 5.3.

5.4 Position Control Laboratory VI


The QNET DCMCT Position Control VI controls the position of the motor using a proportional-integral-derivative
controller. The main elements of the VI front panel are summarized in Table 7 and identified in Figure 5.4 through
the corresponding ID number.

QNET DCMCT Workbook - Student Version v 1.0


Figure 5.2: QNET DCMCT Modeling VI: Measurement Graphs tab selected.

ID # Label Symbol Description Unit


1 Speed ωm Motor ouput speed numeric display. rad/s
2 Current Im Motor armature current numeric display. A
3 Voltage Vm Motor input voltage numeric display. V
4 Signal Type Type of signal generated for the input
voltage signal.
5 Amplitude Generated signal amplitude input box. V
6 Frequency Generated signal frequency input box. Hz
7 Offset Generated signal offset input box. V
8 K K Motor model steady-state gain input box. rad/(V.s)
9 tau τ Motor model time constant input box. s
10 Graph Buffer Buffer length of graph data. s
11 Device Selects the NI DAQ device.
12 Sampling Rate Sets the sampling rate of the VI. Hz
13 Stop Stops the LabVIEW VI from running.
14 Scopes: Speed ωm Scope with measured (in red) and simu- rad/s
lated (in blue) motor speeds.
15 Scopes: Voltage Vm Scope with applied motor voltage (in V
red).
16 Measurement ωm Graph displays buffered measured mo- rad/s
Graphs: Speed tor speed after VI is stopped.
17 Measurement Vm Graph displays buffered input voltage V
Graphs: Voltage used after VI is stopped.

Table 5: QNET DCMCT Modeling VI Components

QNET DCMCT Workbook - Student Version 22


Figure 5.3: QNET DCMCT Speed Control VI.

ID # Label Symbol Description Unit


1 Speed ωm Motor ouput speed numeric display. rad/s
2 Current Im Motor armature current numeric display. A
3 Voltage Vm Motor input voltage numeric display. V
4 Signal Type Type of signal generated for the input
voltage signal.
5 Amplitude Reference speed amplitude input box. rad/s
6 Frequency Refernce speed frequency input box. Hz
7 Offset Reference speed offset input box. rad/s
8 Disturbance Vsd Apply simulated disturbance voltage. V
9 kp kp Controller proportional gain input box. V.s/rad
10 ki ki Controller integral gain input box. V/rad
11 bsp bsp Controller set-point weight input box.
12 Device Selects the NI DAQ device.
13 Sampling Rate Sets the sampling rate of the VI. Hz
14 Stop Stops the LabVIEW VI from running.
15 Speed ωm Scope with reference (in blue) and mea- rad/s
sured (in red) motor speeds.
16 Voltage Vm Scope with applied motor voltage (in V
red).

Table 6: QNET DCMCT Speed Control VI Components

QNET DCMCT Workbook - Student Version v 1.0


Figure 5.4: QNET DCMCT Postion Control VI.

ID # Label Symbol Description Unit


1 Position θm Motor ouput position numeric display. rad
2 Current Im Motor armature current numeric display. A
3 Voltage Vm Motor input voltage numeric display. V
4 Signal Type Type of signal generated for the input
voltage signal.
5 Amplitude Reference position amplitude input box. rad/s
6 Frequency Refernce position frequency input box. Hz
7 Offset Reference position offset input box. rad/s
8 Disturbance Vsd Apply simulated disturbance voltage. V
9 kp kp Controller proportional gain input box. V/rad
10 ki ki Controller integral gain input box. V/(rad.s)
11 kd kd Controller derivative gain input box. V.s/rad
12 fc fc Controller high-pass filter cutoff fre- Hz
quency.
13 Device Selects the NI DAQ device.
14 Sampling Rate Sets the sampling rate of the VI. Hz
15 Stop Stops the LabVIEW VI from running.
16 Position ωm Scope with reference (in blue) and mea- rad
sured (in red) motor positions.
17 Voltage Vm Scope with applied motor voltage (in V
red).

Table 7: QNET DCMCT Position Control VI Components

QNET DCMCT Workbook - Student Version 24


6 LAB REPORT
This laboratory contains three groups of experiments, namely,

1. Modeling,
2. Speed Control, and

3. Position Control.

For each experiment, follow the outline corresponding to that experiment to build the content of your report. Also,
in Section 6.4 you can find some basic tips for the format of your report.

6.1 Template for Content (Modeling)


I. PROCEDURE

1. Bumptest
• Briefly describe the main goal of the experiment.
• Briefly describe the experiment procedure in Step 5 in Section 2.3.

2. Model Validation
• Briefly describe the main goal of the experiment.
• Briefly describe tuning the model parameters in step 7 in Section 2.4.

II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.

1. Bumptest plot from step 5 in Section 2.3.

2. Model validation plot from step 5 in Section 2.4.


3. Provide applicable data collected in this laboratory from Table 1.

III. ANALYSIS
Provide details of your calculations (methods used) for analysis for each of the following:

1. Find the model steady-state gain in 7 in Section 2.3.

2. Find the model time constant in 8 in Section 2.3.

IV. CONCLUSIONS
Interpret your results to arrive at logical conclusions for the following:

1. How well does the model respresent the actual system in step 6 of Section 2.4.

QNET DCMCT Workbook - Student Version v 1.0


6.2 Template for Content (Speed Control)
I. PROCEDURE

1. Qualitative PI Control
• Briefly describe the main goal of the experiment.
• Briefly describe the experimental procedure in Step 5 in Section 3.3.

2. PI Control According to Specifications


• Briefly describe the main goal of the experiment.
• Briefly describe the experimental procedure in Step 6 in Section 3.4.
• Effect of changing damping ratio specification in Step 8 in Section 3.4.
• Effect of changing natural frequency specification in Step 9 in Section 3.4.

3. Set-Point Weight
• Briefly describe the main goal of this experiment.
• Briefly describe the experimental procedure in Step 6 in Section 3.5.

4. Tracking Triangular Signals


• Briefly describe the main goal of this experiment.
• Briefly describe the experimental procedure in Step 5 in Section 3.6.

II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.

1. SLD speed control response plot from step 6 in Section 3.4.


2. Provide applicable data collected in this laboratory from Table 2.

III. ANALYSIS
Provide details of your calculations (methods used) for analysis for each of the following:

1. Speed control analysis in Step 5 in Section 3.3.

2. Effect of changing proportional gain in Step 7 in Section 3.3.


3. Effect of changing integral gain in Step 10 in Section 3.3.

4. Peak time and percent overshoot of SLD speed control response in Step 7 in Section 3.4.
5. Effect of changing set-point weight in Step 6 in Section 3.5.

6. Effect of changing integral gain on tracking error in Step 7 in Section 3.6.

IV. CONCLUSIONS
Interpret your results to arrive at logical conclusions for the following:

1. Whether the SLD speed controller meets the specifications in Step 7 in Section 3.4.

2. Explain why there is steady-state error in the system in Step 5 of Section 3.6.

QNET DCMCT Workbook - Student Version 26


6.3 Template for Content (Position Control)
I. PROCEDURE

1. Qualitative PD Control
• Briefly describe the main goal of the experiment.
• Briefly describe the experimental procedure in Step 6 in Section 4.3.

2. PD Control According to Specifications


• Briefly describe the main goal of the experiment.
• Briefly describe the experimental procedure in Step 5 in Section 4.4.
• Effect of changing damping ratio specification in Step 7 in Section 4.5.
• Effect of changing natural frequency specification in Step 8 in Section 4.5.

3. Response to Load Disturbance


• Briefly describe the main goal of this experiment.
• Briefly describe the experimental procedure in Step 6 in Section 4.5.

II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.

1. Position control response plot from step 5 in Section 4.4.


2. PD disturbance response plot from step 6 in Section 4.5.

3. PID disturbance response plot from step 10 in Section 4.5.


4. Provide applicable data collected in this laboratory from Table 3.

III. ANALYSIS
Provide details of your calculations (methods used) for analysis for each of the following:

1. Position control analysis in Step 6 in Section 4.3.

2. Steady-state error in Step 7 in Section 4.3.


3. Effect of changing derivative gain in Step 9 in Section 4.3.

4. Peak time and percent overshoot of SLD speed control response in Step 6 in Section 4.4.

IV. CONCLUSIONS
Interpret your results to arrive at logical conclusions for the following:

1. Whether the SLD speed controller meets the specifications in Step 6 in Section 4.4.

2. Does the measured steady-state error using a PD control match what is expected in Step 6 of Section 4.5.
3. Does the measured steady-state error using a PID control match what is expected in Step 10 of Section 4.5.

QNET DCMCT Workbook - Student Version v 1.0


6.4 Tips for Report Format
PROFESSIONAL APPEARANCE

• Has cover page with all necessary details (title, course, student name(s), etc.)

• Each of the required sections is completed (Procedure, Results, Analysis and Conclusions).
• Typed.

• All grammar/spelling correct.


• Report layout is neat.

• Does not exceed specified maximum page limit, if any.


• Pages are numbered.

• Equations are consecutively numbered.


• Figures are numbered, axes have labels, each figure has a descriptive caption.

• Tables are numbered, they include labels, each table has a descriptive caption.

• Data are presented in a useful format (graphs, numerical, table, charts, diagrams).
• No hand drawn sketches/diagrams.

• References are cited using correct format.

QNET DCMCT Workbook - Student Version 28


REFERENCES
[1] Quanser Inc. QNET DC Motor Control Trainer User Manual, 2011.

QNET DCMCT Workbook - Student Version v 1.0


STUDENT WORKBOOK
QNET 2.0 HVAC Board for NI ELVIS
Developed by Quanser
Curriculum designed by:
Peter Martin, M.A.Sc., Quanser
Matthias Krug, Ph.D., Quanser
Jacob Apkarian, Ph.D., Quanser

Curriculum
complies with*

INFO@NI.COM CAPTIVATE. MOTIVATE. GRADUATE.


INFO@QUANSER.COM

*ABET Inc. is the recognized accreditor for college and university programs in applied science, computing, engineering, and technology.
On-Off Control

This Workbook and the VIs provided are designed for the second generation black Quanser QNET
2.0 HVAC Board for NI ELVIS II(+) . Second generation VIs can be identified by the small black
symbol in the upper right corner of the VI. These VIs will not work for blue first generation boards.

Topics Covered
• Relay temperature control.

Prerequisits
• The QNET HVAC has been setup and tested. See the QNET HVAC Quick Start Guide for details.
• You have access to the QNET HVAC User Manual.

• You are familiar with the basics of LabVIEW™.

QNET HVAC Workbook - Student v 2.0


1 Background
1.1 Relay Control
On-off control or relay feedback is one of the simplest control strategies. The heater is switched on when the
temperature is lower than the desired value, and the heater is switched off when the temperature is higher than the
desired value. To avoid rapid switches it is common to introduce a hysteresis in the relay switch. A block diagram
of a system with relay feedback is shown in Figure 1.1.

Figure 1.1: Block diagram of the heater system with relay feedback

The error, variable e in Figure 1.1 is the difference between the reference temperature Tr and the actual chamber
temperature Tc . The on-off controller is implemented using a relay switch with hysteresis, as shown in Figure 1.2.
The heater actuator is represented by a saturation block and the chamber plant is represented by the transfer function
P (s).

Figure 1.2: Input and output relation for an on-off controller with hysteresis

The hysteresis width ∆Th in Figure 1.2 has to be chosen such that a large measurement noise does not generate
any unintentional switches. As depicted in Figure 1.2, the output control signal voltage of the on-off controller can
be adjusted using a mean or offset Vh,off and an amplitude Vh,amp .

In the experiment, the behavior of the heater system will be investigated for different values of controller parameters.
More specifically, the control signal and the measured temperature will be observed.

QNET HVAC Workbook - Student 2


1.2 On-Off Control Virtual Instrument
In this laboratory experiment, you will work on tracking a reference temperature using a relay control. Note that
the operating range of the heater is 0 V to 10 V. The LabVIEW™ virtual instrument for on-off temperature control is
shown in Figure 1.3.

Figure 1.3: Virtual instrument for on-off heater control

See Wikipedia for more information on relay, hysteresis, mathematical model, transfer function, and LTI system
theory.

QNET HVAC Workbook - Student v 2.0


2 In-Lab Exercise
1. Open the QNET HVAC On-Off.vi. Make sure the correct Device is chosen.

2. In the Signal Generator section set:


• Signal = Square
• Amplitude (◦ C) = 0
• Frequency (Hz) = 0.0
• Setpoint (◦ C) = 50

3. In the Control Parameters section set:

• Vh_amp (V) = 4
• Vh_off (V) = 4
• ∆ Th (◦ C) = 0.25
4. Run the VI and activate the heater by pressing the Heater On/Off control button.

5. Examine the actual temperature (red) and reference temperature (blue) responses in the Temperature scope.
Wait until the the Chamber Temperature is oscillating around the setpoint.

6. Vary the relay amplitude Vh_amp in the Control Parameters section between 1 V and 8 V. Explain how the
heater voltage affects the temperature variation and, in particular, observe the frequency and amplitude of the
chamber temperature. Attach a representative temperature response.
7. Reset the Control Parameters to:

• Vh_amp (V) = 4
• Vh_off (V) = 4
• ∆ Th (◦ C) = 0.25
8. Vary the relay offset Vh_off in the Control Parameters section between 1 V and 6 V. Explain the effect of the
relay offset for the operation of the relay. In particular, describe what happens when the relay offset is larger
than the relay amplitude.

9. Reset the Control Parameters to:


• Vh_amp (V) = 4
• Vh_off (V) = 4
• ∆ Th (◦ C) = 0.25

10. Examine the effects of changing the relay width (or hysteresis) ∆Th between 0.01 ◦ C and 1.00 ◦ C. Give a short
explanation and attach a temperature response with a narrow and wide hysteresis.
11. Click on the Stop button to stop the VI.

QNET HVAC Workbook - Student 4


© 2014 Quanser Inc., All rights reserved.

Quanser Inc.
119 Spy Court
Markham, Ontario
L3R 5H6
Canada
info@quanser.com
Phone: 1-905-940-3575
Fax: 1-905-940-3576

Printed in Markham, Ontario.

For more information on the solutions Quanser Inc. offers, please visit the web site at:
http://www.quanser.com

This document and the software described in it are provided subject to a license agreement. Neither the software nor this document may be
used or copied except as specified under the terms of that license agreement. Quanser Inc. grants the following rights: a) The right to reproduce
the work, to incorporate the work into one or more collections, and to reproduce the work as incorporated in the collections, b) to create and
reproduce adaptations provided reasonable steps are taken to clearly identify the changes that were made to the original work, c) to distribute
and publically perform the work including as incorporated in collections, and d) to distribute and publicly perform adaptations. The above rights
may be exercised in all media and formats whether now known or hereafter devised. These rights are granted subject to and limited by the
following restrictions: a) You may not exercise any of the rights granted to You in above in any manner that is primarily intended for or directed
toward commercial advantage or private monetary compensation, and b) You must keep intact all copyright notices for the Work and provide the
name Quanser Inc. for attribution. These restrictions may not be waved without express prior written permission of Quanser Inc.

QNET HVAC Workbook - Student v 2.0


Qualitative PI Control

This Workbook and the VIs provided are designed for the second generation black Quanser QNET
2.0 HVAC Board for NI ELVIS II(+) . Second generation VIs can be identified by the small black
symbol in the upper right corner of the VI. These VIs will not work for blue first generation boards.

Topics Covered
• QNET HVAC temperature control.
• Proportional-integral (PI) compensator design.

• Saturation and integral wind-up.


• Feedback control set-point weighing.

Prerequisits
• The QNET HVAC has been setup and tested. See the QNET HVAC Quick Start Guide for details.

• You have access to the QNET HVAC User Manual.


• You are familiar with the basics of LabVIEW™.

QNET HVAC Workbook - Student v 2.0


1 Background
The oscillations that occur with on-off control can be avoided by using a linear proportional and integrating controller.
To design such a controller analytically a simple model representing the actual plant is needed. Since the conditions
shown in Figure 1.4 are representative for what happens when the temperature is controlled, transfer function
Kv
P (s) = (1.1)
s
can be used for the model-based approach to find the controller. The block diagram of the closed loop system is
shown in Figure 1.1.

Figure 1.1: Block diagram of heater PI closed-loop system

The process transfer function is the transfer function in Equation 1.1 and the input-output relation for a PI controller
with set-point weighting is
ki (R(s) − Y (s))
U (s) = kp (bsp R(s) − Y (s)) + (1.2)
s

The closed loop transfer function from the relative temperature reference, ∆Tr = Tr − Ta , to the output temperature
measured relative to the ambient temperature, ∆Tc = Tc − Ta , is
kp bsp s + ki
G∆Tc ,∆Tr (s) = Kv . (1.3)
s2 + Kv kp s + Kv ki

The closed-loop system has the characteristic polynomial

s2 + Kv kp s + Kv ki , (1.4)

and the desired closed loop characteristic polynomial is

s2 + 2ζω0 + ω02 , (1.5)

where ω0 is the undamped closed loop frequency and ζ is the damping ratio. The characteristic equation in
Equation 1.4 matches equation Equation 1.5 with the proportional control parameter
2ζω0
kp = , (1.6)
Kv
and the integral control gain
ω02
ki = . (1.7)
Kv

Large values of ω0 give large values of controller gain. This implies noise will create large variations in the control
signal. The set-point weight parameter bsp can be used to adjust the overshoot of the response.

Temperature control typically admits high controller gains. A consequence of this is that the controller output may
saturate and result in integrator windup. The heater is therefore useful to illustrate the usefulness of integrator
windup.

QNET HVAC Workbook - Student 2


1.1 Integral Windup
Many aspects of a control system can be understood from linear models. There are, however, some nonlinear
phenomena that are unavoidable. There are typically limitations in the actuators: a motor has limited speed, a valve
cannot be more than fully opened or fully closed, etc. For a control system with a wide range of operating conditions,
it may happen that the control variable reaches the actuator limits. When this happens the feedback loop is broken
and the system runs in open loop. The actuator remains at its limit independently of the process output as long as
the actuator remains saturated. If the integral term is large, the error must change sign for a long period before the
integrator winds down. The consequence is that there may be large transients. This phenomena is called integrator
windup and it appears in all systems with actuator saturation and controllers having integral action.

The windup effect is illustrated in Figure 1.2 by the dashed red line. The initial reference signal is so large that the
actuator saturates at the high limit. The integral term increases initially because the error is positive. The output
reaches the reference at around time t = 4 s. However, the integrator has built-up so much energy that the actuator
remains saturated. This causes the process output to keep increasing past the reference. The large integrator
output that is causing the saturation will only decrease when the error has been negative for a sufficiently long time.
When the time reaches t = 6 s, the control signal finally begins to decrease while the process output reaches its
largest value. The controller saturates the actuator at the lower level and the phenomena is repeated. Eventually
the output comes close to the reference and the actuator does not saturate. The system then behaves linearly and
settles quickly. The windup effect on the process output is therefore a large overshoot and a damped oscillation
where the control signal flips from one extreme to the other as in relay oscillations.

Figure 1.2: Illustration of integrator windup.

There are many ways to avoid windup, one method is illustrated in Figure 1.3 The system has an extra feedback
path that that sets the integrator to a value so that the controller output is always close to the saturation limit. This
is accomplished by measuring the difference es between the actual actuator output and feeding this signal to the
integrator through gain 1/Tr .

The signal es is zero when there is no saturation and the extra feedback loop has no effect on the system. When
the actuator saturates, the signal es is different from zero. The normal feedback path around the process is broken
because the process input remains constant. The feedback around the integrator will act to drive es to zero. This
implies that controller output is kept close to the saturation limit and integral windup is avoided.

The rate at which the controller output is reset is governed by the feedback gain, 1/Tr , where the tracking time
constant, Tr , determines how quickly the integral is reset. A long time constant gives a slow reset and a short time
constant a short reset time. The tracking time constant cannot be too short because measurement noise can cause
an undesirable reset. A reasonable compromise is to choose Tr as a fraction of the integrator reset time Ti for

QNET HVAC Workbook - Student v 2.0


Figure 1.3: PID controller with anti-windup

proportional control and √


Tr = Ti Td (1.8)
for PID control  
∫t
1 de(t) 
u(t) = k e(t) + e(τ )dτ + Td . (1.9)
Ti dt
0

The solid curves in Figure 1.2 illustrates the effect of anti-windup. The output of the integrator is quickly reset to
a value such that the controller output is at the saturation limit, and the integral has a negative value during the
initial phase when the actuator is saturated. Observe the dramatic improvement of using windup protection over the
ordinary PI controller that is represented by the dashed lines in Figure 1.2.

1.2 Heater Control Virtual Instrument


The LabVIEW™ virtual instrument that implements the heater PI control is shown in Figure 1.4. The control
parameters kp , ki , bsp as well as the anti-windup tracking time constant Tr can all be adjusted.

See Wikipedia for more information on process control, control theory, and PID.

QNET HVAC Workbook - Student 4


Figure 1.4: Virtual instrument PI control for heater

QNET HVAC Workbook - Student v 2.0


2 In-Lab Exercise
2.1 Qualitative PI Control
1. Open the QNET HVAC PI Control.vi. Make sure the correct Device is chosen.
2. In the Signal Generator section set:
• Signal Type = Square
• Amplitude (◦ C) = 2
• Frequency (Hz) = 0.01
• Offset (◦ C) = 50
3. In the Control Parameters section set:
• kp (V/◦ C) = 20
• ki (V/1000.s.◦ C)= 0
• bsp = 1
4. Make sure the Anti-Windup On/Off control is off.
5. Run the VI and activate the heater by pressing the Heater On/Off button.
6. Examine the temperature response to the square wave input.
7. Change the proportional gain kp between 2 V/◦ C and 20 V/◦ C. Explain the effect proportional gain has on
the temperature control performance. Attach a temperature response when using a low and high proportional
gain.
8. Set kp to 10 V/(◦ C.s) and vary the integral gain ki between 20 V/(1000.s.◦ C) and 500 V/(1000.s.◦ C and observe
its effect on the temperature control performance. Show the temperature response with a low and high integral
gain.
9. Click on the Stop button to stop running the VI.

2.2 Saturation and Windup


1. Ensure the QNET HVAC PI Control.vi is running.
2. In the Signal Generator section set:
• Signal Type = Square
• Amplitude (◦ C) = 2
• Frequency (Hz) = 0.01
• Offset (◦ C) = 50
3. In the Control Parameters section set:
• kp (V/◦ C) = 10
• ki (V/1000.s.◦ C) = 2000
• bsp = 1
4. In the Anti-Windup section set:
• Tr = 10 s
5. What effect does increasing the anti-windup reset parameter have on the control signal and on the temperature
response? Attach a response of the temperature and heater voltage for Tr = 20 s.

QNET HVAC Workbook - Student 6


6. In the Control Parameters section, set Tr = 10 s.

7. What effect does decreasing Tr have on the control signal and on the temperature response? Capture the
temperature response as well as the heater voltage for Tr = 1 s.

8. Click on the Stop button to stop running the VI.

2.3 Set-Point Weight


1. Ensure the QNET HVAC PI Control.vi is running.
2. In the Signal Generator section set:

• Signal Type = Square


• Amplitude (◦ C) = 2
• Frequency (Hz) = 0.01
• Offset (◦ C) = 50
3. In the Control Parameters section set:

• kp (V/◦ C) = 10
• ki (V/1000.s.◦ C)= 1000
• bsp = 0
4. In the Anti-Windup section set:

• Tr = 10
5. Examine the response of the measured temperature in the Temperature scope as well as the input heater
voltage in the Input Voltage scope. Attach the temperature and heater voltage responses.
6. Click on the Stop button to stop running the VI.

7. Try the same controller with a set-point weight of 1. Set bsp = 1 and restart the VI.
8. Study what effects raising bsp has on the measured temperature signal in the Temperature scope and the
control signal shown in the Input Voltage scope. Capture the temperature response and its corresponding
heater voltage.
9. Click on the Stop button to stop running the VI.

QNET HVAC Workbook - Student v 2.0


© 2014 Quanser Inc., All rights reserved.

Quanser Inc.
119 Spy Court
Markham, Ontario
L3R 5H6
Canada
info@quanser.com
Phone: 1-905-940-3575
Fax: 1-905-940-3576

Printed in Markham, Ontario.

For more information on the solutions Quanser Inc. offers, please visit the web site at:
http://www.quanser.com

This document and the software described in it are provided subject to a license agreement. Neither the software nor this document may be
used or copied except as specified under the terms of that license agreement. Quanser Inc. grants the following rights: a) The right to reproduce
the work, to incorporate the work into one or more collections, and to reproduce the work as incorporated in the collections, b) to create and
reproduce adaptations provided reasonable steps are taken to clearly identify the changes that were made to the original work, c) to distribute
and publically perform the work including as incorporated in collections, and d) to distribute and publicly perform adaptations. The above rights
may be exercised in all media and formats whether now known or hereafter devised. These rights are granted subject to and limited by the
following restrictions: a) You may not exercise any of the rights granted to You in above in any manner that is primarily intended for or directed
toward commercial advantage or private monetary compensation, and b) You must keep intact all copyright notices for the Work and provide the
name Quanser Inc. for attribution. These restrictions may not be waved without express prior written permission of Quanser Inc.

QNET HVAC Workbook - Student 8

You might also like