A method, device, equipment and medium for displacement measurement based on photoelectric reflection

Through the displacement measurement method based on photoelectric reflection, the use of photoelectric switches and analog-to-digital conversion processing technology, the problems of high displacement measurement cost and low accuracy in the prior art are solved, and high-precision and low-cost displacement measurement are achieved.

CN118857116BActive Publication Date: 2025-02-07HANGZHOU LONGSHUO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411328004.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-02-07
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

The existing displacement measurement methods are costly, strict requirements on the measurement medium materials, and complex structure of the measurement medium, resulting in reduced accuracy and increased production consumption.

Method used

Using the displacement measurement method based on photoelectric reflection, by obtaining movable measurement media (opic ruler belt, metal plate, honeycomb paper, etc.) and setting light and dark stripes on it, the displacement sinusoidal signal is output using a reflective photoelectric switch, and the displacement is converted through analog and digital conversion. and microcontroller units process to identify the displacement of the measured medium.

Benefits of technology

It significantly reduces costs, broadens the requirements for measuring media materials, simplifies the measurement media structure, improves the accuracy of displacement measurement, and expands the application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118857116B_ABST
    Figure CN118857116B_ABST
Patent Text Reader

Abstract

The present invention relates to a displacement measurement method, device, equipment and medium based on photoelectric reflection, belonging to the field of displacement measurement. The method comprises obtaining a movable measurement medium and evenly and alternately setting bright stripes and dark stripes in the horizontal direction; setting fixed reflective photoelectric switches in parallel in the horizontal direction on one side of the measurement medium, performing displacement measurement by moving the measurement medium in the horizontal direction and outputting a displacement sinusoidal signal; converting the displacement sinusoidal signal into a displacement digital signal by an analog-to-digital converter and transmitting it to a microcontroller unit; and identifying the displacement digital signal by the microcontroller unit and obtaining the displacement of the measurement medium. The present invention realizes concise, efficient and high-precision displacement measurement, and the device is simple and flexible, which is convenient for practical application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of displacement measurement, and in particular relates to a displacement measurement method, device, equipment and medium based on photoelectric reflection. Background Art

[0002] At present, displacement measurement methods such as laser ranging are widely used, but most of them are costly, have strict requirements on the measuring medium materials, and are affected by the process manufacturing level. Various deviations may occur in the production process of the measuring medium, resulting in a decrease in displacement measurement accuracy. In addition, some measuring media have complex structures and are difficult to manufacture, which will significantly increase the manpower and material resources consumed in the displacement measurement process. At the same time, there are relatively few application scenarios for measuring media with complex structures. Summary of the invention

[0003] In order to solve the above problems existing in the prior art, the present invention provides a displacement measurement method, device, equipment and medium based on photoelectric reflection.

[0004] The purpose of the present invention can be achieved through the following technical solutions:

[0005] A displacement measurement method based on photoelectric reflection, the implementation of the displacement measurement method comprising the following steps:

[0006] S1: Obtain a movable measuring medium, the measuring medium comprising an opaque tape, a metal plate, or honeycomb paper, preset a fixed stripe width, take the long side of the measuring medium as the horizontal direction, and evenly and alternately set bright stripes and dark stripes in the horizontal direction on the measuring medium according to the fixed stripe width;

[0007] S2: fixed reflective photoelectric switches are arranged in parallel along the horizontal direction on one side of the measuring medium, the reflective photoelectric switches include a first reflective photoelectric switch and a second reflective photoelectric switch, and displacement measurement is performed by moving the measuring medium along the horizontal direction. During displacement measurement, the reflective photoelectric switch emits light to sequentially reach the bright stripes and the dark stripes and outputs a displacement sinusoidal signal to an analog-to-digital converter, and a center position is set, which is the midpoint of the line connecting the first reflective photoelectric switch and the second reflective photoelectric switch. The horizontal movement direction of the measuring medium is specified, and the horizontal movement direction of the measuring medium includes a positive direction and a negative direction. The direction from the midpoint of the line to the first reflective photoelectric switch is the positive direction, and the direction from the midpoint of the line to the second reflective photoelectric switch is the negative direction;

