# Hyperfast Switching Peltier Cooling Computer Science Essay

Published:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Hyperfast switching Peltier cooling system is a cooling system which is developed to improve the thermal control in various industry and applications. The system help applications such as metallurgy and food industry. One of the important aspects that should be maintained and pay attention to is the humidity. Thus, the system modelling and identification is significant so that the humidity can be controlled and supervise through the development of a discrete PID controller for the system. For effective control, the open loop system is accurately identified and modelled and it is of interest to compare different identification approaches on the system. One of the approaches discussed here involves discrete-time modelling and identification of the system and this will enable a discrete PID controller to be build.

## 1.3 Expected Contribution

The project is divided into two parts; the system identification and statistical analysis of the HSPC system and the discrete PID controller developed for the system. For the first part, wide range of studies and researches related to system identification have been conducted in order to better understand what exactly the purpose of identification before proceeding with the model identification. One of MATLAB's features, System Identification Toolbox (SITB) is implemented to obtain the model. Once the model have been identified, an analysis is conducted to check the power accounted by the model obtained earlier.

The second part of this project is developing a discrete PID controller for the system, which involves a number of steps. A continuous PID controller is designed beforehand prior achieving the discrete version. The performance of the discrete PID controller for the system is tested as well.

## 1.4 Objectives

The objectives that should be achieved at the end of the project are:

To obtain a discrete-time model identification for the hyperfast switching Peltier cooling (HSPC) system,

To perform statistical analysis on the model obtained earlier,

To design a discrete Proportional-Integral-Derivative (PID) controller for the system.

## 1.5 Thesis Structure

The content of this thesis is systematized according to chapters.

Chapter 1 explained the introductory part including the project background, the expected contribution and also the objectives.

Chapter 2 is mainly about the literature review in which journals related to the project are summarized.

Chapter 3 gives detail explanation on the methodology and detailed design on how the project is executed

Chapter 4 presents the results and data obtained as well as the discussion of the findings

Chapter 5 wrap up and conclude the project together with future recommendation for a better results.

## CHAPTER 2: LITERATURE REVIEW

## 2.1 Introduction

This chapter presents the review from previous researches that are related to this final year project. There are preceding researches on model identification of the HSPC system using different approaches and methods. In addition, a proportional integrator derivative (PID) controller is also developed for the HSPC system.

## 2.2 Overview of HSPC system

The cooling system is the HSPC system as described in [1], developed for industries such as metallurgy and food industry. The system is composed of two single-input single-output systems which is the flow control system and also the Peltier system both connected in parallel. Subsequently, the system is followed by a two-input single-output system; cool air inducer and chamber, as shown in Figure 2.2.1.

In the system, air flows into a chamber through a cool air inducer. The cool air inducer is mounted onto the cold surface of a Peltier module. The output humidity which is measured as the output of the cool air inducer and chamber is reliant on both the desired stepper motor angle as well as the duty ratio of a pulse-width-modulation (PWM) signal. The stepper motor angle controls the position of a valve and affects the flow rate of air flowing into the chamber whereas the duty ratio of pulse-width-modulation (PWM) signal will act as disturbance to the Peltier module. Besides that, the system is also disturbed by noise from various sources that includes fluctuation in the ambient temperature and also in the pressure of the air supplied using the air pump [1].

Flow Control System

desired stepper motor angle, u

flow rate

Cool Air Inducer and Chamber

chamber humidity, y

Peltier System

duty ratio, r

Peltier temperature

Figure 2.2.1

Since the identification of the first channel which is from the desired stepper motor angle, u to the output, y have been considered in [2], this project will concentrated on the other channel only. The research is from the duty ratio of the pulse-width-modulation (PWM) signal perturbing the Peltier module, r, to its chamber humidity, y.

As shown in [10], duty ratio of the pulse-width-modulation (PWM) signal perturbing the Peltier module, r, to its chamber humidity, y is straightforward. On top of that, it is also time invariant and can be almost linear.

