毕业设计初稿

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 41

Algorithm Design and Implementation of

Embedded Discrete Multi-domain Constant


Temperature Equalization Control System
嵌入式的离散多区域恒温均衡控制系统算法的设计及实现
School
: Electronic Engineering School

Major: Electronic Information Engineering

Class: EIE 1907

Name: Ye An

Student ID: 05191186

Supervisor: Jiang Li
Professional
Title: Lecturer

From: 2022/12/24 To: 2023/06/07

Abstract
With the development of science and technology,temperature has become an important
index in people’s daily life,and the temperature control is able to improve production
efficiency.Since many temperature adjustment methods have no significant effect on
temperature control, it is particularly important to design a temperature control system with
high control precision and strong control ability.This design will implement a system with
STM32 micro-controller as the core, PID algorithm as the control algorithm, and
temperature control system through the heat sink and Keil5 software. By setting the target
temperature, the system makes the control algorithm control the cooling equipment, so as
to achieve the purpose of precise temperature control.

Keywords:
Content

1.Introduction………………………………………………

1.1Background of Constant Temperature Control System……………………

1.2Structure of Thesis………………………………………………

Chapter 2 Constant Temperature Control System Design………………

2.1 System Overall Design……………………………………

2.2 PID algorithm program implementation…………………………………

2.3 Control algorithm optimization…………………………………………

2.4 Summary of this chapter…………………………………………………

Chapter 3 Temperature control system design………………………

3.1System overall design………………………………………………

3.2Design of each module………………………………………………

3.3Summary of this chapter……………………………………………

Chapter 4 Algorithm debugging and overall optimization……………

4.1 Algorithm simulation………………………………………………


4.2 Algorithm debugging……………………………………………

4.3 Overall optimization……………………………………………………

4.4 Summary of this chapter………………………………………………

Chapter 5 Conclusion and Prospect………………………………………………

Acknowledgement…………………………………………………………………

References………………………………………………………………………

Appendix……………………………………………………………………………

1.Introduction

1.1 Background of Constant Temperature Control System

Nowadays,with the continuous updating and constant upgrading of computer


technology,temperature has become an important index in different kinds of fields
especially in constant temperature control systems.Constant temperature control systems
are essential for a wide range of industrial and scientific applications,including chemical
processing,biological research and so on.Achieving precise temperature control is often
crucial to maintaining product quality, optimizing reaction rates, and ensuring experimental
reproducibility.

One common method for achieving precise temperature control is to use thermostats or
temperature controllers,which regulate the system’s temperature by adjusting heating or
cooling elements.However, these systems are often limited by their ability to respond
quickly to changes in temperature, leading to oscillations or overshoots in the desired
temperature setpoint.

To address these challenges, researchers have developed a variety of advanced thermal


control strategies, including proportional-integral-derivative (PID) control, model predictive
control (MPC), and adaptive control. These techniques leverage advanced sensors,
actuators, and algorithms to provide more accurate and responsive temperature
regulation, enabling a range of high-performance applications.

1.1.1 Overseas and Domestic Research Status of Constant Temperature Control


System

In foreign countries,the research of constant temperature control system has started in the
1970s.They begin to detect temperature and use many kinds of methods to control
it.Nowadays they have taken the large technological results especially in the tuning of
adaptive parameters and the collection of temperature data in sensors.In these
aspects,countries such as Japan,the United States,Germany,Sweden are leading in
technology and have produced a batch of commercial temperature controllers and
instruments with excellent performance.[1]
The development of constant temperature control technology is still in the level of 1980s in
China.The produced controllers can only be used in the average temperature control
system and they are difficult to control the complicated,time-variant and time-delay
systems.Besides,it is a pity that the domestic technology can still not satisfy the
requirements when facing the situations of designing adaptive parameter-tuning
systems.Since our country still has no solutions to reach the level of producing large-scale
instrument,it is also significant to import the constant temperature instruments from foreign
countries.Therefore,there still needs time to develop technology and bridging the gap
between China and other developed countries.

1.1.2 Advantages of Constant Temperature Control System

A temperature control system is a heating and cooling system that maintains a consistent
temperature,usually in a specific area such as a home or business.This type of system
has these main advantages as follows[2]:

(1) High energy efficiency:In the temperature control process,this system maintain one
consistent temperature without wasting energy on heating or cooling beyond the desired
range.

(2) Comfortable environment:The constant temperature system provides comfortable


conditions to avoid fluctuations that could cause discomfort to individuals living or working
in the space.

(3) Excellent stability:This type of system has always been significant for some processes
such as manufacturing,where temperature variations can pose safety risks to workers or
the environment.It can also help to prevent accidents and ensure safe working conditions.

1.1.3 Application Fields of Constant Temperature Control System