[0008] S3: converting the displacement sinusoidal signal into a displacement digital signal through the analog-to-digital converter and transmitting the signal to the micro control unit;

[0009] S4: Identify the displacement digital signal through the micro control unit and obtain the displacement of the measuring medium.

[0010] Preferably, the step S4 specifically includes:

[0011] S401: testing the measuring medium before delivery and obtaining the complete periodic displacement of the measuring medium;

[0012] S402: Acquire the horizontal movement direction of the measurement medium based on the displacement digital signal;

[0013] S403: Acquire the measurement medium displacement according to a signal period recognition algorithm based on the horizontal movement direction of the measurement medium, wherein the measurement medium displacement includes a measurement medium displacement in a positive direction and a measurement medium displacement in a negative direction.

[0014] Preferably, the step S401 specifically includes:

[0015] S401-1: Acquire displacement digital signal information, wherein the displacement digital signal information includes a maximum amplitude of the displacement digital signal, a median amplitude of the displacement digital signal, and a minimum amplitude of the displacement digital signal;

[0016] S401-2: Acquire a complete period of the displacement digital signal according to the displacement digital signal information, wherein the complete period of the displacement digital signal is a signal period corresponding to when the median amplitude of the displacement digital signal, the maximum amplitude of the displacement digital signal, the median amplitude of the displacement digital signal, the minimum amplitude of the displacement digital signal, and the median amplitude of the displacement digital signal are detected in sequence;

[0017] S401 - 3: Obtain a complete cycle displacement of the measurement medium corresponding to a complete cycle of the displacement digital signal.

[0018] Preferably, the step S402 specifically includes:

[0019] S402-1: Acquire a signal waveform phase of the displacement digital signal, wherein the signal waveform phase includes a first signal waveform phase and a second signal waveform phase, wherein the first signal waveform phase is output by the first reflective photoelectric switch, and the second signal waveform phase is output by the second reflective photoelectric switch;

[0020] S402-2: Determine the phase of the signal waveform, and when the phase of the first signal waveform is smaller than the phase of the second signal waveform, the horizontal moving direction of the measuring medium is the positive direction;

[0021] When the first signal waveform phase is greater than the second signal waveform phase, the horizontal movement direction of the measurement medium is the negative direction.

[0022] Preferably, the step S403 specifically includes:

[0023] S403-1: when the horizontal moving direction of the measuring medium is the positive direction, obtaining the displacement of the measuring medium in the positive direction according to the number of positive direction cycles, where the number of positive direction cycles includes the number of positive direction integer cycles and the number of positive direction decimal cycles;

[0024] S403-2: When the horizontal moving direction of the measuring medium is the negative direction, obtaining the negative direction displacement of the measuring medium according to the number of negative direction cycles, where the number of negative direction cycles includes the number of negative direction integer cycles and the number of negative direction decimal cycles.

[0025] Preferably, the step S403-1 is specifically as follows:

[0026] Acquire the number of integer cycles in the positive direction, the starting value of the number of integer cycles in the positive direction is 0, detect the displacement digital signal information in real time, and sequentially detect the median amplitude of the displacement digital signal, the minimum amplitude of the displacement digital signal, the median amplitude of the displacement digital signal, the maximum amplitude of the displacement digital signal, and the median amplitude of the displacement digital signal as a complete positive cycle of the displacement digital signal, and the number of integer cycles in the positive direction increases by 1 each time a positive cycle of the displacement digital signal is detected;

[0027] When it is detected that the previous displacement digital signal positive cycle is a complete cycle but the next displacement digital signal positive cycle is an incomplete cycle, the positive direction termination amplitude of the displacement digital signal is obtained, and the positive direction termination phase of the displacement digital signal is calculated according to the positive direction termination amplitude of the displacement digital signal. The calculation formula is:

[0028] ,

[0029] in, S is the positive end phase of the displacement digital signal. sig 1 is the positive end amplitude of the displacement digital signal, S max is the maximum amplitude of the displacement digital signal, S min is the minimum amplitude of the displacement digital signal;

[0030] The number of fractional cycles in the positive direction is calculated according to the positive direction termination phase of the displacement digital signal, and the calculation formula is:

[0031] ,

