0% found this document useful (0 votes)
9 views12 pages

Department of Electrical Engineering EE361L: Control Systems Lab

Uploaded by

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

Department of Electrical Engineering EE361L: Control Systems Lab

Uploaded by

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

Department of Electrical Engineering

EE361L: Control Systems Lab

Course Instructor: Abdullah Mughees Date:

Lab Engineer: Muhammad Kashif Semester: Spring 2024

Batch: BSEE 21

Lab 11: Modelling and Control of an HVAC System

Name Roll No. Lab Marks

Faiza Hamid Bsee21037

Graded on: _______________________________

Instructor’s Signature: _______________________________


Learning Outcomes
After completing this lab with the aid of LABVIEW, students should be able to

● Derive a transfer function model of a small HVAC system using measured data.

● Control the average temperature of the chamber on QNET 2.0 HVAC board by
implementing the following controllers in LabVIEW.
o Hysteresis controller
o PI controller
11.1 Quanser HVAC Board
The QNET HVAC Board, shown in Figure 11-1 is a thermal control system designed for
various temperature and heat flow control experiments. This board has an array of resistors as
a heater (labeled 9) and a fan (labeled 8) to force the heated air through a see-through air flow
channel. There are seven sensors to sense the temperature at various points along the channel
(labelled 11 and 12) and an additional sensor (labeled 10) to measure the ambient
temperature. With the fan running at a fixed speed, we can change the voltage of the heater to
vary the temperature of the air that the fan forces through the chamber. Figure 11-1 shows the
HVAC Board with its important components labelled.

Figure 11-1: Quanser HVAC Board

2
No. Description No. Description
1 +5 V , +15 V , −15 V indicators 9 Heater
2 User and Status indicators 10 Ambient temperature sensor
3 24 V DC power jack 11 Heater temperature sensor
4 Fuse 12 Channel temperature sensors
5 External power indicator 13 Fan power connector
6 Heater indicator 14 Heater power connector
7 Fan indicator 15 Fan connector
8 5 V DC fan 16 Temperature sensor connector
Table 11-1: List of components on the HVAC Board

The HVAC Board has an onboard data processor to initialize and extract data from the
sensors and a power amplifier to provide voltage the heater. The board attaches with an Elvis
II module and communicates with it via a PCI connector. The Elvis module relays the sensor
data to the computer and gets the commands for the heater voltage. All the communication
between Elvis and computer is managed through LabVIEW.
11.2 Using the Quanser HVAC Board with LabVIEW
The accompanying support VIs initialize various control and sensing elements on the board
beforehand. They provide blocks to get sensor data and set the heater voltage. In the
following sections, some of these blocks and data processing techniques are described.
11.2.1 Initialization
In the VIs that you have been provided, there are some initialization blocks. These blocks,
shown in Figure 11-2, initializes the hardware components according to the following
information.
BOARD ENABLE: Initializes the QNET board on a particular Elvis module.
SENSOR INIT: Initializes the analog data acquisition channel corresponding to the
temperature sensors.
FAN INIT: Initializes the analog output channel for the fan voltage.
MOTOR INIT: Initializes the analog output channel for the DC motor
MUX INIT: Initializes the digital multiplexor to send encoder data from the motor.

Figure 11-2: Initialization blocks

3
11.2.2 Reading the Temperature
This block, shown in Figure 11-3, reads the temperature from the eight sensors mounted on
the board. Its output is an array of eight elements containing temperature in the order shown
in Table 11-2.

Figure 11-3: Read temperature

Element Number Temperature


1 Ambient temperature
2 Temperature of heater chamber
3 Channel temperature 1
4 Channel temperature 2
5 Channel temperature 3
6 Channel temperature 4
7 Channel temperature 5
8 Channel temperature 6
Table 11-2: Order of elements in the temperature array

11.2.3 Writing Voltage to Heater


