Sensor Application Industrial Control

During the initialization process, the value of state is set to 1, so the system has just entered the running state

0 Preface

In the temperature matching of laser frequency-doubling crystals, sometimes a high working temperature is required. During the temperature rise of the crystal, too fast changes will cause the crystal to crack. Therefore, during the startup process, the operator needs to manually control the temperature of the laser crystal in order to avoid such complexity. For the work of the lock, we made a set of automatic control temperature rise and fall system with the single-chip AT89S52 as the core, which effectively ensured that the crystal temperature changes at a safe rate. Due to the nonlinear relationship of the thermistor, the normal temperature control range of the general temperature controller is normal After analyzing the characteristics of the thermistor and the constant current source, the constant current source is appropriately improved to expand the control range of the temperature controller, so that it also has a higher accuracy in a wider temperature range

1 Hardware system design

The core device of the control system circuit is the AT89S52 single-chip microcomputer produced by Atmel. It is an 8-bit single-chip microcomputer with low power consumption, low voltage and high performance. It has an 8KB flash programmable, erasable, Read-only memory; the process it uses is Atmel's high-density non-volatile memory technology, and its output pins and command system are compatible with MCS-51, low price, reliable performance, strong anti-interference ability, so it is widely used in industrial control And embedded systems

Figure 1 is a block diagram of the system. In order to save cost and volume, we use a multi-channel selection switch CD4051 and an analog-to-digital converter AD7705 to work together to form a multi-channel data acquisition system.

CD4051 is a numerical control analog switch produced by NS company.It can control the analog voltage with a maximum input range of about ± 15V. The input 3-bit address code determines which of the eight channels is turned on; the gated channel has a very low input impedance , About 80Ω, the closed channel has very low leakage current, each channel is about 10pA, and the power consumption is about 1μW when it is in working state.It is a digital sensor model.The excellent performance of the digital control analog switch AD7705 is a 16-bit. Serial analog-to-digital conversion chip, the power consumption is very low, at a power supply voltage of 3V and a main frequency of 1MHz, the power consumption is less than 1mW, the supply current is less than 8μA, the conversion accuracy is high, up to ± 0.003%, and the MAX541 is error-free. The serial input digital-to-analog conversion device produced does not require calibration, and the power consumption does not exceed 1.5mWAT24C02 is an EEPROM device produced by Atmel, with a storage capacity of 256 bytes and a rewritable number of up to 1 million times, which is mainly used to store the set temperature PCF8574 is produced by Philips. It can convert I2C serial input data into 8 parallel outputs. It is used in the device's I / O port expansion. In this system, its 8-bit output port is directly connected to the 8-bit data input of LCD12864. Mouth LCD 12864 is a dot-matrix liquid crystal, easy to drive, and the input module of the display diversified system after encoding uses a 4 × 4 matrix keyboard that interrupts scanning.Compared with the regular scanning method, the j-type thermocouple index table improves the use efficiency of the MCU

2 System flow chart

Figure 2 is a flow chart of the system. After power on, the system is initialized first, and then enters the while (1) loop statement.This loop body contains two while statements, which are respectively the while (state) and while (! State) procedures. The value of the bit variable state selects whether to enter the temperature setting state or the system running state.In the running state, the system continuously collects the voltage value across the thermistor through the CD4051 and AD7705, and then compares it with the set voltage value, and automatically heats up through the MAX541 timing output. The voltage value allows the system to rise to the specified temperature within the specified time strictly. During the cycle, the value of the bit variable kd needs to be constantly judged. This variable is a global variable, set by the keyboard interrupt program, and the keyboard interrupt program returns. The key scan value key, which is used to determine which key is pressed.It can be clearly seen from the flowchart that when kd is 0, the program skips the power system protection key program module. When kd is 1, the program first determines the key value , And then run the corresponding key function program, we set a key as a state switching key, when this key is pressed, the program state =! State is executed, so that the state switching is achieved.After entering the set state, M The output of AX541 stops changing and the cursor keeps blinking, prompting the user to enter the temperature setting value.The blinking program of the cursor and the program of changing the output value of MAX541 are implemented by timer interrupts because the two functions are in different states, and in order to avoid Too many interruptions cause the system to be unstable. By using the value of the state variable and the if statement, the two functions are effectively implemented with a timer to enter the timer interrupt program.When the state value is 1, that is, the system is in the running state, Perform the function of periodically changing the output value of MAX541. When the state value is 0, that is, the system is in the set state, the cursor flashing function can be performed.

3 Improvement of constant current source of temperature controller

3.1 Thermistor

3.1.1 NTC thermistor temperature characteristic equation

The NTC thermistor temperature characteristic equation is described by the following empirical formula:

