Displacement detection method, device and circuit and storage medium
By using the interaction between Hall elements and magnetic elements in the displacement detection circuit inside the hydraulic cylinder, the problem of low accuracy in hydraulic cylinder piston displacement detection is solved, achieving high-precision and low-failure-rate displacement measurement.
Patent Information
- Application Number
- CN202510321615.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-04-24
- Filing Date
- 2025-03-18
- Publication Date
- 2025-10-24
AI Technical Summary
The accuracy of oil cylinder piston displacement detection in the existing technology is low, mainly due to the high failure rate caused by the mechanical movement of the waveguide wire.
A displacement detection circuit embedded inside the hydraulic cylinder is used. By utilizing a signal detection device and multiple first Hall elements, the output signal is obtained through the interaction between the magnetic element and the Hall element to determine the position of the magnetic element. The displacement of the piston is calculated by combining the Hall element number and the magnetic field strength.
It achieves high-precision displacement measurement, reduces the failure rate caused by mechanical motion, and improves the accuracy and reliability of detection.
Smart Images

Figure CN120830664A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data detection, in particular to a displacement detection method, device, circuit and storage medium. BACKGROUND
[0002] In the prior art, when measuring the displacement of the oil cylinder piston, a magnetic ring is usually installed on the piston. The magnetic ring moves with the piston on the pressure-resistant pipe. An electronic bin generates a starting pulse. A magnetic field is generated through a waveguide wire. When the magnetic field intersects with the magnetic field of the magnetic ring, a strain mechanical pulse is generated. The pulse is returned at a fixed speed and is received by the electronic bin. The electronic bin calculates the time difference between the starting pulse and the received signal, and thus the position of the magnetic ring, i.e., the displacement of the oil cylinder piston, can be calculated. However, since the waveguide wire has mechanical movement, the failure rate is relatively high, resulting in low accuracy of the displacement detection of the oil cylinder piston. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide a displacement detection method, device, circuit and storage medium, to solve the problem of low accuracy of the displacement detection of the oil cylinder piston.
[0004] To achieve the above-mentioned purpose, the first aspect of the present application provides a displacement detection method applied to a displacement detection circuit embedded in an oil cylinder, the displacement detection circuit comprising a signal detection device and a plurality of first Hall elements connected to each other, the plurality of first Hall elements being connected in sequence, each of the plurality of first Hall elements being arranged at intervals along the direction of movement of a piston in the oil cylinder, a magnetic element being arranged on the piston, the displacement detection method comprising:
[0005] obtaining an output signal detected by the signal detection device, the output signal being generated by the magnetic element passing through any one of the plurality of first Hall elements;
[0006] determining a second Hall element in which the magnetic element is located by using the output signal;
[0007] determining a first displacement of the magnetic element by using the second Hall element;
[0008] calculating a second displacement of the piston by using the second Hall element and the first displacement.
[0009] In the embodiments of the present application, the signal detection device comprises at least one expansion chip and a microcontroller, one end of the expansion chip being connected to the microcontroller, and the other end of the expansion chip being connected to the plurality of first Hall elements respectively; the output signal comprises a level signal;
[0010] The obtaining of the output signal detected by the signal detection device comprises:
[0011] acquire, by the microcontroller, a level signal detected by the at least one extension chip;
[0012] determine, by the microcontroller, the second Hall element in which the magnetic element is located, by using the output signal.
[0013] determine, by the microcontroller, the first Hall element generating the level signal as the second Hall element.
[0014] In the embodiments of the present application, the signal detection device includes a plurality of rectifier units, the plurality of first Hall elements are divided into a first group and a second group, the Hall elements of the first group and the Hall elements of the second group are alternately arranged along the piston movement direction, and the plurality of rectifier units are connected to the plurality of first Hall elements one by one; the output signal includes a first voltage signal and a second voltage signal.
[0015] acquire, by the microcontroller, a level signal detected by the at least one extension chip;
[0016] acquire, by the microcontroller, a level signal detected by the at least one extension chip;
[0017] determine, by the microcontroller, the second Hall element in which the magnetic element is located, by using the output signal.
[0018] determine, by the microcontroller, the first voltage signal and the second voltage signal.
[0019] determine, by the microcontroller, the second Hall element in which the magnetic element is located, according to the signal transformation state, the number of signal change states, and the movement direction of the magnetic element.
[0020] In the embodiments of the present application, the rectifier unit includes a first diode and a second diode, the anode of the first diode is connected to the cathode of the second diode, and the common end of the first diode and the second diode is connected to the output end of the first Hall element; the anode of the first diode connected to the Hall element of the first group is connected to a first signal end, and the cathode of the second diode is connected to a second signal end; the anode of the first diode connected to the Hall element of the second group is connected to a third signal end, and the cathode of the second diode is connected to a fourth signal end.
[0021] acquire, by the microcontroller, a level signal detected by the at least one extension chip;
[0022] determining a difference between the first sub-signal value detected by the first signal end and a voltage drop of the first diode as a first signal value, and determining a sum between the second sub-signal value detected by the second signal end and a voltage drop of the second diode as a second signal value;
[0023] determining a difference between the third sub-signal value detected by the third signal end and a voltage drop of the first diode as a third signal value, and determining a sum between the fourth sub-signal value detected by the fourth signal end and a voltage drop of the second diode as a fourth signal value;
[0024] determining a difference between the second signal value and the first signal value as a first voltage signal, and determining a difference between the fourth signal value and the third signal value as a second voltage signal.
[0025] In the embodiment of the present application, the phase of the first voltage signal and the second voltage signal is used to determine the moving direction of the magnetic element, including:
[0026] In the case that the phase of the first voltage signal is prior to the phase of the second voltage signal, the moving direction of the magnetic element is determined as the piston movement direction;
[0027] In the case that the phase of the first voltage signal is subsequent to the phase of the second voltage signal, the moving direction of the magnetic element is determined as the opposite direction of the piston movement direction.
[0028] In the embodiment of the present application, the second Hall element where the magnetic element is located is determined according to the signal transformation state of the first voltage signal and the second voltage signal, the number of signal change states, and the moving direction, including:
[0029] In the case that the moving direction is the piston movement direction, the signal transformation state of the first voltage signal and the second voltage signal is a falling edge each time, and the number of signal change states is a preset number, the current first Hall element serial number is increased by a preset value to obtain the serial number of the second Hall element where the magnetic element is located;
[0030] In the case that the moving direction is the opposite direction of the piston movement direction, the signal transformation state of the first voltage signal and the second voltage signal is a falling edge each time, and the number of signal change states is a preset number, the current first Hall element serial number is decreased by a preset value to obtain the serial number of the second Hall element where the magnetic element is located.
[0031] In the embodiment of the present application, the second displacement of the piston is calculated by using the second Hall element and the first displacement, including:
[0032] convert the fifth signal value of the second Hall element into a third displacement of the magnetic element, the fifth signal value being a voltage value of the magnetic element passing through the second Hall element;
[0033] determine a second displacement as a sum of the first displacement and the third displacement.
[0034] In the embodiments of the present application, the signal detection device includes a plurality of extension chips and a microcontroller, one end of each of the plurality of extension chips is connected to the microcontroller, and the other end is connected to a plurality of first Hall elements; the output signal includes an interrupt signal;
[0035] The output signal detected by the signal detection device includes:
[0036] The interrupt signal detected by any of the plurality of extension chips is obtained by the microcontroller;
[0037] The second Hall element in which the magnetic element is located is determined by using the output signal, and the second Hall element includes:
[0038] The first Hall element corresponding to the interrupt signal is determined as the second Hall element by the microcontroller.
[0039] In the embodiments of the present application, the second displacement of the piston is calculated by using the second Hall element and the first displacement, and the second displacement includes:
[0040] The magnetic field intensity of the magnetic element passing through the second Hall element is obtained;
[0041] The magnetic field intensity is converted into a fourth displacement;
[0042] The second displacement is determined as a sum of the first displacement and the fourth displacement.
[0043] In the embodiments of the present application, the first displacement of the magnetic element is determined by using the second Hall element, and the first displacement includes:
[0044] The first displacement of the magnetic element is determined by using a first formula;
[0045] The first formula is:
[0046]
[0047] wherein S is the first displacement, N is the serial number of the second Hall element, and Ki is the distance between the i th first Hall element and the i+1 th first Hall element.
[0048] The second aspect of the present application provides a processor configured to execute the displacement detection method according to the first aspect.
[0049] The third aspect of the present application provides a displacement detection circuit, comprising:
[0050] The signal detection device and the plurality of first Hall elements are connected to each other, the plurality of first Hall elements are connected in sequence, and each of the plurality of first Hall elements is arranged at intervals along a direction in which the piston moves in the oil cylinder, and the piston is provided with a magnetic element.
[0051] In the embodiment of the present application, the signal detection device comprises at least one expansion chip and a microcontroller, one end of the expansion chip is connected to the microcontroller, and the other end of the expansion chip is connected to the plurality of first Hall elements respectively.
[0052] In the embodiment of the present application, the signal detection device comprises a plurality of rectifier units, the plurality of first Hall elements are divided into a first group and a second group, the Hall elements of the first group and the Hall elements of the second group are arranged alternately along the direction in which the piston moves, and the plurality of rectifier units are connected to the plurality of first Hall elements one by one.
[0053] In the embodiment of the present application, the rectifier unit comprises a first diode and a second diode, an anode of the first diode is connected to a cathode of the second diode, and a common end of the first diode and the second diode is connected to an output end of the first Hall element; an anode of the first diode connected to the Hall element of the first group is connected to a first signal end, and a cathode of the second diode is connected to a second signal end; an anode of the first diode connected to the Hall element of the second group is connected to a third signal end, and a cathode of the second diode is connected to a fourth signal end.
[0054] In the embodiment of the present application, the signal detection device comprises a plurality of expansion chips and a microcontroller, one end of each of the plurality of expansion chips is connected to the microcontroller, and the other end of each of the plurality of expansion chips is connected to the plurality of first Hall elements.
[0055] The fourth aspect of the present application provides a displacement detection device, the device comprising:
[0056] The processor according to the second aspect;
[0057] The displacement detection circuit according to the third aspect.
[0058] The fourth aspect of the present application provides a machine readable storage medium, and instructions are stored on the machine readable storage medium, the instructions are used to make the machine execute the displacement detection method according to the first aspect.
[0059] In the embodiment, in the displacement detection circuit embedded in the oil cylinder, the signal detection device is directly connected with the plurality of Hall elements, and the plurality of first Hall elements are sequentially connected, and each first Hall element is arranged at intervals in the direction of the movement of the piston in the oil cylinder, so that the displacement measurement can be performed by replacing the waveguide wire in the prior art, without the need for complex mechanical structure or precise waveguide wire, and the failure rate caused by mechanical movement is reduced. Meanwhile, during the detection process, when the magnetic element moves, different Hall elements are triggered in sequence, and the real-time position of the magnetic element can be accurately determined by detecting the second Hall element triggering signal. Further, the rough position is determined by the Hall element serial number, that is, the first displacement, and the fine position is further calculated by combining the second Hall element and the first displacement, so that high-precision displacement measurement is realized.
[0060] Other features and advantages of the embodiments of the present application will be described in detail in the following specific implementation part. BRIEF DESCRIPTION OF DRAWINGS
[0061] The accompanying drawings are included to provide a further understanding of the embodiments of the present application, and constitute a part of the specification, and are used together with the following specific implementation to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the drawings:
[0062] Figure 1 The flowchart of the displacement detection method according to the embodiments of the present application is schematically shown;
[0063] Figure 2 The structural schematic diagram of the oil cylinder is schematically shown;
[0064] Figure 3 The arrangement schematic diagram of the first Hall element is schematically shown;
[0065] Figure 4 The relationship between the Hall element and the magnetic element is schematically shown;
[0066] Figure 5 The three-axis magnetic field strength diagram of the Hall element is schematically shown;
[0067] Figure 6 The displacement detection circuit schematic diagram using the switching type Hall element is schematically shown;
[0068] Figure 7 The displacement detection circuit schematic diagram using the switching type Hall element is schematically shown;
[0069] Figure 8 The circuit detection schematic diagram when the Hall element uses analog signal output is schematically shown;
[0070] Figure 9Fig. 1 shows a schematic diagram of the arrangement of the Hall element when using analog signal output;
[0071] Figure 10 Fig. 2 shows a schematic diagram of the displacement relationship between the Hall element output signal and the magnetic element;
[0072] Figure 11 Fig. 3 shows a schematic diagram of the diode parallel output signal and the schematic diagram of the difference between the parallel signals;
[0073] Figure 12 Fig. 4 shows a schematic diagram of the displacement detection circuit when the Hall element uses digital signal output;
[0074] Figure 13 Fig. 5 shows a displacement detection device according to an embodiment of the present application.
[0075] Legend of reference signs
[0076] 1 electronic bin 2 pressure-resistant tube
[0077] 3 first Hall element 4 magnetic element
[0078] 5 piston 6 cylinder
[0079] 7 hydraulic oil cavity 601 expansion chip
[0080] 801 first diode 802 second diode DETAILED DESCRIPTION
[0081] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0082] It should be noted that the acquisition, transmission, storage, use, processing, etc. of data in the technical solutions of the present application comply with the relevant provisions of national laws and regulations. In the embodiments of the present application, some industry existing solutions, components, models, etc. may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0083] It should be noted that if the application embodiments have directionality indications (such as up, down, left, right, front, back, etc.), the directionality indications are only used to explain the relative position relationship, movement, etc. between components in a certain posture (as shown in the drawings), and if the certain posture changes, the directionality indications will also change accordingly.
[0084] In addition, if the application embodiments have descriptions of "first", "second", etc., the "first", "second", etc. descriptions are only for description purposes and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of indicated technical features. Therefore, the features limited by "first", "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions of each embodiment can be combined with each other, but it must be based on the realization of a person skilled in the art, and when the combination of technical solutions contradicts each other or cannot be realized, it should be considered that the combination of technical solutions does not exist and is not within the protection scope required by the application.
[0085] Figure 1 The flowchart of the displacement detection method according to the embodiments of the application is schematically shown. Taking the case that the method is applied to a processor as an example, as shown in Figure 1 The displacement detection method provided by the embodiments of the application can include the following steps.
[0086] Step 101, obtaining an output signal detected by a signal detection device, the output signal being generated by a magnetic element 4 passing through any one of a plurality of first Hall elements 3;
[0087] In the embodiments of the application, the displacement detection method is applied to a displacement detection circuit embedded in the inside of an oil cylinder. The displacement detection circuit refers to a circuit embedded in the inside of an oil cylinder for detecting the displacement of a piston 5 of the oil cylinder. The displacement detection circuit includes a signal detection device and a plurality of first Hall elements 3 connected to each other. The displacement detection circuit includes a signal detection device and a plurality of first Hall elements 3 connected to each other. The plurality of first Hall elements 3 are connected in sequence, and each first Hall element 3 is arranged at intervals along the direction of movement of the piston 5 in the oil cylinder. The piston 5 is provided with a magnetic element 4. The signal detection device includes an expansion chip 601 or a rectifier unit. The number of signal detection devices can be one-to-one corresponding to the number of first Hall elements 3, or a single signal detection device can correspond to a plurality of first Hall elements 3.
[0088] In addition, as shown in Figure 2 , the displacement detection circuit can further include a plurality of second Hall elements 2 connected to the signal detection device. Figure 2The structure of the oil cylinder is shown in the figure. The oil cylinder also includes an electronic compartment 1, a pressure-resistant tube 2, a piston 5, a cylinder body 6, and a hydraulic oil cavity 7. The magnetic element 4 is fixed to the tail of the piston 5 and moves together with the piston 5, so the displacement of the magnetic element 4 is the displacement of the piston 5. The shape of the magnetic element 4 can be a magnetic ring shape or other shapes such as a square shape. The piston 5 is a tubular structure, the pressure-resistant tube 2 extends into the inside of the piston 5, the displacement detection circuit is fixed in the pressure-resistant tube 2, and is isolated from the hydraulic oil through the pressure-resistant tube 2. When the hydraulic oil enters the hydraulic oil cavity 7 to push the piston 5 to move, the magnetic element 4 moves together with the piston 5, the position of the magnetic element 4 corresponds to the positions of different first Hall elements 3 on the displacement detection circuit. In the case that the magnetic element 4 moves to the positions of different first Hall elements 3, the magnetic element 4 interacts with the Hall elements, so that the Hall elements at the corresponding positions generate output signals. Then the displacement detection circuit outputs different signals, and the circuit board in the electronic compartment 1 converts the output signals of the displacement detection circuit into the required piston 5 displacement signal, that is, the displacement of the piston 5 in the oil cylinder is measured.
[0089] As shown in Figure 3 , Figure 3 The arrangement of the first Hall elements 3 is shown in the figure. The spacing between adjacent first Hall elements 3 is K1, K2, …, K(N-1). The first Hall elements 3 can be arranged at equal distances, or can be adjusted according to the accuracy requirements at different positions. The positions with high accuracy requirements can have smaller spacing, and the positions with high accuracy requirements can have larger spacing. That is, K1=K2=…K(N-1), or K1≠K2≠…≠K(N-1). The maximum range measured by the first Hall elements 3 is Smax, so the number N needs to satisfy
[0090] As shown in Figure 4 , Figure 4 The relationship between the Hall elements and the magnetic element 4 is shown in the figure. The magnetic field along the coordinate axis direction is the magnetic field detected by the Hall elements. During the movement of the magnetic element 4 along the positive direction of the Z axis, the geometric center of the magnetic element 4 and the detection point of the Hall element are always on a straight line (Z axis). Therefore, during the movement, the three-axis magnetic field strength obtained is as shown in Figure 5 It can be known from Figure 5 that during the movement of the magnetic element 4, the magnetic field strength along the X axis and the Y axis is 0, so only the Z-axis magnetic field change can be used for displacement detection. Therefore, if a common single-axis Hall element is used, a through-hole package needs to be selected. That is, the first Hall element 3 can be selected from any one of a switching type, an analog signal output, and a digital signal output. The Hall element can be a Hall chip, or it can be other elements that can convert the magnetic field strength into an electrical signal. The present embodiment does not limit this.
[0091] Step 102, determining the second Hall element where the magnetic element 4 is located by the output signal;
[0092] In the embodiment of the present application, when the magnetic element 4 moves to any first Hall element 3, the first Hall element 3 generates an output signal, at this time, the signal detection device acquires the output signal, and the corresponding second Hall element can be determined by the detection signal. As an example, if the output signal is generated by the Nth first Hall element 3, it indicates that the second Hall element is the corresponding Nth first Hall element 3.
[0093] Step 103, determining the first displacement of the magnetic element 4 by the second Hall element;
[0094] In the embodiment of the present application, since the Hall elements are arranged in sequence, and the serial number of each Hall element is sequentially increased from 1, after the second Hall element is determined, the first displacement can be calculated according to the interval distance between all the first Hall elements 3 passed by the magnetic element 4 and the serial number of the second Hall element.
[0095] Specifically, in an embodiment, the first displacement of the magnetic element 4 is determined by the second Hall element, comprising:
[0096] determining the first displacement of the magnetic element 4 by the first formula;
[0097] The first formula is:
[0098]
[0099] Wherein, S is the first displacement, N is the serial number of the second Hall element, and Ki is the interval between the ith first Hall element 3 and the ith+1 first Hall element 3.
[0100] Step 104, calculating the second displacement of the piston 5 by the second Hall element and the first displacement.
[0101] In the embodiment of the present application, after the first displacement is obtained, since the first displacement can only indicate which Hall element the magnetic element 4 passes through, that is, only the rough displacement of the magnetic element 4 can be obtained, and the accurate position of the magnetic element 4 between two Hall elements cannot be obtained. Therefore, the output value of the second Hall element and the first displacement are needed to determine the accurate position of the magnetic element 4 between two Hall elements, that is, the second displacement of the piston 5. The output value can be a level value or a field intensity.
[0102] In this embodiment, in the displacement detection circuit embedded in the oil cylinder, a signal detection device is directly connected to multiple Hall elements, and multiple first Hall elements 3 are connected in sequence. Each first Hall element 3 is spaced apart along the direction of movement of the piston 5 inside the oil cylinder, which can replace the waveguide wire in the prior art for displacement measurement. There is no need for complex mechanical structures or precision waveguide wires, which reduces the failure rate caused by mechanical movement. At the same time, during the detection process, when the magnetic element 4 moves, different Hall elements are triggered in sequence. By detecting the second Hall element of the trigger signal, the real-time position of the magnetic element 4 can be accurately determined. Furthermore, the rough position, that is, the first displacement, is first determined by the Hall element serial number, and then the fine position is further calculated by combining the second Hall element and the first displacement, thereby achieving high-precision displacement measurement.
[0103] In one embodiment of the present application, when the Hall element is a switch-type Hall element, obtaining the output signal detected by the signal detection device includes:
[0104] Acquiring a level signal detected by at least one expansion chip 601 through a microcontroller;
[0105] The second Hall element where the magnetic element 4 is located is determined by using the output signal, including:
[0106] The first Hall element 3 generating the level signal is determined as the second Hall element by the microcontroller.
[0107] In this embodiment, if Figure 6 As shown, Figure 6 This is a schematic diagram of a displacement detection circuit using a switch-type Hall effect element. The signal detection device includes at least one expansion chip 601 and a microcontroller. One end of the expansion chip 601 is connected to the microcontroller, and the other end is connected to multiple first Hall effect elements 3. One end of the expansion chip 601 includes multiple pins, each of which is connected to a first Hall effect element 3. The expansion chip 601 can be an I / O expansion chip 601.
[0108] When the magnetic element 4 is close to the first Hall element 3 , the first Hall element 3 will output a low-level signal. At this time, the Hall element outputting the low-level signal can be read by the extended chip 601 to determine the second Hall element.
[0109] In addition, if Figure 7As shown, in the case that there are a large number of Hall elements and one I / O expansion chip 601 is not enough, a plurality of I / O expansion chips 601 can be used to connect the Hall elements, wherein the I / O expansion chips 601 can be distinguished by addresses and communicate with the microcontrollers through the I2C bus; when the addresses of one microcontroller are not enough, the microcontrollers are expanded to read the signals. The microcontrollers communicate through UART / SPI.
[0110] In addition, in the embodiment, when the second displacement is determined, the first displacement can be directly determined as the second displacement.
[0111] In the embodiment, by using the detection circuit corresponding to the switching type Hall element, the error caused by the resistance difference in the prior art is eliminated, and the error of the output voltage of the Hall element is also eliminated, so that the precision is higher, and the circuit structure is simple.
[0112] In an embodiment of the present application, when the Hall element adopts analog signal output, the output signal detected by the signal acquisition detection device includes:
[0113] The first voltage signal detected by the rectifier unit connected with the Hall element of the first group and the second voltage signal detected by the rectifier unit connected with the Hall element of the second group are acquired;
[0114] The second Hall element where the magnetic element 4 is located is determined by using the output signal, including:
[0115] The moving direction of the magnetic element 4 is determined by using the phase of the first voltage signal and the second voltage signal;
[0116] The second Hall element where the magnetic element 4 is located is determined according to the signal change state number of the first voltage signal and the second voltage signal and the moving direction.
[0117] In the embodiment, as shown in Figure 8 and Figure 9 , the circuit detection schematic diagram when the Hall element adopts analog signal output is Figure 8 Figure 9 is a schematic diagram of the arrangement of the Hall elements. Among them, the signal detection device includes a plurality of rectifier units (including D1, D2, D3, D4), a plurality of first Hall elements 3 are divided into a first group (including U1, U2, U3, U4) and a second group (including U201, U202, U203, U204), the Hall elements of the first group and the Hall elements of the second group are alternately arranged along the movement direction of the piston 5, and the plurality of rectifier units are connected with the plurality of first Hall elements 3 one by one. Among them, the rectifier unit is used to convert the alternating current signal output by the Hall element into a direct current signal. It should be noted that, in order to ensure the accuracy of the displacement data, the distance between each Hall element should be less than the distance of the change of the Z-axis magnetic field strength from the minimum to the maximum, that is, the effective distance, for example, if the magnetic element 4 moves 1mm to cause a significant change in the magnetic field, the interval should be ≤1mm. Thus, through the alternate arrangement, the movement of the magnetic element 4 will simultaneously affect the two groups of Hall elements, forming complementary signals.
[0118] The Hall elements of the first group output a first voltage signal, and the Hall elements of the second group output a second voltage signal. In order to obtain the first voltage signal and the second voltage signal, it is necessary to first obtain the displacement relationship between the output signals of the Hall elements of the first group and the Hall elements of the second group and the magnetic element 4. Then the difference between the two groups of signals is determined as the first voltage signal and the second voltage signal. For details, please refer to the subsequent embodiments.
[0119] After obtaining the first voltage signal SIGNL1 and the second voltage signal SIGNL2, the movement direction of the magnetic element 4 is determined by using the first voltage signal and the second voltage signal, wherein the forward movement is that the falling edge of SIGNL1 precedes SIGNL2, and the Hall element serial number increases (such as U1→U2). The reverse movement is that the falling edge of SIGNL2 precedes SIGNL1, and the Hall element serial number decreases (such as U2→U1). Among them, the forward movement is along the movement direction of the piston 5, and the reverse movement direction is the opposite direction of the movement of the piston 5.
[0120] The number of signal change states includes the number of changes of the falling edges of the first voltage signal and the second voltage signal. Since the Hall elements are alternately arranged, the movement of the magnetic element 4 will simultaneously affect the two groups of Hall elements, forming complementary signals. Therefore, only when the falling edges of the first voltage signal and the second voltage signal are changed, it is determined that the magnetic element 4 has passed a Hall element. After determining the movement direction and the number of changes, the serial number of the Hall element where the magnetic element 4 is located can be determined, and then the second Hall element can be determined.
[0121] In this embodiment, through the alternate arrangement of the two groups of Hall elements and the setting of the rectifier unit, more abundant signal information can be obtained, the position and movement direction of the magnetic element 4 are determined by using the phase and change state of the voltage signal, the possibility of interference and misjudgment is reduced, and the reliability of displacement detection is improved.
[0122] In an embodiment, the first voltage signal detected by the rectifier unit connected with the first group of Hall elements and the second voltage signal detected by the rectifier unit connected with the second group of Hall elements are obtained, comprising:
[0123] The difference between the first sub-signal value detected by the first signal end and the voltage drop of the first diode 801 is determined as the first signal value, and the sum of the second sub-signal value detected by the second signal end and the voltage drop of the second diode 802 is determined as the second signal value;
[0124] The difference between the third sub-signal value detected by the third signal end and the voltage drop of the first diode 801 is determined as the third signal value, and the sum of the fourth sub-signal value detected by the fourth signal end and the voltage drop of the second diode 802 is determined as the fourth signal value;
[0125] The difference between the second signal value and the first signal value is determined as the first voltage signal, and the difference between the fourth signal value and the third signal value is determined as the second voltage signal.
[0126] In the embodiment, as shown in Figure 8 , the rectifier unit includes a first diode 801 and a second diode 802, the anode of the first diode 801 is connected with the cathode of the second diode 802, and the common end of the first diode 801 and the second diode 802 is connected with the output end of the first Hall element 3; the anode of the first diode 801 connected with the first group of Hall elements is connected with the first signal end SIGNAL1-L, and the cathode of the second diode 802 is connected with the second signal end SIGNAL1-H; the anode of the first diode 801 connected with the second group of Hall elements is connected with the third signal end SIGNAL2-L, and the cathode of the second diode 802 is connected with the fourth signal end SIGNAL2-H. Among them, the first signal end is used for detecting the first sub-signal value, the second signal end is used for detecting the second sub-signal value, the third signal end is used for detecting the third sub-signal value, and the fourth signal end is used for detecting the fourth sub-signal value.
[0127] As shown in Figure 10 , the displacement relationship diagram of the Hall element output signal and the magnetic element 4 is shown in the figure. Figure 10
[0128] The first voltage signal and the second voltage signal can be obtained by parallel connection of the diode and difference value of the parallel output signal. Specifically, as shown in Figure 11 Figure 11 The schematic diagram of the diode parallel output signal and the schematic diagram of the parallel signal difference value are shown. The determination process of the first voltage signal SIGNAL1 is that the Hall elements in the first group are output in parallel through the forward diode, and the signal is the maximum value of the output voltage of the Hall elements in the group minus the diode voltage drop (VF); the determination process of the second voltage signal SIGNAL2 is that the Hall elements in the second group are output in parallel through the reverse diode, and the signal is the minimum value of the output voltage of the Hall elements in the group plus the diode voltage drop (VF).
[0129] In the embodiment, the signal output by the Hall element is processed by the rectifier unit, which can eliminate the noise and interference in the signal and improve the quality of the voltage signal, thereby further improving the accuracy of displacement detection. At the same time, by considering the voltage drop of the diode, the first voltage signal and the second voltage signal can be more accurately calculated, and more reliable data can be provided for subsequent displacement calculation.
[0130] In an embodiment of the present application, the phase of the first voltage signal and the second voltage signal is used to determine the moving direction of the magnetic element 4, including:
[0131] In the case that the phase of the first voltage signal is before the phase of the second voltage signal, the moving direction of the magnetic element 4 is determined as the moving direction of the piston 5;
[0132] In the case that the phase of the first voltage signal is after the phase of the second voltage signal, the moving direction of the magnetic element 4 is determined as the opposite direction of the moving direction of the piston 5.
[0133] In the embodiment, after obtaining the first voltage signal SIGNL1 and the second voltage signal SIGNL2, the moving direction of the magnetic element 4 is determined by using the first voltage signal and the second voltage signal, wherein the forward movement is that the falling edge of SIGNL1 is earlier than SIGNL2, and the Hall element number increases (such as U1→U2). The reverse movement is that the falling edge of SIGNL2 is earlier than SIGNL1, and the Hall element number decreases (such as U2→U1). Wherein, the forward movement is along the direction of the piston 5 movement, and the reverse movement direction is the opposite direction of the piston 5 movement.
[0134] In the embodiment, by comparing the phases of the two voltage signals, the moving direction of the magnetic element 4 can be quickly and accurately determined, without complex algorithms and additional sensors, thereby reducing the cost and complexity of the system.
[0135] In an embodiment of the present application, the second Hall element where the magnetic element 4 is located is determined according to the signal transformation state, the number of signal change states, and the moving direction of the first voltage signal and the second voltage signal, including:
[0136] In the moving direction as the moving direction of the piston 5, and in the case that the signal change state of the first voltage signal and the second voltage signal is the falling edge each time the signal change state is detected, and the number of signal change states is the preset number, the current first Hall element 3 serial number is increased by the preset value, to obtain the serial number of the second Hall element where the magnetic element 4 is located.
[0137] In the moving direction as the reverse direction of the moving direction of the piston 5, and in the case that the signal change state of the first voltage signal and the second voltage signal is the falling edge each time the signal change state is detected, and the number of signal change states is the preset number, the current first Hall element 3 serial number is decreased by the preset value, to obtain the serial number of the second Hall element where the magnetic element 4 is located.
[0138] In the embodiment, the signal state change state includes the falling edge state, and the number of signal change states includes the number of changes of the falling edges of the first voltage signal and the second voltage signal. Since the Hall elements are alternately arranged, the movement of the magnetic element 4 will simultaneously affect the two groups of Hall elements, forming complementary signals. Therefore, only when the falling edges of the first voltage signal and the second voltage signal are changed, it is determined that the magnetic element 4 has passed a Hall element. After determining the moving direction and the number of changes, the serial number of the Hall element where the magnetic element 4 is located can be determined, and then the second Hall element is determined.
[0139] In the embodiment, the serial number of the second Hall element where the magnetic element 4 is located can be more accurately determined by combining the moving direction and the signal change state, thereby improving the accuracy of displacement detection. At the same time, whether the piston 5 moves forward or reversely, the serial number of the second Hall element can be determined through the corresponding rules, which is suitable for bidirectional motion control of the oil cylinder.
[0140] In an embodiment of the present application, the second displacement of the piston 5 is calculated by using the second Hall element and the first displacement, including:
[0141] The fifth signal value of the second Hall element is converted into the third displacement of the magnetic element 4, and the fifth signal value is the voltage value when the magnetic element 4 passes the second Hall element;
[0142] The sum of the third displacement and the first displacement is determined as the second displacement.
[0143] In the embodiment, in order to accurately determine the position of the magnetic element 4 between the two Hall elements, the output voltage value of the Hall element at this time needs to be read. The fifth signal value is the voltage value when the magnetic element 4 passes the second Hall element. When the magnetic element 4 moves with the piston 5 to pass the second Hall element, the second Hall element will generate a corresponding voltage signal due to the change of the magnetic field, and this voltage signal is the fifth signal value.
[0144] The output voltage of the Hall element has a certain functional relationship with the magnetic field intensity, and the magnetic field intensity is related to the relative position between the magnetic element 4 and the Hall element. In actual application, the corresponding relationship between the voltage and the displacement can be obtained through experiments or theoretical calculations in advance to form a mapping table or a function expression. For example, by recording the voltage value output by the Hall element under different displacements through a large number of experiments, a corresponding table of voltage-displacement is obtained. When the fifth signal value (voltage value) of the second Hall element is obtained, the voltage value can be converted into the corresponding displacement value, i.e. the third displacement of the magnetic element 4 relative to the second Hall element, by looking up the mapping table or substituting the function expression.
[0145] The third displacement is the accurate displacement of the magnetic element 4 relative to the second Hall element. By adding the third displacement to the first displacement, the more accurate displacement of the magnetic element 4 in the entire displacement detection interval, i.e. the second displacement of the piston 5, can be obtained.
[0146] In the embodiment, by converting the voltage value of the second Hall element into displacement and adding it to the first displacement, the voltage signal information output by the Hall element is fully utilized, and the displacement of the piston 5 can be calculated more accurately, greatly improving the accuracy of displacement detection.
[0147] In addition, before calculating the second displacement of the piston 5 by using the second Hall element and the first displacement, it is first necessary to determine whether the magnetic element 4 is at the preset starting position. If the magnetic element 4 is not at the starting position, the calculation of the second displacement of the piston 5 is performed after the magnetic element 4 is moved to the starting position by the piston 5. If the magnetic element 4 is at the starting position, the second displacement of the piston 5 is directly calculated by using the second Hall element and the first displacement. When the starting position Hall element U1 signal SIGNL_1 outputs a low level, it indicates that the Hall element sequence number where the magnetic ring is located is 1, i.e. it is at the starting position.
[0148] In an embodiment of the present application, when the Hall element adopts digital signal output, the output signal detected by the signal detection device is obtained, including:
[0149] The interrupt signal detected by any of the plurality of extension chips is obtained by the microcontroller;
[0150] The second Hall element where the magnetic element 4 is located is determined by using the output signal, including:
[0151] The first Hall element 3 corresponding to the generated interrupt signal is determined as the second Hall element by the microcontroller.
[0152] In the embodiment, as shown in Figure 12 , the output signal of the Hall element is converted into the corresponding displacement value by looking up the mapping table or substituting the function expression. Figure 12A schematic diagram of a displacement detection circuit for a Hall element using digital signal output. The signal detection device includes a plurality of expansion chips and a microcontroller, one end of the plurality of expansion chips is connected to the microcontroller, and the other end is connected to a plurality of first Hall elements 3. The output signal includes an interrupt signal. The expansion chip is a 16-bit I / O expansion chip. When the Hall chip detects a change in the magnetic field, it will output a corresponding interrupt signal INT. The interrupt signal INT is connected to the microcontroller through the I / O expansion chip. The microcontroller MCU can quickly locate the Hall element where the magnetic element 4 is located through the interrupt signal, and the second Hall element can be determined.
[0153] When there are a large number of Hall elements, the number of Hall elements can be expanded by adding expansion chips, and at the same time, the number of microcontrollers is also increased to expand the number of expansion chips. The microcontrollers communicate with each other through UART / SPI. It should be noted that the I / O expansion chip will also generate an interrupt signal when the IO port changes. Therefore, the microcontroller can obtain the interrupt signal detected by other microcontrollers, thereby determining the position of the Hall chip connected to the other microcontrollers.
[0154] In this embodiment, the interrupt signal can trigger the microcontroller's processing program in a timely manner, so that the system can respond to the position change of the magnetic element 4 in real time, and the real-time performance of displacement detection is improved.
[0155] In an embodiment of the present application, the second displacement of the piston 5 is calculated using the second Hall element and the first displacement, including:
[0156] Obtain the magnetic field strength of the magnetic element 4 passing through the second Hall element;
[0157] Convert the magnetic field strength to a fourth displacement;
[0158] The sum of the first displacement and the fourth displacement is determined as the second displacement.
[0159] In this embodiment, the Hall element itself has the characteristic of being sensitive to the magnetic field. When the magnetic element 4 moves with the piston 5 through the second Hall element, the magnetic field around the second Hall element will change, and the Hall element will generate a corresponding electric signal according to the change of the magnetic field. By processing and analyzing this electric signal, the magnetic field strength of the magnetic element 4 passing through the second Hall element can be obtained. The microcontroller and the Hall element can communicate with each other through SPI, so the microcontroller can directly obtain the magnetic field strength of the Hall element.
[0160] There is a functional relationship between the magnetic field strength and the relative displacement between the magnetic element 4 and the Hall element. This relationship can be derived theoretically or experimentally. For example, in a laboratory setting, by precisely controlling the displacement of the magnetic element 4 relative to the Hall element and measuring the corresponding magnetic field strength, multiple sets of data can be recorded and fitted to obtain a functional expression or mapping table for the magnetic field strength versus displacement.
[0161] After obtaining the magnetic field strength of the magnetic element 4 as it passes the second Hall effect element, this magnetic field strength value is substituted into a predetermined function expression or lookup mapping table to obtain the corresponding displacement value, i.e., the fourth displacement. This fourth displacement reflects the precise position change of the magnetic element 4 relative to the second Hall effect element.
[0162] Adding the first and fourth displacements gives the second displacement of piston 5. The first displacement defines a rough range, while the fourth displacement precisely corrects this position. The sum of the two more accurately reflects the actual displacement of piston 5 throughout its entire motion.
[0163] In this embodiment, the fourth displacement is calculated using the magnetic field strength and combined with the first displacement, which makes full use of the magnetic field information and can more accurately determine the position of the piston 5. Compared with the method of relying solely on a single displacement calculation, the accuracy of displacement detection is greatly improved. At the same time, by obtaining the magnetic field strength of the Hall element to calculate the displacement, it is not affected by power outages and has strong adaptability.
[0164] In addition, the present invention also provides a displacement detection circuit, comprising:
[0165] The signal detection device and multiple first Hall elements 3 are connected to each other, and the multiple first Hall elements 3 are connected in sequence. Each first Hall element 3 is arranged at intervals along the direction of movement of the piston 5 in the cylinder, and a magnetic element 4 is provided on the piston 5.
[0166] In one embodiment, the signal detection device includes at least one extension chip, and the extension chip is respectively connected to the plurality of first Hall elements 3 .
[0167] In one embodiment, the signal detection device includes multiple rectifier units, multiple first Hall elements 3 are divided into a first group and a second group, the Hall elements of the first group and the Hall elements of the second group are alternately arranged along the movement direction of the piston 5, and the multiple rectifier units are connected to the multiple first Hall elements 3 in a one-to-one correspondence.
[0168] In an embodiment, the rectifier unit comprises a first diode 801 and a second diode 802, an anode of the first diode 801 is connected with a cathode of the second diode 802, and a common end of the first diode 801 and the second diode 802 is connected with an output end of the first Hall element 3; an anode of the first diode 801 connected with the first Hall element of the first group is connected with a first signal end, and a cathode of the second diode 802 is connected with a second signal end; an anode of the first diode 801 connected with the second Hall element of the first group is connected with a third signal end, and a cathode of the second diode 802 is connected with a fourth signal end.
[0169] In an embodiment, the signal detection device comprises a plurality of extension chips, and the plurality of extension chips are connected with the plurality of first Hall elements 3 one by one.
[0170] The specific implementation of the displacement detection circuit in the embodiment can refer to the method embodiment described above, and will not be repeated here.
[0171] The embodiment of the application provides a processor configured to execute the displacement detection method according to the above-mentioned embodiments.
[0172] The embodiment of the application provides a displacement detection device, which comprises:
[0173] The processor in the above-mentioned embodiments; and the displacement detection circuit in the above-mentioned embodiments.
[0174] Figure 13 A detection device according to an embodiment of the application is schematically shown. As shown in Figure 13 The detection device 1300 provided by the embodiment of the application comprises:
[0175] The acquisition module 1301 is configured to acquire an output signal detected by the signal detection device, the output signal being generated by the magnetic element passing through any one of the plurality of first Hall elements;
[0176] The first determination module 1302 is configured to determine the second Hall element in which the magnetic element is located by using the output signal;
[0177] The second determination module 1303 is configured to determine the first displacement of the magnetic element by using the second Hall element;
[0178] The calculation module 1304 is configured to calculate the second displacement of the piston by using the second Hall element and the first displacement.
[0179] Optionally, the acquisition module 1301 is specifically configured to:
[0180] acquire, by the microcontroller, the level signal detected by at least one extension chip;
[0181] The first determining module 1302 is specifically configured to:
[0182] The first Hall element generating the level signal is determined as the second Hall element by the microcontroller.
[0183] Optionally, the acquisition module 1301 comprises:
[0184] The first acquisition sub-module is configured to acquire a first voltage signal detected by a rectifier unit connected to the first group of Hall elements and a second voltage signal detected by a rectifier unit connected to the second group of Hall elements.
[0185] The first determining module 1302 comprises:
[0186] The first determining sub-module is configured to determine the moving direction of the magnetic element by using the phases of the first voltage signal and the second voltage signal.
[0187] The second determining sub-module is configured to determine the second Hall element in which the magnetic element is located according to the signal transformation state, the number of signal change states and the moving direction of the first voltage signal and the second voltage signal.
[0188] Optionally, the first acquisition sub-module comprises:
[0189] The first determining unit is configured to determine the difference between the first sub-signal value detected by the first signal end and the voltage drop of the first diode as the first signal value, and determine the sum of the second sub-signal value detected by the second signal end and the voltage drop of the second diode as the second signal value.
[0190] The second determining unit is configured to determine the difference between the third sub-signal value detected by the third signal end and the voltage drop of the first diode as the third signal value, and determine the sum of the fourth sub-signal value detected by the fourth signal end and the voltage drop of the second diode as the fourth signal value.
[0191] The third determining unit is configured to determine the difference between the second signal value and the first signal value as the first voltage signal, and determine the difference between the fourth signal value and the third signal value as the second voltage signal.
[0192] Optionally, the first determining sub-module comprises:
[0193] The fourth determining unit is configured to determine that the moving direction of the magnetic element is the piston movement direction in the case that the phase of the first voltage signal is before the phase of the second voltage signal.
[0194] The fifth determining unit is configured to determine that the moving direction of the magnetic element is the opposite direction of the piston movement direction in the case that the phase of the first voltage signal is after the phase of the second voltage signal.
[0195] Optionally, the second determining sub-module comprises:
[0196] The first increment unit is configured to, in the case that the moving direction is the piston movement direction, and each time the signal transition state of the first voltage signal and the second voltage signal is a falling edge, and the number of signal change states is a preset number, increment the current first Hall element serial number by a preset value to obtain the serial number of the second Hall element where the magnetic element is located.
[0197] The second increment unit is configured to, in the case that the moving direction is the opposite direction of the piston movement direction, and each time the signal transition state of the first voltage signal and the second voltage signal is a falling edge, and the number of signal change states is a preset number, decrement the current first Hall element serial number by a preset value to obtain the serial number of the second Hall element where the magnetic element is located.
[0198] Optionally, the calculation module 1204 comprises:
[0199] The first conversion sub-module is configured to convert the fifth signal value of the second Hall element into the third displacement of the magnetic element, the fifth signal value being a voltage value of the magnetic element when passing through the second Hall element.
[0200] The third determining sub-module is configured to determine the sum of the third displacement and the first displacement as the second displacement.
[0201] Optionally, the first determining module 1302 is specifically configured to:
[0202] The microcontroller acquires the interrupt signal detected by any of the plurality of extension chips;
[0203] Optionally, the second determining module 1303 is specifically configured to:
[0204] The microcontroller determines the first Hall element corresponding to the generated interrupt signal as the second Hall element.
[0205] Optionally, the calculation module 1304 further comprises:
[0206] The second acquisition sub-module is configured to acquire the magnetic field intensity of the magnetic element passing through the second Hall element;
[0207] The second conversion sub-module is configured to convert the magnetic field intensity into the fourth displacement;
[0208] The third determining sub-module is configured to determine the sum of the first displacement and the fourth displacement as the second displacement.
[0209] It should be noted that the information interaction, execution process and the like between the above apparatuses / units are based on the same concept as the method embodiments of the present application, and are corresponding apparatuses of the above methods. All implementation manners in the above method embodiments are applicable to the embodiments of the apparatus, and specific functions and brought technical effects can be referred to the method embodiments part, which will not be described here.
[0210] The embodiments of the present application further provide a machine readable storage medium, which has instructions stored thereon, and the instructions are used to cause a machine to execute the above displacement detection method.
[0211] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can adopt a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.
[0212] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems), computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device implemented in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows and / or blocks.
[0213] These computer program instructions can also be stored in a computer readable storage medium that can direct the computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer readable storage medium produce a manufactured product including instruction apparatus, which implements the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows and / or blocks.
[0214] These computer program instructions can also be loaded into a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable data processing device to produce a computer implemented process, so that the instructions executed on the computer or other programmable data processing device provide a process for implementing the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1steps of a function specified in one or more blocks.
[0215] In one typical arrangement, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0216] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the processor can execute instructions. The memory can also include non-volatile memory, such as read only memory (ROM), electrically programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), flash memory, or other memory technologies, about which the processor can execute instructions. The memory can be a memory storage device of any type.
[0217] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically programmable read only memory (EEPROM), flash memory or other memory technologies, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carrier waves.
[0218] It should also be noted that the terms "comprising", "containing", or any other similar term are intended to encompass non-exclusive inclusions such that a process, method, article, or apparatus that comprises a list of elements does not include those elements solely, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0219] The above merely provides an embodiment of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
Claims
1. A displacement detection method characterized by, The application is applied to a displacement detection circuit embedded in an oil cylinder, the displacement detection circuit comprises a signal detection device and a plurality of first Hall elements connected with each other, the plurality of first Hall elements are connected in sequence, each of the plurality of first Hall elements is arranged at intervals along the direction of movement of a piston in the oil cylinder, a magnetic element is arranged on the piston, and the displacement detection method comprises the following steps: obtaining an output signal detected by the signal detection device, the output signal being generated by the magnetic element passing through any one of the plurality of first Hall elements; determining a second Hall element in which the magnetic element is located by using the output signal; determining a first displacement of the magnetic element by using the second Hall element; calculating a second displacement of the piston by using the second Hall element and the first displacement.
2. The displacement detection method according to claim 1, characterized by, The signal detection device comprises at least one extension chip and a microcontroller, one end of the extension chip is connected with the microcontroller, and the other end of the extension chip is connected with the plurality of first Hall elements respectively; and the output signal comprises a level signal. The step of obtaining the output signal detected by the signal detection device comprises the following steps: obtaining the level signal detected by the at least one extension chip by using the microcontroller. The step of determining the second Hall element in which the magnetic element is located by using the output signal comprises the following step: determining the first Hall element generating the level signal as the second Hall element by using the microcontroller.
3. The method of claim 1, wherein, The signal detection device comprises a plurality of rectifier units, the plurality of first Hall elements are divided into a first group and a second group, the Hall elements of the first group and the Hall elements of the second group are arranged alternately along the direction of movement of the piston, and the plurality of rectifier units are connected with the plurality of first Hall elements one by one; and the output signal comprises a first voltage signal and a second voltage signal. The step of obtaining the output signal detected by the signal detection device comprises the following steps: obtaining the first voltage signal detected by the rectifier unit connected with the Hall element of the first group and the second voltage signal detected by the rectifier unit connected with the Hall element of the second group; The step of determining the second Hall element in which the magnetic element is located by using the output signal comprises the following steps: determining the moving direction of the magnetic element by using the phases of the first voltage signal and the second voltage signal; determining the second Hall element in which the magnetic element is located according to the signal transformation state, the number of signal change states and the moving direction of the magnetic element.
4. The method of claim 3, wherein, The rectifier unit comprises a first diode and a second diode, the anode of the first diode is connected with the cathode of the second diode, the common end of the first diode and the second diode is connected with the output end of the first Hall element; the anode of the first diode connected with the Hall element of the first group is connected with a first signal end, and the cathode of the second diode is connected with a second signal end; the anode of the first diode connected with the Hall element of the second group is connected with a third signal end, and the cathode of the second diode is connected with a fourth signal end. The first voltage signal detected by a rectifier unit connected with the first group of Hall elements and the second voltage signal detected by a rectifier unit connected with the second group of Hall elements, comprises: The difference between the first sub-signal value detected by the first signal end and the voltage drop of the first diode is determined as the first signal value, and the sum between the second sub-signal value detected by the second signal end and the voltage drop of the second diode is determined as the second signal value; The difference between the third sub-signal value detected by the third signal end and the voltage drop of the first diode is determined as the third signal value, and the sum between the fourth sub-signal value detected by the fourth signal end and the voltage drop of the second diode is determined as the fourth signal value; The difference between the second signal value and the first signal value is determined as the first voltage signal, and the difference between the fourth signal value and the third signal value is determined as the second voltage signal.
5. The method of claim 3, wherein, The phase of the first voltage signal and the second voltage signal is used to determine the moving direction of the magnetic element, comprising: In the case that the phase of the first voltage signal is before the phase of the second voltage signal, it is determined that the moving direction of the magnetic element is the piston movement direction; In the case that the phase of the first voltage signal is after the phase of the second voltage signal, it is determined that the moving direction of the magnetic element is the opposite direction of the piston movement direction.
6. The method of claim 5, wherein, The second Hall element where the magnetic element is located is determined according to the signal transformation state of the first voltage signal and the second voltage signal, the number of signal change states, and the moving direction, comprising: In the case that the moving direction is the piston movement direction, the signal transformation state of the first voltage signal and the second voltage signal is a falling edge every time it is detected, and the number of signal change states is a preset number, the current first Hall element serial number is increased by a preset value to obtain the serial number of the second Hall element where the magnetic element is located; In the case that the moving direction is the opposite direction of the piston movement direction, the signal transformation state of the first voltage signal and the second voltage signal is a falling edge every time it is detected, and the number of signal change states is a preset number, the current first Hall element serial number is decreased by a preset value to obtain the serial number of the second Hall element where the magnetic element is located.
7. The method of claim 3, wherein, The second displacement of the piston is calculated using the second Hall element and the first displacement, comprising: The fifth signal value of the second Hall element is converted into the third displacement of the magnetic element, and the fifth signal value is the voltage value of the magnetic element when passing through the second Hall element; The sum of the third displacement and the first displacement is determined as the second displacement.
8. The method of claim 1, wherein, The signal detection device comprises a plurality of expansion chips and a microcontroller, one end of each of the plurality of expansion chips is connected with the microcontroller, and the other end is connected with a plurality of first Hall elements; the output signal comprises an interrupt signal; The output signal detected by the signal detection device is obtained, comprising: The interrupt signal detected by any expansion chip in the plurality of expansion chips is obtained by the microcontroller; The second Hall element at which the magnetic element is located is determined by using the output signal, and the second Hall element comprises: The first Hall element corresponding to the generated interrupt signal is determined as the second Hall element by the microcontroller.
9. The method of claim 8, wherein, The second displacement of the piston is calculated by using the second Hall element and the first displacement, and the second displacement comprises: The magnetic field intensity of the magnetic element passing through the second Hall element is acquired; The fourth displacement is converted from the magnetic field intensity; The sum of the first displacement and the fourth displacement is determined as the second displacement.
10. The method of claim 1, wherein, The first displacement of the magnetic element is determined by using the second Hall element, and the first displacement comprises: The first displacement of the magnetic element is determined by using a first formula. The first formula is: Wherein, S is the first displacement, N is the serial number of the second Hall element, and Ki is the interval between the i th first Hall element and the i+1 th first Hall element.
11. A processor, comprising: The displacement detection method according to any one of claims 1 to 10 is configured to be executed.
12. A displacement detection circuit, characterized by comprising: Comprise: The signal detection device and a plurality of first Hall elements are connected to each other, the plurality of first Hall elements are connected in sequence, and each of the plurality of first Hall elements is arranged at intervals in the direction of the movement of the piston in the oil cylinder, and the piston is provided with a magnetic element.
13. The displacement detection circuit of claim 12, wherein, The signal detection device comprises at least one expansion chip and a microcontroller, one end of the expansion chip is connected with the microcontroller, and the other end is connected with the plurality of first Hall elements respectively.
14. The displacement detection circuit of claim 12, wherein, The signal detection device comprises a plurality of rectifier units, the plurality of first Hall elements are divided into a first group and a second group, the Hall elements of the first group and the Hall elements of the second group are arranged alternately in the direction of the movement of the piston, and the plurality of rectifier units are connected with the plurality of first Hall elements one by one.
15. The displacement detection circuit of claim 14, wherein, The rectifier unit comprises a first diode and a second diode, the anode of the first diode is connected with the cathode of the second diode, and the common end of the first diode and the second diode is connected with the output end of the first Hall element; the anode of the first diode connected with the Hall element of the first group is connected with a first signal end, and the cathode of the second diode is connected with a second signal end; the anode of the first diode connected with the Hall element of the second group is connected with a third signal end, and the cathode of the second diode is connected with a fourth signal end.
16. The displacement detection circuit of claim 12, wherein, The signal detection device comprises a plurality of expansion chips and a microcontroller, one end of the plurality of expansion chips is connected with the microcontroller, and the other end is connected with a plurality of first Hall elements.
17. A displacement detection device, characterized by The device comprises: The processor according to claim 11; The displacement detection circuit according to any one of claims 12 to 16.
18. A machine-readable storage medium, characterized in that, The machine readable storage medium stores instructions for causing the machine to execute the displacement detection method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Control method of IPM electromotor for driving electric motor car
CN101567655A
Vector control permanent magnet synchronous servo motor initial magnetic pole position search method
CN105915139A
Combined absolute position Hall encoder detection method
CN116232162A
Electromagnetic displacement measuring circuit
CN210051289U
Hydraulic cylinder displacement detection device based on programmable linear Hall
CN213902232U