[0032] in, l 1 is the number of fractional cycles in the positive direction, It is the termination phase of the positive direction of the displacement digital signal;

[0033] The displacement in the positive direction of the measuring medium is calculated according to the number of positive direction cycles, and the calculation formula is:

[0034] ,

[0035] Among them, L1 is the displacement of the measuring medium in the positive direction, D is the displacement of the measuring medium in a complete cycle, and N1 is the number of integer cycles in the positive direction. l 1 is the number of fractional cycles in the positive direction.

[0036] Preferably, the step S403-2 specifically includes:

[0037] Obtain the number of integer cycles in the negative direction, the starting value of the number of integer cycles in the negative direction is 0, detect the displacement digital signal information in real time, and sequentially detect the median amplitude of the displacement digital signal, the maximum amplitude of the displacement digital signal, the median amplitude of the displacement digital signal, the minimum amplitude of the displacement digital signal, and the median amplitude of the displacement digital signal as a complete negative cycle of the displacement digital signal, and the number of integer cycles in the negative direction increases by 1 each time a negative cycle of the displacement digital signal is detected;

[0038] When it is detected that the previous negative cycle of the displacement digital signal is a complete cycle but the next negative cycle of the displacement digital signal is an incomplete cycle, the negative direction termination amplitude of the displacement digital signal is obtained, and the negative direction termination phase of the displacement digital signal is calculated according to the negative direction termination amplitude of the displacement digital signal. The calculation formula is:

[0039] ,

[0040] in, S is the negative end phase of the displacement digital signal. sig 2 is the negative end amplitude of the displacement digital signal, S max is the maximum amplitude of the displacement digital signal, S min is the minimum amplitude of the displacement digital signal;

[0041] The number of fractional cycles in the negative direction is calculated according to the negative direction termination phase of the displacement digital signal, and the calculation formula is:

[0042] ,

[0043] in, l 2 is the number of fractional cycles in the negative direction, It is the negative direction termination phase of the displacement digital signal;

[0044] The negative direction displacement of the measuring medium is calculated according to the number of negative direction cycles, and the calculation formula is:

[0045] ,

[0046] Among them, L2 is the displacement of the measuring medium in the negative direction, D is the displacement of the measuring medium in a complete cycle, and N2 is the number of integer cycles in the negative direction. l 2 is the number of fractional cycles in the negative direction.

[0047] A displacement measurement device based on photoelectric reflection, used to perform the above-mentioned displacement measurement method, characterized in that it includes a device setting module, a signal conversion module, and a displacement measurement module;

[0048] The device setting module is used to obtain a movable measuring medium, the measuring medium includes an opaque tape, a metal plate, and honeycomb paper, a fixed stripe width is preset, and the long side of the measuring medium is taken as the horizontal direction. Bright stripes and dark stripes are evenly and alternately arranged on the measuring medium in the horizontal direction according to the fixed stripe width; fixed reflective photoelectric switches are arranged in parallel in the horizontal direction on one side of the measuring medium, the reflective photoelectric switches include a first reflective photoelectric switch and a second reflective photoelectric switch, and displacement measurement is performed by moving the measuring medium in the horizontal direction. During displacement measurement, the reflective photoelectric switch emits light to sequentially reach the bright stripes and the dark stripes and outputs a displacement sinusoidal signal to an analog-to-digital converter, and a center position is set, the center position is the midpoint of the line connecting the first reflective photoelectric switch and the second reflective photoelectric switch, and a horizontal moving direction of the measuring medium is specified. The horizontal moving direction of the measuring medium includes a positive direction and a negative direction. The direction from the midpoint of the line to the first reflective photoelectric switch is the positive direction, and the direction from the midpoint of the line to the second reflective photoelectric switch is the negative direction;

[0049] The signal conversion module is used to convert the displacement sinusoidal signal into a displacement digital signal through the analog-to-digital converter and transmit it to the micro control unit;

[0050] The displacement measurement module is used to identify the displacement digital signal and obtain the displacement of the measurement medium through the micro control unit.

[0051] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the above-mentioned displacement measurement method is implemented when the processor executes the program.

[0052] A storage medium containing computer executable instructions, wherein the computer executable instructions are used to perform the displacement measurement method described above when executed by a computer processor.

