Chemical synthesis requires high temperature detection and control, which is the key link of chemical synthesis process. Detect the temperature of the chemical synthesis unit and control the maximum heating temperature according to the process requirements; In the heating stage, the synthesis temperature was controlled to rise at a rate of 15 ℃ per hour; The temperature after adding catalyst is controlled by constant value: 370 ℃ in the early stage, 380 ℃ in the middle stage and 390 ℃ in the later stage; The control accuracy is ± 3 ℃ L, and the alarm signal will be sent when the maximum temperature reaches 400 ℃ for three consecutive times. Display the detected temperature value; Print the maximum temperature value and detection time every half an hour; There is room for expansion to realize multi loop control.

1. Hardware structure of temperature detection and control system

The hardware circuit of the system consists of temperature detection, signal amplification, a / D conversion, AT89C51 single chip microcomputer, power amplification and execution circuit, printing, display and alarm circuit. AT89C51 single chip microcomputer is selected as the main control computer and PID control algorithm with dead zone is adopted. When the temperature is within the given dead zone range, it will not be adjusted; When it exceeds the given range, the single chip microcomputer drives the stepping motor and adjusts the heating device according to the calculation results to control the synthesis temperature. The hardware structure of the system is shown in Figure 1.

Hardware circuit design of temperature detection system based on AT89C51 single chip microcomputer

Fig. 1 temperature detection and control system

1.1 temperature signal input channel

The temperature signal input channel is composed of temperature sensor, signal amplification, a / D conversion and other circuits.

1) Temperature sensor: the temperature sensor adopts platinum resistance. This kind of material has the advantages of stable performance, strong anti-interference ability and high measurement accuracy. The temperature measuring element R. and the resistance element form a bridge circuit to convert the resistance change of platinum resistance caused by temperature change into voltage signal and send it to the amplifier. Since the platinum resistance is installed on the measurement site and connected to the console through a long line, the three wire wiring method is adopted in order to reduce the influence of lead resistance. Therefore, the influence of the external temperature change on the resistance R of the connecting wire is offset by each other in the bridge circuit.

2) Signal amplification circuit: the signal amplification circuit is composed of single chip integrated precision amplifier ad522. The circuit has 14 pins, in + and in – are the signal differential input terminals, and the external resistance RC between pins 2 and 14 is used to adjust the amplification factor. Pins 4 and 6 are the zero adjustment terminal, pin 13 is the data shielding terminal, pin 12 is the measurement terminal, and pin 11 is the reference terminal. The potential difference between these two ends is the input signal voltage added to the subsequent A / D converter. When in use, the measuring end and the output end (7 pins) are externally connected to form an amplified output signal. Connect the signal ground to the power ground (pin 9) of the amplifier to provide a path for the bias current of the amplifier.

3) A / D conversion circuit: the A / D conversion circuit is composed of ICL7109, which is the product of Intel company. ICL7109 adopts the working principle of double integral formula, and the conversion rate is not high, but it can meet the requirements of the system for sampling rate. Because the chip has strong anti-interference characteristics, it is very advantageous to ensure the detection and control accuracy of the system. The resolution of ICL7109 is 12 bits; The conversion rate is 7.5

Hardware circuit design of temperature detection system based on AT89C51 single chip microcomputer

Fig. 2 signal detection and amplification and a / D conversion circuit

Times / second (the clock is 3.58MHz); After conversion, it is output in 12 bit binary code. The A / D converter is directly connected with the PL port and P0 port of the single chip microcomputer. The converted 12 bit data is directly input from the P0 port and stored in the on-chip RAM. The 12 bit data needs to be read in twice. P1.0, P1.1 and P1.2 of MCS-51 are respectively connected with the run / hold input (run / hold), byte enable end (hbeh and hbel) and the status output end (status) of a / D converter, and the chip selection end (c-0ad) is connected with p2.2, Under the control of chip selection and byte enable signal, the converted data can be read directly.

1.2 control temperature setting circuit

Four switches k4-k1 are set in P1.7 ~ P1.4 of AT89C51 to represent the cooling control switch and the late, middle and early switches of setting temperature control respectively. When ki is closed to 0, it means that the control temperature is set to 370 ℃ (early temperature of catalyst use); When K2 is closed, set the control temperature to 380 ℃ (middle stage of catalyst use), and when K3 is closed, set the control temperature to 390 ℃ (later stage of catalyst use); When K4 is closed, stop heating and the system enters the cooling process. The software detects the status of P1.7 ~ P1.4. If it is found that a switch is closed, set the corresponding control temperature and turn to the corresponding working process.

1) Power amplification and executive circuit: because the stepping motor has the characteristics of fast start and stop, accurate stepping and direct acceptance of digital quantity, the stepping motor is used as the executive element in the system. The stepping motor is used as the actuator in the control system. Its function is to convert the electrical pulse signal sent by the computer into the corresponding mechanical displacement. It has the following main characteristics: (1) the step value is not affected by various interference factors. The speed of rotor movement mainly depends on the frequency of electrical pulse signal, and the total displacement of rotor depends on the number of total pulses( 2) The error will not accumulate for a long time, and the accumulated error of each rotation of the rotor is zero( 3) Good reaction performance. Start, stop, reverse and any other movement mode changes are completed in a few pulses. When operating within a certain frequency range, no step will be lost in any operation mode.

