Application of grating sensor in automatic displacement measurement system

Publisher:创新火花Latest update time:2011-04-01 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
This paper introduces an automatic displacement measurement system with a single-chip microcomputer as the core. The system uses a grating sensor to convert the measured displacement into an electrical signal. After pre-amplification and circuit processing, it is sent to the 8031 ​​single-chip microcomputer for comprehensive calculation and output, and displayed through LED. The paper introduces the design of the overall circuit and the hardware and software flow of the single-chip microcomputer system. 1 Introduction The block diagram of the precision position scale CNC system currently used in precision machining and CNC machine library is shown in Figure 1.




Figure 1 Block diagram of precision displacement CNC system

With the development of electronic technology and single-chip microcomputer technology, grating sensors are widely used in displacement measurement systems and are gradually transforming towards intelligence.

Figure 2 is a schematic diagram of the principle of an automatic displacement measurement system using a grating sensor. The system uses the moiré fringes generated by grating movement in combination with electronic circuits and single-chip microcomputers to complete the automatic measurement of displacement. It has the functions of determining the direction of grating movement, presetting initial values, realizing automatic positioning control and over-limit alarm, self-test and power-off protection, and temperature error correction. The following is an introduction to the working principle and design concept of the system.


Figure 2 Schematic diagram of the grating sensor displacement measurement system

2 Electronic subdivision and direction determination

circuit The essence of grating displacement measurement is to use the grating pitch as a standard ruler for position measurement. At present, high-resolution grating rulers are generally expensive and difficult to manufacture. In order to improve the system resolution, it is necessary to subdivide the moiré fringes. This system uses an electronic subdivision method. When two gratings overlap at a small angle, moiré fringes will be generated in a direction roughly perpendicular to the grating lines. As the grating moves, the moiré fringes also move up and down. In this way, the measurement of the grating pitch is converted into the measurement of the number of moiré fringes. The same amount of moiré fringes has an optical magnification effect, and its magnification factor is

(1)

Where: W is the width of the moiré fringe; d is the grating pitch (pitch); θ is the angle between the two gratings, and rad

is placed within a moiré fringe width. Four photoelectric devices can be placed at a certain interval to realize the electronic subdivision and sheep direction functions. The grating scale used in this system has 50 line pairs/mm and a grating pitch of 0.02mm. If four subdivisions are used, a counting pulse with a resolution of 5μm can be obtained, which has achieved a very high accuracy in general industrial measurement and control. Since displacement is a vector, both its size and direction must be detected, so at least two photoelectric signals with different phases are required. In order to eliminate common-mode interference, DC components and even harmonics, we use a differential amplifier composed of low-drift operational amplifiers. The four photoelectric signals obtained by the four electric devices are sent to the input of two differential amplifiers respectively. The phase difference of the two signals output from the differential amplifier is π/2. In order to obtain the direction determination and counting pulses, the two signals need to be shaped. First, they are shaped into a square wave with a duty cycle of 1:1, and then input into the reversible counter through a four-division direction determination circuit composed of two AND-OR-NOR gates 74LS54 chips, and finally sent to the single-chip microcomputer system composed of 8031 ​​for processing.

3 Single-chip microcomputer and interface circuit

In order to realize reversible counting and improve the measurement speed, the system uses a 193 reversible counter. Assuming that the operating speed of the working platform is v, the grating sensor pitch is d, and the subdivision number is N, the frequency of the counting pulse is

(2)

If v=1m/s, d=20μm, N=20, then f=1MHz, and the corresponding counting time interval is 1. Obviously, the response of the 8031 ​​single-chip microcomputer system is 2μs, which is not enough. After the reversible counter is divided, the measurement speed can be greatly improved.

Since 193 is a 4-bit binary output, in order to interface with the single-chip microcomputer, two 193s are cascaded, so that up to 255 pulses can be counted. If there is another pulse, the carry end or the borrow end will output a pulse to the T0 and T1 ends of the single-chip microcomputer for counting, ensuring that the signal sent to 8031 ​​is not lost.

The maximum length that this system can measure is several meters (determined by the actual length of the grating), and the minimum resolution is μm level, requiring 7 display data. No sign is displayed when running forward, and a "-" sign needs to be displayed when running reversely, so together with the sign bit, a total of 8 display blocks are required. In order to meet people's application habits, the display block uses a common cathode LED.

In order to realize the intelligentization of the measurement system, a 2×8 keyboard matrix is ​​set up, including 10 numeric keys from 0 to 9 and 6 function keys: L/A length/angle conversion function key; +/- sign conversion function key; ΔT temperature error correction function key; EXE execution key; ENT preset key CE (clear key). The keyboard, display and single-chip computer are connected through an interface chip 8155. Among them, the PA port of 8155 is set to the basic output mode as the segment code line of the 8-bit LED display; the PB port is set to the output mode as the bit selection line of the 8-bit LED; the PC port is set to the input mode as the row scan line of the keyboard. The PB port selects 1 bit of display each time, and each display is 1ms. Due to the visual inertia of the human eye, the 8-bit display block can be displayed simultaneously.

Since the pulses from the preamplifier circuit 74LS54 are divided by two 193s, only "large" numbers greater than 255 directly enter the 8031, while "small" numbers less than 255 are input from the two 193s through the I/O interface to the 8031 ​​for internal processing. This I/O interface chip is implemented by expanding an 8255. Among them, the 8255 PB port is set as the basic input mode, PB0-PB3 is used as 1#193 input, and PB4~PB7 is used as 2#193 input. The low bits of the PA port and PC port are set as outputs, which are used as the system parallel BCD code output. Since the 8031 ​​microcontroller has no internal ROM, a 2732 (4k EPROM) should be expanded externally. Only PSEN chip selection is used, and there is no need to add address decoding. In order to latch the address signal input from the 8031P0 port, a 74LS373 address latch needs to be added between the 8031 ​​and 2732.

4 Software Design

Based on the hardware circuit and system function requirements, we designed a software program. Due to the use of a temperature error correction subroutine, the accuracy of detection can be greatly improved. The grating sensor is an optomechanical integrated structure. The grating scale is made of glass and the shell is made of aluminum. When the ambient temperature changes, it will inevitably cause the structural dimensions to change, resulting in changes in the grating pitch, which will cause detection errors. When the ambient temperature is set to 20℃ as the detection standard value, the displacement error value caused by the temperature change is measured by comparing with the standard value, and the displacement error-temperature characteristic curve is measured immediately. The error-temperature equation is fitted from the characteristic curve as the basis for the software temperature error correction.

This system software adopts a modular structure, and the software compilation is simple, compact and reasonable.

5 Conclusion

According to the above hardware circuit and software design, the system's measurement accuracy can be better than ±5μm after experimental testing. At present, the intelligent instrument we developed for automatic length and angle measurement using grating sensors has formed a series of products with a resolution ranging from 20μm to 1μm. It has the advantages of stable performance, strong anti-interference ability, small size, compact structure, and low cost. It has been successfully applied to hangar renovation and related optoelectronic size and position detection systems.
Reference address:Application of grating sensor in automatic displacement measurement system

Previous article:Application of photoelectric sensors in automated production lines
Next article:Simple Ambient Light Sensor Circuit

Latest sensor Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号