In addition, by extracting the output only at the harmonics contained in the input r, the linear contribution of r to the output is achieved and the linear contribution of the other input u is filtered out. However, there will be some remaining contributions of u caused by non-linear distortion. This distortion is considered as zero, but practically no system is perfectly linear. Thus, the remnants which is known to be on the same harmonics at the output as those contained in r are regarded as noise disturbance.

The experiment as described in [1] is conducted to obtain the data that will be used for benchmarking when modelling and performing the identification of the system. In the experiment, the signals applied are multisines, referred as Signal A and Signal B with period of N=600. The non-zero harmonics have a flat spectrum with equivalent amplitude and are described as follow:

Signal A: 1, 7, 13, 19, . . ., 235

Signal B: 5, 11, 17, 23, . . ., 239

The effect of even order non-linearity on the linear estimate are completely eliminated and the effect of odd order nonlinearity on the linear estimate are reduced. This is accomplished through the suppression of harmonic multiples of two and three.

The sampling interval is set to 1 s, which is the fastest sampling possible if significant slew rate non-linearity is to be avoided.

Experimental data from [2] shows that there is neither significant variable delay in the path from r to y nor in the intermediate flow rate. In this study, four periods of the output are measured for both testing and validation sets after the transient effect has decayed, and in synchrony with four periods of the input.

## 2.3 System Identification of the HSPC System

At this part, modelling and identification of a system should be distinguishable. Modelling process contains definition of the system, its limit, input and output signals, as well as development of some ideas about its structure. On the other hand, identification is a process that uses a model with given structures but unknown parameters in which it will be tuned such that the system will perform as analogous to the real system when they are fed with the same input signal.

System identification comprises the method of obtaining a transfer function by applying a known test signal to a system, observing the output, and comparing it with the input to determine the system's transfer function. System identification is useful when a mathematical model is to be build based on the measured data besides serving it purpose to determine the explanation of the model.

Identification often defines as the numerical completion of some elementary work done in modelling for example in this study of HSPC system. It should be apparent that system identification is always an approximation problem. It is impossible for a mathematical model to reproduce precisely the behaviour of a real physical system. Instead of saying 'the plant model' it should rather be say 'a plant model' because there are many possible models of different complexity for a given plant [].

The outcome of the identification process is determined by the following factors:

The system which delivers data. Its 'true' structure and its 'true' parameter values remain unknown in the case of real-world system. However, an artificial system such as a simulation model is transparent, thus allowing to judge the quality of the identification methods.

The data taken from the system and fed into the identification method is determined by the experimental setup and the preprocessing measures. The form of the excitation signals and their frequency range play a role, as well as the sampling rate and some filtering of the measured data. As shown in [9], the collected data is separated into data that is used for identification and some other data that serves for validation purposes.

The model structure which is taken for identification must be able to cover all significant types of behaviour observed in the data. For this study, it can be seen that a nonlinear model of higher order is more capable to match the given data better than a linear model of lower order. In the second case, however, the computational burden is smaller, and the resulting simpler model is often better suited for future use. So choosing the model structure is some kind of a trade-off.

## 2.3.1 System Identification Toolbox (SITB)

There are several software packages which is useful for identification of the system. The tool which is presented for current studies is the System Identification Toolbox of The MathWorks Inc. This toolbox provided number of commands which are convenient to handle identification of data and models as well as allowing the models to be build and validated. The most important features are also available in a graphical user interface (GUI).

## 2.4 PID Controller

PID (proportional integral derivative) control is one of the earlier control strategies and implementation [59]. It has a simple control structure which can be easily understood by plant operators and also relatively easy to tune. Since many control systems using PID control found it satisfactory and practical, this controller has wide range of applications in the industry mainly the industrial control.

## 2.4.1 Ziegler-Nichols Tuning Formulae

A very useful tuning formula was proposed by Ziegler and Nichols in early 1942 [10]. This is the earliest design method for the PID controller and works effectively for many systems. The tuning formula is obtained when the plant model is represented by a first-order plus dead time (FOPDT) as follows:

(2.4.1)

This will be significance when a system model cannot be physically derived and thus an experiment has to be performed to obtain the parameters for the approximate model in (2.4.1).