[0053] The beneficial effects of the present invention are:

[0054] (1) Displacement measurement through photoelectric reflection significantly reduces costs, has broad requirements for measuring medium materials, reduces the possibility of deviations in the manufacturing process of the measuring medium, and thus improves the accuracy of displacement measurement. In addition, the structure of the measuring medium is simple and has relatively many application scenarios.

[0055] (2) By testing the measuring medium before delivery and obtaining the complete cycle displacement of the measuring medium, a basis for subsequent displacement measurement is provided, thus reducing the workload of subsequent calculations;

[0056] (3) The horizontal movement direction of the measuring medium is obtained through the displacement digital signal, breaking the limitation of some measurement methods that can only measure in one direction, so that the measuring medium can move freely in both positive and negative directions;

[0057] (4) The displacement of the measuring medium is obtained according to the signal period recognition algorithm based on the horizontal movement direction of the measuring medium. The calculation is simple and the displacement measurement accuracy is high, which can significantly improve the efficiency of displacement measurement. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.

[0059] Figure 1 The present invention is a flow chart of the steps of a displacement measurement method based on photoelectric reflection. DETAILED DESCRIPTION

[0060] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.

[0061] The working principle and use process of the present invention:

[0062] See also Figure 1 , a displacement measurement method based on photoelectric reflection, comprising:

[0063] S1: Obtain a movable measuring medium, the measuring medium including but not limited to an opaque tape, a metal plate, or honeycomb paper, preset a fixed stripe width, take the long side of the measuring medium as the horizontal direction, and evenly and alternately set bright stripes and dark stripes in the horizontal direction on the measuring medium according to the fixed stripe width;

[0064] S2: fixed reflective photoelectric switches are arranged in parallel along the horizontal direction on one side of the measuring medium, the reflective photoelectric switches include a first reflective photoelectric switch and a second reflective photoelectric switch, and displacement measurement is performed by moving the measuring medium along the horizontal direction. During displacement measurement, the reflective photoelectric switch emits light to sequentially reach the bright stripes and the dark stripes and outputs a displacement sinusoidal signal to an analog-to-digital converter, and a center position is set, which is the midpoint of the line connecting the first reflective photoelectric switch and the second reflective photoelectric switch. The horizontal movement direction of the measuring medium is specified, and the horizontal movement direction of the measuring medium includes a positive direction and a negative direction. The direction from the midpoint of the line to the first reflective photoelectric switch is the positive direction, and the direction from the midpoint of the line to the second reflective photoelectric switch is the negative direction;

[0065] S3: converting the displacement sinusoidal signal into a displacement digital signal through the analog-to-digital converter and transmitting the signal to the micro control unit;

[0066] S4: Identify the displacement digital signal through the micro control unit and obtain the displacement of the measuring medium.

[0067] In this embodiment, the micro control unit identifies the displacement digital signal and obtains the displacement of the measuring medium, which can be specifically implemented by the following steps:

[0068] S401: before leaving the factory, the measuring medium is tested and the complete cycle displacement of the measuring medium is obtained, which provides a basis for the subsequent displacement measurement and reduces the subsequent calculation workload. The complete cycle displacement of the measuring medium is the displacement of the measuring medium when a complete displacement digital signal cycle is detected;

[0069] S402: Acquiring the horizontal moving direction of the measuring medium based on the displacement digital signal, breaking the limitation that some measuring methods can only measure in one direction, so that the measuring medium can move freely in both positive and negative directions;

[0070] S403: Based on the horizontal moving direction of the measuring medium, the displacement of the measuring medium is obtained according to the signal period recognition algorithm. The calculation is simple and the displacement measurement accuracy is high, which can significantly improve the displacement measurement work efficiency. The displacement of the measuring medium includes the displacement of the measuring medium in the positive direction and the displacement of the measuring medium in the negative direction.

[0071] In this embodiment, the measuring medium is tested before leaving the factory and the complete periodic displacement of the measuring medium is obtained, which can be specifically implemented by the following steps:

[0072] S401-1: Acquire displacement digital signal information, wherein the displacement digital signal information includes a maximum amplitude of the displacement digital signal, a median amplitude of the displacement digital signal, and a minimum amplitude of the displacement digital signal;