2) Composition of execution control system: as shown in Figure 3. The control system of stepping motor is mainly composed of stepping motor controller, power amplifier and stepping motor. The stepping controller consists of a ring pulse distributor, control logic and forward and reverse control gate. Its function is to distribute the input pulse signals in a certain order, and then send them to the winding of the stepping motor through power amplification to drive the stepping motor to rotate.

Hardware circuit design of temperature detection system based on AT89C51 single chip microcomputer

Fig. 3 block diagram of stepping motor control system

3) Working principle and distribution mode of stepping motor: there are many types of stepping motor, such as single-phase, two-phase, three-phase, four phase, five phase and six phase. This design adopts three-phase reactive stepping motor. The step angle of the motor is 1.5 °, the maximum static distance is 50kg · cm, and the maximum no-load starting frequency is 550 steps / s.

The three-phase stepping motor has three windings a, B and C. It can operate according to the required law by circulating power to the three windings according to a certain law. Its working principle is shown in Figure 4. The pulse generator in the figure generates a certain frequency pulse signal as required, and generates a certain regular electric pulse through the pulse distributor to output to the driver to drive the stepper motor. This part can be controlled by computer or single chip microcomputer. The pulse distributor can use programmed I / O interface.

Hardware circuit design of temperature detection system based on AT89C51 single chip microcomputer

Fig. 4 working principle block diagram of three-phase stepping motor

The pulse distribution mode and power on sequence of stepping motor are as follows:

Hardware circuit design of temperature detection system based on AT89C51 single chip microcomputer

For each group of pulses given by the pulse distributor, the stepping motor takes one step and rotates an angle. The single chip microcomputer can change the pulse distribution mode and output pulse frequency at any time through the program, so it can flexibly and conveniently control the speed and rotation direction of the stepping motor. The control part of stepping motor is completed by single chip microcomputer and 8155 parallel interface. Port a PA0 ~ pa2 of 8155 are used as three-phase control ports of stepping motor respectively. The stepping motor drive circuit uses photoelectric coupling to isolate the single chip microcomputer system from the stepping motor drive circuit, so as to enhance the anti-interference ability of the system and prevent the threat of the high voltage of the motor drive circuit to the safety of the single chip microcomputer when the triode is damaged. Appropriate high-power triode VT can be selected according to the current of stepping motor to complete the task of amplification and motor drive. Diode VD is a protective element, which provides a low resistance freewheeling circuit for the motor winding when the current is cut off, clamps the collector potential at the power supply voltage, and prevents too high reverse voltage from breakdown of the triode.

In order to record the temperature and detection time of the synthesis device in time, the micro printer TP is selected μ P-40 serves as a recording and printing device. AT89C51 internal timer is selected to start TP every half an hour μ P-40 print once, TP μ The P-40 printer is connected with the single chip microcomputer through 8155. In order to randomly display the detected temperature length value, a piece of 8155 is selected as the interface of LED nixie tube. The stepping motor and printing driving circuit are shown in Figure 5.

Hardware circuit design of temperature detection system based on AT89C51 single chip microcomputer

Fig. 5 stepping motor and printing drive circuit diagram

2 software design of temperature detection and control system

2.1 system software functions

1) Detect the status of switches K1, K2, K3 and K4, set the temperature control value, and turn the control system into the corresponding heating or cooling stage;

2) Start a / D conversion, continuously read the conversion results for 5 times, take them as a temperature detection signal after filtering and nonlinear correction, and display the detected temperature value;

3) Carry out PID calculation and drive the stepping motor to adjust the temperature according to the calculation results;

4) Every half an hour, the timer generates an interrupt application, starts the printer in the interrupt service program, prints and records the temperature value and detection time;

5) If the temperature exceeds the limit, an alarm signal will be sent.

2.2 main program of temperature detection and control

Main program function: complete system initialization; Judge whether the temperature exceeds the limit. If it exceeds the limit, turn to alarm processing. If it does not exceed the limit, read the K1, K2, K3 and K4 States, and execute the corresponding function subroutine according to its input state. The main program flow chart is shown in Figure 6.

Hardware circuit design of temperature detection system based on AT89C51 single chip microcomputer

Fig. 6 main program flow chart

2.3 main subroutine flow chart

1) PID operation subroutine: take out the temperature given value and measured value, calculate the deviation signal e (k), compare e (k) with the set dead band value, if P (enough) does not exceed the dead band range, the output adjustment is 0 this time, and return to the detection program; If the adjusted output of P (k) + k is out of the range of P (k) + K, then p (k) = K.

2) Stepper motor driver: the system selects three-phase stepper motor and adopts three-phase six beat working mode. The stepper signal supplied by each winding is controlled by port a of 8155. See Table 1 for its rotation direction and power on sequence.

Hardware circuit design of temperature detection system based on AT89C51 single chip microcomputer

Table 1 rotation direction and power on sequence of stepping motor

According to the steering of the stepping motor and the change law of the winding energization sequence during operation, the control word table of the stepping motor can be set in the ram of 8155, as shown in Table 1. The head address is Tabo and the tail address is tab7. Obviously, the drive signal controls the power on sequence from tab0, and the motor rotates forward; If the power on sequence is controlled from tab7, the motor is reversed.

The speed of the stepping motor is determined by the period T of the pulse signal. The period of the pulse signal is determined by the CPU through the delay program or the timing time of the timer / counter. The three-phase winding in the system is controlled by port a of 8155. The delay time in the program is 10 and the motor speed is n = 60 / (n) × T) N I in revolution / fraction

Source; 21ic

Leave a Reply

Your email address will not be published. Required fields are marked *