High-speed Moiré fringe subdivision device and its subdivision method
By establishing the correspondence between the speed and the AD collected signal in the photoelectric encoder, and using the internal circuit of the microprocessor to amplify and correct the signal, the problem of reducing accuracy and increasing cost of the photoelectric encoder at high speeds is solved, and efficient signal processing and cost optimization are achieved.
Patent Information
- Application Number
- CN202211542251.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-03
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-12-03
AI Technical Summary
The existing optoelectronic encoders have limited AD sampling speed under high speed conditions, resulting in distortion of moiré fringe signals, reduced accuracy, and traditional solutions increase circuit cost and volume.
By establishing the correspondence between the speed of the photoelectric encoder and the AD collected signal, using the OPA amplifier and CMP voltage comparator inside the microprocessor, we judge and compensate for AD undersampling, avoid signal distortion, and use the internal circuit of the microprocessor to amplify and correct signals to reduce hardware circuit changes.
It is realized that without changing the optoelectronic encoder hardware circuit, it improves signal accuracy and reduces circuit costs, avoids moiré stripe subdivision errors, and reduces the complexity and cost of hardware circuits.
Smart Images

Figure CN115727768B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photoelectric displacement precision measurement, and in particular to a high-speed moiré fringe subdivision device and a subdivision method thereof. Background Art
[0002] Photoelectric encoders are digital angle measurement devices that integrate optics, mechanics, and electronics. Moiré-based encoders are widely used due to their fast response, stable operation, and high accuracy. The processing circuitry of photoelectric encoders first uses an analog-to-digital converter (AD) to acquire the moiré signal and process it in a microprocessor (ARM, DSP, or FPGA) for further processing. However, due to the limited acquisition speed of the AD, coupled with the increasing density and fineness of the code disk and grating lines, as the speed of the photoelectric encoder increases, the moiré generation speed increases, and the AD sampling rate suffers from undersampling, resulting in distortion of the acquired moiré signal. This reduces the precision of the code obtained by moiré segmentation, and consequently, the accuracy of the photoelectric encoder. In some high-speed applications, the function of the photoelectric encoder can only be guaranteed to the best of its ability, but accuracy cannot be guaranteed. In more serious cases, even function cannot be guaranteed, resulting in the problem of angular jumps in the output of the photoelectric encoder. The main solutions currently available are to use an AD with a high conversion speed or multiple single-channel ADs. The first approach is expensive, increasing costs; the second approach trades quantity for speed, requiring multiple single-channel ADs to acquire the signal, increasing the size and cost of the processing circuitry. Therefore, both of the above-mentioned methods have the problem of increasing the cost of the processing circuit. Summary of the Invention
[0003] In view of the above problems, the purpose of the present invention is to propose a high-speed moiré fringe subdivision device and subdivision method. By establishing a corresponding relationship between the rotational speed of the photoelectric encoder and the AD acquisition signal, it is determined whether the signal acquired by the AD is undersampled. If undersampled, the AD acquisition signal is amplified and then subdivided, thereby avoiding the moiré fringe subdivision error caused by AD undersampling. The present invention utilizes the amplifier terminal (OPA) inside the microprocessor, which has a relatively fast processing speed relative to the amplification algorithm. At the same time, it uses the voltage comparator terminal (CMP) inside the microprocessor to measure the rotational speed of the photoelectric encoder, thereby avoiding the problem of misjudgment of the rotational speed. The shortcomings of the prior art, such as high cost and large circuit volume, are solved.
[0004] To achieve the above objectives, the present invention adopts the following specific technical solutions:
[0005] The present invention provides a high-speed moiré fringe subdivision device, comprising a light emitting diode, a code disk, a grating, a photoelectric receiving tube and a microprocessor;
[0006] The light beam emitted by the light emitting diode passes through the code disk and grating and is incident on the photoelectric receiving tube. The photoelectric receiving tube converts the moiré fringes into electrical signals and transmits them to the microprocessor. The moiré fringes include coarse code signals and fine code signals.
[0007] The microprocessor includes: AD acquisition circuit, speed measurement circuit, OPA amplifier terminal and communication circuit;
[0008] The precision code signal is first transmitted to the speed measurement circuit to measure the actual speed of the encoder;
[0009] When the actual speed of the encoder is the same as the preset speed, the fine code signal and the coarse code signal are collected separately through the AD acquisition circuit.
[0010] The coarse code signal is decoded after passing through the AD acquisition circuit;
[0011] After the precise code signal passes through the AD acquisition circuit, it is determined whether the precise code signal is distorted:
[0012] If the precise code signal is not distorted, the precise code subdivision processing is performed;
[0013] If the precision code signal is distorted, the amplification factor of the distorted precision code signal is calculated and written into the OPA amplifier terminal, and the precision code signal is amplified by the OPA amplifier terminal; the amplified precision code signal is subjected to precision code subdivision processing;
[0014] In the microprocessor, the fine code signal after the subdivision processing and the coarse code signal after the decoding processing are subjected to fine and coarse correction and connection processing, and the binary angle is obtained and output through the communication circuit.
[0015] Preferably, the speed measurement circuit shapes the moiré fringes into a square wave, and then obtains the frequency ω of the square wave by means of timing counting by a microprocessor;
[0016] The relationship between the square wave frequency ω and the encoder speed is shown in the following formula:
[0017]
[0018] in,
[0019] n is the rotational speed;
[0020] m is the number of lines engraved by one circle of the code disk, that is, the number of moiré fringes obtained when the code disk rotates one circle.
[0021] Preferably, the moire fringes are shaped by means of a voltage comparator terminal inside a microprocessor or by adding a hardware comparator.
[0022] Preferably, the calculation formula for the distorted precise code signal amplification factor is:
[0023]
[0024] in,
[0025] f sin (x), f cos (x) is the distorted precision code signal;
[0026] k1 and k2 are magnification factors;
[0027] f s ' in (x), f c ' os (x) is the precision code signal after amplification.
[0028] The present invention also provides a high-speed moiré fringe subdivision method, comprising the following steps:
[0029] S1. Set the preset speed, calculate and monitor the actual speed of the encoder according to the speed measurement circuit in the microprocessor, and determine whether it is the same as the preset speed;
[0030] S2. When the actual speed of the encoder is the same as the preset speed, the fine code signal and the coarse code signal in the moiré fringes are collected through the AD acquisition circuit.
[0031] S3, performing coarse code decoding processing on the coarse code signal;
[0032] Determine whether the precise code signal is distorted. If the precise code signal is not distorted, perform precise code subdivision processing;
[0033] If the precision code signal is distorted, the amplification factor of the distorted precision code signal is calculated and written into the OPA amplifier terminal. The precision code signal is amplified by the OPA amplifier terminal and then the precision code subdivision process is performed.
[0034] S4. After fine-coarse correction and connection processing of the fine code signal and the coarse code signal in the microprocessor, the binary angle is obtained and output through the communication circuit.
[0035] Preferably, step S1 includes:
[0036] First, the moiré fringes are shaped into square waves through the speed measurement circuit, and then the frequency ω of the square wave is obtained by timing counting through the microprocessor;
[0037] The relationship between the square wave frequency ω and the actual speed of the encoder is shown in the following formula:
[0038]
[0039] in,
[0040] n is the rotational speed;
[0041] m is the number of lines engraved by one circle of the code disk, that is, the number of moiré fringes obtained when the code disk rotates one circle.
[0042] Preferably, the calculation formula for the distorted fine code signal amplification factor in step S3 is:
[0043]
[0044] in,
[0045] f sin (x), f cos (x) is the distorted precision code signal;
[0046] k1 and k2 are magnification factors;
[0047] f s ' in (x), f c ' os (x) is the precision code signal after amplification.
[0048] Compared to existing technologies, this invention compensates for AD undersampling by establishing a correspondence between the photoelectric encoder speed and the AD acquisition signal, replacing the traditional method of modifying hardware circuits. This eliminates the need to modify any photoelectric encoder processing circuitry during operation; the upper-level system only needs to provide the operating speed before operation. This design significantly reduces hardware circuit costs. The added speed prediction circuit not only predicts and monitors the speed but also provides a moiré square wave signal to the upper-level system. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 3 is a schematic structural diagram of a high-speed moiré fringe subdivision device provided according to an embodiment of the present invention.
[0050] Figure 2 3 is a comparison diagram of the moiré fringe AD sampling waveforms provided according to an embodiment of the present invention.
[0051] Figure 3 4 is a flow chart of a high-speed moiré fringe subdivision method provided according to an embodiment of the present invention.
[0052] Figure 4 4 is a flowchart of a high-speed moiré fringe subdivision method provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the following description, identical modules are denoted by identical reference numerals. In the case of identical reference numerals, their names and functions are also identical. Therefore, their detailed description will not be repeated.
[0054] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation of the present invention.
[0055] Figure 1 A schematic structural diagram of a high-speed moiré fringe subdivision device provided according to an embodiment of the present invention is shown.
[0056] like Figure 1 As shown, the high-speed moiré fringe subdivision device provided by the embodiment of the present invention is a photoelectric encoder processing circuit, including a light-emitting diode, a code disk, a grating, a photoelectric receiving tube and a microprocessor.
[0057] First set the preset speed.
[0058] The light beam emitted by the light emitting diode passes through the code disk and the grating and is incident on the photoelectric receiving tube. The photoelectric receiving tube converts the moiré fringes into electrical signals and transmits them to the microprocessor. The moiré fringes include coarse codes and fine codes.
[0059] The microprocessor includes: an AD acquisition circuit, a speed measurement circuit, an OPA amplifier terminal and a communication circuit.
[0060] Based on the original hardware circuit design of the photoelectric encoder, a speed measurement circuit (CMP) is added to monitor the speed.
[0061] The precision code signal is first transmitted to the speed measurement circuit, where the encoder's rotational speed is measured via the voltage comparator terminal CMP. The speed measurement circuit outputs the precision code signal as a waveform. Binary angle is calculated by counting the waveforms.
[0062] The speed measurement circuit shapes the moiré fringes (sinusoidal and cosine signals) into a square wave. This shaping circuit can be implemented using either a hardware comparator or a voltage comparator terminal within a microprocessor. The present invention uses a voltage comparator terminal within the microprocessor, eliminating the need to modify the hardware circuit design or add a comparator circuit. The square wave frequency ω is then obtained through a microprocessor timer count.
[0063] The relationship between the square wave frequency ω and the encoder speed is shown in the following formula:
[0064]
[0065] in,
[0066] n is the rotation speed, unit is rpm (revolutions per minute);
[0067] m is the number of lines engraved by the code disk of the photoelectric encoder, that is, the number of moiré fringes obtained when the code disk rotates one circle.
[0068] Formula (1) can be used to monitor the preset speed of the upper system and provide the upper system with a square wave that shapes the moiré fringes.
[0069] When the actual speed of the encoder is the same as the preset speed: the fine code signal and the coarse code signal are collected separately through the AD acquisition circuit;
[0070] When the actual speed of the encoder is different from the preset speed: continue to monitor the actual speed of the encoder until the actual speed of the encoder is the same as the preset speed, and then collect the fine code signal and the coarse code signal respectively through the AD acquisition circuit.
[0071] After the coarse code signal passes through the AD acquisition circuit, it is transmitted to the microprocessor for coarse code decoding processing;
[0072] After passing through the AD acquisition circuit, the precision code signal is transmitted to the OPA amplifier terminal, which is used to amplify the signal. This design eliminates the need for complex amplification algorithms and has a fast operating speed.
[0073] Determine whether different precision code signals need to be amplified, that is, determine whether the precision code signals are distorted:
[0074] If the precise code signal is not distorted, it is transmitted to the microprocessor for precise code subdivision processing;
[0075] If the precision code signal is distorted, the amplification factor of the distorted precision code signal is calculated and written into the OPA amplifier terminal, and the precision code signal is amplified by the OPA amplifier terminal.
[0076] The calculation process of the distorted precision code signal amplification factor is:
[0077] According to the Nyquist sampling theorem, the sampling frequency of the AD acquisition circuit must be greater than or equal to twice the maximum frequency of the signal, as shown in the following formula:
[0078] ω AD ≥2ω max (2)
[0079] When the AD sampling frequency is greater than twice the signal frequency, the signal collected will not have spectrum aliasing and the recovered precise code signal will not be distorted.
[0080] Figure 2 A comparison diagram of Moire fringe AD sampling waveforms provided according to an embodiment of the present invention is shown.
[0081] like Figure 2As shown, it is a comparison diagram of the normal AD sampling Moiré fringe signal and the under-sampling Moiré fringe signal due to too fast rotation speed. Figure 2 It can be seen that the peak-to-peak value of the undersampled moiré fringe signal is smaller than the normal value, but the DC component of the two is consistent. If this signal is directly used for subdivision calculations, the resulting binary angle value of the photoelectric encoder will have large errors, or even the photoelectric encoder will lose its function and experience skipping. Therefore, it is necessary to amplify the distorted precise code signal collected by the AD acquisition circuit before subdivision processing. This is shown in the following formula:
[0082]
[0083] in,
[0084] f sin (x), f cos (x) is the undersampled moiré fringe signal;
[0085] k1 and k2 are magnification factors;
[0086] f s ' in (x), f c ' os (x) is the signal after amplification.
[0087] The present invention uses an amplifier terminal (OPA) inside a microprocessor to directly write the amplification factor into the OPA voltage comparator terminal to achieve amplification of the precise code signal.
[0088] The amplified precision code signal is transmitted to the microprocessor for precision code subdivision processing.
[0089] The microprocessor performs fine-coarse correction and connection processing on the fine code signal and the coarse code signal to obtain a binary angle which is output through a communication circuit.
[0090] The communication circuit is connected to the communication interface via a serial communication circuit and outputs the binary angles of the fine code signal and the coarse code signal.
[0091] In one embodiment provided by the present invention:
[0092] If there is no amplifier terminal (OPA) inside the microprocessor, the amplification factor formula can also be used to directly calculate the amplified signal.
[0093] If the microprocessor does not have a voltage comparator terminal (CMP), the speed calculation and monitoring can also be achieved through a hardware comparator.
[0094] Figure 3 A schematic flow chart of a high-speed moiré fringe subdivision method according to an embodiment of the present invention is shown.
[0095] Figure 4 A flowchart of a high-speed moiré fringe subdivision method provided according to an embodiment of the present invention is shown.
[0096] like Figure 3-4 As shown, the high-speed moiré fringe subdivision method provided by the embodiment of the present invention includes the following steps:
[0097] S1. Set the preset speed, calculate and monitor the actual speed of the encoder according to the speed measurement circuit in the microprocessor, and determine whether it is the same as the preset speed;
[0098] Step S1 includes:
[0099] First, the moire fringe (sine and cosine signals) is shaped into a square wave through a speed measurement circuit, and then the frequency ω of the square wave is obtained by timing counting through a microprocessor.
[0100] The relationship between the square wave frequency ω and the actual speed of the encoder is shown in the following formula:
[0101]
[0102] in,
[0103] n is the rotation speed, unit is rpm (revolutions per minute);
[0104] m is the number of lines engraved by the code disk of the photoelectric encoder, that is, the number of moiré fringes obtained when the code disk rotates one circle.
[0105] Formula (1) can be used to monitor the preset speed of the upper system and provide the upper system with a square wave that shapes the moiré fringes.
[0106] S2. When the actual speed of the encoder is the same as the preset speed, the fine code signal and the coarse code signal in the moiré fringes are collected through the AD acquisition circuit.
[0107] S3, performing coarse code decoding processing on the coarse code signal;
[0108] Determine whether the precise code signal is distorted. If the precise code signal is not distorted, it is transmitted to the microprocessor for precise code subdivision processing;
[0109] If the precision code signal is distorted, the amplification factor of the distorted precision code signal is calculated and written into the OPA amplifier terminal, and the precision code signal is amplified by the OPA amplifier terminal.
[0110] The distorted precise code signal acquired by the AD acquisition circuit needs to be amplified and then subdivided. This is shown in the following formula:
[0111]
[0112] in,
[0113] f sin (x), f cos (x) is the undersampled moiré fringe signal;
[0114] k1 and k2 are magnification factors;
[0115] f s ' in (x), f c ' os (x) is the signal after amplification.
[0116] The present invention uses an amplifier terminal (OPA) inside a microprocessor to directly write the amplification factor into the OPA amplifier terminal to achieve amplification of the precise code signal.
[0117] The amplified precise code signal is subjected to precise code segmentation processing.
[0118] S4. After fine-coarse correction and connection processing of the fine code signal and the coarse code signal in the microprocessor, the binary angle is obtained and output through the communication circuit.
[0119] This solution compensates for AD undersampling by establishing a correspondence between the photoelectric encoder's rotational speed and the AD acquisition signal, replacing the traditional method of modifying hardware circuits. This solution eliminates the need to modify any photoelectric encoder processing circuitry during operation; the upper-level system only needs to provide the operating speed before operation. This design significantly reduces hardware circuit costs. The added speed prediction circuit not only predicts and monitors the rotational speed but also provides a moiré square wave signal to the upper-level system.
[0120] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0121] The above specific embodiments of the present invention do not constitute a limitation on the scope of protection of the present invention. Any other corresponding changes and modifications made based on the technical concept of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A high-speed moiré fringe subdivision device, characterized in that: Including light emitting diodes, code disks, gratings, photoelectric receiving tubes and microprocessors; The light beam emitted by the light emitting diode passes through the code disk and the grating and is incident on the photoelectric receiving tube. The photoelectric receiving tube converts the moiré fringes into electrical signals and transmits them to the microprocessor. The moiré fringes include coarse code signals and fine code signals. The microprocessor includes: an AD acquisition circuit, a speed measurement circuit, an OPA amplifier terminal and a communication circuit; The precise code signal is first transmitted to the speed measurement circuit to measure the actual speed of the encoder; When the actual speed of the encoder is the same as the preset speed, the fine code signal and the coarse code signal are respectively collected by the AD acquisition circuit; The coarse code signal is subjected to coarse code decoding processing after passing through the AD acquisition circuit; After the precise code signal passes through the AD acquisition circuit, it is determined whether the precise code signal is distorted: If the precise code signal is not distorted, then performing precise code subdivision processing; If the fine code signal is distorted, the amplification factor of the distorted fine code signal is calculated and written into the OPA amplifier terminal, and the fine code signal is amplified by the OPA amplifier terminal; the amplified fine code signal is subjected to fine code subdivision processing; In the microprocessor, the fine code signal after the subdivision processing and the coarse code signal after the decoding processing are subjected to fine and coarse correction and connection processing, and the binary angle is obtained and output through the communication circuit.
2. The high-speed moiré fringe subdivision device according to claim 1, characterized in that: The speed measurement circuit shapes the moiré fringes into a square wave, and then obtains the frequency of the square wave by timing counting by the microprocessor. ; Square wave frequency The relationship between it and the encoder speed is shown in the following formula: in, is the rotational speed; It is the number of lines engraved by the code disk in one rotation, that is, the number of moiré fringes obtained when the code disk rotates one circle.
3. The high-speed moiré fringe subdivision device according to claim 2, characterized in that: The moiré fringes are shaped by adding a hardware comparator in the speed measurement circuit.
4. The high-speed moiré fringe subdivision device according to claim 3, characterized in that: The calculation formula of the distorted fine code signal amplification factor is: in, 、 is the distorted precise code signal; 、 is the magnification; 、 It is the precision code signal after amplification processing.
5. A high-speed moiré fringe subdivision method, implemented using the high-speed moiré fringe subdivision device according to claim 1, characterized in that: The following steps are involved: S1. Set a preset speed, calculate and monitor the actual speed of the encoder according to the speed measurement circuit in the microprocessor, and determine whether it is the same as the preset speed; S2. When the actual speed of the encoder is the same as the preset speed, the fine code signal and the coarse code signal in the moiré fringes are collected by the AD acquisition circuit; S3, performing coarse code decoding processing on the coarse code signal; determining whether the precise code signal is distorted, and performing precise code subdivision processing if the precise code signal is not distorted; If the fine code signal is distorted, the amplification factor of the distorted fine code signal is calculated and written into the OPA amplifier terminal, and the fine code signal is amplified by the OPA amplifier terminal and then fine code subdivision is performed; S4. The microprocessor performs fine-coarse correction and connection processing on the fine code signal and the coarse code signal to obtain a binary angle, which is output through a communication circuit.
6. The high-speed moiré fringe subdivision method according to claim 5, characterized in that: The step S1 comprises: First, the moiré fringe is shaped into a square wave through the speed measurement circuit, and then the frequency of the square wave is obtained by timing counting through the microprocessor. ; The square wave frequency The relationship between the actual speed of the encoder is shown in the following formula: (4) in, is the rotational speed; It is the number of lines engraved by the code disk in one rotation, that is, the number of moiré fringes obtained when the code disk rotates one circle.
7. The high-speed moiré fringe subdivision method according to claim 6, characterized in that: The calculation formula of the distorted fine code signal amplification factor in step S3 is: (5) in, 、 is the distorted precise code signal; 、 is the magnification; 、 It is the precision code signal after amplification processing.
Citation Information
Patent Citations
Signal acquisition and processing device and method for non-image absolute photoelectric encoder
CN111238548A
Photoelectric encoder moire fringe subdivision method
CN112556734A