[0073] S401-2: Acquire a complete period of the displacement digital signal according to the displacement digital signal information, wherein the complete period of the displacement digital signal is a signal period corresponding to when the median amplitude of the displacement digital signal, the maximum amplitude of the displacement digital signal, the median amplitude of the displacement digital signal, the minimum amplitude of the displacement digital signal, and the median amplitude of the displacement digital signal are detected in sequence;

[0074] S401 - 3: Obtain a complete cycle displacement of the measurement medium corresponding to a complete cycle of the displacement digital signal.

[0075] In this embodiment, obtaining the horizontal movement direction of the measurement medium based on the displacement digital signal can be specifically implemented by the following steps:

[0076] S402-1: Acquire a signal waveform phase of the displacement digital signal, wherein the signal waveform phase includes a first signal waveform phase and a second signal waveform phase, wherein the first signal waveform phase is output by the first reflective photoelectric switch, and the second signal waveform phase is output by the second reflective photoelectric switch;

[0077] S402-2: Determine the phase of the signal waveform, and when the phase of the first signal waveform is smaller than the phase of the second signal waveform, the horizontal moving direction of the measuring medium is the positive direction;

[0078] When the first signal waveform phase is greater than the second signal waveform phase, the horizontal movement direction of the measurement medium is the negative direction.

[0079] In this embodiment, the displacement of the measuring medium is obtained according to the signal period recognition algorithm based on the horizontal movement direction of the measuring medium. The displacement of the measuring medium includes the displacement in the positive direction of the measuring medium and the displacement in the negative direction of the measuring medium. Specifically, the following steps can be performed:

[0080] S403-1: when the horizontal moving direction of the measuring medium is the positive direction, obtaining the displacement of the measuring medium in the positive direction according to the number of positive direction cycles, where the number of positive direction cycles includes the number of positive direction integer cycles and the number of positive direction decimal cycles;

[0081] Acquire the number of integer cycles in the positive direction, the starting value of the number of integer cycles in the positive direction is 0, detect the displacement digital signal information in real time, and sequentially detect the median amplitude of the displacement digital signal, the minimum amplitude of the displacement digital signal, the median amplitude of the displacement digital signal, the maximum amplitude of the displacement digital signal, and the median amplitude of the displacement digital signal as a complete positive cycle of the displacement digital signal, and the number of integer cycles in the positive direction increases by 1 each time a positive cycle of the displacement digital signal is detected;

[0082] When it is detected that the previous displacement digital signal positive cycle is a complete cycle but the next displacement digital signal positive cycle is an incomplete cycle, the positive direction termination amplitude of the displacement digital signal is obtained, and the positive direction termination phase of the displacement digital signal is calculated according to the positive direction termination amplitude of the displacement digital signal. The calculation formula is:

[0083] ,

[0084] in, S is the positive end phase of the displacement digital signal. sig 1 is the positive end amplitude of the displacement digital signal, S max is the maximum amplitude of the displacement digital signal, S min is the minimum amplitude of the displacement digital signal;

[0085] The number of fractional cycles in the positive direction is calculated according to the positive direction termination phase of the displacement digital signal, and the calculation formula is:

[0086] ,

[0087] in, l 1 is the number of fractional cycles in the positive direction, It is the termination phase of the positive direction of the displacement digital signal;

[0088] The displacement in the positive direction of the measuring medium is calculated according to the number of positive direction cycles, and the calculation formula is:

[0089] ,

[0090] Among them, L1 is the displacement of the measuring medium in the positive direction, D is the displacement of the measuring medium in a complete cycle, and N1 is the number of integer cycles in the positive direction. l 1 is the number of fractional cycles in the positive direction;

[0091] S403-2: when the horizontal moving direction of the measuring medium is the negative direction, obtaining the displacement of the measuring medium in the negative direction according to the number of negative direction cycles, where the number of negative direction cycles includes the number of negative direction integer cycles and the number of negative direction decimal cycles;