The approach that is used to extract those parameters can be accomplished by using the step response of the plant model as shown in Figure 2.4.1.

step.JPG

Figure 2.4.1

From Figure 2.4.1, it can be seen that the parameters of k, L, T and a can be extracted by the simple approach shown by using the Ziegler-Nichols formula as shown in the following table:

## Controller type

## From step response

## Kp

## Ti

## Td

## P

1/a

## PI

0.9/a

3L

## PID

1.2/a

2L

L/2

Table 2.4.1

## CHAPTER 3: METHODOLOGY

## 3.1 Introduction

This chapter is tend to explained the detailed design of the project, how the project is going to be executed, which approach has been chosen and why.

## 3.2 Theoretical Studies

A theoretical study is conducted as it is one of the most important aspect when designing or conducting a scientific research. This is done through readings the journals and publications, articles and manuals related to the system identification and also the HSPC system as it provided a lot of information regarding the project. A basic study about the software used when modelling the system which is the System Identification Toolbox (SITB) of MATLAB is made since it will assist a lot when determining the model. A research on how to construct and to test the performance of a PID controller also is done since it is just not a normal PID controller. The controller will be in its discrete form. Therefore, an extensive study have been executed to develop the discrete PID controller from its continuous form.

## 3.3 Discrete-time Modelling and Identification of the HSPC System

flowchart.PNG

Figure 3.3.1

From Figure 3.3.1, identification comprises of two fields of work. The first one is the knowledge needed about system to be modelled. This included setting up and performing the experiment as well as to collect the data from the real system. Next, the data collected must be analyzed and this usually involved lengthy numerical calculations which is cumbersome, in order to determine the best model. Practically, this will be done by a software-based tool which will minimized the identification and modelling works. The tool which is presented here is the System Identification Toolbox (SITB) of The MathWorks Inc. The toolbox offers various commands to facilitate and handle identification data and models and thus, allows the model to be build and to be validated.

This project itself have been carried on from the software supported part since the experiment design and collection of data have been treated in [9]. Measurements were obtained for 4 sets of steady-state periods and all the data provided in [9] are used as benchmark for the identification and modelling of this HSPC system.

The data included:

Non-zero harmonics multisine Signal A and Signal B

Four steady-state periods of the chamber temperature for testing set

Averaged flow rate, Peltier temperature and chamber temperature for validation set.

Before feeding any input to the SITB, the data use need to undergo certain processes to ensure that they will produced a good model. The processes are:

1. Averaging the output of testing sets and find its Fast Fourier Transform (FFT)

This will help to reduce the effect of noise as the data handled is actually the mean data

X=[1:600]; %define new vector in frequency domain

X(1:600)=0; %set the value of the vector as zero

stem(X) %obtain the stem plot of the vector

% Read in the desired number of frequency samples

k = input('Number of frequency points = ');

% Read in the sequence

B = input('Enter the sequences = ');

Fs=1;

L=length(B); %L will contain the number of elements in B

Y=fft(B); %obtain FFT of signal B

Y(1)=0;

Y1=abs(Y); %take the absolute value of Y

stem(Y1);grid

title('Testing Set')

xlabel('Harmonic Number'); ylabel('DFT Magnitude')

2. Removing the harmonics

f1=[5:6:239]; %define the vector of harmonic

f2=[600-f1];

X(f1+1)=Y(f1+1);

X(f2+1)=Y(f2+1);

stem(abs(X));grid

title('Testing Set (without harmonics)')

xlabel('Harmonic Number'); ylabel('DFT Magnitude')

3. Convert the testing set back to its time-domain by using Inverse Fast Fourier Transform (IFFT)

This is the data set that will be act as the output when using the SITB

x=real(ifft(X));

x=x';

plot(x)

title('IFFT of Testing Set')

xlabel('Number of clock pulses'); ylabel('Amplitude')

4. Checking harmonics for both input; Signal A and Signal B by using Fast Fourier Transform (FFT)

To check the non-zero harmonics, whether they have a flat spectrum with equivalent amplitude or not

After all the processes have been done, then only the data is input into the SITB.