The DAQWrite block is configured to provide voltage to the heater via a digital to analog
converter and an onboard power amplifier. Note that this block must always be preceded by a
saturation block to limit the heater voltage to ± 10V , otherwise the analog write block for the
motor voltage might raise and stop the execution of the program if a voltage outside the range
of ± 10V is written to it. Also, there is a Boolean control to cut off the heater voltage if the
user wants to turn off the heater, as shown in Figure 11-5. This control is connected as an
input to an If block with True option as the voltage from the controller and False voltage as a
constant zero.

Figure 11-4: Write voltage to heater

4
Figure 11-5: Heater On/Off button

11.2.4 Splitting the Temperature Array


An Index Array block splits the 8 element temperature array from the Temp Read block to 8
separate signals. These temperatures can then be used in the control process.

Figure 11-6: Splitting the temperature array

11.2.5 Calculating the Average Chamber Temperature


The following diagram shows how the average chamber temperature can be calculated from
the individual temperatures. The individual elements are first combined into an array using
the Build Array block. Then an Add Array Elements block calculates the sum of all elements
which is finally divided by the number of elements to find the arithmetic mean. It is
important to choose only the temperature measurements from the six channel sensors, as
listed in Table 11-2.

Figure 11-7: Calculating the average temperature

11.2.6 Relay Block for Hysteresis


The Relay block in LabVIEW can switch an output between two options depending on the
value of a designated input. The upper and lower thresholds for hysteresis are provided as
two inputs to the block. The Relay is accessible in the Control and Simulation -> Simulation -
> Nonlinear Systems. You can double-click the relay block to adjust its switching parameters,
high threshold, low threshold, output when high and output when low. The function of each
parameters is evident from its name. The relay’s output is equal to output when high if the
input is higher than the high threshold and the output is equal to output when low if the input
is lower than the low threshold.

Figure 11-8: Relay block in LabVIEW

5
11.2.7 Generating Tracking Signal for the Control System
A Signal generator block can be used to generate waveforms to provide to the control system
as the tracking input signal. There is a cluster of controls placed on the Front Panel to act as
the parameters for the signal generator.

Figure 11-9: Signal generator with controls

11.2.8 Starting and Stopping the VI


The VI can be started by entering Ctrl+R from the keyboard or pressing the Run button near
the top left corner. It is important not to stop the VI from the usual Abort Execution
button near the Run button. The VI must be stopped by pressing the Stop control in the
Front Panel, as shown in Figure 11-10, to properly de-initialize and disable the temperature
sensors and heater elements on the HVAC Board.

Figure 11-10: Stop button for properly de-initializing the board’s components and stopping the VI

11.3 Task 1: Building the Transfer Function Model of the HVAC System
Objective: Identify the parameters in the transfer function model of the HVAC System using
measured data.
The heater in the HVAC board raises the temperature of the air flowing in the chamber. As
the voltage is applied to the heater, the initial relation between the temperature measured by
the sensor and the heater voltage can be approximated by a pure integrator as the following
transfer function. K v is a parameter depending on the thermal and electrical properties of this
system.
T H ( s) K v
G ( s )= =
V H (s ) s

The parameter K v can be found by driving the heater with a step voltage and observing the
resulting temperature curve. If the heater is provided with a voltage V H ( s ) , the resulting
temperature response will be as follows.
Kv V H (s )
T H ( s )=
s
Taking inverse Laplace transform, we get

T H ( t ) =K v ∫ ( v H ( t ) ) dt

6
If v H ( t ) is constant, we get the following expression for T H ( t ) , which is the equation of a
straight line with a gradient K v v H .
T H ( t ) =K v v H t

This result can be used to find the parameter K v of the system by measuring the gradient of
the temperature-time graph when the heater is provided with a constant voltage for an initial
few seconds.
1. Open the accompanying file QNET HVAC Quick Start VI.vi and turn on the HVAC
board. Make sure the heater switch, shown in Figure 11-5 is ON. Set the heater voltage to
10 V . Run the VI and observe the average temperature of the chamber. As soon as the
temperature crosses 37 ° C , stop the VI. Take two points on the temperature graph in the
initial region where the curve is a straight line. Calculate the parameter K v from the
gradient of the graph. [5
points]

