Application of grating sensor in automatic displacement measurement system

I. Introduction

With the rapid advancement of electronic technology and microcontroller systems, grating sensors have become a crucial component in precision displacement measurement systems. These sensors are increasingly being integrated into intelligent systems that offer enhanced accuracy, reliability, and functionality.

Figure 2 illustrates the working principle of an automatic displacement measurement system using a grating sensor. The system utilizes the moiré fringes produced by the relative movement of two gratings, which are then processed by electronic circuits and a microcontroller to achieve automated measurement. This system includes features such as direction detection, preset value setting, automatic positioning control, over-limit alarm, self-test, power-down protection, and temperature error correction. The following sections will explain the system’s working mechanism and design approach.

II. Electronic Subdivision and Direction Judgment Circuit

The fundamental concept behind grating-based displacement measurement is to use the grating pitch as a reference standard. However, high-resolution gratings can be costly and complex to manufacture. To enhance system resolution, the moiré fringes are electronically subdivided. When two gratings are slightly misaligned, moiré fringes appear perpendicular to the grating lines, and their movement corresponds to the displacement of the grating. This allows the measurement of grating pitch to be converted into counting the number of moiré fringes. The magnification factor is given by:

(1)

Where: W is the width of the moiré fringe; d is the grating pitch; θ is the angle between the two gratings in radians.

Within one moiré fringe, four optoelectronic sensors can be placed at regular intervals to perform electronic subdivision and determine the direction of movement. For example, with a grating scale of 50 lines per mm (a pitch of 0.02 mm), and four subdivisions, the system achieves a resolution of 5 micrometers, which is highly suitable for most industrial applications. Since displacement is a vector quantity, it requires both magnitude and direction. Therefore, at least two phase-shifted photoelectric signals are needed. To reduce interference and noise, a differential amplifier composed of low-drift operational amplifiers is used. The four signals from the optical sensors are fed into two differential amplifiers, resulting in two output signals with a π/2 phase difference. These signals are shaped into square waves and passed through a four-subdivision judgment circuit made of two 74LS54 NOR gate chips before being sent to the 8031 microcontroller for processing.

III. Single-Chip Microcontroller and Interface Circuit

To enable bidirectional counting and increase the system's speed, a 193 reversible counter is used. Assuming a platform speed of v, a grating pitch of d, and a subdivision number of N, the frequency of the counting pulse is calculated as:

(2)

If v = 1 m/s, d = 20 μm, and N = 20, the frequency becomes 1 MHz, which is too fast for the 8031 microcontroller to handle within its 2 μs response time. By using the 193 counter, the system's measurement speed is significantly improved. The 193 outputs 4-bit binary data, so two of them are cascaded to count up to 255 pulses. If the pulse count exceeds this, the carry or borrow signal is sent to the 8031’s T0 input, ensuring no signal is lost.

The system can measure distances up to several meters, depending on the grating length, with a minimum resolution of micrometers. Seven digits are required for display, with an additional sign bit for negative values. A common cathode LED display is used to meet user preferences.

A 2×8 keyboard matrix is implemented for user interaction, including 10 numeric keys and 6 function keys like L/A, +/-, ΔT, EXE, ENT, and CE. The keyboard, display, and microcontroller are connected via an 8155 interface chip. The PA port controls the LED segments, the PB port selects the display digits, and the PC port scans the keyboard. Each digit is displayed for 1 ms, leveraging human eye inertia to create a stable display.

The pulses from the 74LS54 pre-circuit are divided by two 193 counters. Pulses greater than 255 are directly sent to the 8031, while smaller ones are read through an 8255 I/O interface. The 8255’s PB port inputs the 193 data, and the PA and PC ports output BCD codes. Since the 8031 lacks internal ROM, a 2732 EPROM is used, connected via a 74LS373 address latch.

IV. Software Design

Based on the hardware setup and system requirements, a modular software program was developed. A temperature error correction subroutine significantly improves measurement accuracy. Grating sensors, being opto-mechanical devices, are sensitive to temperature changes. As the ambient temperature fluctuates, the glass grating and aluminum housing expand or contract, causing errors in the grating pitch. To compensate, a calibration process is performed at 20°C, and the temperature-displacement curve is used for real-time correction. The software structure is simple, efficient, and well-organized.

V. Conclusion

Based on the above hardware and software design, the system achieves an experimental accuracy better than ±5 μm. Our smart meter, utilizing grating sensors for length and angle measurement, has been successfully commercialized. It offers resolutions ranging from 20 μm to 1 μm, with stable performance, strong anti-interference capability, compact size, and cost-effectiveness. It has been widely applied in hangar reconstruction and photonic size and position detection systems.

Global hardware network

Stay tuned for more updates

Tag: Grating Measurement, Differential Amplifier, Electronic Subdivision, Sensor, Single Chip System

Previous: Application of Photoelectron in Sensor Technology Next: How to solve the problem in the practical application of oxygen sensor

OUTDOOR LIGHTING

Outdoor Lighting,Led Bollard Light,Landscape Spot Light,Led Garden Light

JIANGMEN MICHEN LIGHTING CO.,LTD , https://www.jmmission.com