To execute the SITB window in MATLAB, type 'ident' in the main window. A window as shown below will be opened.

1.JPG

To import the data from main window, click on the import data tab and a pop-down menu is opened. For this project, time domain data is used to obtain the model. Fill in all the required fields as shown below:

3.JPG

Once the data have been import, it need to be preprocess. By clicking on the preprocess tab, remove mean is chosen and new data 'testd' is created.

5.JPG

6.JPG

As shown from previous figure, the data use in the working data space is 'test'. Change this data by dragging the 'testd to the working data space.

7.JPG

The data is ready to be estimated by now. Click on the estimate tab and the pop down menu will shows different types of models that can be estimated by using the SITB.

8.JPG

First choose one model with different order- then select the best and compare with the other model with their best order

Validate data- take the transfer function of the model- use filter function to check the transient response (all real system exhibit transient phenomena to some extent before the steady state is reached)

## 3.3.1 The Practical side of System Identification

By using the data provided, the most important steps in the identification process are to try out different model structures, compute the best model in the structures and to validate this model obtained. Typically, this has to be repeated few times with various model structures before a good or maybe acceptable model is found.

These are the 4 steps proven to be useful in identification process:

Step 1: Looking at the data

Once the data have been plotted, look at them carefully and try to see the dynamics. The output of this step is found to be more precise when the data is detrend by removing the means. Detrend here refers as using the data to eliminate long-term trends in order to accentuate on short-term changes. By removing the means, a model for the variations around an operating point is obtained compare to a model describing the operating point.

Step 2: Examining the data

The data are then computed and examined by using the Data Views. Once the model is obtained, it can be observed into different aspects by using different Model Views. Just checked on the view to show the properties of all selected models at any time. All the models can be checked in and out by clicking on its icon. However, few difficulties may be faced when examining the data. These includes:

Unstable model: The ARX model may be unstable but somehow it is useful for the controlling purposes

Model order: If a fourth order model does not give a good Model Output Plot, then try with eight order. If the fit improves, it indicates that the system requires a higher order model

Step 3: Fine tuning orders and noise structures

Different structures can give different quality of the models. This can be proven by trying out various structures and to compare the properties of the models obtained. When comparing different structures, the issues that should be concern about includes:

Fit between simulated and measured output:

Observe the fit between these two output which is the simulated and the measured one for the validation data. Normally, a lower order model is chosen as practically the complexity reduced with the number of order. However, it also depends a lot on the system itself. For this HSPC system, it can be found out that actually a higher order model fits the system better than lower order model.

Pole-zero cancellations

When analyzing the pole-zero plot, if it indicates that there is pole-zero cancellations in the dynamics, this suggests that lower order models can be used to represent the model. But maybe the order of the ARX model has to be increased in order to get a better fit. Thus, the extra poles introduced can just be described as noise.

Step 4: Accepting the model

When all the 3 steps have been followed accordingly, the final step is to accept the model which is found to be the best or at least meet the requirement for its intended application.

## 3.4 Statistical Analysis of the Model

Once the discrete model of the HSPC system has been decided, a statistical analysis of the model obtained should be conducted. This analysis is important as to get the information and knowledge about the model and also the system. The power of linear term to the total output power for each individual period and the difference between averaged validation output and actual non-averaged validation output also have been calculated.

MSE=

RMS=

## 3.5 Design of the PID Controller

From the discrete-time model obtained earlier, a discrete-time PID controller is to be developed. A typical structure of PID control system is shown in Figure 3.5.1, where it can be seen that the error signal, e(t) is used to generate the proportional, integral and derivative actions, with the resulting signals weighted and summed to form the control signal u(t) applied to the plant model.

The starting point of deriving the discrete-time PID controller is the continuous-time PID controller:

where u(t) is the controller output (the control variable), e(t) is the control error:

where r(t) is the reference point and y(t) is the process measurement.

## CHAPTER 4: RESULTS AND DISCUSSIONS

## 4.1 Introduction

## 4.2 Discrete-time Model Identification of the HSPC system

First of all, before proceeding with the modelling and identification, the properties of the data provided are checked. The data is said to be Some adjustment are made