dT H
=¿ ___________0.2__________
dt

K v =¿ ________0.02___________

11.4 Task 2: Temperature Control Using Hysteresis Method


Objective: Build a hysteresis controller on LabVIEW to control the average temperature of
the HVAC chamber.
A simple On/Off or a bang-bang controller works by just turning the plant on to full power or
turning it off. In our temperature control application, on-off control means that the heater
turns on at maximum power if the temperature is above the set point temperature and turned
off when it is below the set point. However, such a controller would turn the heater on and off
very rapidly and may cause malfunction. So practically, a hysteresis controller is used which
defines two thresholds above and below the set point and turns the heater on if the
temperature falls below the lower threshold and turns it on if the temperature rises above the
upper threshold. This provides a cushion between turning the heater on and off and prevents
rapid switching.
For a feedback system shown in the following diagram, with the controller D ( s ) and the plant
G ( s ), the controller works on the following hysteresis function.

7
R (s ) E ( s) U (s ) C (s)
+¿ D (s ) G (s )
−¿

Figure 11-11: Feedback control system

u ( t )={u L , e ( t ) >e th u H , e ( t ) ←e th }

Here, u ( t ) is the input to the plant, e ( t ) is the error from the reference input, u H and u L are the
upper and lower input levels, and e th is the hysteresis threshold. This function implies that the
output of the controller is at high level, u H if the error is lower than a threshold and the output
is at the low level, u L, if the error is higher than a threshold.
For most common control systems, such a naïve controller would cause severe oscillations
that aren’t usually acceptable. But with the slow response of thermal systems and high heat
capacity relative to the powers of the heaters, these controllers do the job for temperature
control systems with oscillations in temperature limited to within an acceptable range.
1. Run the VI and turn off the heater using the Heater On/Off button in the Front Panel to
allow the system to cool down. Wait until the average temperature is below 30 ° C .

2. Build a hysteresis controller to control the average temperature of the chamber on the
HVAC board. Use the Relay block to implement the hysteresis controller. Use 35 ° C as
the required temperature. Implement the u L, u H and e th as numeric controls on the front
panel so you can change them while the VI is running. Use the following values of u L, u H
and e th for this part. Show the graph of temperature and set point to the lab instructor when
the chamber temperature oscillates steady around the set point. [5
points]

Parameter Value
uL 0
uH 8
e th 2

3. Measure the peak-to-peak change in the average chamber temperature when it is


oscillating steadily around the set point. [2
points]
Average chamber temperature is 4.2 𝑪𝒐

4. Measure the time period of oscillations of the average chamber temperature. [2 points]

8
The time period of oscillation of the average chamber is 80sec.

5. Decrease the value of e th to a point where the time period of the oscillations is about 18 s .
Write the value of e th and the peak-to-peak measurement of temperature oscillations.
[5 points]
The value of 𝒆𝒕𝒉 is 0.15 peak-to-peak measurement of temperature oscillation.

6. Change the values of u H , u L to minimize the amplitude of temperature oscillation. Measure


the peak to peak change in temperature and time period of oscillations in the steady state.
[5 points]

T pk−pk =¿___0.4C________________

T osc=¿ ________25s___________

11.5 Task 3: Temperature Control Using PI Controller


Objective: Design and implement a PI controller to control the chamber temperature
according to the given specifications.
The hysteresis controller in the previous task can perform well enough for some applications,
but you will have noticed that there are oscillations in the controlled temperature, which is
not always acceptable where a precise control of temperature is required. To control the
temperature exactly at the set point, we need at least a proportional controller. But as you will
see in this task, the designed P gain comes to be quite low for this HVAC system. This would
cause large steady state errors in the controlled temperature. Thus to achieve a stable
temperature control with no steady state error, we will implement a PI controller as D ( s ) in
the temperature control loop. The transfer function of the PI controller and the open loop
system are given below.

T r (s ) E ( s) U (s ) T ( s)
+¿ D (s ) G (s )
−¿

