Figure 1 Block diagram of precision displacement CNC system
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
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 radis 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.
Previous article:Application of photoelectric sensors in automated production lines
Next article:Simple Ambient Light Sensor Circuit
- Popular Resources
- Popular amplifiers
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Milestone! SmartSens CMOS image sensor chip shipments exceed 100 million units in a single month!
- Taishi Micro released the ultra-high integration automotive touch chip TCAE10
- The first of its kind in the world: a high-spectral real-time imaging device with 100 channels and 1 million pixels independently developed by Chinese scientists
- Melexis Launches Breakthrough Arcminaxis™ Position Sensing Technology and Products for Robotic Joints
- ams and OSRAM held a roundtable forum at the China Development Center: Close to local customer needs, leading the new direction of the intelligent era
- Optimizing Vision System Power Consumption Using Wake-on-Motion
- Infineon Technologies Expands Leading REAL3™ Time-of-Flight Portfolio with New Automotive-Qualified Laser Driver IC
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- Application Note - Optimizing Capacitance and AC Impedance Measurements Using the 4200A-SCS Parameter Analyzer
- SPI interface driver based on TI-RTOS and separate control of CS pin
- FPGA_100 Days Journey_VGA Design
- CCS Basics Tutorial
- Design of wireless network sensor based on Bluetooth protocol
- MCU experts, do I need to modify the USB virtual serial port program generated by STM32cubeMX?
- 2021 ST Industrial Summit Tour starts to reserve seats: "Motor Drive, Power Supply, Industrial Automation" + "New Products, Courses, Training"
- Happy Dragon Boat Festival, salty rice dumplings, sweet rice dumplings, which kind do you like?
- [Topmicro Intelligent Display Module Review] 5. Development Board NUCLEO-F746ZG Communication with Intelligent Display Module
- TI MCU has launched a new product! August live broadcast reveals new features video replay summary!