[0092] Obtain the number of integer cycles in the negative direction, the starting value of the number of integer cycles in the negative direction is 0, detect the displacement digital signal information in real time, and sequentially detect the median amplitude of the displacement digital signal, the maximum amplitude of the displacement digital signal, the median amplitude of the displacement digital signal, the minimum amplitude of the displacement digital signal, and the median amplitude of the displacement digital signal as a complete negative cycle of the displacement digital signal, and the number of integer cycles in the negative direction increases by 1 each time a negative cycle of the displacement digital signal is detected;

[0093] When it is detected that the previous negative cycle of the displacement digital signal is a complete cycle but the next negative cycle of the displacement digital signal is an incomplete cycle, the negative direction termination amplitude of the displacement digital signal is obtained, and the negative direction termination phase of the displacement digital signal is calculated according to the negative direction termination amplitude of the displacement digital signal. The calculation formula is:

[0094] ,

[0095] in, S is the negative end phase of the displacement digital signal. sig 2 is the negative end amplitude of the displacement digital signal, S max is the maximum amplitude of the displacement digital signal, S min is the minimum amplitude of the displacement digital signal;

[0096] The number of fractional cycles in the negative direction is calculated according to the negative direction termination phase of the displacement digital signal, and the calculation formula is:

[0097] ,

[0098] in, l 2 is the number of fractional cycles in the negative direction, It is the negative direction termination phase of the displacement digital signal;

[0099] The negative direction displacement of the measuring medium is calculated according to the number of negative direction cycles, and the calculation formula is:

[0100] ,

[0101] Among them, L2 is the displacement of the measuring medium in the negative direction, D is the displacement of the measuring medium in a complete cycle, and N2 is the number of integer cycles in the negative direction. l 2 is the number of fractional cycles in the negative direction.

[0102] A displacement measuring device based on photoelectric reflection, comprising a device setting module, a signal conversion module, and a displacement measuring module;

[0103] The device setting module is used to obtain a movable measuring medium, the measuring medium includes but is not limited to an opaque tape, a metal plate, and honeycomb paper, a fixed stripe width is preset, and the long side of the measuring medium is taken as the horizontal direction. Bright stripes and dark stripes are evenly and alternately arranged on the measuring medium in the horizontal direction according to the fixed stripe width; fixed reflective photoelectric switches are arranged in parallel in the horizontal direction on one side of the measuring medium, the reflective photoelectric switches include a first reflective photoelectric switch and a second reflective photoelectric switch, and displacement measurement is performed by moving the measuring medium in the horizontal direction. During displacement measurement, the reflective photoelectric switch emits light to sequentially reach the bright stripes and the dark stripes and outputs a displacement sinusoidal signal to an analog-to-digital converter, and a center position is set, the center position is the midpoint of the line connecting the first reflective photoelectric switch and the second reflective photoelectric switch, and a horizontal moving direction of the measuring medium is specified. The horizontal moving direction of the measuring medium includes a positive direction and a negative direction. The direction from the midpoint of the line to the first reflective photoelectric switch is the positive direction, and the direction from the midpoint of the line to the second reflective photoelectric switch is the negative direction;

[0104] The signal conversion module is used to convert the displacement sinusoidal signal into a displacement digital signal through the analog-to-digital converter and transmit it to the micro control unit;

[0105] The displacement measurement module is used to identify the displacement digital signal and obtain the displacement of the measurement medium through the micro control unit.

[0106] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.

[0107] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0108] The program code included on the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, RF, etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages ​​or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0109] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.

Claims

