The analog temperature controller is used to control the air temperature at the outlet of the ventilation pipeline system in the second generation nuclear power plant. The analog temperature controller has the disadvantages of poor accuracy and complex adjustment. In this paper, a temperature controller based on microcontroller chip STM32 is introduced. In this paper, the design of hardware circuit structure and software flow are introduced, and the hardware configuration and software design of MCU peripherals are described in detail. The test results show that the temperature controller can control the temperature of the ventilation pipeline system stably and reliably, and the measurement accuracy meets the requirements of the technical specifications. It can replace and upgrade the analog temperature controller. In the pipeline ventilation system of the second generation nuclear power plant, it is necessary to control the air temperature of the pipeline.
Analog temperature controllers were manufactured by European suppliers in the 1980s. The original manufacturers have stopped producing these series of temperature controllers and technical services. The analog temperature controller in use now has entered the aging stage and is often damaged. The working mode and initial parameters of the analog temperature controller are set by analog potentiometer. Before the installation of the analog temperature controller, the dial of the analog potentiometer needs to be carefully adjusted.
Therefore, the regulation and control of the temperature of the pipeline system is rough, which is greatly influenced by human factors. The adjusting period of analog temperature controller is relatively short, and its tooth-shaped electrical interface is repeatedly inserted and pulled out, which is easy to rust and damage, and accelerates the aging speed. Generally used temperature controllers in industry can not basically meet the requirements of the existing ventilation pipeline system for the electrical interface and control mode of temperature controllers. Therefore, a temperature control circuit using programmable microcontroller STM32 as the core is designed by using the existing mature digital circuit design technology and keeping the electrical interface and control principle unchanged. Embedded hardware circuit and software programming technology are used to simplify the original analog circuit structure, and have a certain degree of expansibility, which is easy to upgrade the software version. The working mode and parameters of the temperature controller are set by keys on the LCD panel. The parameters and temperature measurements are displayed directly on the LCD panel.
This paper introduces the hardware structure and software flow design of the temperature controller based on the microcontroller STM32 chip. The hardware circuit module and the setting of peripheral software are elaborated in detail. The temperature controller is connected with the wiring base in the cabinet of the ventilation pipeline system through a hard toothed electrical connector. The circuit of temperature controller is composed of sensor signal conditioning module, STM32 microcontroller, output channel, power supply module and LCD module. The sensor signal conditioning module filters, amplifies and isolates the input signals of two external temperature sensors. STM32 microcontroller uses its own multi-channel ADC to sample the signals of two sensors [1-2].
The inlet temperature and outlet temperature of the pipeline are calculated from the sampling data. According to the control logic, the calculated temperature value is compared with the initial setting value and the return difference value, and the logical operation results control the output channel output. At the same time, the temperature measurements and initial parameter settings are sent to the LCD screen for display. The power module supplies power to other circuit modules on the circuit board.
The block diagram of the hardware circuit is shown in Figure 1. Next, the configuration of MCU peripherals and the output module are described in detail. STM32 microcontroller is a 32-bit ARM chip based on a new generation of Cortex-M3 architecture produced by Italian Semiconductor Company. The operating voltage of both the core and peripheral is 3.3V, which has very low power consumption [4].
On-chip integrated with rich and comprehensive peripherals. The main frequency can reach 72MHz, and the peripheral frequency can be set when the software is programmed. The general input-output interface (GPIO) can be redefined according to the need of application. The sampling sequence, sampling frequency and data transmission mode of analog signals can be set by software. In this design, two channels of 12-bit analog-to-digital converter (ADC) with 16 channels on microcontroller chip are used to sample the signals of two sensors. First, the temperature sensor at the inlet of the pipeline is collected, and then the temperature sensor at the outlet is collected. The sampling frequency is set at the debugging stage according to the field temperature transformation. After sampling is completed, the data are collected. Direct memory access (DMA) is used to read directly into the open array in the dynamic storage space. Temperature values of temperature sensors at the inlet and outlet of pipeline are calculated from the sampled data. According to the control logic, the microcontroller controls the output of GPIO port and digital-to-analog converter (DAC). The core circuit module of STM32 microcontroller chip and its peripheral crystal oscillator and decoupling capacitor is shown in Figure 2. The output channel of temperature controller has two types of output, dry contact signal and 4-20mA signal. STM32 microcontroller GPIO output high and low level control solid state relay coil excitation, so that the relay output dry contact signal to the downstream circuit. The output voltage signal of DAC is transformed by V/I in the output channel, and the general 4-20mA standard industrial current signal is output. The dry contact signal controls the input and removal of downstream heater, and the 4-20mA current signal controls the solenoid valve at the air inlet and outlet of the pipeline, so that the opening of the air valve can be maintained within a certain range. The circuit schematic diagram of the V/I converter circuit is shown in Fig. 3. The output of the temperature controller is controlled by two variables, the inlet temperature variable and the outlet temperature variable. When the working mode is max, the logical relationship between input and output of two variables is shown in Figure 4. When the mode of operation is min, the logical relationship between input and output is shown in Figure 5. The air temperature measured by the temperature sensor at the air outlet and outlet of the pipeline system is Tc and Tg respectively. The setting value of the air inlet temperature is Xe, the return value is kXp, the setting value of the air outlet temperature is Xk, and the return value is Xp. The initial setting parameters Xk, Xe, Xp and KXp divide the first quadrant plane of coordinates into three regions: left oblique line, right oblique line and horizontal line area.
Assuming that the temperature controller works in Max mode, the brown area is when any measured value of the inlet and outlet temperature Xc or Xg is in the left oblique area, and the temperature controller outputs contact closure signal and 20 mA current signal. Xc or Xg in the transverse area, the temperature controller output contact closure signal and proportional current signal, Xc and Xg in the right oblique area, the temperature controller has no output. Assuming that the temperature controller works in Min mode, the brown area is when any measured value of inlet and outlet temperature Xc or Xg is in the left oblique area, thermostatic element and the temperature controller outputs contact closure signal and 20 mA current signal. Xc or Xg in the transverse area, the temperature controller output contact closure signal and proportional current signal, Xc and Xg in the right oblique area, the temperature controller has no output. The software design of the temperature controller is closely related to the hardware structure. The general flow chart of the system software is shown in Figure 6. After the temperature controller is powered on, the system self-check and register initialization are carried out first, and then the registers of ADC, DMA, GPIO and DAC are initialized. The sampling order of the analog signals from the two sensor signal conditioning channels is as follows: the intake temperature sensor signal sampling and the outlet temperature sensor signal sampling. The air temperature of pipeline system changes slowly [7], so the working frequency of ADC is set to 500 kHz, and the sampling period is set to 236.7 working hours [8].
Sampled data is transmitted to the array opened by the data storage area through the direct register storage operation. After 100 times of sampling, the storage array is refreshed once. When calculating the temperature value of import and export from the sampled data, first 100 times of sampled data are filtered by means of a mean filter to eliminate the input signal noise and sampling noise of the sensor. After using the mean filter, the measured data displayed on the LCD screen is stable and the change is gentle [9-10]. When the data is displayed, you can view the temperature settings and backlash values. Microcontroller STM32 outputs digital quantity and ADC output voltage signal to output channel through GPIO port. The output channel converts digital quantity signal into relay dry contact signal, which realizes the isolation between controller and downstream system. The output analog voltage signal is converted to 4-20mA current signal by V/I conversion. The output of MCU satisfies the logic relation of control principle. The output current signal of the channel is smooth and no jump. The temperature measurement error of the thermostat should be within 0.5% (full range 0-99.9 C). Table 1 below shows the theoretical value and measured value of the corresponding temperature using the standard resistance box as the input resistance value of the temperature sensor of the air inlet and outlet, referring to the Pt100 scale. The last column calculates the difference between the two. From Table 1, it can be seen that the maximum error between the measured temperature and the theoretical value is 0.
3 (?) C, and within the required full range of 0.5 (?) C, it fully meets the requirements of high precision temperature measurement. In this paper, a temperature control circuit based on microcontroller STM32 is designed to meet the requirement of temperature measurement and control at the outlet of ventilation pipeline system in nuclear power plant, under the condition that the electrical interface and control logic remain unchanged. The test results show that the temperature controller can work steadily and reliably in the ventilation pipeline system of nuclear power plant. It can control downstream heaters and solenoid valves accurately. It can also measure the air temperature at the inlet and outlet of the pipeline with high precision. It is easier to operate and maintain than the original simulation temperature control.