• No results found

Heat Flow

N/A
N/A
Protected

Academic year: 2022

Share "Heat Flow"

Copied!
46
0
0

Loading.... (view fulltext now)

Full text

(1)

Modeling and Process Control

Heat Flow

Instructor Manual

(2)

Table of Contents

1. INTRODUCTION...1

2. PREREQUISITES...2

3. OVERVIEWOF FILES...2

4. PRE-LAB...3

4.1. Modeling...4

4.1.1. Dynamics of the Heat Flow Experiment...4

4.1.2. Bumptest...4

4.2. Desired Response...6

4.2.1. Second-Order System...6

4.2.2. Peak Time and Overshoot...7

4.2.3. Steady-State Error...8

4.2.4. Heat Flow Specifications...11

4.3. Temperature Control...12

4.3.1. On-Off Control...12

4.3.2. Proportional-Integral Control...13

5. IN-LAB PROCEDURES...19

5.1. Bumptest Modeling...19

5.1.1. Getting Started...20

5.1.2. Running the Bumptest...21

5.2. On-Off Temperature Control...26

5.3. PI Temperature Control...31

6. REFERENCES...44

(3)

1. Introduction

The Quanser Heat Flow Experiment (HFE) is the process control plant shown in Figure 1. This system consist of a chamber equipped with three temperature sensors located equidistantly. There is a coil- based heater and a blower at one end chamber that is used to transfer heat conductively. The HFE has a built-in amplifier to deliver power to the heater and blower and the amount of power is controlled using analog signals. There is also a tachometer mounted on the blower to measure the speed of the fan.

The purpose of the experiment is to model the system using the “bumptest” method. This is a simple technique used to find the first-order model of the system (for a particular temperature sensor). The second main topic is temperature control. The temperature of the chamber is regulated by using an on- off control and a PID-based compensator. The on-off control is a more basic approach that does not require any knowledge of the plant. The PID algorithm is designed using the model previously found, and can obtain better performance. More practical process control related concepts are discussed, such as set-point point and integral anti-windup.

Figure 1: Quanser Heat Flow experiment.

The following topics are covered in this laboratory:

Derive a first-order transfer function model of the system using the Bumptest method.

(4)

related strategies such as set-point weight and anti-windup.

2. Prerequisites

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

Data acquisition card (e.g. Q8) and the main components of the Heat Flow (e.g. actuator, sensors), as described in References [1] and [2], respectively.

Wiring and operating procedure of the Heat Flow plant with the DAC device, as discussed in Reference [2].

Transfer functions.

Designing a PID controller.

3. Overview of Files

Table 1 below lists and describes the various files supplied with the experiment.

File Name Description

Heat Flow Laboratory – Student Manual.pdf

This manuals goes through some pre-lab and in-lab exercises to model and control the Quanser Heat Flow device.

Heat Flow Laboratory – Instructor Manual.pdf

Same as the Student version except the solution boxes are unshaded.

Heat Flow – User Manual Describes the Heat Flow hardware, gives its specifications, and explains how to setup and wire the system to perform labs.

setup_hfe.m The main Matlab script that sets the sensor calibration gains of the Heat Flow. Run this file only to setup the laboratory.

hfe_lib.mdl Heat Flow Simulink library that has the Heat Flow subsystem. This subsystem contains QuaRC block that interface to the Heat Flow hardware, i.e. heater and blower and temperature sensors.

q_hfe_open_loop.mdl Simulink file that can feed open-loop voltages to the heater and blower and measure the temperatures using QuaRC.

q_hfe_on_off.mdl Simulink file that implements the on-off controller on the Heat Flow system using QuaRC.

q_hfe_pi.mdl Simulink file that implements the PI controller on the Heat Flow system using QuaRC.

Heat Flow.mws Maple worksheet used to derive the model as well as the various controllers. Maple 9, or a later release, is required to open, modify, and execute this file.

(5)

File Name Description

Heat Flow.html HTML presentation of the Maple Worksheet. It allows users to view the content of the Maple file without having Maple 9

installed. No modifications to the equations can be performed when in this format.

d_bumptest.m Finds the steady-state gain and time constant of a bumptest response.

d_hfe_pi.m Designs a proportional-integral (PI) temperature controller for the Heatflow plant based on the desired overshoot and peak time specifications.

plot_hfe_response.m Generates a Matlab figure that plots the Heat Flow response using recent data in the workspace or from the saved data_A_B_temp and data_A_B_u MAT files described below.

data_A_B_temp.mat Saved closed-loop temperature response data. Contains the setpoint and measured temperature. The A denotes the controller used, e.g.

on-off or pi, and the B provides additional information, e.g. specs is the PI response when specifications where used.

data_A_B_u.mat Saved heater and blower voltage inputs for closed-loop response.

See what A and B denote in the row above.

plot_data_open_loop_heater.m Used to plot the bumptest response from the

sample_open_loop.mat file. It uses d_bumptest.m and d_hfe_pi.m to calculate the model parameter automatically and the

corresponding PI gains.