Temperature control systems have become essential in various industrial and commercial
applications,providing accurate and efficient regulation of temperature in various
processes.Here are some few examples of applications field of constant temperature
control system[3]:

(1) HVAC(Heating,Ventilation,and Air Conditioning)Systems:Temperature control is vital in


HVAC systems to maintain a comfortable indoor environment for humans,enabling precise
control of heating and cooling in homes and commercial buildings.

(2) Food and Beverage Industry:Temperature control systems are used in food and
beverage industries to maintain the optimal temperature range for storage,processing and
transportation of perishable products like fruits,vegetables,meat,dairy and beverages.

(3) Medical and Pharmaceutical Industry: Maintaining precise temperature conditions is


critical for preserving the effectiveness of drugs and vaccines, which require specific
temperature ranges for storage and transportation.

(4) Chemical Industry: In chemical industries, precise temperature control is essential to


ensure the quality and consistency of chemical reactions, making it possible to produce
high-quality products with minimal waste.

(5) Automotive Industry: Temperature control systems are used in automotive


manufacturing processes to regulate temperatures during painting and coating operations,
ensuring high-quality finishes and preventing defects.

1.1.4 Common-used Algorithm in Constant Temperature Control Systems

The most common algorithm used in constant temperature control system is the
PID(Proportional-Integral-Derivative) algorithm.PID algorithm can not only solve the above
problems, but also in the unsupervised, for a long time temperature will be automatically
collected, automatic controlling of the semiconductor temperature controller achieves
heating or cooling function, the system temperature will always be maintained constantly.

The PID algorithm works by continuously measuring the current temperature and
comparing it to a desired setpoint temperature. The difference between the two, known as
the error signal, is used to determine the appropriate action to take to maintain the
setpoint temperature.To implement the PID algorithm, specific tuning parameters must be
chosen for each component to ensure stable and accurate control. These tuning
parameters are often adjusted through trial and error or by using specialized software
tools.

1.2 Structure of Thesis

The structure of this paper is mainly divided into four chapters:

The first chapter introduces the background of constant temperature control system.The
oversea and domestic research status of system have firstly been studied.Then the
advantages and widespread application fields of temperature control system have also
been analyzed. Based on these backgrounds,the PID algorithm in temperature control
system has been led out.

The second chapter introduces the temperature control system design.In this chapter,the
overall design and different modules design will be introduced and analyzed. Next,the
summary of this chapter will be made

The third chapter introduces the PID constant temperature control algorithm design and
implementation.

The fourth chapter introduces the overall algorithm debugging and optimization.
2.Constant Temperature Control System Design

This constant temperature control system,based on STM32,is mainly composed of LCD


