1. Overview
When the lime kiln is burning lime, the temperature at different places in the kiln may be different. The production process requires obtaining the average temperature of four points in the kiln, understanding the temperature value of each point, and alarming the average value and the temperature of each measuring point; if the signal at a certain place is abnormal (the sensor is damaged or disconnected), it can be alarmed in time and excluded from data processing. This system can complete the above functions, detect and process the temperature of the lime kiln, and transmit the remote temperature average value or the highest point in the form of 4-20mA. The working schematic diagram of the product is shown in Figure 1 below. There are four thermocouples placed at four points in the lime kiln. These four thermocouples are the four input signal sources of the system. The system is used to measure as shown in Figure 1:
2. System Hardware Design
1. System structure diagram and human-machine interface
The block diagram of the system is shown in Figure 2. The hardware part of the system is mainly composed of the front-end input circuit, A/D and D/A circuits, human-machine interface circuit, CPU and peripheral circuits. The main function of the system is to allow four-way signal input. The user can select the input thermocouple type through parameter setting. The average temperature is usually displayed. If the operator needs, he can press the button on the panel to view the temperature of any signal. The four-way signal is independent. If one of the signals is short-circuited or disconnected, it will not affect the work of the other signals. The instrument has an over-limit alarm function and a thermocouple disconnection prompt function. The average temperature or the highest temperature signal is transmitted as a 4-20mA current signal output. The system has a power-off protection function. When the power is off, the set data can be saved.
The system is designed with a good human-machine interface. The operation display panel is shown in Figure 3. There are two rows of digital tubes and four buttons on the control display panel to display the system operation and modify the parameters. The system operation mode is divided into two states: programming and operation. The first key K1 (state switching key) can be used to switch between the two states. In the programming state, the upper row of digital tubes displays the parameter code, and the lower row of digital tubes displays the corresponding parameters. In this state, the second key K2 (shift key) can be used to sequentially change different parameter codes and parameters. The third key K3 (plus key) and the fourth key K4 (minus key) can be used to modify the parameters.
In the running state, the upper row of digital tubes displays the sequence number of each signal circuit (1~~5), and the lower row of digital tubes displays the corresponding temperature. Among them, 1~4 channels display the four circuit numbers and their temperatures respectively, and 5 channels display the average temperature of the four channels. These five channels are automatically cyclically displayed, and the display content can be stopped on the current circuit by using the fourth key K4 (positioning key). In the programming or running state, whenever K1 is pressed, the state can be changed to the initial stage of another state.
There is no expansion bus, program memory or I/O port in the circuit design. The four parallel ports of the CPU are all used as ordinary I/O ports. The CPU and peripheral circuits are all standard. Here we focus on the A/D and D/A circuits, human-machine interface circuits and power supply circuits with design features. [page]
2. Data acquisition circuit and amplifier circuit
The circuit of the data acquisition part is shown in Figure 4. The current limiting resistor R1 and the voltage regulator TL431 generate a 2.5V standard voltage. The system has a total of 7 analog input signals, 4 thermocouple signal inputs (EXT1-EXT4), 1 cold end compensation signal, one reference signal, and one ground signal (EXT5). The 2.5V voltage is added to the 10K resistor and the external diode in series to form the cold end compensation circuit of the thermocouple. It uses the voltage-temperature characteristics of the diode working in the forward direction to measure the cold end temperature. The reference signal is generated by the 2.5V voltage and the voltage divider resistor. Therefore, an 8-to-1 multi-channel analog switch CD4051 is used, and the high and low levels of the three pins P2.0, P2.1, and P2.2 of the single-chip computer control the selection of the analog channel. Since the input thermocouple graduation number is set by the user, the signal size of different graduation numbers is different, so a programmable amplifier composed of OP07 and 4051 (U2) is designed. The input signal enters the A/D after amplification, and the signal value of each channel is obtained after acquisition and processing. Program-controlled amplification uses a single-chip microcomputer to control 4051, select different channels, and at the same time select different amplification factors. The external resistors of 4051 are: R25=20K, R26=47K, R27=2.4K, R28=3.9K, R29=1.9K. There are 4 different magnifications, namely, magnification 1=(20+47+2.4+3.9+1.6)/(47+2.4+3.9+1.6)≈1.3 times, magnification 2=(20+47+2.4+3.9+1.6)/(2.4+3.9+1.6)≈10 times, magnification 3=(20+47+2.4+3.9+1.6)/(3.9+1.6)≈14 times, magnification 4=(20+47+2.4+3.9+1.6)/1.6≈46 times. The 1.3x magnification is mainly used for collecting the cold-end compensation diode signal. The four 22M pull-up resistors in the circuit complete the thermocouple disconnection detection function.
Four thermocouples are placed at 4 points in the lime furnace as the four-way mV signal input end of the system. After the thermocouple signal is selected and input, it enters the program-controlled amplifier circuit. The mV value is different for different signal graduation numbers. Different amplification factors are selected through software to make the maximum value of these amplified signals close to the maximum allowable value of A/D; so as to make full use of A/D resources and ensure measurement accuracy. If the amplification factor is A, the signal amplified from the program control is AX. The determination of the amplification factor of various signals is related to the analog input of the subsequent A/D device. The A/D of this circuit selects 7135 (five and a half digits), the reference voltage is 0.5V, and the analog input range of 7135 is 0~1V voltage. For example, for B and S standard thermocouples, the amplification factor should be 46, and for K, E, standard thermocouples, the amplification factor should be 14. The cold compensation diode signal is about 0.65V, and a 1.3x magnification is used. Now take the conversion calculation of one signal as an example to illustrate. When measuring a certain thermocouple input, the external thermocouple input millivolt value, cold end compensation diode voltage drop, reference voltage and analog ground are collected in sequence. The V base input from the X2 terminal of 4051 is a known voltage and is solidified in the program. D base, D zero, and Dx are the real-time A/D acquisition values of the reference, zero point and input thermocouple signal respectively. The self-calibration of zero point and full scale can be completed through the following formula, and the VX value can be calculated. Since the three signals of V base, Vx and ground pass through the same hardware input channel, the discrete error of the hardware and the zero point and full scale drift have the same impact on the three. The following formula can be used to correct the errors of zero point, magnification and A/D links, and the measurement accuracy of the system can be guaranteed when using general devices.
Dbase-Dzero/Dx-Dzero=Vx/Vbase
Since the relationship between thermocouple mV and temperature is nonlinear, we use the broken line method for nonlinear correction. VX can be calculated through piecewise nonlinear data processing to obtain the corresponding temperature CX. Adding the cold-end compensation temperature C0 obtained by measuring the cold-end compensation diode voltage, we can get the actual measured temperature C of the circuit, that is, C=CX+C0.
At the same time, due to the thermocouple, the voltage value at the measuring end will be partially offset. This situation causes a large error. It must be cold-end compensated. Because the forward conduction voltage of the diode changes steadily when the temperature changes, which is -2mV/℃, we use the diode to measure the humidity at the cold end for compensation. The specific steps are as follows:
In the first step, we input a standard voltage of 0.7V to the cold end compensation input to get an AD sampling value D0, and then we input a standard voltage of 0.6V to get an AD sampling value D1. Subtracting the two gets a value ΔD. According to the characteristics of the diode, the voltage changes by 2mV for every 1°C. The difference between the first standard signal and the second standard signal we input is 100mV, which is equivalent to a 100mV change in the forward voltage of the diode, corresponding to a 50°C change in the cold end temperature. The coefficient K=ΔD/50 of the corresponding AD value change for every 1°C change in the cold end temperature can be calculated. Since the cold end temperature change range is small (0-50°C), the relative accuracy requirement is not high, so the coefficient is directly solidified in the program when designing products for mass production. When the cold end compensation diode 1N4148 is connected to the input end, according to the above, the magnitude of the cold end temperature change can be deduced based on the coefficient and the magnitude of the change in the cold end AD acquisition value.
Step 2: We input the current ambient temperature Ta in the instrument setting state, and promptly measure the value Da of the diode 1N4148 terminal voltage after amplification AD conversion, and store Ta and Da in EEPROM. When the instrument is in working state, we measure the diode AD conversion value Db in real time, and then subtract the two to get ΔDab=Da-Db, ΔDab divided by K (representing the size of each 1℃ AD sampling value) to get a temperature value difference Y. Then Y plus the set ambient temperature initial value Ta to get the actual cold end temperature C0=Y+Ta. This cold end compensation has a certain error. When the ambient temperature changes, the measured actual cold end temperature C0 will change accordingly. The ambient temperature does not change much within a certain period of time, so the error caused by it is very small compared to the thermocouple and can be ignored. But when the environment changes greatly, such as the change from winter to summer, the change is tens of degrees. If the cold compensation error is greater than 1 degree, we can re-enter the reference Ta for correction.
3. A/D circuit
The A/D circuit is mainly composed of 74LS157 and ICL7135 chips. 7135 uses 0.5V reference signal and analog voltage input range is 0-1V. ICL7135 adopts dynamic scanning BCD code output mode, that is, the BCD codes of ten thousand, thousand, hundred, ten and individual characters appear in turn on B8, B4, B2 and B1 terminals, and the character selection pulse appears synchronously on each terminal of D5-D1. The collected weak signal is amplified by program control and converted into a digital signal through AD conversion. The 74LS157 four 2 to 1 selector is used to make the "ten thousand" bit data output and other three flag signals (overrange, underrange, polarity output) share the four I/O lines P0.0-P0.3 of C52 with the BCD code data output B8, B4, B2 and B1. Time-sharing transmission is realized by controlling the selection terminal SEL of 74LS157 by D5. When SEL inputs low level, select 1A-4A output, and when inputs high level, select 1B-3B output. Because the "ten thousand" bit data can only output 0 or 1, it is a half bit. Therefore, it just forms a four-bit data output with OR (overrange), UR (underrange) and POL (positive and negative polarity) for the microcontroller to read. The hardware interface mode with C52 is the query mode. The software uses the query of D5, D4, D3, D2, and D1 to realize the data output on "ten thousand", "thousand", "hundred", "ten", and "one".
4. Control panel circuit
This circuit consists of two parts: key control circuit and display circuit. The specific circuit is shown in Figure 5. The circuit uses ZLG7289 as the core chip, which is connected to the microcontroller through three pins. The single chip can complete dynamic display scanning and key query, saving the hardware resources and time resources of the microcontroller I/O port. In the actual circuit, the chip selection/CS grounding clock line CLK of Zlg7289 is connected to the P2.7 port, the data line DIO is connected to the P2.6 port, and the key signal line KEY is connected to the P2.5 port.
The zlg7289 is an intelligent display driver chip with SPI serial interface function that can drive 8-bit common cathode digital tubes (or 64 independent LEDs) at the same time. It can directly drive eight-bit LED digital tubes without peripheral components and can simultaneously connect a keyboard matrix of up to 64 keyboards. The single chip can complete the expansion of LED display and keys. The zlg7289 contains a decoder that can directly accept BCD code or hexadecimal code and has two decoding methods at the same time. In addition, it also has a variety of control instructions, such as blanking, flashing, left shift, right shift, segment addressing, etc. This system uses two rows of 4-bit digital tubes, and the digital tubes use dynamic display. According to the requirements of zlg7289, the digital tubes are selected to be common cathode. Pins 18 to 25 of Zlg7289 are connected to the bit drive end of the digital tube, and pins 10 to 17 are connected to the segment drive end of the digital tube. The content to be displayed can be sent to 7289 through the data line and clock line. This circuit only has four buttons. When a key is pressed, the KEY pin level changes to notify the CPU to read the key value through the data line and clock line. [page]
5. Alarm circuit and signal output circuit
There are two types of alarms: upper limit alarm and lower limit alarm. The two alarm relays are connected to P0.5 and P0.7 of the microcontroller through PNP drive transistors, and low level is effective. Software design: When the four-way signal and the average value exceed the upper limit set by each, the relay will sound an alarm, and the last digit of the upper digital tube of the control panel will display the word H; similarly, when the four-way signal and the average value are lower than the set lower limit, the relay will also sound an alarm and display the word L in the same position.
The circuit diagram of the analog output part is shown in Figure 6. The single chip microcomputer selects the temperature average value or the highest temperature measurement point signal according to the set parameters to send it to the ten-bit D/A chip 7520, and cooperates with the LM741 amplifier to obtain the voltage output; finally, it passes through a V/I conversion circuit composed of LM741 to obtain the analog current 4-20mA and 1-5V voltage output.
6. Switching power supply circuit
This transmitter uses a 24V DC power supply of the DDZ-Ⅲ electric unit combination instrument. The advantage of this power supply method is that each unit saves the power supply voltage device, and no power frequency power enters the unit instrument, which not only solves the problem of instrument heating, but also provides favorable conditions for the explosion-proof of the instrument. Since ±5V is required internally, the system uses a DC/DC switching power supply to generate 5V and -5V voltages. The power supply circuit is shown in Figure 7.
The MC34063 used in the power supply circuit is a chip that integrates the main functional circuits of DC-DC conversion. It can be designed to complete the functions of voltage increase (decrease) and polarity conversion, and requires few external components. The external input 24V voltage can be converted to +5V through MC34063, and then the voltage is converted to -5V through ICL7660. The 24V voltage can also be used for the internal 4-20mA output circuit. When the circuit is working, the maximum current of 5V is 0.4 amperes, and the maximum current of -5v is 0.02 amperes.
3. Software design and debugging
The software design mainly includes the main program, ICL7135 A/D conversion program, BCD code conversion program, operation comparison program, read and write 24C02 subroutine, table lookup program, function key subroutine and other functional modules. The main program flow chart is shown in Figure 8.
The main program mainly includes two branches, one is the programming state and the other is the running state.
The microcontroller is first initialized, and the initial state of the program is set to the running state. Except for entering the running state just after power on, the program must judge the status flag bit in the future, and enter the programming or running state according to the judgment result. In the running state, the parameters cannot be edited. Various operating parameters can only be read from 24C02, and the input signal is measured in a circuit. Finally, the temperature value of each measuring point is obtained through zero-point full-scale self-calibration, cold end compensation calculation, and table lookup. In this state, various operating parameters such as display measurement, alarm, and fault information can be selected by the ← key. The system does not measure in the state of editing parameters. When entering the programming state, it is required to enter the programming password. On the premise that the password is entered correctly, each parameter can be selected by the ← key, and can be modified by the ↑↓ keys and stored in 24C02. After stopping the key operation for 5 minutes, it will automatically enter the running state regardless of whether the status key is pressed.
When the single-chip computer is in operation, the upper four-digit digital tube displays the circuit number (the most suitable two digits display alarm and fault information), and the lower four-digit digital tube displays the corresponding data respectively. The K4 key can be used to switch to display different circuits and their parameters. Among them, the circuit numbers 1-4 represent different four-way signals, and the average value is displayed on the fifth channel. After comparison, the largest one and the average value of the four channels can be selected and output in the form of 4-20mA through parameter setting. The software determines the selection level of the four-way signal connected to 4051 and AT89C52. The selected analog input signal is amplified by the program-controlled 4051 and the operational amplifier, and enters the ICL7135 for A/D conversion, and the voltage signal is converted into BCD code (from ten thousand digits to units digits, five-digit address output). The conversion subroutine is used to convert the BCD code into hexadecimal numbers, and finally various data processing is performed to obtain the temperature value, find the maximum value and average value, and perform alarm and signal fault judgment processing.
Previous article:Design of train strain test system based on DSP
Next article:Multi-channel temperature and humidity measurement and control system based on ADμC812 single chip microcomputer
- Popular Resources
- Popular amplifiers
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- New review activity! Free review of TI LAUNCHXL CC2650
- Renovation of old items + Bluetooth payment speaker into wireless doorbell
- Share: Domestic power IC replaces foreign
- Which book is good for learning single-chip microcomputer? 51 single-chip microcomputer tutorial book recommendation
- Can lm324 achieve a 0.05hz second-order high-pass filter?
- How to get the current memory address when STM32 uses DMA? (Solved)
- The 24A MOS tube can replace the 25N50 model parameters and is used in AC-DC switching power supplies.
- MSP430G2553-PC communication protocol
- Playing with Zynq Serial 3 - Introduction to AXI Bus Protocol 1
- PHYTEC's imx8mplus development board review