sample_open_loop.mat Sample bumptest response. Contains all three temperatures, heater voltage, and blower voltage.

meas_step_rsp_specs Used to computes the peak time, settling time, percentage overshoot, and steady-state error automatically from a step response.

Table 1: Files supplied with the Heat Flow experiment.

4. Pre-Lab

Section 4.1 explains how to model the Heat Flow plant. In Section 4.2, the percentage overshoot, steady-state error, and peak time desired response is discussed. Two controllers to regulate the

(6)

4.1. Modeling

4.1.1. Dynamics of the Heat Flow Experiment

The complete thermodynamic model of the Quanser Heat Flow system is a challenge beyond the scope of this manual. The block diagram shown in Figure 2 depicts the inputs and outputs of the system. The blower voltage, Vb, and heater voltage, Vh, applied affects how the chamber temperature changes with respect to the ambient (i.e. room) temperature, denoted by variable Ta.

Figure 2: Dynamics of Heat Flow system.

The temperature of the chamber at sensor n can be described by d =

d

tTn t( ) f(Vh Vb Ta xn, , , )

, [1]

where xn is the distance between sensor n and the heater. For the purposes of designing a temperature controller, a simple first-order transfer function model of the system will suffice. Consider the transfer function

=

Tn s( ) Kn ( )Vh s +

τn s 1 , [2]

where for temperature sensor n, Kn is the steady-state gain and τn is the time constant.

4.1.2. Bumptest

The bumptest is a simple test based on a step response for a stable system. It is carried out in the following way. A constant input is chosen. A stable system will then reach an equilibrium. The input is then changed rapidly to a new level and the output is recorded.

(7)

Figure 3: Input and output signal used in the bumptest method.

The step response shown in Figure 3 is generated using the transfer function ( ) =

Y s ( ) U s

K +

τ s 1 [3]

with the parameters =

K 10.0 [4]

and

=

τ 5.0 [ ]s . [5]

The input signal, u, is a step that 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 engaged, the output eventually settles to its steady-state value yss. From the output and input signals, the steady-state gain is

= Ky

u [6]

where

=

y yss y0 − . [7]

(8)

=

u umax umin − . [8]

In order to find the model time constant, τ, the output signal at y(t1) must be measured. It is defined =

y t1( ) 0.632 yss y0 + [9]

and the time is t1 = t0 + τ

. [10]

From this, the model time constant is =

τ t1 t0 − . [11]

4.2. Desired Response

4.2.1. Second-Order System

The block diagram shown in Figure 4 is a general unity feedback system with a compensator C(s) and a transfer function representing the plant, P(s). The measured output, Y(s), is supposed to track the reference signal, R(s), and the tracking has to satisfy certain specifications.

Figure 4: Unity feedback system.

The output of the system shown in Figure 4 is =

( )

Y s C s( )P s (( ) R s( ) − Y s( )) [1]

and by solving for Y(s) the resulting closed-loop transfer function =

( )

Y s C s( )P s( )R s( ) +

1 C s( )P s( ) [2]

is obtained. Recall that the HFE voltage-to-temperature transfer function =

( )

P s K

+

τ s 1 . [3]

(9)

As will be seen in the control design section, using a proportional-integral (PI) compensator with a first-order plant, such as in [3], the closed-loop transfer function in [2] has the form

( ) = Y s

( ) R s

ωn2

+ +

s2 2ζ ωn s ωn2 [4]

where ωn is the natural undamped frequency and ζ is the damping ratio. This is called the standard second-order transfer function and the properties of its response depend on the values of ωn and ζ parameters.

4.2.2. Peak Time and Overshoot

Consider when a second-order system as shown in Equation [4] is subjected to a reference step =

( ) R s R0

s [5]

with an step amplitude of R0 = 1.5. The obtained response is shown in Figure 5, below, where the red trace is the output response, y(t), and the blue trace is the reference step, r(t).

Figure 5: Standard second-order step response.

The maximum value of the response is denoted by the variable y and it occurs at a time t . For a

(10)

= PO

100 (ymax R0 − )

R0 .

[6]

From the initial step time, t0, the time it takes for the response to reach its maximum value is

tp = tmax t0 − . [7]

This is called the peak time of the system.

In a second-order system, the amount of overshoot depends solely on the damping ratio parameter and it can be calculated using the equation

= PO 100 e





− π ζ 

− 1 ζ 2

.

[8]

The peak time depends on both the damping ratio and natural frequency of the system and it can be derived that the relationship between them is

tp = π ωn 1 − ζ 2

.

[9]

Generally speaking then, the damping ratio affects the shape of the response while the natural frequency affects the speed of the response.

4.2.3. Steady-State Error

Steady-state error is the difference between the reference and output signals after the system response has settled. Thus for a time t when the system is in steady-state, the steady-state error equals

ess = rss t( ) − yss t( ) [10]

where rss(t) is the value of the steady-state reference and yss is the steady-state value of the process output.

Assume the compensator is .

1. Find the error transfer function E(s) in Figure 1 in terms of the reference R(s), the plant P(s), and the compensator C(s).