display module,timer module,temperature detection module,heat dissipation fan control
module and PID control module.Its main function is to use LCD module to display the real-
time temperatures in different temperature sensors by setting desired temperature and
detecting real-time temperature. Then the PID algorithm control module will output PWM
wave according to the collected temperature and PWM wave will control the temperature
by the rotating speed of heat dissipation fans.
2.1 System Overall Design
The total structure of constant temperature control system is shown as follows in
Figure2.1,including LCD display module,temperature detection module,heat dissipation
module and PID control module.
Figure2.1 The total structure of constant temperature control system
To achieve the temperature detection module,DS18B20 temperature sensor can become
the most appropriate sensor.DS18B20 has 3 pins,which are also named as GND,Vcc and
Data.The GND pin is used to connect to the GND terminal of the circuit while the Vcc pin
can be used to give the power to the sensor which ranges from 3.3V to 5V.Then the data
pin supplies the temperature values detected by DS18B20 temperature sensor which can
communicate with the help of 1-wire method.
The LCD display module can be used to display the curves of temperatures in every
temperature sensors with the changing time.Every DS18B20 temperature sensor saves
the data in STM32 in the form of array,then the two-dimension coordinate is able to be
shown in the LCD screen and the temperature data in the array can be displayed in the
LCD module.
The PID control module uses the errors between desired temperature and actual
temperature to achieve the established amounts of control so that they have the ability to
control the output amount of PWM wave by the calculation of proportion,integral and
derivative.
The heat dissipation fan module is used to utilize the output PWM wave to control the
rotating speed of fan to modulate the temperature.As the rotating speed of fans become
faster,the fan keeps working and the temperature starts to decrease faster.on the
contrast,when the fan stops rotating,temperature begins to increase so that the
temperature can be back to original state.
2.2 Different Module Design
2.2.1 STM32 Microcontroller Module Design
The STM32 family is a family of microcontroller ICs based on various 32-bit RISC ARM
Cortex-M cores.It has the good stability,high performance and any other excellent
characteristics so that many novices want to choose it to study.It has large amounts of
application fields such as data collection,medical equipment and so on.
Even though the 51 single chip has become the widely used chip,its input/output port has
no ability to output the high level.Therefore,it is difficult for this kind of chip to heat the
heater so that the equipment can’t work normally.STM32F103 has the consummate
functions such as keeping working from the freezing environment to the heating
environment with no harm,adjusting itself adaptively to have the lower power consumption
compared with other STM32 chips,high accuracy and broad application range compared
with other kinds of chips.Thus,STM32F103 has become the main microcontroller in this
design.
2.2.2 Temperature Detection Module Design
1.The analysis of Temperature Detection Module
People often need to detect the temperature in their daily life.When they feel
uncomfortable or suspect of being infected with the virus,they always detect/measure their
body temperature to see whether they have signs of fever.When they go to the street in
large cities,they are able to see one large board which shows the environment
temperature.From these scenarios the temperature detection is of great significance to be
used anywhere.
There are several kinds of temperature sensors including infrared temperature
sensor,thermal resistance,thermocouple and so on.Infrared temperature sensors has the
rapid measurement and can’t be affected by the material and color of the
object.However,it has the relatively low accuracy and expensive prices.Thermal resistance
detect temperature by changing its resistance value with temperature and can be made
into small sensors,but they have the low accuracy and nonlinear
characteristics.Thermcouples use the thermoelectric potential difference of different
materials to measure temperature and have a wide measurement range and high
measurement temperature capability,but it can be easily affected by interference.
In this design DS18B20 temperature sensor has become the main type to achieve
temperature detection.Its temperature measurement range is -55℃ to 125℃ with an
accuracy of ±0.5℃ and it is determined by its internal structure and used materials.The
range can also be expanded by stacking multiple DS18B20s.DS18B20 also adopts 1-Wire
bus and digital signal output,and digitizes the analog temperature signal by reading
serialized temperature data from the sensor.During data transmission,it uses a unique
temperature measurement method called”Sigma-Delta ADC” which utilizes an analog
converter and a digital filter.This digital filter uses a linear stage with a high-pass filter and
a certain number of integrators for filtering the input signal, which can cancel out the noise
and instability of the sensor and output a more stable temperature value.By these
functions,the basic requirements of this design can still be satisfied simply.
2.The Implementation of Temperature Detection Module
In order to implement this module,the following Figure2.2 and Figure2.3 show the basic
schematic of this module:
Figure2.2 The Schematic 1 of Temperature Detection Module

Figure2.3 The Schematic 2 of Temperature Detection Module


The DS18B20 temperature sensor has three pins including VDD,GND and DQ.These pins
should all be connected to the STM32 device,where VDD connects to the power supply of
device,GND connects to the ground wire of device and DQ connects to the data
input/output pin of device.Then this equipment needs to use 1-Wire bus to communicate
with DS18B20.In all communication with DS18B20,the bus must be connected to pin DQ
and one of the device’s GPIO output can be connected to DQ.After that,the device can
use the command of ROM to read the serial number and checksum from the device and
the temperature conversion command allows the device to read temperature data from
DS18B20.The temperature sensor need to interface TEMP0/1/2 in Figure2.3 to convert
analog input into digital value for processing and analysis by equipment so that it can
provide the temperature data required by the device.Then the temperature detection
module can be achieved.
2.2.3 LCD Display Module Design
This design is mainly using TFT-LCD crystal display screen as the LCD display module
to show the curve of temperatures in temperature sensor with the time changing.This kind
of LCD has the higher density of pixels than that of traditional liquid crystal display so that
it can provide higher resolution and finer picture quality.It also has the thin film transistor
technology which helps to achieve high-precision pixel control,high-contrast and high-
brightness display effect.The chosen TFT-LCD is shown as follows in Figure2.4:
Figure2.4 The TFT-LCD Crystal Display Screen in LCD Display Module
To achieve this kind of module,drawing the curve of temperature data with the time
changing is the first step.DS18B20 temperature sensor saves the data in STM32 in the
form of array.Since STM32 has several kinds of timer and they have the corresponding
functions,drawing the X-Y two-dimension coordinate system in the LCD screen should be
completed at first.Then displaying all of the temperature data in the LCD screen by
drawing points in the coordinate system should be done next.Here is the flow chart
Figure2.5 of displaying temperatures in the LCD screen.
Figure2.5 The Flow Chart of Displaying Temperature in LCD Screen
After drawing the coordinate,drawing points is also an important step to complete the
curve.In order to do this,using LCD display to modify the size and position should be done
at first.Then writing the data into LCD screen through STM32 to achieve the purpose of
showing points is also a necessary step.After completing the points,lighting all of the
drawn points can make the lines appear in the screen.
2.2.4 Heating Module Design
In constant temperature control systems,in order to keep balance between high and cool
temperature,heating or cooling has become the vital step to keep the temperature
stable.First turn to the heating module.In this process,the PID algorithm becomes an
important control algorithm to output the PWM wave so that the heating module can be
easily controlled.When the PID algorithm keeps operating,the signal keeps outputting,and
the heater has finally been controlled by this process.
Here are Figure2.6 and Figure2.7 to achieve the heating module:

Figure2.6 The Heating Module 1 of System


Figure2.7 The Heating Module 2 of System
In this figure, the blue rectangle represents the temperature controller, which uses the
PID algorithm to calculate the proportional, integral and derivative parameters to adjust
the ambient temperature with the data read from the temperature sensor. Components
such as temperature sensor, power supply and automatic detection circuit are all
embedded in the temperature controller.
When the current ambient temperature is lower than the target temperature, the PID
algorithm will trigger the heating circuit, and connect the output signal of the power supply
to the constant temperature device, thereby starting the constant temperature device to
increase the ambient temperature. The temperature sensor continuously monitors the
ambient temperature, and transmits the temperature data to the PID algorithm for analysis
and processing. The PID algorithm compares this to a preset target temperature, then
adjusts thermostats and fans as needed to maintain a stable ambient temperature.
2.2.5 Heat Dissipation Module
In this module,the heat dissipation fan become a very important part to accelerate the
process of heat dissipation.Choosing the kinds of fans attach high importance to
designers.Many kinds of fan usually have two pins,VCC and GND,and they are connected
to the positive and negative poles of source respectively.
After choosing the fan,the next key step is to control these fans.To achieve it,the control
towards PWM wave is able to avoid the running speed of fans being too fast or too slow
so that the environment temperature can be controlled better.Then connect the heat
dissipation fan to the temperature controllers and let the fan work by PWM control.
The following Figure2.8 also shows the fan circuit to maintain the state of constant
temperature:

Figure2.8 The Fan Circuit of Constant Temperature Control System


When the environment temperature is higher than the desired temperature,the PID
algorithm will trigger the fan circuit and connect the output signal of source to the fan to
lower the environment temperature.
3. PID Algorithm Design and Implementation in Constant Temperature
Control System

In chapter 2,the overall system design has been introduced and the different modules in
the whole system have been analyzed in detail.In this chapter,the PID algorithm will be
introduced into 4 aspects,including its basic principles,parameter tuning,program
implementation and control algorithm optimization.

3.1 Basic Principles of PID Algorithm

PID,which is also the abbreviation of proportional-integral-derivative,is the most mature


and widely used control algorithm in continuous systems that combines
proportional,integral and derivative calculations.Its controllers are mainly appropriate for
the systems which are basically linear and have dynamic characteristics that do not
change over time.Practical operating experience and theoretical analysis have shown that
the use of PID control algorithm can achieve satisfactory consequences in controlling
many industrial processes.

In essence, a PID controller is to perform calculations using applies an accurate and


responsive correction to a control function the deviation values input according to the
proportional-integral-derivative functional relationship with the goal of controlling the
output. An ideal PID control law of continuous control system is as below:[6]
In this formula,Kp means proportional gain,Tt means integral time constant,TD means
derivative time constant,u(t) means the output signal of PID controller,e(t) means the error
between given value(often shown as r(t)) and detected value.

It can also be simplified as:

In this formula,Kp,Ki,Kd mean proportional,integral and derivative gains,e(t) means the


error between given value and detected value,u(t) means the output signal of PID
controller.

The analysis for designing a digital implementation of a PID controller in


a microcontroller (MCU) or FPGA device requires the standard form of the PID controller
to be discretized.[8]In PID algorithm,there are also two kinds of algorithms including
positional PID algorithm and incremental PID algorithm.Now it’s time to analyze these two
algorithms.

To the positional PID algorithm,its discrete formula can be written as:

From the formula of positional algorithm,it is able to see that the proportional part is only
related to current error e(k) and the integral part shows the sum of errors in the
system.Therefore,the advantages of positional PID algorithm lie in its clear controller
structure and obvious parameter tuning.However,there are two disadvantages to this PID
algorithm.The first one is that the deviation e(k) needs to continuously accumulated,which
increases the computational workload and burden on computers so that it will result in a
significant change in the position of an actuator.The second one is the occurrence of
integral saturation phenomenon,which means that when the control amount of the system
has reached its maximum value,the error will continue to accumulate under the action of
integration.For the phenomenon of integral saturation, an integral limiting algorithm is
usually adopted, which sets the limit value of the controller's output control quantity. When
the output of the PID controller exceeds the set range, the integral operation is stopped.

To the incremental PID algorithm,its discrete formula can be written as:


For the incremental PID algorithm,it improves on the shortcomings of the positional PID
algorithm, thus it becomes the advantages of the incremental PID algorithm.It has three
advantages:①The algorithm adopts weighted processing without the need for
accumulation to control the increment Δu (k) is only related to the last three sampling
values;② The computer only outputs control increments at a time Δu(k), which is the
amount of change in the position of the actuator, therefore the probability of computer
failure is relatively low;③The impact during manual and automatic switching is small, and
undisturbed switching can be achieved. The phenomenon of integral saturation is a
common phenomenon in the application of positional PID algorithm. Therefore, for
positional PID algorithm, in addition to limiting the output, it is also necessary to limit the
integral output. Incremental algorithm effectively avoids the phenomenon of integral
saturation. Therefore, in incremental PID control algorithm, only output limiting is required,
without integral limiting.

In conclusion,the incremental PID algorithm is the best algorithm for this design to control
the heat dissipation fan.In this design,the input is the error between desired temperature
and actual temperature and after the calculation of proportional,integral and derivative,its
final combination of three calculation results will become the output to achieve the final
goal.The incremental PID algorithm is shown as follows in Figure3.1.

Figure3.1 Structure of Incremental PID Algorithm

3.2 Parameter Tuning

Parameter Tuning of PID algorithm is a complex process which generally needs to be


carried out slowly according to the controlled object.There are many classic tuning
methods for PID parameters such as trial and error method or Ziegler-Nichol’s method.
[10]
When tuning the parameters of the PID controllers,the parameters of the controller can
be adjusted by experimental methods according to the qualitative relationship between
parameters and the dynamic and steady-state performance of the system. The most
important problem in debugging is to know which parameter should be adjusted and
whether the parameter should be increased or decreased when the system performance
can not be satisfied.There are several kinds of famous methods to tune the parameters:

3.2.1 Z-N Parameter Tuning Method

It can also be called Ziegler-Nichols method,which uses the step response curve of
controlled object to obtain the model of controlled object.According to the characteristics
of large lag and large inertia of the expander and referring to the relevant data, the control
system of the expander can be approximately simplified. After linearization, the transfer
function can be expressed as follows:

Generally speaking, the overshoot of the PID controller due to Z-N setting is relatively
large. For this reason, C.C.Hang proposed the improved Z-N method, which improved the
overshoot of the system by weighting the given value and modifying the integral constant.
This method is considered to be the most successful improvement of the Z-N method.

The Ziegler-Nichols critical oscillation method is only applicable to open-loop stable


objects. This method first applies a proportional controller to the controlled object, and its
gain is small, and then gradually increases the gain to make the system appear stable
oscillation. At this time, the critical oscillation gain is the value K of the proportional
controller, and the oscillation period is the system Where the oscillation period is, and then
according to the formula (3) to tune the PID controller parameters.

A similar tuning method is the Cohen-Coon response curve method, which is the same as
the Ziegler-Nichols response curve method, except that the tuning formula is different, and
the tuning formula is shown in formula (4):
3.2.2 Attenuation Oscillation Method

The attenuation oscillation method adjusts the parameter value of the controller by
causing the system to generate attenuation oscillation. numerically. After reaching stability,
add step disturbance by changing the given value, observe the attenuation ratio of the
recorded curve of the controlled variable, and then change the ratio from large to small
until the attenuation ratio of 4:1 appears, and record the attenuation ratio at this time
Scale ∂s (called 4: 1 attenuation scale), get the attenuation period Ts from the curve. Then
according to the formula, find out the parameter setting value of the controller.If equal
amplitude oscillation is difficult to achieve, obtain a 4:1 oscillation curve under pure ratio
as the basis for parameter setting.

To achieve the attenuation oscillation method,there are several steps to tune the
parameter:

1) Put the integral time to the maximum and the differential time to zero to make the
control system operate and set the proportionality to a larger value.Purring P to reduce
proportionality means put control system into operation in a purely proportional
manner.Then keep reducing the ratio slowly, observe the output of the regulator and the
fluctuation of the control process until the attenuation process of 4:1 has been found.It is
called “finding attenuation 4:1”.

2) For some control objects, if the vibration is too strong with the attenuation ratio of 4:1,
the attenuation ratio of 10:1 can be used at this time. But it is very difficult to measure the
attenuation period at this time, the rise time Tr of the first peak can be measured, and the
operation steps are the same as above.

3) Calculate the value of each parameter according to the attenuation ratio s and
attenuation period Ts, Tr in Table2 .

Table2 Attenuation Curve Method Regulator Parameter Calculation

Control Control δ/% Ti/min Td/min


Quality Laws
Requirement
s

Attenuation P δs
Ratio 4:1