Figure 11-12: Temperature control system

K P s+ K I Kv
D ( s )= , G ( s )=
s s
The coefficients K P and K I need to be designed so that the closed loop system has some
required characteristics.

9
To implement the controller D ( s ) in LabVIEW, you have to subtract the real time
temperature of the chamber, T ( t ), from the reference temperature, T r ( t ) to get the temperature
error, e ( t ). Then the voltage for the heater, u ( t ), would be calculated using the following
formula.

u ( t )=K P e ( t ) + K I ∫ e ( t ) dt

The calculated voltage would then be applied to the heater using the method describer in
section 11.2.3.
1. Run the VI and turn off the heater using the Boolean control in the Front Panel to let the
system cool down. Wait until the average temperature is below 30 ° C .

2. Find the closed loop transfer function, T ( s ), for the temperature control system given in
the above diagram. [3 points]
GD
T(s)=
1+ GD
T(S)=kv ¿ ¿

3. Given the step response specification T p=120 s and T s=580 s, find the corresponding
values of σ and ω d for the closed-loop system. [2 points]
π
Wd= =0.026
120
4
𝝈= =0.0069
580
0.069
N= =0.26
0.026
Wn=√ ❑=0.027

4. Build a second order transfer function with the σ and ω d found above. [2 points]
0.00073
2
s + 0.0138 s +0.00073

5. Compare the characteristic polynomial of the transfer function found in the previous part
with the T ( s ) for a PI controller and the HVAC system, as derived in part 2, and find the
values of K P and K I . Use the value of K v found in Task 1. [2 points]

Kp=0.689
K1=0.037

10
6. Build the PI controller in LabVIEW and use it to control the average chamber temperature
of the HVAC Board. Set the desired temperature to 35 ° C . Show the resulting temperature
curves to the lab instructor. [5 points]

7. Form the temperature graph, measure the T p, T s and %O.S. and e ss after the system settles
to a steady state. [3 points]
Ess=0.01
%os=1.82%
Ts=200s
Tp=80sec

11
Assessment Rubrics
Method:
Lab report evaluation and instructor observation during lab sessions.
CLO Able to complete the tasks Able to complete the Tasks completion below Marks
Performance
over 80% (4-5) tasks 50 – 80% (2-3) 50% (0-1)
1. Teamwork 1 Actively engages and Cooperates with other Distracts or
cooperates with other group members in a discourages other
group members in an reasonable manner. group members from
effective manner. conducting the
experiment.
2. Laboratory 1 Respectfully and Observes safety rules Disregards safety
safety and carefully observes safety and procedures with rules and procedures.
disciplinary rules and procedures minor deviation.
rules
3. Realization of 3 Selects relevant Needs guidance to Incapable of selecting
experiment equipment to the select relevant relevant equipment to
experiment, develops equipment to the conduct the
setup diagrams of experiment and to experiment.
equipment connections develop equipment
or wiring. connection or wiring
diagrams.
4. Conducting 3 Uses each equipment and Uses the equipment Unable to use
experiment components as intended, and components with appropriate
conducting the minor error. Needs equipment, and
experiment perfectly. help in conducting experiment is
experiment. substantially wrong.

5. Data 3 Plans data collection to Plans data collection Does not know how
collection achieve experimental to achieve to plan data collection
objectives, and conducts experimental to achieve
an orderly and a objectives, and experimental goals;
complete data collection. collects complete data data collected is
with minor error. incomplete and
contain errors.
6. Data analysis 3 Accurately conducts Conducts Unable to conduct
simple computations and computations and simple analysis on
statistical analysis using analysis on collected collected data; no
collected data; correlates data with minor error; attempt to correlate
experimental results to reasonably correlates experimental results
known theoretical values. experimental results with known
to known theoretical theoretical values.
values.
7. Computer use 3 Uses computer to collect Uses computer to Does not know how
and analyze data collect and analyze to use computer to
effectively. data with minor error. collect and analyze
data.

Total (out of 35)

12

You might also like