1. Averaging the output of testing sets and find its FFT - reduce the effect of noise

2. Removing the harmonics

3. Checking harmonics for both input by using FFT

Without removing the transient,

## MODEL

## TESTING SET

## VALIDATION SET

## Mean Squared Error

## (MSE)

## ORDER

## BEST FIT (%)

## ORDER

## BEST FIT (%)

TRANSFER FUNCTION

8

97.68

4

94.73

0.0002227

OUTPUT ERROR

7

97.66

3

94.58

0.0002268

ARMAX

12

97.70

3

94.37

3.959e-06

ARX

7

96.12

11

93.66

7.813e-05

By removing the transient using filter function,

## MODEL

## TESTING SET

## VALIDATION SET

## ORDER

## BEST FIT (%)

## ORDER

## BEST FIT (%)

TRANSFER FUNCTION

8

97.68

8

1.854

OUTPUT ERROR

7

97.66

7

35.05

ARMAX

12

97.70

12

0.0005633

ARX

7

96.12

7

94.48

## 4.3 Statistical Analysis of the Model

RMS of the model output for the validation set= 1.5361

## Validation Set

## RMS Value

## Power of linear term to total output power for each individual period (%)

1

1.5417

99.637

2

1.5382

99.863

3

1.5447

99.443

4

1.5390

99.812

RMS of actual average output for the validation set= 1.5372

## Validation Set

## RMS Value

## Difference between actual averaged validation output and actual non-averaged validation output (%)

1

1.5417

0.45

2

1.5382

0.10

3

1.5447

0.75

4

1.5390

0.18

## 4.4 Design of the PID Controller

Through system identification as discussed in Section 4.2, the transfer function that describes the system is obtained as a 7th order ARX model. Since it is modelled in its higher order, the system cannot be physically derived in order for the controller to be developed.

Here, the Ziegler-Nichols Tuning Formula comes into consideration by extracting the parameters needed for a controller to be constructed. By using this formula, a continuous-time PID controller is achieved.

First, the discrete-time transfer function, Gd obtained before is converted to its continuous-time transfer function, Gc by using the d2c command. An open loop is performed in which the Gc is fed with step function. The commands use and the results obtained are as follows:

Gd=filt([-0.00204 -0.01065 -0.03558 -0.03917 -0.04286 -0.02018 -0.01548],[1 -1.433 1.139 -1.308 1.191 -1.122 0.7687 -0.2216], 1);

Gc=d2c(Gd);

display (Gc)

step(-Gc)

k=dcgain (-Gc)

OUTPUT:

Gc = -0.00204s^7-0.003686s^6-0.03189s^5-0.0869s^4-0.1628s^3-0.4538s^2-0.286s - 0.6128

## ---------------------------------------------------------------------------------------------

s^7 + 1.507 s^6 + 7.538 s^5 + 8.964 s^4 + 13.2 s^3 + 9.496 s^2 + 3.366 s + 0.05207

k = 11.7702

Figure 1

step.JPG

Figure 2

From the step response of open loop as shown in Figure 1, the following values can be extracted by comparing it with Figure 2.

L= from time of step input to the intersection of the tangent line with the time axis

T= time interval between the step input and the intersection of the tangent line with the final steady-state output level

k=(steady-state change in the process output y)/(amplitude of input step A)

From the step response, the value of L=9, T= 136, k= 11.7702

Next, the Ziegler-Nichols tuning formulae as shown in Table 1 can be applied.

## Controller type

## From step response

## Kp

## Ti

## Td

## P

1/a

## PI

0.9/a

3L

## PID

1.2/a

2L

L/2

Table 1: Ziegler-Nichols Tuning Formulae

Where a=kL/T=0.7789

For PID controller, we get the values as:

## Kp=1.5406

## Ti= 18

## Td=4.5

Value of Kp, Ki and Kd of the PID Controller:

## Kp=1.5406

## Ki= Kp/Ti= 0.08559

## Kd= KpTd= 6.9327

Finally, the continuous-time PID controller is obtained as:

## CONTINUOUS-TIME PID CONTROLLER DESIGN