PI 1.2δs 0.5Ti
PID 0.8δs 0.3Ti 0.1Td

Attenuation P δ's
Ratio 10:1

PI 1.2δ's 2Tr

PID 0.8δ's 0.3Tr 0.1Tr

4)Put the proportional degree on a value larger than the calculated value, then add the
integral time Ti, and then slowly add the differential time Td. When operating, you must
follow the "PID order to add parameters", that is, first P times I and last D, do not destroy
this order.

5)Reduce the ratio to the calculated value, and adjust the parameters appropriately by
observing the curve. That is, "watch and run fine-tuning" until you find the best value.

3.2.3 Response Curve Method

The response curve method is one of the common methods for tuning the parameters of a
PID controller.The basic principle of this method is to use the response of system to a step
input to determine the appropriate parameter values.

To use the response curve method, a step input is applied to the system, and the resulting
response curve is recorded. The response curve can then be used to estimate the
system’s transfer function, which can be approximated by a first-order plus time delay
(FOPTD) transfer function.

The parameters of the FOPTD model can then be used to estimate the appropriate PID
parameter values. Specifically, the time constant of the FOPTD model can be used to
estimate the value of the proportional gain (Kp), while the time delay can be used to
estimate the value of the derivative gain (Kd). The integral gain (Ki) can be estimated
based on the response of the system to a steady-state error.

Once the estimated parameter values are obtained, they can be used to set the initial PID
controller parameters. The controller’s performance can be evaluated, and the parameters
can be adjusted as needed to achieve the desired control performance.

Overall, the response curve method is a useful tool for tuning the PID controller
parameters and can provide good results with relatively low computational effort.
However, the method does rely on a relatively simple model of the system, and care must
be taken to ensure that the resulting parameter values are appropriate for the specific
application

3.2.4 Critical Ratio Method

The critical ratio method is a popular method of tuning the parameters of a PID controller.
The method is based on using the ratio of the system’s time constant to its dead time to
determine appropriate PID parameters.Experimental results show that the new procedure
performs better than both the contingent critical‐ratio and the conventional critical‐ratio
techniques.[14]

The first step in the critical ratio method is to obtain response data by applying a step
input to the system and measuring the response. This response data is then used to
estimate the system’s time constant and dead time.

The critical ratio is defined as the ratio of the system’s time constant to its dead time. A
higher critical ratio indicates that the system is more sluggish, while a lower critical ratio
suggests a faster system response. Based on the critical ratio, recommended PID
parameters can be calculated using empirical rules.

For systems with a low critical ratio (less than 0.1), the recommended parameters are:

For systems with a medium critical ratio (between 0.1 and 1.0), the recommended
parameters are:

For systems with a high critical ratio (greater than 1.0), the recommended parameters are:
Once the recommended PID parameters are calculated, they can be applied to the
system and tested for performance. Adjustments to the parameters can be made as
necessary to achieve the desired control performance.

Overall, the critical ratio method is a useful tool for determining appropriate PID
parameters based on the system’s dynamic characteristics. However, it does rely on a
simple model of the system and may not provide optimal performance in all cases, so care
must be taken when applying the method to specific systems.

3.3 Program Implementation

3.3.1 Software Selection

With the continuous updating of simulation software,the selection of software has also
become a very important choice to simulate the best result.After several investigations to
simulation software,researchers have discovered that Multisim,Proteus and
Matlab/Simulink have become the most popular software in most respondents.

Multisim is a well-deserved pioneer in virtual simulation of complex circuits of analog and


digital circuits.It has figurative and extremely real virtual instruments,and both the
appearance of the interface and the internal functions have reached the highest level.It
has a professional interface and classification, powerful and complex functions, and is
extremely accurate in calculating data.However,the disadvantage of Multisim is that its
software is too large and the support for MCU is insufficient,and the additional functions
such as making boards are not as good as other specialized software.

Proteus is an EDA tool software which supports circuit diagram design,PCB layout and
circuit simulation.Proteus supports the simulation and debugging of the single-chip
application system so that the software and hardware design can be quickly verified
before the PCB board being made,which not only saves costs but also shortens the
development cycle of the single-chip application.The disadvantage of Proteus is that it’s
insufficient for the data calculation of the circuit.

MATLAB is a high-level technical computing language and interactive environment for


algorithm development, data visualization, data analysis, and numerical computation.
MATLAB has a wide range of applications for modeling, analysis, and planning of dynamic
systems, including signal and image processing, communications, system control design,
test and measurement, financial modeling and analysis, and computational biology,
among many other application areas. Simulink provides an interactive graphical
environment, as well as a custom module library, and can be extended for specific
applications, and can be applied to many fields such as control system design, signal
processing and communication, and image processing.[15]

In summary,after the comparison with these software,MATLAB/Simulink becomes the


