Grating ruler keywords: grating; Displacement; single chip microcomputer
Grating: Grating is a combination of digital technology and traditional printing technology, which can show different special effects on special films. Show the lifelike three-dimensional world on the plane, the smooth animation fragments like movies, and the incredible illusion effect.
Grating is a thin sheet composed of strip lenses. When we look at one side of the lens, we will see a thin line on the other side of the picture, and the position of this line is determined by the observation angle. If we print these images on different lines on the back of the grating in turn, corresponding to the width of each lens and observe them through the lens from different angles, we will see different images.
In fact, the grating ruler plays a role in detecting the coordinates of the tool and the workpiece. It is often used in CNC machine tools to observe whether there is any error in the movement of the tool, so as to compensate the movement error of the tool. In fact, it's just like the human eye sees that my cutting is biased. Then it can give the hand a standard, whether to adjust or not, whether to change the intensity.
Equivalent to eyes.
I. Introduction
At present, the block diagram of precision symmetrical CNC system used in precision machining and CNC hangar is shown in figure 1.
With the development of electronic technology and single chip microcomputer technology, grating sensor has been widely used in displacement measurement system, and gradually changed to intelligent direction.
Fig. 2 is a schematic diagram of an automatic displacement measurement system composed of grating sensors. The system uses moire fringes produced by grating motion combined with electronic circuit and single chip microcomputer to complete automatic displacement measurement. It has the functions of discriminating the moving direction of grating, presetting initial value, realizing automatic positioning control and over-limit alarm, self-checking and power-off protection, and correcting temperature error. The working principle and design idea of the system are introduced below.
Second, electronic subdivision and direction determination circuit
The essence of grating displacement measurement is to measure alignment and weighing with grating pitch as standard ruler. At present, high-resolution grating ruler is generally expensive and difficult to manufacture. In order to improve the resolution of the system, it is necessary to subdivide the moire fringe, and the electronic subdivision method is adopted in this system. When the two gratings are slightly tilted and overlapped, moire fringes will be generated in the direction roughly perpendicular to the grating scribe lines, and the moire fringes will also move up and down with the grating movement. In this way, the measurement of grating spacing is transformed into the measurement of the number of moire fringes, and the same number of moire fringes has optical amplification effect, and its magnification is:
( 1)
Where: w is the width of moire fringe; D is the grating pitch; θ is the included angle between two gratings, rad.
Within a moire fringe width, four photoelectric devices can be placed at a certain interval to realize electronic subdivision and sheep direction function. The grating ruler used in this system has a grating line of 50 pairs /mm and a grating pitch of 0.02 mm If it is divided into four parts, a counting pulse with a resolution of 5μm can be obtained, which has reached a high precision in general industrial measurement and control. Because the displacement is a vector, its magnitude and direction need to be detected, so at least two photoelectric signals with different phases are needed. In order to eliminate * * * mode interference, DC component and even harmonics, we adopt a differential amplifier composed of low drift operational amplifiers. Four photoelectric signals obtained by four electrical devices are sent to the input ends of two differential amplifiers respectively, and the phase difference of the signals output by the two differential amplifiers is π/2. In order to get direction finding and counting pulses, it is necessary to shape these two signals. Firstly, it is shaped into a square wave with a duty ratio of 1: 1, and then it is input into a reversible counter through a quadrant direction finding circuit composed of two NOR gates 74LS54 chips. Finally, these two signals need to be shaped.
Three, single chip microcomputer and interface circuit
In order to realize reversible counting and improve the measuring speed, the system adopts 193 reversible counter. Assuming that the operating speed of the workbench is V, the grating spacing of the grating sensor 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, it is not competent for the response of the 803 1 single chip microcomputer system of 2 μ s. After frequency division by the reversible counter, the measuring speed can be greatly improved.
Because 193 is a 4-bit binary output, two pieces of 193 are cascaded to interface with the single chip microcomputer, so that at most 255 pulses can be counted. If there is still a pulse, the carry terminal or the borrow terminal will output a pulse to the T0 and T 1 terminals of the single chip microcomputer for counting, so as to ensure that the signal sent to 803 1 is not lost.
The maximum length of the system can measure several meters (determined by the actual length of the grating), and the minimum resolution is micron, which requires seven display data. The symbol is not displayed in the forward operation, and the "-"sign is required in the reverse operation, so * * * and the symbol bit need 8 display blocks. In order to meet everyone's application habits, the display block adopts * * * cathode LED.
In order to realize the intelligence of the measurement system, a 2×8 keyboard matrix is set up, including 0 ~ 9 * * * 10 number keys and 6 function keys: L/A length/angle conversion function key; +/-symbol conversion function key; δ t temperature error correction function key; EXE execution key; Enter the preset key CE (Clear key). Keyboard, display and single chip microcomputer are connected by interface chip 8 155. Among them, the PA port of 8 155 is set to the basic output mode as the segment code line displayed by 8-bit LED; PB port is set to output mode as the bit line selection of 8-bit LED; The PC port is set to the line scan line input mode of the keyboard. The PB-port Xia line gates 1 bit every time and 1ms every time. Due to the inertia of human vision, 8-bit display blocks can be displayed simultaneously.
Because the pulse from the pre-circuit 74LS54 is divided into two pieces by 193, only the "big" number greater than 255 directly enters 803 1, and the "small" number less than 255 is input to 803 1 through the I/O interface. In this I/O interface chip, the 8255PB port is set as the basic input mode, with PB0-PB3 as the input of 1# 193 and PB4~PB7 as the input of 2# 193. The low bits of PA port and PC port are set as outputs, which are output as system parallel BCD codes. Because 803 1 single chip microcomputer has no built-in ROM, it is necessary to extend a 2732(4k EPROM). Only PSEN chip selection is used without adding address decoding. In order to latch the address signal input from port 803 1P0, a 74LS373 address latch should be added between 803 1 and 2732.
Fourthly, software design.
According to the requirements of hardware circuit and system function, the software program is designed, and the detection accuracy is greatly improved because of the adoption of temperature error correction subroutine. Grating sensor is an optical, mechanical and electrical integrated structure. Grating ruler is made of glass, and its shell is made of aluminum. When the ambient temperature changes, it will inevitably lead to the change of structure size and grating spacing, which will bring detection errors. Set the ambient temperature of 20℃ as the detection standard value, compare it with the standard value to measure the displacement error caused by temperature change, immediately measure the displacement error-temperature characteristic curve, and fit the error-temperature equation from the characteristic curve as the basis for software temperature error correction. The system software adopts modular structure, which is concise, compact and reasonable.
Verb (abbreviation of verb) conclusion
According to the above hardware circuit and software design, the measurement accuracy of the system is better than 5 microns through experimental tests. At present, intelligent instruments for automatically measuring length and angle by grating sensors have formed a series of products, and the resolution can range from 20μm to1μ m. They have the advantages of stable performance, strong anti-interference ability, small volume, compact structure and low cost, and have been successfully applied to hangar reconstruction and related photoelectric size and position detection systems.
Introduction of grating ruler displacement sensor
First, the basic principle of displacement sensor
The working principle of grating displacement sensor is that when the main grating (scale grating) and sub-grating (indicator grating) in a pair of gratings are relatively displaced, under the interaction of light interference and diffraction, a black and white (or light and dark) regular stripe pattern is generated, which is called moire fringe. After photoelectric device conversion, black and white (or bright and dark) stripes are converted into sinusoidal electrical signals, which are amplified by an amplifier and shaped by a shaping circuit to obtain two sine waves or square waves with a phase difference of 90 degrees, which are sent to a grating digital display meter for counting and display.
Second, the displacement sensor installation mode
The grating linear displacement sensor can be installed flexibly in different parts of the machine tool.
Generally, the main ruler is installed on the workbench (skateboard) of the machine tool, and the bed moves with the knife. The reading head is fixed on the bed, so that the reading head is installed under the main ruler as far as possible. When choosing the installation method, we must pay attention to the splashing direction of chips, cutting fluid and oil. If the reading head must be installed upward due to the limitation of installation position, an auxiliary sealing device must be added. In addition, in general, the reading head should be installed in the static part relative to the machine tool as far as possible. At this time, the output line is easy to fix, and the scale should be installed in the moving part relative to the machine tool (such as a skateboard).
1. Installation base surface of displacement sensor
When installing the grating linear displacement sensor, the sensor cannot be directly installed on a rough machine tool, let alone a machine tool coated with primer. The grating ruler and the reading head are respectively installed on two parts of the machine tool that move relatively. Check the parallelism between the installation surface of the main ruler of the machine tool workbench and the movement direction of the guide rail with a dial indicator. Fix the dial indicator on the lathe bed and move the workbench. The parallelism should be within 0.1mm/1000 mm.. If this requirement cannot be met, it is necessary to design and process the grating ruler base. The requirements of the pedestal are as follows: ① A pedestal with the same length as the grating ruler should be added (the grating ruler should preferably grow out of the pedestal by about 50mm). (2) The base shall be milled to ensure its plane parallelism within 0.1mm/1000 mm.. In addition, it is necessary to process a reading head base with the same height as the ruler base. The total error between the reading head base and the ruler base should not be greater than 0.2mm.. During installation, adjust the position of the reading head so that the parallelism between the reading head and the grating ruler is about 0. 1 mm, and the spacing between the reading head and the grating ruler is about1~1.5mm. ..
2. Installation of main ruler of displacement sensor
Use M4 screw to fix the grating ruler on the mounting surface of the workbench installed on the machine tool, but do not tighten it. Fix the dial indicator on the lathe bed and move the workbench (the ruler and workbench move at the same time). Measure the parallelism between the main ruler plane and the moving direction of the machine tool guide rail with a dial indicator, and adjust the position of the M4 screw of the main ruler. When the parallelism of the main ruler is within the range of 0. 1mm/ 1000mm, tighten the M2 screw thoroughly. When installing the grating ruler, you should pay attention to the following three points:
(1) When installing the main ruler, if the grating is larger than 1.5M, you can't just install both ends like a bridge, but you need to support it in the whole main ruler.
(2) After installation with the base, it is best to clamp the midpoint (or point) of the ruler body with a clamp.
(3) When the clamp cannot be installed, it is best to glue the grating ruler body with glass to fix the base ruler and the main ruler.
3. Installation of reading head of displacement sensor
When installing the reading head, first ensure that the base surface of the reading head meets the installation requirements, and then install the reading head. The installation method is similar to that of the main ruler. Finally, adjust the reading head to ensure that the parallelism between the reading head and the grating ruler is within 0. 1mm, and the gap between the reading head and the ruler is controlled within1~1.5 mm.
4, displacement sensor limit device
After all grating linear displacement sensors are installed, a limit device must be installed on the guide rail of the machine tool to prevent the reading head from colliding with both ends of the main ruler when the machine tool moves, thus damaging the grating ruler. In addition, when purchasing the grating linear displacement sensor, users should try to choose the grating ruler which is about 100mm beyond the machining size of the machine tool, leaving a margin.
5, displacement sensor inspection
After installing the grating linear displacement sensor, you can connect the digital display meter and move the workbench to observe whether the digital display meter counts normally.
Select a reference position on the machine tool and move the working point back and forth to the selected position. The readings of digital display instruments should be the same (or zero). In addition, you can also use the dial indicator (or dial indicator) to make the dial indicator and the digital indicator return to zero at the same time (or remember the initial data), and return to the initial position after going back and forth many times to observe whether the data of the digital indicator and the dial indicator are consistent.
Through the above work, the installation of grating sensor is completed. But for the general machine tool processing environment, there are many iron filings, cutting fluids and oil stains. Therefore, the grating sensor should be equipped with a protective cover. The design of the protective cover is determined by increasing the cross section of the grating sensor and leaving a certain space size. The protective cover is usually sealed with rubber to make it waterproof and oil-proof.
Three, the use of displacement sensor matters needing attention
(1) The sockets of grating sensor and digital display meter should be plugged and unplugged after the power supply is cut off.
(2) As far as possible, add a protective cover, clean up the debris and oil spill on the scale in time, and prevent any foreign matter from entering the grating sensor housing.
(3) Regularly check whether the mounting connecting screws are loose.
(4) In order to prolong the life of the dustproof sealing strip, a thin layer of silicone oil can be evenly coated on the sealing strip, and care should be taken not to splash on the scratched surface of the glass grating.
(5) In order to ensure the reliability of the grating sensor, the surface of the grating ruler and the indicating grating can be cleaned and wiped regularly with a mixed solution of ethanol (50% each) to keep the surface of the glass grating ruler clean.
(6) The grating sensor is strictly forbidden to vibrate and knock violently, so as not to damage the grating ruler. If the grating ruler is broken, the grating sensor will fail.
(7) Do not disassemble the grating sensor by yourself, and do not arbitrarily change the relative distance between the main grating ruler and the auxiliary grating ruler, otherwise the accuracy of the grating sensor may be damaged; On the other hand, it may also cause the relative friction between the main grating ruler and the auxiliary grating ruler, and damage the chromium layer will also damage the grating line, thus leading to the scrapping of the grating ruler.
(8) Pay attention to prevent oil pollution and water pollution on the surface of the grating ruler, so as not to destroy the stripe distribution of the grating ruler lines and cause measurement errors.
(9) The grating sensor should try to avoid working in a severely corroded environment, so as not to corrode the chromium layer of the grating and the surface of the grating ruler and damage the quality of the grating ruler.