In the formula: RT is the thermistor resistance value at T, RT0 is the thermistor resistance value at T0.From the above expression, it can be seen that the change in resistance has an exponential relationship with the change in temperature, the temperature increases, and the resistance decreases rapidly , High sensitivity is the main advantage of thermistor temperature measurement

3.1.2 Thermoelectric characteristics of NTC thermistor

When the temperature of the thermistor changes by 1 ℃, the relative change of its resistance value is defined as the thermal temperature coefficient of the thermistor. From the empirical formula of the thermistor, the thermal temperature coefficient a can be derived as:

It can be seen from the above formula that the temperature coefficient of the NTC thermistor is negative and is related to temperature changes.The lower the temperature, the higher the temperature coefficient and the higher the sensitivity; otherwise, the lower the sensitivity

3.1.3 Introduction to Linear Interpolation

The main advantages of the thermistor are: large temperature coefficient, high sensitivity to internal system errors, suitable for high-precision measurement, but its disadvantage is that there is nonlinearity.In order to improve the accuracy of the display, the thermistor needs to be linearly interpolated to deal with this Method According to the accuracy requirements, the temperature characteristic curve is segmented. The more segments, the higher the approximate accuracy of linearization.After segmentation, several polyline segments are used to approximate the curve.The coordinate values ​​of the vertices are stored in the table. The binary search method determines which fold line segment the thermistor corresponding to the measured temperature belongs to, and then linearly interpolates according to the slope of the corresponding fold line to obtain the measured temperature.The linear interpolation method is explained below using the illustrated method:

In Figure 3, k is the number of the break point, Tt is the temperature value calculated according to the interpolation method, and Tact is the actual temperature value corresponding to the corresponding resistance value. Obviously, the more the segments, the smaller the distance between Rk and Rk + 1, The smaller the distance between Tt and Tact, the smaller the error between the measured value and the calculated value

According to Figure 3, the general formula of the temperature expression is:

Where: Vt is the voltage value across the thermistor collected by the Fire Alarm Equipment Forum, It is determined by the constant current source selected

3.2 Constant current source

From the characteristics of the thermistor, we can see that at high temperature, the change in resistance caused by the same temperature change is small, that is, the temperature coefficient is small, and the traditional solution is to increase the current of the constant current source. The resistance value becomes larger, and the voltage applied across the thermistor also becomes larger.When this voltage exceeds the normal operating voltage of the operational amplifier, the constant current source will not work properly at this time. Obviously the working current of the constant current source cannot be too large at low temperatures. At high temperatures, the working current of the constant current source must not be too small.To overcome this pair of contradictions, we divide the constant current source into two gears, respectively 10μA and 100μA. The single-chip control relay can be used to automatically switch between two gears when the temperature is Use a constant current source of 10μA when the temperature is below 100 ° C, and use a constant current source of 100μA when the temperature is above 100 ° C. This is equivalent to increasing the sensitivity at high temperature, which can improve the degree of precision Siemens fire alarm equipment for temperature collection.This method It not only expands the temperature control range of the temperature controller, but also ensures the measurement accuracy

Figure 4 is the improved constant current source circuit diagram. The benchmark uses the LM285 series 1.2V voltage regulator tube. The model with the filter capacitor NPN transistor connected at both ends is 9013 thermistor.

12 Show remaining content on this page

The 100K (25 ° C) thermistor model MODELTCS651 is used by Wavelength. The relay has excellent performance. Free-wheeling diodes are connected to both ends of the relay to avoid damage to the transistor during the current shutdown process, and at the same time reduce the interference to the system. IN input The terminal is controlled by the I / O port of the single-chip microcomputer. When the IN terminal is high, the transistor is turned on, and the current is switched from 100μA to 10μA. The temperature control module collects the voltage across the thermistor from the OUT terminal, and a filter capacitor is connected at both ends.

During the programming process, we put the thermistor resistance value corresponding to 0 ℃ ~ 180 ℃ into the array. The analog-to-digital converter AD7705 converts the collected voltage signal into a digital variable microcontroller. The electronic value of the thermistor resistance can be interpolated. The controller algorithm performs table look-up calculation on the thermistor resistance value, so that the current actual temperature can be calculated

4 Conclusion

The temperature control system and the constant current source are connected to the PID module developed by us. The temperature rise and fall of the system works well after power-up.According to the characteristics of different crystals, the corresponding temperature change rate is used to ensure the safety of the crystal working environment and effectively extend The life of the crystal.

PM Stepper Motor

Pm Stepper Motor,Square Flange Stepper Motor,High Precision Stepper Motor,Permanent Magnet Stepper Motor

Changzhou Sherry International Trading Co., Ltd. , https://www.sherry-motor.com