1. A displacement measurement method based on photoelectric reflection, characterized in that: The implementation of the displacement measurement method comprises the following steps: S1: Obtain a movable measuring medium, the measuring medium comprising an opaque tape, a metal plate, or honeycomb paper, preset a fixed stripe width, take the long side of the measuring medium as the horizontal direction, and evenly and alternately set bright stripes and dark stripes in the horizontal direction on the measuring medium according to the fixed stripe width; S2: fixed reflective photoelectric switches are arranged in parallel along the horizontal direction on one side of the measuring medium, the reflective photoelectric switches include a first reflective photoelectric switch and a second reflective photoelectric switch, and displacement measurement is performed by moving the measuring medium along the horizontal direction. During displacement measurement, the reflective photoelectric switch emits light to sequentially reach the bright stripes and the dark stripes and outputs a displacement sinusoidal signal to an analog-to-digital converter, and a center position is set, which is the midpoint of the line connecting the first reflective photoelectric switch and the second reflective photoelectric switch. The horizontal movement direction of the measuring medium is specified, and the horizontal movement direction of the measuring medium includes a positive direction and a negative direction. The direction from the midpoint of the line to the first reflective photoelectric switch is the positive direction, and the direction from the midpoint of the line to the second reflective photoelectric switch is the negative direction; S3: converting the displacement sinusoidal signal into a displacement digital signal through the analog-to-digital converter and transmitting the signal to the micro control unit; S4: Identifying the displacement digital signal and obtaining the displacement of the measuring medium by the micro control unit; S401: testing the measuring medium before delivery and obtaining the complete periodic displacement of the measuring medium; S402: Acquire the horizontal movement direction of the measurement medium based on the displacement digital signal; S403: Acquire the displacement of the measuring medium according to a signal period recognition algorithm based on the horizontal movement direction of the measuring medium, wherein the displacement of the measuring medium includes a displacement in a positive direction of the measuring medium and a displacement in a negative direction of the measuring medium; S403-1: when the horizontal moving direction of the measuring medium is the positive direction, obtaining the displacement of the measuring medium in the positive direction according to the number of positive direction cycles, where the number of positive direction cycles includes the number of positive direction integer cycles and the number of positive direction decimal cycles; Acquire the number of integer cycles in the positive direction, the starting value of the number of integer cycles in the positive direction is 0, detect the displacement digital signal information in real time, and sequentially detect the median amplitude of the displacement digital signal, the minimum amplitude of the displacement digital signal, the median amplitude of the displacement digital signal, the maximum amplitude of the displacement digital signal, and the median amplitude of the displacement digital signal as a complete positive cycle of the displacement digital signal, and the number of integer cycles in the positive direction increases by 1 each time a positive cycle of the displacement digital signal is detected; When it is detected that the previous displacement digital signal positive cycle is a complete cycle but the next displacement digital signal positive cycle is an incomplete cycle, the positive direction termination amplitude of the displacement digital signal is obtained, and the positive direction termination phase of the displacement digital signal is calculated according to the positive direction termination amplitude of the displacement digital signal. The calculation formula is: , in, S is the positive termination phase of the displacement digital signal. sig 1 is the positive end amplitude of the displacement digital signal, S max is the maximum amplitude of the displacement digital signal, S min is the minimum amplitude of the displacement digital signal; The number of fractional cycles in the positive direction is calculated according to the positive direction termination phase of the displacement digital signal, and the calculation formula is: , in, l 1 is the number of fractional cycles in the positive direction, It is the termination phase of the positive direction of the displacement digital signal; The displacement in the positive direction of the measuring medium is calculated according to the number of positive direction cycles, and the calculation formula is: , Among them, L1 is the displacement of the measuring medium in the positive direction, D is the displacement of the measuring medium in a complete cycle, and N1 is the number of integer cycles in the positive direction. l 1 is the number of fractional cycles in the positive direction; S403-2: when the horizontal moving direction of the measuring medium is the negative direction, obtaining the negative direction displacement of the measuring medium according to the number of negative direction cycles, where the number of negative direction cycles includes the number of negative direction integer cycles and the number of negative direction decimal cycles; Obtain the number of integer cycles in the negative direction, the starting value of the number of integer cycles in the negative direction is 0, detect the displacement digital signal information in real time, and sequentially detect the median amplitude of the displacement digital signal, the maximum amplitude of the displacement digital signal, the median amplitude of the displacement digital signal, the minimum amplitude of the displacement digital signal, and the median amplitude of the displacement digital signal as a complete negative cycle of the displacement digital signal, and the number of integer cycles in the negative direction increases by 1 each time a negative cycle of the displacement digital signal is detected; When it is detected that the previous negative cycle of the displacement digital signal is a complete cycle but the next negative cycle of the displacement digital signal is an incomplete cycle, the negative direction termination amplitude of the displacement digital signal is obtained, and the negative direction termination phase of the displacement digital signal is calculated according to the negative direction termination amplitude of the displacement digital signal. The calculation formula is: , in, S is the negative end phase of the displacement digital signal. sig 2 is the negative end amplitude of the displacement digital signal, S max is the maximum amplitude of the displacement digital signal, S min is the minimum amplitude of the displacement digital signal; The number of fractional cycles in the negative direction is calculated according to the negative direction termination phase of the displacement digital signal, and the calculation formula is: , in, l 2 is the number of fractional cycles in the negative direction, It is the negative direction termination phase of the displacement digital signal; The negative direction displacement of the measuring medium is calculated according to the number of negative direction cycles, and the calculation formula is: , Among them, L2 is the displacement of the measuring medium in the negative direction, D is the displacement of the measuring medium in a complete cycle, and N2 is the number of integer cycles in the negative direction. l 2 is the number of fractional cycles in the negative direction.