(11)

Solution:

As shown in Figure 1, the Laplace transform of the error is =

( )

E s R s( ) − Y s .( ) [s1]

Substituting the closed-loop transfer function in [2] for Y(s) yields the error transfer function =

( )

E s R s( ) +

1 C s( )P s( ) . [s2]

2. Recall the final-value theorem ess = lim

s 0

s ( )E s

. [11]

Given that the compensator equals =

( )

C s kp , [12]

the reference is the step defined in [5], and the process model is the transfer function in [3], find the steady-state error of the system.

0 1 2

(12)

Solution:

Substituting the process model in [3], the reference signal in [5], and the compensator defined in [12] into the error transfer function found in [s2] results in the expression

= ( )

E s R0

s

 



+ 1 kp K

+

τ s 1 .

[s3]

Applying the final-value theorem to the above system gives ess R0 = 

 



lim →

s 0

+

τ s 1

+ +

τ s 1 kp K .

[s4]

When evaluated, the resulting steady-state error due to a step response is ess = R0

1 kp K + .

[s5]

3. Based on the steady-state error result from a step response with a proportional gain, what Type of system is the Heat Flow when performing temperature control (0, 1, 2, or 3)?

Solution:

This is a Type 0 system because there is a constant steady-state error given a step reference.

0 1 2

0 1 2

(13)

4.2.4. Heat Flow Specifications

The time-domain specifications for controlling the temperature of the HFE are:

ess 0 = , [13]

tp 10.0 [ ] = s

, and [14]

=

PO 10.0 ["%" .] [15]

Thus when tracking the desired temperature, the transient response should have a peak time less than or equal to 10.0 seconds, an overshoot less than or equal to 10 %, and the steady-state response should have no error.

Calculate what the maximum peak of the response, in degrees Celsius, when the desired temperature is =

Td t( ) T ,d off R0 + ustep(tt0) . [16]

The step function is defined as =