most appropriate software in this design and then Simulink can be used to simulate PID
algorithm.

3.3.2 Program Design


This design uses the Matlab platform as the simulation platform.Figure 3.2 shows the
compiled program of this design:

Figure3.2 The compiled program of Design

In this program,u_n means the array of u[n] and u_n1 means the array of u[n-1],then by
this logic e_n,e_n1 and e_n2 also mean the arrays of e[n],e[n-1] and e[n-2].By the basic
principle of PID algorithm,u[n] means the current temperature data with the time changing
while e[n] can be explained as the error between current temperature data and desired
temperature data.Kp,Ki and Kd mean the proportional,integral and derivative coefficients
while CT expresses the current time between arrays u_n and e_n.Ts shows the sampling
period and its value in the program is 1.There also exists one function 1200*atan(x)/31
which indicates the relationship between ambient temperature at current time and current
time.

Then after the circulation the final image of function has been successfully
made.According to the formula of discrete incremental PID algorithm,the value of alpha
can be obtained and it is able to influence the ambient temperature in the next
second.The temperature data in the next second is 1200*atan(x)/31+alpha then the u[n]
and e[n] array can be changed to continue the calculation and obtain the temperature
data.

3.3.3 Simulation Analysis

To begin with,the experimental simulation with constant power heating must be


completed.When the heating begins,the temperature will keep increasing and finally tend
to become stable until the heating temperature equals to the environment temperature.As
shown in Figure 3.3,the curve which shows the function 1200*atan(x)/31 represents that
the temperature keeps rising from time 0 to 100s and eventually be approximate to 60,and
it suits for the requirements of this design.

Figure3.3 The Function Image without PID Algorithm

In addition,add the PID constant temperature control algorithm on the basis of constant
power heating and try to adjust the coefficient of Kp because the oversized Kp will make
the temperature change rapidly.With these conditions,it is simple to desire the
temperature to be 60 Celsius to achieve the requirements.However,the curves become
very choppy and after adjusting the Kp coefficient to become 0.40,the amplitude of
oscillation starts to decrease and it becomes more stable as shown in Figure 3.4:
Figure3.4 The Function Image after adjusting Kp

Furthermore,the integral coefficient Ki is mainly used to oscillation of curves.When there


exists appropriate Ki,the oscillation of curves can be reduced in the image and it is able to
make the actual temperature become stable besides the desired temperature.In
Figure3.4,the actual temperature starts to stabilize after 50s.However,when decreasing Ki
from 0.05 to 0.01,the temperature begins to stabilize after 40s as is shown in Figure3.5.
Figure3.5 The Function Image after adjusting Ki

Eventually,adjusting the Kd coefficient is also an significant step to avoid the phenomenon


of oscillation.In Figure3.5,even though the oscillation of curve has been reduced and the
temperature has become more stable,there still exists the phenomenon of temperature
oscillation from 0 to 40s.By analyzing the curve,adjusting the Kd coefficient has become
very important.After adjusting Kd from 0.005 to 0.01, the curve shows a rapid upward
trend from 0 to 30 and the upward trend is stable without any oscillation in Figure3.6.The
temperature reached the setting temperature in about 30 seconds.
Figure3.6 The Function Image of adjusting Kd

After adjusting these three coefficients,the curve of temperature rising tends to become
stable and the time to reach the stable temperature seems to become shorter and
shorter.It has met all the requirements of using PID algorithm in constant temperature
control system.

3.4 Control Algorithm Optimization

Optimizing the algorithm is crucial to achieving the desired temperature control


performance. The optimization process involves adjusting the PID parameters to lessen
overshoot, reduce errors, and reduce settling time.

Here is one algorithm optimization of this design in Figure3.7:


Figure3.7 The Algorithm Optimization of Constant Temperature Control System

In this Figure,the proportional,integral and derivative coefficients Kp,Ki and Kd change


towards 0.25,0.005 and 0.0005.Then here is the output result after the optimization in
Figure3.8:
Figure3.8 The Final Output Result after Optimization

In summary, optimizing a PID control algorithm involves selecting a control objective, fine-
tuning the PID parameters, and testing the results to improve the system’s performance.
This process is iterative, and the PID gains and control outputs are refined until a desired
system response is achieved.
4.Experiment Debugging and Result Analysis

This chapter is mainly discussing the final experiment debugging and result analysis.It has
outlined the experimental consequences and result analysis when the overall
configuration of the system becomes normal.This chapter also some solutions when
facing some problems in the design.

4.1 Experiment Debugging

Figure4.1
Figure4.2

4.2 Result Analysis

4.3 Summary of this chapter