2. The displacement measurement method according to claim 1, characterized in that: The step S401 specifically includes: S401-1: Acquire displacement digital signal information, wherein the displacement digital signal information includes a maximum amplitude of the displacement digital signal, a median amplitude of the displacement digital signal, and a minimum amplitude of the displacement digital signal; S401-2: Acquire a complete period of the displacement digital signal according to the displacement digital signal information, wherein the complete period of the displacement digital signal is a signal period corresponding to when the median amplitude of the displacement digital signal, the maximum amplitude of the displacement digital signal, the median amplitude of the displacement digital signal, the minimum amplitude of the displacement digital signal, and the median amplitude of the displacement digital signal are detected in sequence; S401 - 3: Obtain a complete cycle displacement of the measurement medium corresponding to a complete cycle of the displacement digital signal.

3. The displacement measurement method according to claim 1, characterized in that: The step S402 specifically includes: S402-1: Acquire a signal waveform phase of the displacement digital signal, wherein the signal waveform phase includes a first signal waveform phase and a second signal waveform phase, wherein the first signal waveform phase is output by the first reflective photoelectric switch, and the second signal waveform phase is output by the second reflective photoelectric switch; S402-2: Determine the phase of the signal waveform, and when the phase of the first signal waveform is smaller than the phase of the second signal waveform, the horizontal moving direction of the measuring medium is the positive direction; When the first signal waveform phase is greater than the second signal waveform phase, the horizontal movement direction of the measurement medium is the negative direction.

4. A displacement measuring device based on photoelectric reflection using the displacement measuring method according to claim 1, characterized in that: It includes a device setting module, a signal conversion module, and a displacement measurement module; The device setting module is used to obtain a movable measuring medium, the measuring medium includes an opaque tape, a metal plate, and honeycomb paper, a fixed stripe width is preset, and the long side of the measuring medium is taken as the horizontal direction. Bright stripes and dark stripes are evenly and alternately arranged on the measuring medium in the horizontal direction according to the fixed stripe width; fixed reflective photoelectric switches are arranged in parallel in the horizontal direction on one side of the measuring medium, the reflective photoelectric switches include a first reflective photoelectric switch and a second reflective photoelectric switch, and displacement measurement is performed by moving the measuring medium in the horizontal direction. During displacement measurement, the reflective photoelectric switch emits light to sequentially reach the bright stripes and the dark stripes and outputs a displacement sinusoidal signal to an analog-to-digital converter, and a center position is set, the center position is the midpoint of the line connecting the first reflective photoelectric switch and the second reflective photoelectric switch, and a horizontal moving direction of the measuring medium is specified. The horizontal moving direction of the measuring medium includes a positive direction and a negative direction. The direction from the midpoint of the line to the first reflective photoelectric switch is the positive direction, and the direction from the midpoint of the line to the second reflective photoelectric switch is the negative direction; The signal conversion module is used to convert the displacement sinusoidal signal into a displacement digital signal through the analog-to-digital converter and transmit it to the micro control unit; The displacement measurement module is used to identify the displacement digital signal and obtain the displacement of the measurement medium through the micro control unit.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the displacement measurement method as described in any one of claims 1 to 3 is implemented.

6. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to perform the displacement measurement method according to any one of claims 1 to 3 when executed by a computer processor.

Citation Information

Patent Citations

  • Position detection apparatus

    CN104101369A

  • Optical element

    CN105008865A