The closed-loop response of the system is first analyzed without any compensator or controller added to it.

Gc=tf([-0.00204 -0.003686 -0.03189 -0.0869 -0.1628 -0.4538 -0.286 -0.6128], [1 1.507 7.538 8.964 13.2 9.496 3.366 0.05207])

zpk (Gc)

Ts=1;

sys=feedback(-Gc,1);

[y,t]=step(sys,600);

plot (t,y)

xlabel('Number of Clock Pulse')

ylabel('Amplitude')

title('Continuous Model: without PID controller')

After that, the continuous PID controller obtained from the Ziegler-Nichols Tuning Formulae are added to the system. The closed-loop response of the system is then plotted.

Kp = 1.5406;

Ki = 0.08559;

Kd = 6.9327;

s = tf('s');

C = Kp + Ki/s + Kd*s;

sys_c = feedback(C*-Gc,1);

[x,t]=step(sys_c,600);

plot(t,x)

xlabel('Number of Clock Pulse')

ylabel('Amplitude')

title('Continuous Model: with PID controller')

## DISCRETE-TIME PID CONTROLLER DESIGN

One of the main objectives of this project is to create a discrete-time PID controller for the system. The detail design of the discrete version is presented here.

First of all, the closed-loop response of the system is analyzed without any compensator or controller added to it. To achieve a closed-loop, the transfer function need to be closed and this can be done by using the feedback command. Once it is closed, the closed-loop step response with zero-order hold can be examined by using the step and stairs command. As the step command is fed with a discrete model, it will produces an output vector of discrete samples at the sampling time, Ts of the model. For this system, the Ts is set to be 1s and thus it will simulate the step response for 1s. The stairs command on the other hand will produced a stair step plot which is analogous to the plot produced by a zero-order hold circuit.

Gc=tf([-0.00204 -0.003686 -0.03189 -0.0869 -0.1628 -0.4538 -0.286 -0.6128], [1 1.507 7.538 8.964 13.2 9.496 3.366 0.05207])

zpk (Gc)

Ts=1;

Gd=c2d(Gc, Ts, 'zoh')

zpk(Gd)

sys=feedback(-Gd,1);

[y,t]=step(sys,600);

stairs (t,y)

xlabel('Number of Clock Pulse')

ylabel('Amplitude')

title('Discrete Model: without PID controller')

Subsequently, the c2d command will be use to convert the continuous-time PID controller to a discrete-time PID controller. This is achieved by specifying 'tustin' as the conversion method. Tustin's method represents the bilinear transformation that is apply in order to convert a continuous model to discrete time.

Kp = 1.5406;

Ki = 0.08559;

Kd = 6.9327;

s = tf('s');

C = Kp + Ki/s + Kd*s;

dC = c2d(C,Ts,'tustin')

OUTPUT:

dC = 15.45 z^2 - 27.65 z + 12.37

## ---------------------------

z^2 - 1

The output dC is the discrete-time PID controller and can be rewrite as:

Now, the performance of the closed-loop response with discrete-time PID controller can be observed whether it satisfies the system requirements. A closed-loop stair step response should be displayed.

Kp = 1.5406;

Ki = 0.08559;

Kd = 6.9327;

s = tf('s');

C = Kp + Ki/s + Kd*s;

dC = c2d(C,Ts,'tustin')

sys_c = feedback(dC*-Gd,1);

[x,t]=step(sys_c,600);

stairs(t,x)

xlabel('Number of Clock Pulse')

ylabel('Amplitude')

title('Discrete Model: with PID controller')

The performance of both continuous-time and discrete-time PID controller can be summarized as shown in Table 2.

Model

Characteristic

Open Loop

Continuous-time

Discrete-time

without PID controller

with PID controller

without PID controller

with PID controller

Peak response amplitude

11.8

0.962

1.07

1.01

1.1

Overshoot (%)

0

4.32

6.96

9.25

10.4

Settling time (s)

244

16.8

47.7

17.9

47.7

Rise time (s)

136

6.2

0

5.75

2.36

Steady-state value

11.8

0.922

1

0.922

1

Table 2