This chapter verifies the feasibility of the incremental PID algorithm as a control algorithm
in the heat dissipation control system through experimental debugging and result analysis.
By adjusting the three parameters of the PID algorithm, the temperature control of the PID
algorithm is more stable, and the speed of reaching a stable temperature is faster.
5.Conclusions and Prospects

In this paper, we have designed and implemented an embedded discrete multi-domain


constant temperature equalization control system based on the PID control algorithm. The
system’s hardware design includes temperature sensors, a microcontroller and so on. The
software design contains the PID control algorithm, which is used to maintain the target
temperature by adjusting the heater’s power.

Experimental results show that the PID control algorithm can effectively control the
system’s temperature and provide precise temperature control. The system can maintain
a stable temperature within an acceptable error range. The temperature equalization
control scheme based on the PID control algorithm improves the system’s temperature
efficiency and reduces energy consumption.

In the future, we can further improve the system’s performance and reduce energy
consumption by optimizing the PID control algorithm and using more advanced control
methods such as fuzzy logic, neural network, and adaptive control. We can also
incorporate wireless communication technology into the system design to enable remote
control and monitoring of the system’s temperature.

Furthermore, we can expand the system’s application to other domains, such as food and
chemical production, where precise and consistent temperature control is essential. The
system’s design can also be modified to allow for multi-zone temperature control.

In conclusion, the PID constant temperature control algorithm is an effective method for
temperature control in a discrete multi-domain constant temperature equalization control
system. The system has the potential for further development and application in various
fields, promoting energy conservation and environmental protection.
Reference

[1]Menglong Cong,Dandan Sun,Constant Temperature Control System Based on


Incremental PID Algorithm[A],Inner Mongolia University for Nationalities,2014

[2]

[3]

[4]

[5]

[6]Y X Li, H B Xu, G X Gu, Y J Guo, B Wang. "A review of stability control algorithms for
weapon platforms", Journal of Physics: Conference Series, 2023

[7]

[8]

[9]

[10]Khulood A. Dagher* Ahmed S. Al-Araji**,Design of an Adaptive PID Neural Controller


for Continuous Stirred Tank Reactor based on Particle Swarm Optimization,Al-Khwarizmi
Engineering Journal, Vol. 9, No. 4, P.P. 46- 53 (2013)

[11]Ruijie He, Zhigang Wang and Wencheng Fu,Application Of PID Control Based On BP
Neural Network In The Expansion Machine Of Organic Rankine Cycle System,Tianjin
University of Technology,GRC Transactions, Vol. 42, 2018

[12]
[13]

[14]Liao, C. (1992), "A New Contingent Critical‐ratio Technique", International Journal of


Operations & Production Management, Vol. 12 No. 6, pp. 66-74.

[15]Shi Jia-nan,Xia Jiao,Li Yu-shuai,Li Jia-Xuan,Ye Yong-Fang,Simulation of PID Control


Algorithm Based on Matlab[A],Shanxi Normal University,2020

[16]

[17]

[18]

[19]

[20]
Acknowledgement

Four years of university life represents a period of end, and it is a new beginning. I have a
lot of words to say to people around me. When I finished this paper, the first time was a
feeling of relief, and then there was a lot of thoughts.

The first thing I want to mention is my supervisor, Jiang Li. I would like to thank the tutor
for the advancement and guidance of my work in the overall study of the thesis, and a
careful review during the completion of the thesis. Although the contact with the instructor
is not long, the instructor's concern for the progress of our team's work, and the guidance
of each member's work content in the group, let us work hard to complete the individual
learning tasks. The mentor's enthusiasm and relaxation, and the relaxed learning style,
allowed me to develop the ability of independent study and hands-on practice, which
made me very productive. At the same time, the other teachers of the set up group also
put forward their opinions and suggestions during the process of completing the
inspection. Their supervision and supervision also remind me to remind myself to work
hard to complete my task.

In addition, I would also like to thank the teachers and students who have met in this
university for four years, especially my roommates and Zhang Xin teacher. You are giving
me the care and life care, giving me care and encouragement when I am in trouble,
sharing and communicating together when I am happy. In the process of completing the
thesis, learn to share the use of new software and delve into the theoretical knowledge. It
is you who let me study or live, full of optimistic attitude and caring gratitude.

I also want to thank my parents. You have always been full of tolerance and love for me,
giving support to all aspects of my study and life, giving me free space that no one else
has. I am grateful to my parents for urging and supporting me in the process of completing
the thesis. Drinking water as a source of thought, I should present this paper as a final
answer to the university and present it to you.

I am grateful to everyone around me, and I am grateful for the many things I have
experienced. I will keep it in mind. What I learned during this graduation project will be my
greatest asset. Finally, once again, I would like to express my heartfelt thanks to my
family, classmates and teachers during the completion of the thesis!
Appendix

You might also like