Microprocessor temperature control device for a thermal object

. The article deals with a device for temperature control of a thermal object. The device is based on a single-chip AVR ATmega32 microcontroller. There are two modes of temperature regulation. The first is designed for temperature regulation within the range of -55 ° C to +125 ° C, and the second is from +126 ° C to +1000 ° C. The first range uses a DS18B20 digital serial output temperature sensor. The temperature measurement resolution in the first temperature range of -55 °C to +125 °C is 0.0625 °C. The second range uses a K-type thermocouple and a MAX6675 thermocouple signal converter with I2C interface. The discreteness of temperature measurement in the range from +126 C to +1000 C is 2 C. The microprocessor based controller has a very wide temperature control range from -55 to +1000°C, which is well within the temperature range required by the process. In the first area, due to high accuracy digital temperature sensor DS18B20, the resolution is very good ±0.0625 °C, which enables the use of the controller in climate control systems.


Introduction
Certain technological processes as well as climate control systems require the temperature of thermal objects to be regulated and maintained within strictly defined ranges.These systems are currently being implemented on the basis of microprocessor systems.
The general principle of operation of such systems is that the controlling device polls the setpoint device (controller) which determines the set temperature and the temperature sensor which determines the actual temperature at the selected discreteness in time.The controller compares the required temperature at the set point with the actual temperature and calculates the discrepancy.A control action is generated on the basis of the discrepancy signal to eliminate the discrepancy.
As a rule, all temperature control tasks are similar.The only differences are the temperature range, the actuator capacity and the control law.This makes it practical to implement a standard microprocessor temperature control system which can easily be adapted for various applications.

Methods and materials
The proposed microprocessor-based temperature control system is designed as a basic system that has a number of interchangeable hardware modules and customizable software.
The developed device is implemented on the basis of AVR ATmega32 family singlechip microcontroller.The structural diagram of the developed device is shown in Figure 1.The following designations are used in figure 1: TS1 -digital temperature sensor of DS18B20 type, TS2 -thermocouple of K type, TSA -thermocouple signal amplifier with I2C interface, CB -control buttons; LCD -liquid crystal display; PA -power amplifier, ED -executive device (heater).
The microprocessor regulator is designed to maintain the set temperature in a facility.It is equipped with two temperature sensors.The first temperature sensor (TS1) is digital, type DS18B20: The second temperature sensor (TS2) is a thermocouple type K.The thermocouple is connected to the microcontroller through an analogue-to-digital converter with an integrated thermocouple signal booster with cold junction compensation type MAX6675.The analog-to-digital converter MAX6675 is interfaced to the microcontroller by means of a synchronous serial I2C interface.This solution is designed to cover the highest possible process temperature range.The first high precision digital sensor of the DS18B20 type is designed for temperatures between -55 and +125 ˚C.The temperature measurement resolution of this sensor is 0.0625 °C DS18B20.The second temperature sensor (TS2), in the form of a thermocouple, is capable of working up to 1000 °C.However, this sensor has a temperature resolution of 2 °C.The liquid crystal display (LCD) is used to indicate operating conditions, set points and measurement results.Actuating device, depending on the task will be a heating element.Apart from that, there is an option of selecting one of the two options of temperature sensors -a highly precise digital DS18B2 with a low temperature range (up to +125 ˚C) or a thermocouple with a wide temperature range (up to 1000 ˚C) but with a low resolution.
Temperature and humidity ATS is being developed as a coupled system, i.e. the parameters are interrelated and influence one another.
Temperature is selected as a parameter, and the control law is proportional-integral (PI).We consider a variant of temperature controller implementing proportional-integral (PI) control law.The controller equation is as follows: W-regulator output power, W; KP -proportional factor; Ki -integration factor; ӨS -set temperature, °С; ӨC -current temperature, °С.Regulation error ΔӨ is defined by the following expression: A schematic diagram of the automatic control system is shown in Figure 2.

Fig. 2. ATS block diagram
The following symbols are introduced in Figure 2: gt -set temperature, °С; Xt -current temperature, °С; Yt -temperature discrepancy, °С; Wt -power supplied to heater, W; f -the disturbance acting on the control object.As the digital system to be designed is discrete, regulation takes place in some sampling steps ∆t.
We compose a mathematical model of the controller in difference form: here: W -regulator output power, W; KP -proportional factor; -integration factor; ΔӨ -control error, °С; ∆t -sampling interval.The load is controlled smoothly by means of number pulse control.With number pulse control a whole number of sine waves are generated in the load.A microcontroller timer configured in pulse width modulation mode is used to implement the pulse number control, which is used to match the microcontroller to the heater.A powerful KSD440AC8 solid state relay is used as the key element to switch the AC voltage, allowing direct connection of the control circuit to the microcontroller input.The output switching voltage can be 480 volts and the current rating for this relay is 40 amps.A triac is used as the power element in the solid state relay.A control signal is applied to the triac's control input «UIN» DC.A variable mains voltage "U" is applied to the output of the triac with a connected load (heating element).The voltage on the load is «UOUT».Pulse Width Modulation (PWM) works as follows (see Figure 3), first a fixed time interval "T" is formed, during this time interval the value of the control signal «UIN» can take on a single or zero value.In this way, voltage pulses with a period of "T" and a duration of «τ».The AC voltage on the load will be for a period of time «τ».Ratio of period "T" to pulse duration «τ» is called the load factor and is defined by formula 4.  The algorithm is implemented as standard modules.This makes it easy to make changes to the program.For example, additional temperature sensors can be added, either digital sensors like the DS18B20 or thermocouples.A DS18B20 digital temperature sensor with a serial single-wire interface has a number that is assigned to it at the factory.This allows any number of sensors to be added as required.The presence of an I2C serial interface, with an individual number for the thermocouple signal amplifier, also allows this to be done easily with thermocouples.
The control unit algorithm is shown in Figure 4.
In the "Initialization" program block, the modes of operation of the firmware blocks on the microcontroller are set and the type of temperature sensor, DS18B20 or thermocouple type K, is selected.If necessary, P and PI component coefficients can be entered.
After initialization, the desired temperature value is set and displayed in Setup mode.The sensor is interrogated, the error is calculated, the control action is generated and the parameters are shown on the display.
The control program text is implemented in C language optimised for the Ardito form board and debugged in the Arduino 1.

Results
As a result, a microprocessor-based temperature control system was developed.This system has a temperature control range of -55 °C to +1000 °C.The entire temperature range is divided into two ranges, the first from -55 °C to +125 °C, and the second from +126 °C to +1000 °C.The first range uses a digital temperature sensor with a serial output, type DS18B20.The temperature measurement resolution in the first temperature range of -55 °C to +125 °C is 0.0625 °C.The second range uses a thermocouple type K and a MAX6675 thermocouple signal converter.The temperature measurement discreteness in the range from +126°C to +1000°C is 2°C.

Discussion
The developed microprocessor temperature controller has a wide control range from -55 to +1000 ˚C, which perfectly covers the temperature range required in technological processes.In the first range, due to the use of high precision digital temperature sensor DS18B20, the high resolution of ±0.0625 ˚C is available, which allows the use of the regulator in climate control systems.The use of the DS18B20 serial digital temperature sensor, the MAX6675 thermocouple signal amplifier analogue-to-digital converter, and the device algorithm in the form of modules, easily enables multi-channel operation.

Conclusions
This variant of microprocessor-based temperature controller makes it possible to create versatile regulators with a high temperature range and good temperature measurement discreteness.The number of temperature measurement channels can easily be increased.Inter- facing to a personal computer to display temperature control results can also be easily implemented.