ustep( )τ { 1 0 ≤ τ -1 τ < 0 ,

[17]

the offset temperature is

T ,d off 47.5 [ = degC]

, [18]

and the amplitude of the step is R0 5.0 [ = degC]

. [19]

Thus when the step goes positive to 1, the desired temperature will be at 50.0 °C.

Solution:

Using the expression =

T tp( ) T ,d off − 1 + 2R0 R0

 



+

1 PO

100 , [s6]

the maximum overshoot of the response should not exceed =

T tp 50.5 [( ) degC]

. [s7]

This is the overshoot constraint of the system.

0 1 2

(14)

4.3. Temperature Control

4.3.1. On-Off Control

An on-off control can be implemented using a variety of switches and its design requires no model of the plant. The block diagram shown in Figure 6 shows the on-off controller that will be used with the Heat Flow. The on-off control is implemented using a relay switch. Also shown in the diagram, is the nonlinear dynamics of the heater actuator, which is limited between 0 V and 5.0 V.

Figure 6: On-off control with relay.

The relay characteristics is illustrated in Figure 7. When on, the relay switch outputs a voltage of Vh,on

to the heater. When off, its outputs a value of Vh,off to the heater (typically this is set to 0 V). The hysteresis width, ∆Th, can be adjusted according to the desired goal. Changing the width of this hysteresis affects the performance of the control, as will be investigated in the laboratory.

(15)

Figure 7: Relay switch.

4.3.2. Proportional-Integral Control

4.3.2.1. Closed-Loop Transfer Function

The proportional-integral (PI) compensator used to control the temperature of the Heat Flow has the structure

=

Vh t( ) kp (bsp ( )Td tT t( )) + kid

⌡ Td t( ) − T t( ) t

. [20]

where kp is the proportional control gain, bsp is the set-point weight, ki is the integral control gain, Td(t) is the desired or setpoint temperature, T(t) is the measured chamber temperature at a particular sensor, and Vh(t) is the heater control voltage. The block diagram of the PI control is illustrated in Figure 8.

Remark: The temperature is controlled about a single sensor – either 1, 2, or 3. From this point on, the Tn notation for measured temperature at sensor n will be dropped. The T denotes the temperature measured at a particular sensor. Typically this will be sensor 1 but it can be chosen for any.

(16)

1. Find the closed-loop temperature control transfer function, T(s)/Td(s), using the time-domain PI control in Equation [20], the block diagram in Figure 8, and the process model in [3]. Assume the zero initial conditions, thus T(0-) = 0.

Solution:

The controller transfer function is =

Vh s( ) kp (bsp ( )Td sT s( )) + ki (Td s( ) − T s( ))

s [s8]

and it can be obtained by taking the Laplace transform of [20] or using the block diagram in Figure 8. Substituting this into the process transfer function in [3] and solving for T(s)/Td(s) gives the HFE closed-loop transfer function

( ) = T s Td s( )

K (kp s bsp ki + )

+ +

s2τ (1 kp K s K ki + ) .

[s9]

4.3.2.2. Find PI Gains

1. The resulting PI Heat Flow closed-loop transfer function has the same structure as the standard second-order system given in [4]. The denominator of [4] is called the standard characteristic equation,

+ +

s2 2ζ ωn s ωn2

. [21]

Find the control gains kp and ki that map the characteristic equation of the HFE closed-loop system to the standard characteristic equation given above. With these two equations, the control gains can be designed based on a specified natural frequency, ωn, and damping ratio, ζ.

0 1 2

Figure 8: Heat Flow PI controller.

(17)

Solution:

The characteristic equation of the HFE closed-loop transfer function in [s9] is

+ + +

s2

τ s K kp s K ki [s10]

and can be re-structured into the form

+ +

s2 (1 kp K s + ) τ

K ki

τ .

[s11]

Equating this with the standard characteristic equation in [21] gives the expressions K ki =

τ ωn2 [s12]

and

= 1 kp K +

τ 2ζ ωn

.

[s13]

Solve for kp and ki to obtain the control gains equations that meet the ωn and ζ specifications.

Thus the proportional gain is kp =

− + 1 2ζ ωnτ

K [s14]

and the integral gain is ki = ωn

K .

[s15]

2. Using the equations described in Section 4.2.2, express the natural frequency and the damping ratio in terms of percentage overshoot and peak time specifications.

0 1 2

(18)

Solution:

To find the damping ratio given a percentage overshoot specification, solve for ζ in Equation [8] and get the expression

= ζ − 

 



ln PO 100

1

 +

 



ln PO 100

2

π2 .

[s16]

Solving for ωn in Equation [9] expresses the natural frequency in terms of the peak time, that is =

ωn π

tp 1 − ζ2

. [s17]

3. Calculate the minimum damping ratio and natural frequency required to meet the specifications given in Section 4.2.4.

Solution:

Substitute the percentage overshoot specifications given in [15] into Equation [s16] to get the required damping ratio

=

ζ 0.591 . [s18]

Using this result and the desired peak time, given in [14], with Equation [s17] gives the minimum natural frequency needed

=

ωn 0.389

 



rad

s . [s19]

The PI gains will be computed in an in-lab exercise once the model parameters have been found.

4.3.2.3. Steady-State Error

1. Find the error transfer function of the closed-loop Heat Flow system when using the PI compensator.

0 1 2

0 1 2

(19)

Solution:

Substituting the plant transfer function in [3], the step amplitude in [19], and the PI compensator

= ( )

C s kp + ki

s , [s20]

into error transfer function [s1] gives =

( )

E s R0

s





+  1

 



kp + ki s K +

τ s 1 .

[s21]

2. Evaluate the steady-state error. Is there any benefit of adding integral action?

Solution:

Applying the final-value theorem to the error transfer function yields the expression ess R0 = 





lim →

s 0

s (τ s 1 + )

+ + +

ss K kp s K ki .

[s22]

Evaluating this expression gives the steady-state error

ess 0 = . [s23]

Thus there is no steady-state error when using the integral gain.

4.3.2.4. Anti-Windup

The heater actuator on the Heat Flow can be modeled by the function =

( ) u t



5 5 v <

vv ≤ 0 and − + 5 v ≤ 0

0 v < 0

[22]

0 1 2

0 1 2

(20)

operates linearly in the 0-5.0 V range but saturates when it goes below 0 V or beyond 5.0 V.

This nonlinearity can cause issues when used with a controller that has integral action. If the controller saturates, the integrator may begin to drift and effectively break the feedback loop. This is called integrator wind up.

An integrator anti-windup scheme such as the one shown in Figure 9 can be used to mitigate this issue.

If the control signal does not saturate, then the extra feedback loop with the time constant Tr is inactive because u = v. When the controller output saturates, the extra feedback loop drives the saturation error, es, to zero and causes the integrator to output a value just at the saturation limit. This means that the control signal will decrease from the saturation limit as soon as the control error goes negative.

Figure 9: PI with anti-windup scheme.

The windup protection is governed by the integrator reset time Tr. There is less protection against windup if Tr is made large (e.g. none if Tr = ∞). If Tr = 1 second, then the integrator is reset in one sampling period.

In Figure 10, the effect of using an anti-windup scheme is shown. The dashed blue line represents the response without windup protection and the solid red line is the response with anti-windup. When wind up occurs, the integrator builds up a lot of energy and causes there to be a larger overshoot in the response. However, with anti-windup the input to the integrator is decreased when the controller saturates and the overshoot is decreased significantly. Anti-windup becomes especially important in slow systems with large time constants, such as the Heat Flow, because the integrator has more time to wind up.

(21)

Figure 10: Effect of using integrator anti-windup on response.

5. In-Lab Procedures

5.1. Bumptest Modeling

The q_hfe_open_loop Simulink diagram shown in Figure 11 is used to feed open-loop voltages to the heater and blower and measure the corresponding chamber temperatures and fan speed. The Heatflow subsystem contains QuaRC blocks that interface with the Heat Flow hardware. The To Host File block is used to save the temperature sensors readings and the blower and heater input voltages to a Matlab MAT file. The experimental data saved in this file can then be accessed in Matlab to plot the response and take measurements.

(22)

Figure 11: Simulink diagram used to run HFE in open-loop using QuaRC.

5.1.1. Getting Started

Follow this procedure to run the open-loop controller on the Heat Flow device:

1. Load the Matlab software.

2. Browse through the Current Directory window in Matlab and find the folder that contains the lab files, e.g. q_hfe_open_loop.mdl.

3. Double-click on the q_hfe_open_loop.mdl file to open the Simulink diagram shown in Figure 11.

4. Go to the Current Directory window and open the setup_hfe.m file.

5. Run the script by selecting the Debug | Run item from the menu bar or clicking on the Run button in the tool bar. This loads the appropriate sensor calibration gains in the Matlab workspace.

6. The Heatflow subsystem in this model is linked to a Simulink library called hfe_lib.mdl. To access the library, right-click on the Heatflow subsystem and select Link Options | Go To Library Block. Double-click on the block to open it. The interior of the Heatflow subsystem is shown in Figure 12, below.

(23)

Figure 12: Heatflow subsystem.

7. Configure DAQ: Double-click on the HIL Initialize block inside the Heatflow subsystem (from hfe_lib) and ensure it is configured for the DAQ device that is installed in your system. By default the block is setup for the Quanser Q8 hardware-in-the-loop board. Before making changes, make sure you unlock the Simulink library by clicking on Edit | Unlock Library in the hfe_lib menu bar.

8. Save any changes and close hfe_lib. All the Heat Flow QuaRC controllers are linked to this block so any changes only have to be applied once.

9. Ensure all the connections have been made as instructed Reference [2].

10. Power on the Heat Flow.

Remark: The blower should start when the power is engaged.

11. You are now ready to build and run the controller.

5.1.2. Running the Bumptest

This procedure demonstrates how to perform the bumptest with the heater:

1. Setup the Matlab workspace and the HFE Library as discussed in Section 5.1.1.

2. Click on Quarc | Build to compile the q_hfe_open_loop Simulink diagram.

3. Go to Quarc | Start to begin running the controller.

4. To start set Vh = 0 and Vb = 4 in the Simulink diagram so the only the blower is on.

5. Once the temperature readings have settled, change the heater voltage to 5.0 V.

6. The scopes should be displaying responses similar to figures 13, 14, and 15. When the heater

(24)

Figure 13: Temperature bumptest response. T1 is

yellow, T2 is purple, and T3 is cyan. Figure 14: Fan speed in blower.

Figure 15: Heater (yellow) and blower (purple) voltage.

7. When the temperatures begin to reach steady-state, i.e. when they begin to level off, stop the controller by clicking on QuaRC | Stop or on the Stop button in the Simulink model tool bar.

8. The temperature sensor readings and blower and heater voltages are saved in the MAT file data_open_loop.mat and it can be be accessed using the Matlab commands shown in Text 1, below.

(25)

% load raw data from MAT file load('data_open_loop.mat');

% save into variables t = data_hfe_ol(1,:);

T1 = data_hfe_ol(2,:);

T2 = data_hfe_ol(3,:);

T3 = data_hfe_ol(4,:);

Vh = data_hfe_ol(5,:);

Vb = data_hfe_ol(6,:);

Text 1: Loading data from data_open_loop.mat.

9. Does the temperature in different locations along the duct go up at the same rate? Explain.

Solution:

The temperature increases or changes at different rates along the chamber. As shown by the scope response in Figure 13, above, the temperature measured at sensor T1 goes up much faster then those measured at T2 and T3 because it is the closer to the heater and blower.

10. Using the commands shown in Text 1 and Matlab plotting commands, create a plot that shows the temperature response at the T1 sensor as well as the blower and heater voltages used. Attach this to your report.

0 1 2

(26)

Solution:

A typical bumptest response is shown in Figure 16, below, with a heater step of 5.0 V and when the blower is held at a constant 4.0 V. See the full command set used to generate this in the plot_data_open_loop_heater.m script.

Figure 16: Typical bumptest response observed at T1 with Vh = 5.0 V and Vb = 4.0V.

11. The Heat Flow step response resembles a first-order transfer function. Using the bumptest method discussed in Section 4.1.2, find the steady-state gain observed at the T1 sensor.

0 1 2

(27)

Solution:

See the plot_data_open_loop_heater.m Matlab script for more details on calculating the steady-state gain automatically.

From Figure 16, the measured initial and steady-state temperatures are

y0 36.5 [ = degC] [s24]

and

yss 90.9 [ = degC]

. [s25]

Therefore when the heater step voltage change is =

u 5.0 [ ]V [s26]

the temperature varies =

y 54.4 [degC .] [s27]

Using Equation [6] with the collected results above, the resulting steady-state gain is =

K 10.9

 



degC

V . [s28]

12. Find the time constant from the obtained response.

Solution:

See the plot_data_open_loop_heater.m Matlab script for more details on calculating the steady-state gain automatically.

In order to find time of first decay t1 = t0 + τ, the corresponding temperature measurement defined in Equation [9] must be found. From Figure 16, the time when the temperature reaches

=

y t1 57.44 [( ) degC] [s29]

is

t1 19.0 [ ] = s

. [s30]

The step start time is t0 5.1 [ ] = s

. [s31]

Given the step start time t0 and decay time t1 with Equation [11], the time constant of the Heat Flow is

=

τ 13.9 [ ]s . [s32]

0 1 2

0 1 2

(28)

13. Turn off the Heat Flow device if no more experiments will be conducted in this session.

Other things to try...

Modeling using a random input (e.g. using the Matlab System Identification toolbox).

5.2. On-Off Temperature Control

The q_hfe_on_off Simulink model shown in Figure 17, below, is used to run the on-off controller discussed in Section 4.3.1 on the Heat Flow device. The Heatflow subsystem is linked to the Heat Flow library, hfe_lib, and the on-off controller is implemented using the Simulink Relay block.

Figure 17: Simulink diagram to run on-off controller on Heat Flow using QuaRC.

This procedure demonstrates how to run the on-off on the HFE:

1. Setup the Matlab workspace and the HFE Library for the q_hfe_on_off Simulink model (shown in Figure 17, above) as discussed in Section 5.1.1.

2. Click on Quarc | Build to compile the q_hfe_on_off Simulink diagram.

3. Set the Amplitude (deg C) block to 2.5 and the Offset (deg C) to 47.5. This square setpoint will vary between 45.0 °C and 50.0 °C.

4. In the Signal Generator block, set the Frequency of the square wave to 0.02 Hz.

5. Set the Vb (V) block to 4.0 V. The blower will be running at a constant rate while we vary the voltage to the heater, using the on-off control, to regulate the temperature to the setpoint.

6. For this run, set the Choose Sensor block to 1 in order to control the temperature about the T1

(29)

sensor. However, you can select whichever sensor (1, 2, or 3) to control.

7. Go to Quarc | Start to begin running the controller.

8. The typical on-off control temperature response for sensor T1 is shown in Figure 18 and the heater and blower voltages are shown in Figure 19. The heater voltage is the yellow trace and the purple plot is the blower voltage.

Figure 18: T1 on-off controller response. Figure 19: On-off control signals.

9. After each run, the last 60 seconds of the desired and measured temperature readings and the heater and blower voltages are saved to the Matlab workspace under the variables data_temp and data_u, respectively. You can access the data using the the commands shown in Text 2, below.

% save into variables t = data_temp(:,1);

T1d = data_temp(:,2);

T1 = data_temp(:,3);

Vh = data_u(:,2);

Vb = data_u(:,3);

Text 2: Loading data from workspace varaibles data_temp and data_u.

Using the commands outlined in Text 2, above, and Matlab plotting commands, create a plot that shows the temperature response at the T1 sensor as well as the blower and heater voltages used when running the on-off controller with a hysteresis width of 1.0 °C, Vh,off = 0, and Vh,on = 5.0 V. Attach the resulting plot to your report.

(30)

Solution:

A typical on-off controller response is shown in Figure 20, below. The hysteresis width of the relay is set to 1.0 °C for this response. That is, 0.5 °C is the switch on point and -0.5 °C is the switch off point. When the relay goes ON the output to the heater is 5.0 V and when it goes OFF it outputs 0 V. Meanwhile the blower is held at a constant 4.0 V. See the full command set used to generate this in the plot_hfe_response.m script.

Figure 20: On-off controller response with ∆Th = 1 °C.

10. Give one advantage and one disadvantage of the on-off controller.

0 1 2

(31)

Solution:

One advantage is the simplicity of the control and how we don't need a model of the system to control it.

One disadvantage is the controller performance. The temperature never settles at a steady-state value. As the relay goes on and off, the temperature ramps up and down about the desired temperature.

11. Reduce the hysteresis width by a desired amount. Make sure you document what on-off control parameters were used and attach a plot of the response (showing the temperature and heater and blower voltages).

0 1 2

(32)

Solution:

The on-off controller response shown in Figure 21, below, uses the same on-off voltage but the hysteresis width of the relay is reduced to 0.5 °C. See the full command set used to generate this in the plot_hfe_response.m script.

Figure 21: On-off controller response with ∆Th = 0.5 °C.

12. How does decreasing the hysteresis width affect the response? Do you see any potential drawbacks to making the width too small?

0 1 2

(33)

Solution:

As shown by the top plot in Figure 21, making the hysteresis width narrower improves the performance by making the temperature stabilize more closely to the setpoint. Having a tighter threshold doesn't allow the temperature to overshoot and undershoot as much.

Making the width too small may cause the voltage to go on and off very often. This type of high-frequency switching can be hard on the actuator.

13. Click on QuaRC | Stop to turn off the controller.

14. Power off the Heat Flow if no more experiments will be ran in this session.

Other things to try...

Vary the on-off voltages of the heater relay.

Add an on-off controller for the blower.

Smooth out the output voltages using a sigmoid or rate limiter.

5.3. PI Temperature Control

The Simulink model called q_hfe_pi, depicted in Figure 22, is used to implement the PI compensator on the Heatflow using QuaRC. The setpoint is set to the same temperature as in the on-off controller.

0 1 2

(34)

Figure 22: Simulink diagram used to run PI control on Heat Flow using QuaRC.

The PI Control subsystem is shown in Figure 23. As depicted, the kp and ki Slider Gain blocks are used to change the proportional and integral gains, respectively. You can also vary the set-point weight and the integral anti-windup of the compensator. Set-point weight hasn't been discussed but its affect on the response will be investigated in the laboratory session.

Figure 23: Inside the PI Control subsystem in q_hfe_pi model.

(35)

5.3.1.1. Qualitative Proportional Control

In this procedure, the user can see the effect of having integral control.

1. Setup the Matlab workspace and the HFE Library for the q_hfe_pi Simulink model as discussed in Section 5.1.1.

2. Click on Quarc | Build to compile the q_hfe_on_off Simulink diagram.

3. Set the Amplitude (deg C) block to 2.5 and the Offset (deg C) to 47.5. This square setpoint will vary between 45.0 °C and 50.0 °C.

4. In the Signal Generator block, set the Frequency of the square wave to 0.02 Hz.

5. Set the Vb (V) block to 4.0 V. The blower will be running at a constant rate while we vary the voltage to the heater, using the on-off control, to regulate the temperature to the setpoint.

6. For this run, set the Choose Sensor block to 1 in order to control the temperature about the T1

sensor. However, in the future you can select whichever sensor (1, 2, or 3) to control.

7. Go to Quarc | Start to begin running the controller.

8. The control temperature response for sensor T1 is shown in Figure 24 with the PI gains set to kp

= 0.2 and ki = 0.2. These, of course, are just the initial gains and can be changed to alter the closed-loop behaviour. The heater and blower voltages are given in Figure 25. The heater voltage is the yellow trace and the purple plot is the blower voltage. Again the blower is held at a constant 4.0 V.

Figure 24: PI temperature response. Figure 25: PI blower and heater voltages.

9. To observe the affect of a pure proportional control, set kp = 0.2 and ki = 0.

10. Allow the temperature to settle to 45.0 °C. When the step goes up to to 50.0 °C, let the

controller run until the step goes back down again. Save this response in a plot and attach it to your report.

(36)

Solution:

The typical proportional controller response is illustrated in Figure 26. See the full command set used to generate this in the plot_hfe_response.m script.

Figure 26: Pure proportional control response using kp = 0.2.

11. Measure the steady-state error. Is the response as expected?

0 1 2

(37)

Solution:

The steady state-error measured in Figure 26 is ess 1.74 [ = degC]

. [s33]

Since it was determined in Section 4.2.3 that the Heat Flow is a Type 0 system, having a constant steady-state error with a proportional-only control is expected.

12. Using the equation developed in Section 4.2.3, evaluate the steady-state error numerically given the amplitude of the step, the control gain 0.2, and the model parameters found in Section 5.1.2.

How does it compared to the measured value (taking the sensor resolution into account, if necessary)?

Solution:

Evaluating the Equation [s5] with the 5.0 °C step amplitude, the model gain parameter [s28], the proportional gain 0.2 set, gives the steady-state error

ess 1.57 [ = degC]

. [s34]

The value predicted is slightly less then measured. However, with a sensor resolution of +/- 0.1 °C this is quite close.

13. Click on QuaRC | Stop to stop running the controller.

14. If no more experiments will be performed in this session, turn off the Heat Flow.

0 1 2 0 1 2

(38)

5.3.1.2. Qualitative Integral Control

1. Run the q_hfe_pi QuaRC controller with kp = 0.2 and ki = 0, as in Section 5.3.1.1.

2. Slowly begin increasing the integral gain. Attach a sample response. Discuss some of the affects of using integral action in the controller.

Solution:

Using the gains kp = 0.2 and ki = 0.1 gives the response shown in Figure 27. Including integral control improves the steady-state error and increases the response speed, i.e. decreases peak time. However, there is a larger overshoot.

Figure 27: Qualitative PI response.

3. The integral anti-windup scheme is currently being used, as identified by the saturation marks on the Integrator block inside the PI Control subsystem (pictured in Figure 23). The heater saturation is 0-5 V, so the lower and upper saturation limits of the integrator are set to 0 and 5, as shown in Figure 28, below. The integrator resets every sample, so the reset time is

automatically set to Tr = 1 when using this block.

4. To turn the anti-windup off, first turn off the controller. Then go into the PI Control subsystem, double-click on the Integrator block, and un-select the Limit Output parameter as illustrated in

0 1 2

(39)

Figure 28.

Figure 28: Integrator block parameters.

5. Rebuild and start the q_hfe_pi controller.

6. Set the gains to the kp = 0.2 and ki = 0.4 and run through a step. Attach the resulting response in a plot (make sure the temperature as well as the heater and blower voltages are given).

(40)

Solution:

The response in Figure 29 illustrates what occurs when there is no windup protection and the actuator becomes saturated. It takes a while for the energy built-up in the integrator to decrease and this results in a larger overshoot in the temperature.

Figure 29: PI control response without anti-windup.

7. Re-engage the windup with the same gains and attach that response. Is the response improved?

0 1 2

(41)

Solution:

As shown in Figure 29, when using the same gains with anti-windup the overshoot is significantly less. When the actuator saturates, the input signal to the integrator begins to decrease and the heater voltage does not stay saturated as long.

Figure 30: PI control response without anti-windup.

8. Click on QuaRC | Stop to stop running the controller.

9. If no more experiments will be performed in this session, turn off the Heat Flow.

5.3.1.3. PI Control According to Specifications

Go through this procedure to run the PI controller with gains that satisfy the specifications:

1. Recall the peak time and overshoot specifications given in Section 4.2.4. Based on the model parameters, K and τ, found in Section 5.1.2, as well as the natural frequency and damping ratio that need to be met in order to satisfy the time-domain response requirements, calculate the

0 1 2

(42)

Solution:

Using the steady-state gain model parameters found in [s28] and the time constant in [s32] as well as the desired natural frequency found in [s19] with Equation [s14], generates the integral control gain

ki 0.192 = 

 



V s

degC . [s35]

Similarly, the proportional control gain is obtained by substituting the model parameters given above, the desired natural frequency in [s19], and the minimum damping ratio specification in [s18] into Equation [s15] to get

kp 0.495 = 

 



V

degC . [s36]

2. Run the q_hfe_pi QuaRC controller with the PI gains and attach the corresponding closed-loop step response.

0 1 2

(43)

Solution:

The response when using the PI gains given in [s35] and [s36] is shown in Figure 31.

Figure 31: Response using designed PI gains.

3. Measure the peak time and percentage overshoot. Do they satisfy the specifications?

0 1 2

(44)

Solution:

As shown in the top plot of Figure 31, the peak occurs at 32.4 seconds so the peak time is tp 7.4 [ ] = s

. [s37]

Since the peak goes up to about 51.49 °C, the percentage overshoot is =

PO 29.8 ["%" .] [s38]

The peak time satisfies the specifications because it is less than the 10.0 seconds. However, the percentage overshoot does not since it goes over the 10 % maximum.

4. If the response did not satisfy the requirements or to improve it, try to do some control tuning by adjusting the value of the set-point weight parameter via the Slider Gain block called Set-Point Weight, found in the PI Control subsystem. It may also be helpful to adjust the PI gains slightly.

Attach any response along with the PI gains and the set-point weight used. How does the set- point weight parameter affect the response?

0 1 2

(45)

Solution:

The response shown in Figure 31 was done using the same PI gains, i.e. given in [s35] and [s36], and the set-point weight

bsp 0.9 = . [s39]

Figure 32: Response using designed PI gains.

Decreasing the set-point weight causes the overshoot to also decrease. As shown in Figure 8, above, the set-point weight changes the influence of the temperature setpoint in the

proportional control. By decreasing this gain, less voltage is fed to the heater from the

proportional control and the overshoot is effectively decreased. The drawback is the response time is typically slowed (i.e. peak time increases).

5. If adjustments were made, measure the peak time and percentage overshoot. Are the requirements now satisfied?

0 1 2

(46)

Solution:

As shown in the top plot of Figure 32, the peak occurs at 32.1 seconds giving a peak time of tp 7.1 [ ] = s

. [s40]

The peak goes up to about 50.52 °C, which is just over the limit 50.5 computed in Section 4.2.4. Therefore the percentage overshoot is

=

PO 10.4 ["%" .] [s41]

The peak time is still satisfied and the overshoot is close to the 10 % requirement.

6. Stop the QuaRC controller.

7. Shut off the Heat Flow if no more experiments will be conducted in this session.

Other things to try...

Try using a PID controller.

Add an PI controller for the blower.

Using another type of controller to regulate the temperature, e.g. lead-lag.

6. References

[1] Quanser. Q4/Q8 User Manual.

[2] Quanser. Heat Flow User Manual.

0 1 2

References

Related documents

The versions of these models with finite variance transmission rate share the following pattern: if the sources connect at a fast rate over time the cumulative statistical

To avoid both supply chain disturbance and increased theft risk there are three types of solutions; improved and more exact scheduling of delivery time,

From simulation that, we observed that heat transfer rate of double pipe heat exchanger with dent pattern has better heat exchange rate when compared to plain surface... Figure

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i

However, the effect of receiving a public loan on firm growth despite its high interest rate cost is more significant in urban regions than in less densely populated regions,

Som visas i figurerna är effekterna av Almis lån som störst i storstäderna, MC, för alla utfallsvariabler och för såväl äldre som nya företag.. Äldre företag i

In this section, we will begin with a description of the most common method used for solving the heat equation; namely, the separation of variables.. Subse- quently, we can employ