Optical magnetic encoder, absolute angle detection method, electrical device and processor
By combining the optomagnetic encoder with Hall sensor and photoelectric sensor, the problems of poor vibration resistance of the optoelectronic encoder and insufficient accuracy of the magnetoelectric encoder are solved, and high-precision absolute angle detection is achieved.
Patent Information
- Application Number
- CN202211288351.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2042-10-20
AI Technical Summary
Existing photoelectric encoders have poor vibration resistance in harsh environments, insufficient resolution and accuracy of magnetoelectric encoders, making it difficult to accurately calculate the absolute angle of the encoder.
The optical magnetic encoder is used, combined with the Hall sensor and the photoelectric sensor, and the pulse signal is output through the photoelectric sensor and the Hall sensor output Hall signal, determine the magnetic pole interval and relative angle of the encoder, and calculate the absolute angle.
It realizes high-precision absolute angle detection in harsh environments, with the advantages of simple structure and high resolution.
Smart Images

Figure CN115628764B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of encoders, and in particular to an optical magnetic encoder, an absolute angle detection method, an electrical device, and a processor. Background Art
[0002] Angular displacement sensors, as key components, are widely used in a wide range of fields, including industrial automation, CNC machine tools, new energy electric vehicles, robotics, and video surveillance. They provide real-time detection and feedback on the system's displacement, velocity, and angle of rotation. For example, in video surveillance applications, stepper motors are currently used via belt drives to drive the camera in open-loop rotation. If the stepper motor loses steps or the belt becomes loose, the camera can deviate from its preset position, resulting in loss of the desired image. Therefore, closed-loop detection at the camera end is essential.
[0003] The two main types of encoders currently used on the market are photoelectric encoders and magnetoelectric encoders. Photoelectric encoders primarily consist of a rotating shaft, code disk, grating, light source, and light receiver. The grating code disk rotates along the rotating shaft, and light emitted by the light source propagates in a straight line. When it encounters the grating slits, it passes through the slits and is received by the light receiver. After processing by the subsequent signal processing circuit, the final output pulse waveform is processed. Its advantages lie in its high accuracy and resolution. Magnetoelectric encoders, on the other hand, consist of magnets and Hall elements. They offer fast response speeds, high temperature resistance, compact size, vibration resistance, and resistance to dust and condensation, making them more suitable for miniaturization and harsh environments.
[0004] During the implementation of the present invention, the inventors discovered that the aforementioned related technologies suffer from at least the following problems: the code disc lines of photoelectric encoders are generally not resistant to oil stains, and the gratings, due to their material properties, particularly glass gratings, have poor vibration resistance, making them difficult to adapt to harsh environments such as dust and oil stains, as well as applications subject to high shock and overload. Magnetoelectric encoders, on the other hand, lack the accuracy and resolution of photoelectric encoders. While the resolution of the encoder can be improved by using a multi-pole magnetoelectric encoder and increasing the number of magnetic pole pairs in the encoder's magnetic ring, it is still difficult to distinguish which of the multiple pole pairs the output angle lies on, making it difficult to calculate the encoder's absolute angle. Summary of the Invention
[0005] Embodiments of the present application provide an optical magnetic encoder, an absolute angle detection method, an electrical device, and a single-chip microcomputer.
[0006] The purpose of the embodiment of the present invention is achieved through the following technical solutions:
[0007] To solve the above technical problems, in the first aspect, an embodiment of the present invention provides an optical magnetic encoder, comprising: a printed circuit board; a ring-shaped multi-pole magnet, wherein an axial bottom surface of the multi-pole magnet is connected to the printed circuit board; a plurality of Hall sensors fixed to the printed circuit board, wherein the plurality of Hall sensors are distributed along a ring shape on the outside of the multi-pole magnet, and the distance between each Hall sensor and the multi-pole magnet is the same; a light shielding plate coaxially arranged with the multi-pole magnet, and the light shielding plate is arranged on the other axial bottom surface of the multi-pole magnet; a plurality of photoelectric sensors fixed to the printed circuit board, wherein the light source part and the detection part of each photoelectric sensor are respectively arranged on both sides of the light shielding plate along the axial direction.
[0008] In some embodiments, the number of the photoelectric sensors and the number of magnetic poles in the multi-pole magnet satisfy the following relationship:
[0009] n≤2 q
[0010] Wherein, n represents the number of magnetic poles of the multi-pole magnet, and q represents the number of the photoelectric sensors.
[0011] In some embodiments, the mechanical angle between any two of the Hall sensors has the following relationship:
[0012]
[0013] Wherein, T represents the mechanical angle between the two Hall sensors, θ1 represents the electrical angle of a pair of magnetic poles, x represents the number of the Hall sensors, m represents the number of magnetic pole pairs with a full period actually spaced between the two Hall sensors, and n represents the number of magnetic pole pairs of the multi-pole magnet.
[0014] In some embodiments, the light shielding plate includes a light-shielding area and a light-transmitting area, and when the light shielding plate rotates relative to the photoelectric sensor, the light-shielding area and / or the light-transmitting area are located between the light source part and the detection part of the photoelectric sensor; wherein, when the light-shielding area is located between the light source part and the detection part of the photoelectric sensor, the photoelectric sensor outputs a first pulse level, and when the light-transmitting area is located between the light source part and the detection part of the photoelectric sensor, the photoelectric sensor outputs a second pulse level, and the first pulse level and the second pulse level are inverted pulse levels.
[0015] In some embodiments, the position interval of each magnetic pole corresponds to a unique coding combination, and the coding combination is composed of the pulse levels of the outputs of the several photoelectric sensors in sequence; wherein, when the coding combination adopts Gray code encoding, the number of the shading area and the light-transmitting area are both one and the shape is semicircular, or, when the coding combination adopts pseudo-random code encoding, the number of the shading area and the light-transmitting area are both at least one and the shape is fan-shaped, wherein, when the number of the shading area and the light-transmitting area are both at least two, the shading area and the light-transmitting area are staggered.
[0016] In some embodiments, when the coding combination adopts pseudo-random coding, and when the number of poles of the multi-pole magnet is 3 pairs, each of the photoelectric sensors is distributed at an interval of 120°, the number of the shading area and the light-transmitting area is one, the central angle of the shading area is 120° and the central angle of the light-transmitting area is 240°, or the central angle of the shading area is 240°
[0017] The central angle of the light-transmitting area is 120°, or, when the number of pole pairs of the multi-pole magnet is 4 pairs, each of the photoelectric sensors is distributed at 90° intervals, the number of the light-shielding area and the light-transmitting area is one, and the central angles of the light-shielding area and the light-transmitting area are both 180°, or, when the number of pole pairs of the multi-pole magnet is 5 pairs, each of the photoelectric sensors is distributed at 72° intervals, the number of the light-shielding area and the light-transmitting area is one, the central angle of the light-shielding area is 144°, and the The central angle of the light-transmitting area is 216°, or the central angle of the light-shielding area is 216° and the central angle of the light-transmitting area is 144°, or, when the number of magnetic poles of the multi-pole magnet is 8 pairs, each of the photoelectric sensors is distributed at an interval of 45°, the number of the light-shielding areas and the light-transmitting areas is two, and the light-shielding areas and the light-transmitting areas are arranged alternately, the central angle of one of the light-shielding areas and the light-transmitting area is 45°, and the central angle of another light-shielding area and the other light-transmitting area is 135°.
[0018] In some embodiments, the optical magnetic encoder further includes: a processor, the processor is fixed to the printed circuit board and electrically connected to the printed circuit board, and each of the Hall sensors and each of the photoelectric sensors are electrically connected to the processor through the printed circuit board.
[0019] In some embodiments, the optical magnetic encoder further includes: a communication interface, which is fixed to the printed circuit board and electrically connected to the processor, and is used to connect to the servo microcontroller.
[0020] To solve the above technical problems, in the second aspect, an electrical device is provided in an embodiment of the present invention, including: the optomagnetic encoder as described in the first aspect; an actuator, the optomagnetic encoder is connected to the actuator; a driving mechanism, the driving mechanism is connected to the actuator; and a servo microcontroller, respectively connected to the driving mechanism and the optomagnetic encoder, and configured to output a control signal to the driving mechanism based on the absolute angle detected and fed back by the optomagnetic encoder.
[0021] In some embodiments, the actuator includes a rotating shaft, a through hole is provided on the printed circuit board, and the rotating shaft is inserted into the through hole.
[0022] To solve the above technical problems, in the third aspect, an embodiment of the present invention provides a method for detecting an absolute angle, which is applied to the opto-magnetic encoder described in the first aspect. The method includes: after the opto-magnetic encoder is powered on, obtaining the pulse signal output by each photoelectric sensor and the Hall signal output by each Hall sensor; and determining the absolute angle of rotation of the opto-magnetic encoder based on the pulse signal and the Hall signal.
[0023] In some embodiments, determining the absolute angle of rotation of the optical magnetic encoder based on the pulse signal and the Hall signal includes: sequentially combining the pulse levels currently output by each photoelectric sensor to obtain a coding combination, and determining the specific interval of the current magnetic pole based on the coding combination; determining the relative angle in the current magnetic pole based on the Hall signal; and calculating the absolute angle at the current moment based on the specific interval and the relative angle.
[0024] In some embodiments, the absolute angle at the current moment is calculated using the following formula:
[0025] θ=65536×N+θ2
[0026] Among them, θ represents the absolute angle at the current moment, N represents the specific interval of the current magnetic pole, and θ2 represents the relative angle.
[0027] In some embodiments, the method further includes: when the optomagnetic encoder is electrically stationary, controlling the photoelectric sensor to perform several detections and obtaining a coding combination for each detection; determining whether there is an abnormal coding combination in the coding combinations obtained from the several detections; and if so, controlling the optomagnetic encoder to rotate a preset angle.
[0028] In some embodiments, the determining whether there is an abnormal coding combination in the coding combinations obtained from several detections includes: determining whether there is an inconsistent coding combination in the several detections; if so, determining that the photoelectric sensor is located at the cutting edge of the shading area and the light-transmitting area of the light-blocking sheet.
[0029] To solve the above technical problems, in the fourth aspect, an embodiment of the present invention further provides a processor, comprising: at least one single-chip microcomputer; and a memory communicatively connected to the at least one single-chip microcomputer; wherein the memory stores instructions that can be executed by the at least one single-chip microcomputer, and the instructions are executed by the at least one single-chip microcomputer so that the at least one single-chip microcomputer can execute the method described in the third aspect above.
[0030] Compared with the prior art, the beneficial effects of the present invention are: different from the prior art, the embodiments of the present invention provide an optical magnetic encoder, an absolute angle detection method, an electrical device and a processor, the optical magnetic encoder includes a printed circuit board, a ring-shaped multi-pole magnet, a plurality of Hall sensors, a light barrier and a plurality of photoelectric sensors, the multi-pole magnet and the light barrier are coaxially arranged, and the printed circuit board and the light barrier are respectively arranged on the two axial bottom surfaces of the multi-pole magnet, the Hall sensor and the photoelectric sensor are fixed on the printed circuit board, the Hall sensor is distributed along the ring on the outside of the multi-pole magnet, and the distance between each Hall sensor and the multi-pole magnet is the same, the light source part and the detection part of the photoelectric sensor are respectively arranged on both sides of the light barrier along the axial direction, the embodiment of the present invention provides an optical magnetic encoder with a simple structure, which can realize the absolute angle detection of the encoder through the pulse signal and Hall signal output by the optical magnetic encoder, and the detection accuracy is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] One or more embodiments are exemplarily described by pictures in the corresponding drawings. These exemplified descriptions do not constitute limitations on the embodiments. Elements / modules and steps with the same reference numerals in the drawings are represented as similar elements / modules and steps. Unless otherwise stated, the figures in the drawings do not constitute a scale limitation.
[0032] FIG1( a ) is a perspective view of an optical magnetic encoder provided in a first embodiment of the present invention;
[0033] FIG1( b ) is a perspective view of the optical magnetic encoder from another perspective provided by the first embodiment of the present invention;
[0034] FIG1( c ) is an exploded view of the optical magnetic encoder shown in FIG1( a );
[0035] FIG1(d) is a top view of the optical magnetic encoder shown in FIG1(a);
[0036] Figure 2 1 is a schematic structural diagram of a multi-pole magnet and a Hall sensor in the optical magnetic sensor;
[0037] FIG3( a ) is a waveform diagram of angle solution when calculating the absolute angle when the optical magnetic encoder has a multi-pole magnet with 6 pairs of poles;
[0038] FIG3( b ) is a waveform diagram of angle solution when calculating the absolute angle when the optical magnetic encoder has a multi-pole magnet with 8 pairs of poles;
[0039] Figure 4(a) is a waveform graph of 6-channel Hall signal;
[0040] FIG4( b ) is a waveform curve diagram of the three-phase Hall signal after the Hall signal pair difference shown in FIG4( a );
[0041] Figure 5 1 is a diagram illustrating several structures of a light-blocking sheet provided in the first embodiment of the present invention;
[0042] FIG6(a) is a schematic diagram showing the structure of the light shield and the relative positional relationship between the light shield and the photoelectric sensor, and the corresponding output coding combination when the pulse level output by the photoelectric sensor adopts Gray code coding as the coding combination;
[0043] FIG6( b ) is a schematic diagram showing a structure of a light shield and the corresponding output coding combination under the relative position relationship between the light shield and the photoelectric sensor when the pulse level output by the photoelectric sensor adopts a pseudo-random code sequence as a coding combination;
[0044] Figure 7 This is a structural block diagram of an electrical device provided by Embodiment 2 of the present invention;
[0045] Figure 8 1 is a flow chart of a method for detecting an absolute angle provided in accordance with a third embodiment of the present invention;
[0046] Figure 9 yes Figure 8 A schematic diagram of a sub-process of step S20 in the detection method shown;
[0047] Figure 10 1 is a flow chart of another absolute angle detection method provided in Embodiment 3 of the present invention;
[0048] Figure 11 1 is a flow chart of another absolute angle detection method provided in the third embodiment of the present invention;
[0049] Figure 12 This is a hardware structure diagram of a processor provided in Example 4 of the present invention. DETAILED DESCRIPTION
[0050] The present invention will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several variations and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.
[0051] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0052] It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other and are all within the scope of protection of this application. In addition, although the functional modules are divided in the device schematic and the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flow chart. In addition, the words "first" and "second" used in this article do not limit the data and execution order, but only distinguish between the same or similar items with basically the same functions and effects.
[0053] Unless otherwise defined, all technical and scientific terms used in this specification have the same meanings as those commonly understood by those skilled in the art to which this invention belongs. The terms used in this specification and in the description of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" as used in this specification includes any and all combinations of one or more of the relevant listed items.
[0054] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0055] In order to solve the problems that current photoelectric encoders are difficult to adapt to harsh environments and that magnetoelectric encoders have low resolution and accuracy, the embodiments of the present invention provide a new type of optical magnetic encoder, an absolute angle detection method, an electrical device, and a processor. The optical magnetic encoder uses the pulse signal output by the photoelectric sensor in combination with the Hall signal output by the Hall sensor to determine the magnetic pole interval where the encoder is located and the relative angle in the magnetic pole, thereby obtaining a more accurate absolute angle. While having the advantage of a simple structure, the optical magnetic encoder also has the advantage of high resolution.
[0056] Specifically, the embodiments of the present invention are further described below with reference to the accompanying drawings.
[0057] Example 1
[0058] An embodiment of the present invention provides an optical magnetic encoder. Please refer to Figures 1(a), 1(b), 1(c), and 1(d). Figure 1(a) shows a stereoscopic view of the optical magnetic encoder provided by the embodiment of the present invention from one perspective, Figure 1(b) shows a stereoscopic view of the optical magnetic encoder provided by the embodiment of the present invention from another perspective, Figure 1(c) shows an exploded view of the optical magnetic encoder shown in Figure 1(a), and Figure 1(d) shows a top view of the optical magnetic encoder shown in Figure 1(a). The optical magnetic encoder 10 includes at least a printed circuit board 11, a multi-pole magnet 12, a Hall sensor 13, a light shield 14, and a photoelectric sensor 15. Furthermore, the optical magnetic encoder 10 may also include a processor 16 and a communication interface 17.
[0059] Described printed circuit board (PCB) 11, is used for integrating each electronic component on described optical magnetic encoder 10, and realizes electrical connection and communication between each electronic component, it should be noted that, in the embodiment of the present invention, only described is provided with two types of electronic components of Hall sensor 13 and photoelectric sensor 15 on printed circuit board 11, described printed circuit board 11 can also be provided with other power devices such as resistor, capacitor. And have, each electronic component can be fixed on described printed circuit board 11 by the mode of welding, be connected according to respective principle. And have, in the example shown in Figure 1, the center of described printed circuit board 11 is provided with through hole 110, described through hole 110 is used for inserting the rotating shaft of actuator, and described printed circuit board 11 is fixed on the rotating shaft of actuator.
[0060] The multi-pole magnet 12 is an annular multi-pole magnet 12, and has two bottom surfaces in the axial direction. One bottom surface in the axial direction of the multi-pole magnet 12 is connected to the printed circuit board 11, and the light shielding sheet 14 is provided on the other bottom surface in the axial direction of the multi-pole magnet 12. In addition, the multi-pole magnet 12 includes a plurality of pairs of magnetic poles, see Figure 2 , which illustrates the structure of the multi-pole magnet 12 and Hall sensor 13 in the optical magnetic sensor shown in Figure 1 of the present invention, wherein adjacent magnetic blocks N and S form a pair of magnetic poles. Furthermore, the multi-pole magnet 12 is fixed to the printed circuit board 11, and the inner side of the multi-pole magnet 12 can be fixed to the base of the actuator.
[0061] In FIG. 1 and FIG. Figure 2In the illustrated example, six pairs of magnetic poles are present. In other embodiments, the multi-pole magnet 12 may have at least two pairs of magnetic poles. The number of pairs of magnetic poles in the multi-pole magnet 12 can be set based on the actual resolution required. FIG3( a ) shows the angle solution waveform when calculating the absolute angle when the magnet has six pairs of magnetic poles, while FIG3( b ) shows the angle solution waveform when calculating the absolute angle when the magnet has eight pairs of magnetic poles. It is readily apparent that increasing the number of pairs of magnetic poles in the multi-pole magnet 12 can increase the resolution of the optical magnetic encoder 10.
[0062] There are a plurality of Hall sensors 13, or Hall elements, fixed to the printed circuit board 11. Specifically, they may be fixed to the printed circuit board 11 via Hall brackets. The Hall sensors 13 are distributed in a circular pattern outside the multi-pole magnet 12. As shown in FIG1(c), each Hall sensor 13 is located at the same distance from the multi-pole magnet 12, so that the magnetic sensing portion of each Hall sensor 13 is located at a radially equidistant point outside the multi-pole magnet 12. The radial direction refers to the diameter of the multi-pole magnet 12. Furthermore, each pair of magnetic poles corresponds to six Hall elements, namely, three pairs of Hall elements for the three phases A, B, and C, namely, A+, A-, B+, B-, C+, and C-. Each phase is a pair of radial elements, namely, A+ and A-, B+ and B-, and C+ and C- form a pole pair, and the electrical angle between two Hall elements of a pole pair is 180°. The electrical angles of the three phases A, B, and C are 120° apart. FIG4( a ) shows the waveform curves of the six Hall effect signals A+, A-, B+, B-, C+, and C-, and the expressions of the six Hall effect signals are as follows:
[0063]
[0064] Furthermore, the two Hall sensors that form a pair of poles can be differentially processed to increase the amplitude of the AD analog signal while removing the high-frequency components in the signal. The waveform curve of the Hall signal is shown in Figure 4(b), and the corresponding three-phase signal expression is as follows:
[0065]
[0066] Furthermore, under the premise that the multi-pole Hall distribution also follows the principle of the single-pole Hall distribution, any two Hall sensors can be placed at any appropriate angle and position as long as the above electrical angle relationship is satisfied. Please refer to Figures 1(c) and Figure 2 , the Hall sensors 13 are distributed at set angles in the circumferential direction of the same virtual circle C, and the mechanical angle between any two Hall sensors 13 has the following relationship:
[0067]
[0068]
[0069] T = L + θ1 × m, m∈[0, n]
[0070] Where T represents the mechanical angle between the two Hall sensors 13, θ1 represents the electrical angle of a pair of magnetic poles, x represents the number of Hall sensors 13, m represents the number of magnetic pole pairs with a full period between the two Hall sensors 13, and n represents the number of magnetic pole pairs of the multi-pole magnet 12. Simplifying the above formula, the mechanical angle between any two Hall sensors 13 has the following relationship:
[0071]
[0072] For example, in the embodiment of the present invention, Figure 2 In the example shown, there are 6 pairs of magnetic poles. Substituting n=6 into the above formula, the electrical angle θ1 of each pair of magnetic poles can be obtained as 60°. Substituting it into the calculation formula of the mechanical angle between any two Hall sensors 13, the result is L=10°. Therefore, in actual design, the interval angle between two Hall sensors can be shown in Table 1 below:
[0073]
[0074] Table 1
[0075] For another example, if there are 8 pairs of magnetic poles, after substituting n=8 into the above formula, the electrical angle θ1 of each pair of magnetic poles can be obtained as 45°. After substituting it into the calculation formula of the mechanical angle between any two Hall sensors 13, L=7.5°. Therefore, in actual design, the interval angle between two Hall sensors can be shown in Table 2 below:
[0076]
[0077]
[0078] Table 2
[0079] The light shield 14 is coaxially arranged with the multi-pole magnet 12. For example, it can be coaxially sleeved on the outside of the rotating shaft of the actuator, so that the light shield 14 and the multi-pole magnet 12 can achieve synchronous rotation. The light shield 14 is fixed on the other axial bottom surface of the multi-pole magnet 12, that is, the light shield 14 and the printed circuit board 11 are respectively arranged on the two axial bottom surfaces of the multi-pole magnet 12. The light shield 14 is used to block the on and off of light during rotation; optionally, the light shield 14 can be fixed to the rotating shaft of the actuator with the multi-pole magnet 12 by gluing, and rotate synchronously with the rotating shaft. In addition, the light shield 14 can also be bonded to the multi-pole magnet 12 as a whole during production and then sleeved on the rotating shaft of the actuator.
[0080] See Figure 5 , which shows several structural examples of the light shielding sheet 14, the light shielding sheet 14 includes a light shielding area 141 and a light transmitting area 142. When the light shielding sheet 14 rotates relative to the photoelectric sensor 15, the light shielding area 141 and / or the light transmitting area 142 are located between the light source part and the detection part of the photoelectric sensor 15. Obviously, Figure 5 As shown, the sector area and radius of the light-transmitting area 142 are smaller than the sector area and radius of the light-shielding area 141. This structural arrangement enables the light-shielding area 141 to block the light emitted by the light source portion of the photosensor 15, while the light-transmitting area 142 does not block the light emitted by the light source portion of the photosensor 15. Since there may be multiple photosensors 15, when there are multiple photosensors 15, the light source portions and detection portions of all photosensors 15 are located between the light-shielding areas 141 of the light-shielding sheet 14; or, the light source portions and detection portions of all photosensors 15 are located between the light-transmitting areas 142 of the light-shielding sheet 14; or, the light source portions and detection portions of some photosensors 15 are located between the light-shielding areas 141 of the light-shielding sheet 14, and the light source portions and detection portions of other photosensors 15 are located between the light-transmitting areas 142 of the light-shielding sheet 14. Specifically, when the light-shielding area 141 is located between the light source and detection sections of the photosensor 15, the photosensor 15 outputs a first pulse level. When the light-transmitting area 142 is located between the light source and detection sections of the photosensor 15, the photosensor 15 outputs a second pulse level. The first pulse level and the second pulse level are inverted pulse levels. That is, if the light-shielding area 141 blocks light, the photosensor 15 outputs a high first pulse level, while the second pulse level is low. Conversely, if the first pulse level is low, the second pulse level is high.
[0081] There are several photoelectric sensors 15 , which are fixed to the printed circuit board 11 and arranged outside the multi-pole magnet 12 . The light source and detection part of each photoelectric sensor 15 are respectively arranged on both sides of the light shielding plate 14 along the axial direction.
[0082] Specifically, the number of the photoelectric sensors 15 and the number of magnetic poles in the multi-pole magnet 12 satisfy the following relationship:
[0083] n≤2 q
[0084] Wherein, n represents the number of magnetic poles of the multi-pole magnet 12 , and q represents the number of the photoelectric sensors 15 .
[0085] Please refer to Figure 6(a) and Figure 6(b) together, wherein Figure 6(a) shows the structure of the light shield when the pulse level output by the photoelectric sensor adopts Gray code coding as the coding combination and the corresponding output coding combination under the relative position relationship with the photoelectric sensor, and Figure 6(b) shows the structure of the light shield when the pulse level output by the photoelectric sensor adopts pseudo-random code coding as the coding combination and the corresponding output coding combination under the relative position relationship with the photoelectric sensor. Figure 6(a) and Figure 6(b) both take three photoelectric sensors as an example, and the dotted lines indicate the positions of the three photoelectric sensors. The photoelectric sensor whose light source is blocked by the blocking area of the light shield 14 outputs a high level 1, and the photoelectric sensor whose light source is not blocked by the blocking area of the light shield 14, that is, the light-transmitting area is located between the light source and the detection part, outputs a low level 0. The coding combination corresponds to the pulse levels output by the photoelectric sensors in the clockwise direction.
[0086] Each magnetic pole position interval corresponds to a unique coding combination, and the coding combination is composed of the pulse levels of the outputs of the plurality of photoelectric sensors in sequence. When the coding combination is encoded using a Gray code, the number of the light-shielding area and the light-transmitting area are both one, and the shape is semicircular. Alternatively, when the coding combination is encoded using a pseudo-random code, the number of the light-shielding area and the light-transmitting area are both at least one, and the shape is fan-shaped. When there are at least two light-shielding areas 141 and at least two light-transmitting areas 142, the at least two light-shielding areas 141 and the at least two light-transmitting areas 142 are arranged in an alternating manner. The pseudo-random code can be one of an m-sequence, an M-sequence, and a truncated sequence.
[0087] For example, when the number of magnetic pole pairs is 2, 4, or 6, the number of coding combinations using Gray code is exactly the same as the number of magnetic pole pairs. One coding combination can correspond to one magnetic pole interval, and only one bit of the two adjacent codes changes. That is, when the number of magnetic pole pairs is 2, the relationship between the number q of the photoelectric sensors 15 and the number n of the magnetic pole pairs in the multi-pole magnet 12 is 2≤2q Calculation shows that at least one photoelectric sensor is required to satisfy the relationship 2≤2 1 , the coding combination of Gray code is 0-1; the two coding combinations correspond to the specific intervals of the two magnetic poles respectively. When the number of magnetic pole pairs is 4, the relationship between the number q of photoelectric sensors 15 and the number n of magnetic pole pairs in the multi-pole magnet 12 is 4≤2 q Calculation shows that at least 2 photoelectric sensors are required to satisfy the relationship 4≤2 2 , the coding combination of Gray code is 00-01-11-10; the four coding combinations correspond to the specific intervals of the four magnetic poles. When the number of magnetic pole pairs is 6, the relationship between the number q of photoelectric sensors 15 and the number n of magnetic pole pairs in the multi-pole magnet 12 is 6≤2 q Calculation shows that at least 3 photoelectric sensors are required to satisfy the relationship 4≤2 3 , the coding combination of Gray code is 100-110-111-011-001-000; the 6 coding combinations correspond to the specific intervals of the 6 magnetic poles, as shown in Figure 6(a).
[0088] For another example, please continue to see Figure 5 When the number of magnetic pole pairs is 3, 4, 5, or 8, a pseudo-random code is used: when the number n of magnetic pole pairs of the multi-pole magnet 12 is 3, the relationship between the number q of the photoelectric sensors 15 and the number n of magnetic pole pairs in the multi-pole magnet 12 is 3≤2 q Calculation shows that at least 2 photoelectric sensors are required to satisfy the relationship 3≤2 2 , and each of the photoelectric sensors 15 is distributed at intervals of 120°. At this time, the number of the light-shielding area 141 and the light-transmitting area 142 is one, and the light-shielding sheet 14 can be cut into two codes of 0 and 1 according to the angles of 120° and 240°, such as Figure 5 As shown, when the number of magnetic pole pairs n = 3, the central angle α1 of the light-shielding area 141 is 120° and the central angle α2 of the light-transmitting area 142 is 240°, or when the central angle α1 of the light-shielding area 141 is 240° and the central angle α2 of the light-transmitting area 142 is 120°, the encoding combination of the pseudo-random code is 01-11-10, and the three encoding combinations correspond to the specific intervals of the three magnetic poles respectively. When the number of magnetic pole pairs n of the multi-pole magnet 12 is 4, the relationship between the number q of the photoelectric sensors 15 and the number n of magnetic pole pairs in the multi-pole magnet 12 is 4≤2 q Calculation shows that at least 2 photoelectric sensors are required to satisfy the relationship 3≤2 2 , and each of the photoelectric sensors 15 is distributed at 90° intervals. At this time, the number of the light-shielding area 141 and the light-transmitting area 142 is one, and the light-shielding sheet 14 can be cut into two codes of 0 and 1 at an angle of 180°, such as Figure 5As shown, when the number of magnetic pole pairs n=4, the central angle α1 of the light-shielding area 141 and the central angle α2 of the light-transmitting area 142 are both 180°, and the encoding combination of the pseudo-random code is 00-01-11-10, and the four encoding combinations correspond to the specific intervals of the four magnetic poles. When the number of magnetic pole pairs n of the multi-pole magnet 12 is 5, the relationship between the number q of the photoelectric sensors 15 and the number n of magnetic pole pairs in the multi-pole magnet 12 is 5≤2 q Calculation shows that at least 3 photoelectric sensors are required to satisfy the relationship 5≤2 3 , and each of the photoelectric sensors 15 is distributed at an interval of 72°. At this time, the number of the light-shielding area 141 and the light-transmitting area 142 is one, and the light-shielding sheet 14 can be cut into two codes of 0 and 1 according to the angles of 144° and 216°, such as Figure 5 As shown, when the number of magnetic pole pairs n = 5, the central angle α1 of the light-shielding area 141 is 144° and the central angle α2 of the light-transmitting area 142 is 216°, or when the central angle α1 of the light-shielding area 141 is 216° and the central angle α2 of the light-transmitting area 142 is 144°, the encoding combination of the pseudo-random code is 001-011-111-110-100, and the five encoding combinations correspond to the specific intervals of the five magnetic poles. When the number of magnetic pole pairs n of the multi-pole magnet 12 is 8, the relationship between the number q of the photoelectric sensors 15 and the number n of magnetic pole pairs in the multi-pole magnet 12 is 8≤2 q Calculation shows that at least 3 photoelectric sensors are required to satisfy the relationship 8≤2 3 , and each of the photoelectric sensors 15 is distributed at 45° intervals. At this time, the number of the light-shielding area 141 and the light-transmitting area 142 are both two, and the light-shielding sheet 14 can be cut into two codes of 0 and 1 according to the angles of 45°, 45°, 135° and 135°, such as Figure 5 As shown, when the number of magnetic pole pairs n=8, the central angle α1 of one of the shading areas 141 and the central angle α2 of one of the light-transmitting areas 142 are 45°, the central angle α1′ of another of the shading areas 141 and the central angle α2′ of another of the light-transmitting areas 142 are 135°, and the coding combination of the pseudo-random code is 001-000-100-010-101-110-111-011. The 8 coding combinations correspond to the specific intervals of the 8 magnetic poles, respectively, as shown in FIG6(b).
[0089] It should be noted that Gray code and pseudo-random code can be used to encode any number of magnetic pole intervals greater than or equal to 2. The number of magnetic pole pairs and the corresponding encoding method used in the above embodiment are not limited to the two. The specific setting can be combined with the design and cutting shape of the actual light shielding sheet 14; the structure of the light shielding sheet 14 is not limited to Figure 5 The structure shown can be designed according to the actual detection accuracy requirements.
[0090] The processor (Microcontroller Unit, MCU) 16 is fixed to the printed circuit board 11 and electrically connected to the printed circuit board 11. Each of the Hall sensors 13 and each of the photoelectric sensors 15 are electrically connected to the processor 16 via the printed circuit board 11. The processor 16 stores a calculation program for processing the detection signals of the photoelectric sensors 15 and the Hall sensors 13, enabling detection and calculation of absolute angles. Each Hall sensor 13 generates a Hall signal, a sine or cosine voltage signal, when the multi-pole magnet 12 rotates. This signal is output to the AD detection port of the processor 16 via an electrical connection. Similarly, when rotating, the photoelectric sensor 15 outputs a pulse signal to the I / O detection port of the processor 16.
[0091] The communication interface 17 is fixed to the printed circuit board 11 and electrically connected to the processor 16. The communication interface 17 can be used to connect to the servo microcontroller. The communication interface 17 can be a communication serial port of various chips. The angle data and other parameters stored in the processor 16 can be read and written through the communication interface 17.
[0092] Example 2
[0093] The embodiment of the present invention provides an electrical device, see Figure 7 , which shows a structural block diagram of an electrical device provided by an embodiment of the present invention. The electrical device 1 includes: an optical magnetic encoder 10, an actuator 20, a driving mechanism 30, and a servo microcontroller 40.
[0094] The optical magnetic encoder 10 is the optical magnetic encoder 10 described in the first embodiment, and can be used to detect the absolute rotation angle of the actuator 20 after power is supplied. The optical magnetic encoder 10 is connected to the actuator 20.
[0095] The actuator 20 is coaxially fixed to the optical magnetic encoder 10, enabling the optical magnetic encoder 10 to detect information such as the absolute angle, rotation speed, and rotation direction of the actuator 20. Specifically, referring to FIG1( b ), the actuator 20 includes a rotating shaft. The printed circuit board 11 is provided with a through hole 110 , and the rotating shaft is inserted into the through hole 110 . Specifically, the printed circuit board 11 is fixed to the rotating shaft at the end of the actuator 20 .
[0096] The driving mechanism 30 is connected to the actuator 20 . The driving mechanism 30 may be a stepping motor or the like. The driving mechanism 30 may drive the actuator 20 through a transmission mechanism, such as a transmission belt.
[0097] The servo microcontroller 40 is connected to the driving mechanism 30 and the optical magnetic encoder 10 respectively, and is configured to output a control signal to the driving mechanism 30 based on the absolute angle detected and fed back by the optical magnetic encoder 10 .
[0098] The servo microcontroller 40 can drive the driving mechanism 30 to rotate, thereby driving the actuator 20 to rotate through the transmission mechanism, and then the optical magnetic encoder 10 coaxially arranged with the rotation axis of the actuator 20 can detect and collect information such as the absolute angle, speed, and rotation direction of the actuator 20, and feed the information back to the servo microcontroller 40, so that the servo microcontroller 40 can adjust the control signal output to the driving mechanism 30 accordingly, such as correcting the control signal according to the deviation between the actual rotation angle and the control amount.
[0099] Taking the electrical device 1 as an example, which is a rotatable surveillance camera, the actuator 20 is the camera body, and the drive mechanism 30 is a stepper motor. After receiving the motion instruction, the servo microcontroller 40 outputs a control signal for controlling the rotation of the camera to the stepper motor (i.e., the drive mechanism 30). The stepper motor (i.e., the drive mechanism 30) rotates according to the control signal and drives the transmission belt mounted on the stepper motor (i.e., the drive mechanism 30) to move, and the transmission belt drives the camera body (i.e., the actuator 20) to rotate. The optical magnetic encoder 10 is arranged at the end of the surveillance camera to detect the direction, speed, absolute angle and other information of the rotation of the surveillance camera, and feeds back the information to the servo microcontroller 40. The servo microcontroller 40 determines whether there is a deviation between the control amount of the camera rotation in the output control signal and the actual rotation angle of the camera body based on the feedback information, and then adjusts the output control signal.
[0100] Example 3
[0101] An absolute angle detection method according to an embodiment of the present invention is applied to the optical magnetic encoder described in Example 1. Figure 8 , which shows the process of an absolute angle detection method provided by an embodiment of the present invention, the method includes but is not limited to the following steps:
[0102] Step S10: After the optical magnetic encoder is powered on, the pulse signal output by each photoelectric sensor and the Hall signal output by each Hall sensor are obtained;
[0103] In an embodiment of the present invention, after the optical magnetic encoder is powered on, the processor obtains the pulse signal output by the photoelectric sensor through the AD interface connected to the photoelectric sensor. At the same time, the processor also obtains the Hall signal output by the Hall sensor through the I / O interface connected to the Hall sensor, and stores the pulse signal and the Hall signal together with the clock signal in a memory or register.
[0104] Step S20: determining the absolute angle of rotation of the optical magnetic encoder according to the pulse signal and the Hall signal.
[0105] Then, based on the pulse signal and the Hall signal, the absolute angle of rotation of the optical magnetic encoder after power-on can be calculated. For details, see Figure 9 , which shows Figure 8 A sub-process of step S20 in the detection method, wherein determining the absolute angle of rotation of the optical magnetic encoder based on the pulse signal and the Hall signal, includes:
[0106] Step S21: sequentially combining the pulse levels currently output by each photoelectric sensor to obtain a coding combination, and determining the specific interval of the current magnetic pole according to the coding combination;
[0107] Step S22: determining the relative angle of the current magnetic pole according to the Hall signal;
[0108] In an embodiment of the present invention, the photoelectric sensor is used to locate the specific interval of the magnetic pole to which the current photoelectric encoder rotates, and the Hall sensor is used to locate the corresponding relative angle within the magnetic pole. For the pulse signals collected by each photoelectric sensor, the pulse levels output by each photoelectric sensor at the current moment can be arranged in sequence to obtain a coding combination, and the specific interval of the magnetic pole corresponding to it can be determined based on the coding combination. That is, after determining the number of magnetic poles passed by the current optical magnetic encoder during rotation, the corresponding magnetic poles are determined. Figure 2 For the Hall signals collected by the Hall sensors, the relative angle corresponding to the Hall signals can be obtained by looking up the standard angle table, that is, the specific position within the magnetic pole can be determined.
[0109] Furthermore, a standard angle table can be pre-established using a high-precision photoelectric encoder. For example, the optical-magnetic encoder described in Example 1 of the present invention can be coaxially mounted with an existing high-precision photoelectric encoder. After power-on rotation, the three-phase Hall signals of the optical-magnetic encoder and the standard angle values of the high-precision photoelectric encoder are sampled at the same time using high-speed acquisition methods. The sampled data is then processed using a corresponding data processing method to obtain a unique corresponding relationship between the two and save it as the standard angle table. Regarding the standard angle table, during the actual operation of the optical-magnetic encoder provided by the embodiment of the present invention, the actually acquired Hall signals can be used as offset addresses to read the corresponding standard angle values, and the read standard angles can be fitted to obtain corrected data to correct and compensate the standard angle table to eliminate the influence of magnetic pole asymmetry errors.
[0110] Step S23: Calculate the absolute angle at the current moment according to the specific interval and the relative angle.
[0111] After obtaining the specific interval and the relative angle, the absolute angle at the current moment can be calculated according to the formula. The calculation formula for the absolute angle at the current moment is as follows:
[0112] θ=65536×N+θ2
[0113] Among them, θ represents the absolute angle at the current moment, N represents the specific interval of the current magnetic pole, and θ2 represents the relative angle.
[0114] Please also see Figure 2 From the example shown, it is not difficult to obtain that if θ1 is used as the first pair of magnetic poles (N=1), then when rotating to the S magnetic block where θ2 is located, the absolute angle is θ=65536×2+θ2.
[0115] In the embodiment of the present invention, if the optical magnetic encoder is powered on and the photoelectric sensor is exactly at the edge of the light shield, the encoder output will have an edge jump, resulting in an incorrect encoder output from the photoelectric sensor and ultimately an error in the calculation of the absolute angle. To identify this situation, please refer to Figure 10 , which shows the process of another absolute angle detection method provided by an embodiment of the present invention, the method further includes:
[0116] Step S31: When the optical magnetic encoder is electrically stationary, controlling the photoelectric sensor to perform several detections and obtaining a coding combination for each detection;
[0117] Step S32: Determine whether there is an abnormal coding combination among the coding combinations obtained through the multiple detections; if so, jump to step S33;
[0118] Specifically, see Figure 11 , which shows the process of another absolute angle detection method provided by an embodiment of the present invention, specifically showing Figure 10 The sub-process of step S32 in the detection method shown, wherein determining whether there is an abnormal coding combination among the coding combinations obtained from the multiple detections includes:
[0119] Step S321: Determine whether there are inconsistent coding combinations in the multiple detections; if so, jump to step S322;
[0120] Step S322: Determine that the photoelectric sensor is located at the cutting edge of the light shielding area and the light transmitting area of the light shielding sheet. In this case, jump to step S33;
[0121] Step S33: controlling the optical magnetic encoder to rotate a preset angle.
[0122] In an embodiment of the present invention, after the optical magnetic encoder is powered on and has not yet begun rotating, it performs several tests to detect whether there are any inconsistent code combinations. If so, it is determined that the photoelectric sensor is exactly located at the edge of the cut light barrier. If not, it is determined that the photoelectric sensor is not located at the edge of the cut light barrier, and the next step of absolute angle detection can be performed. For example, when the optical magnetic encoder is powered on and at rest, the code output of the photoelectric sensor is detected and read 10 times, and the code combination status of each output is stored in a status register. If one or two of the 10 code outputs are inconsistent with the other outputs, it indicates that the code output of the photoelectric sensor has jumped, and it is determined that the photoelectric sensor is exactly located at the edge of the light barrier.
[0123] Furthermore, if an inconsistent coding combination is detected and it is determined that the photoelectric sensor is located at the edge of the cut light barrier, the optical magnetic encoder needs to be rotated by a preset angle so that the photoelectric sensor is no longer located at the edge of the cut light barrier. For example, when an inconsistent coding combination is detected, the photoelectric magnetic encoder is driven by an actuator driven by a servo microcontroller or other host computer to rotate 5° clockwise or counterclockwise. Typically, after the rotation, the photoelectric magnetic encoder is no longer at the edge. To ensure the accuracy of the result, the coding output of the photoelectric sensor after the rotation can be re-tested in step S31. If the output does not jump, it indicates that the photoelectric sensor is no longer located at the edge of its light barrier.
[0124] It should be noted that the number of detections of the photoelectric sensor when powered on and at rest, the number of abnormal coding combinations, and the angle of control of the rotation of the opto-magnetic encoder are all examples. In actual application scenarios, they can be set according to the structure and usage scenarios of the opto-magnetic encoder without being restricted to the limitations of the embodiments of the present invention.
[0125] Example 4
[0126] The present invention also provides a processor. Figure 12 , which shows that it is possible to perform Figures 8 to 11 The hardware structure of the processor for the absolute angle detection method: The processor 16 may be the processor 16 shown in the first embodiment, capable of executing the absolute angle detection method described in the third embodiment, and the processor 16 may further be the servo microcontroller 40 described in the second embodiment.
[0127] The processor 16 includes: at least one single-chip microcomputer (MCU, also known as micro control unit) 16a; and a memory 16a communicatively connected to the at least one single-chip microcomputer 16a. Figure 12 The memory 16a stores instructions that can be executed by the at least one single-chip microcomputer 16a, and the instructions are executed by the at least one single-chip microcomputer 16a so that the at least one single-chip microcomputer 16a can execute the above Figures 8 to 11 The said absolute angle detection method. The said single chip microcomputer 16a and the said memory 16a can be connected by bus or other means, Figure 12 The bus connection is taken as an example.
[0128] Memory 16a, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the absolute angle detection method in the embodiments of the present application. Microcontroller 16a executes the non-volatile software programs, instructions, and modules stored in memory 16a to execute various server functions and data processing, thereby implementing the absolute angle detection method in the aforementioned method embodiment.
[0129] The memory 16a may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function; the data storage area may store data generated based on the use of the absolute angle detection device. Furthermore, the memory 16a may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some embodiments, the memory 16a may optionally include a memory remotely located relative to the microcontroller 16a. These remote memories may be connected to the absolute angle detection device via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0130] The one or more modules are stored in the memory 16a, and when executed by the one or more single chip microcomputers 16a, the absolute angle detection method in any of the above method embodiments is executed, for example, the absolute angle detection method described above is executed. Figures 8 to 11 method steps.
[0131] The above-mentioned product can execute the method provided in the embodiment of this application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of this application.
[0132] The embodiment of the present application further provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which are executed by one or more single-chip microcomputers, for example, to execute the above-described Figures 8 to 11 method steps.
[0133] The present application also provides a computer program product, including a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the absolute angle detection method in any of the above method embodiments, for example, executing the above-described Figures 8 to 11 method steps.
[0134] An embodiment of the present invention provides an optical magnetic encoder, an absolute angle detection method, an electrical device and a processor. The optical magnetic encoder includes a printed circuit board, an annular multi-pole magnet, a plurality of Hall sensors, a light shield and a plurality of photoelectric sensors. The multi-pole magnet and the light shield are coaxially arranged, and a printed circuit board and a light shield are respectively arranged on the two axial bottom surfaces of the multi-pole magnet. The Hall sensor and the photoelectric sensor are fixed on the printed circuit board. The Hall sensor is distributed along a ring on the outside of the multi-pole magnet. The distance between each Hall sensor and the multi-pole magnet is the same. The light source part and the detection part of the photoelectric sensor are respectively arranged on both sides of the light shield along the axial direction. An embodiment of the present invention provides an optical magnetic encoder with a simple structure. The absolute angle detection of the encoder can be realized by the pulse signal and Hall signal output by the optical magnetic encoder, and the detection accuracy is high.
[0135] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0136] Through the description of the above embodiments, it will be clear to those skilled in the art that each embodiment can be implemented by means of software plus a general hardware platform, or of course, by hardware. It will be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Under the concept of the present invention, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present invention as described above. For the sake of simplicity, they are not provided in detail. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An optical magnetic encoder, characterized in that include: printed circuit boards; An annular multi-pole magnet, wherein an axial bottom surface of the multi-pole magnet is connected to the printed circuit board; a plurality of Hall sensors fixed to the printed circuit board, wherein the plurality of Hall sensors are distributed in a ring shape outside the multi-pole magnet, and the distance between each Hall sensor and the multi-pole magnet is the same; A light shield is coaxially arranged with the multi-pole magnet, and the light shield is arranged on the other bottom surface of the multi-pole magnet in the axial direction; A plurality of photoelectric sensors are fixed to the printed circuit board, wherein the light source portion and the detection portion of each photoelectric sensor are respectively arranged on both sides of the light shielding plate along the axial direction; The light shielding plate includes a light-shielding area and a light-transmitting area. When the light shielding plate rotates relative to the photosensor, the light-shielding area and / or the light-transmitting area are located between the light source portion and the detection portion of the photosensor. When the light-shielding area is located between the light source portion and the detection portion of the photosensor, the photosensor outputs a first pulse level. When the light-transmitting area is located between the light source portion and the detection portion of the photosensor, the photosensor outputs a second pulse level. The first pulse level and the second pulse level are pulse levels in opposite phases. The position interval of each magnetic pole in the multi-pole magnet corresponds to a unique coding combination, and the coding combination is composed of the pulse levels output by the plurality of photoelectric sensors in sequence; When the coding combination adopts Gray code encoding, the number of the light-shielding area and the light-transmitting area are both one and the shape is semicircular; or, when the coding combination adopts pseudo-random code encoding, the number of the light-shielding area and the light-transmitting area are both at least one and the shape is sector-shaped; When the number of the light-shielding areas and the number of the light-transmitting areas are both at least two, the light-shielding areas and the light-transmitting areas are arranged alternately.
2. The optical magnetic encoder according to claim 1, wherein: The number of the photoelectric sensors and the number of magnetic poles in the multi-pole magnet satisfy the following relationship: n≤2q Wherein, n represents the number of magnetic poles of the multi-pole magnet, and q represents the number of the photoelectric sensors.
3. The optical magnetic encoder according to claim 1, wherein: The mechanical angle between any two Hall sensors has the following relationship: Wherein, T represents the mechanical angle between the two Hall sensors, θ1 represents the electrical angle of a pair of magnetic poles, x represents the number of the Hall sensors, m represents the number of magnetic pole pairs with a full period actually spaced between the two Hall sensors, and n represents the number of magnetic pole pairs of the multi-pole magnet.
4. The optical magnetic encoder according to claim 1, wherein: When the coding combination adopts pseudo-random coding, and there is, When the number of magnetic pole pairs of the multi-pole magnet is 3, the photoelectric sensors are spaced 120° apart, the number of the light-shielding area and the number of the light-transmitting area are both one, the central angle of the light-shielding area is 120° and the central angle of the light-transmitting area is 240°, or the central angle of the light-shielding area is 240° and the central angle of the light-transmitting area is 120°, or, When the number of magnetic poles of the multi-pole magnet is 4, the photoelectric sensors are spaced 90° apart, the number of the light-shielding area and the number of the light-transmitting area are both one, and the central angles of the light-shielding area and the light-transmitting area are both 180°. or, When the number of magnetic pole pairs of the multi-pole magnet is 5, the photoelectric sensors are spaced 72° apart, the number of the light-shielding area and the number of the light-transmitting area are both one, the central angle of the light-shielding area is 144° and the central angle of the light-transmitting area is 216°, or the central angle of the light-shielding area is 216° and the central angle of the light-transmitting area is 144°, or, When the number of magnetic poles of the multi-pole magnet is 8 pairs, the photoelectric sensors are distributed at 45° intervals, the number of the shading areas and the light-transmitting areas are both two, and the shading areas and the light-transmitting areas are arranged alternately, the central angle between one shading area and one light-transmitting area is 45°, and the central angle between another shading area and another light-transmitting area is 135°.
5. The optical magnetic encoder according to any one of claims 1 to 4, characterized in that: The optical magnetic encoder also includes: A processor is fixed to the printed circuit board and electrically connected to the printed circuit board, and each of the Hall sensors and each of the photoelectric sensors is electrically connected to the processor through the printed circuit board.
6. The optical magnetic encoder according to claim 5, characterized in that The optical magnetic encoder also includes: A communication interface is fixed to the printed circuit board and electrically connected to the processor, and is used to connect to the servo microcontroller.
7. An electrical device, characterized in that: include: The optical magnetic encoder according to any one of claims 1 to 6; An actuator, the optical magnetic encoder is connected to the actuator; a driving mechanism connected to the actuator; The servo single chip microcomputer is connected to the driving mechanism and the optical magnetic encoder respectively, and is configured to output a control signal to the driving mechanism based on the absolute angle detected and fed back by the optical magnetic encoder.
8. The electrical device according to claim 7, characterized in that The actuator includes a rotating shaft. A through hole is provided on the printed circuit board, and the rotating shaft is inserted into the through hole.
9. A method for detecting an absolute angle, characterized in that: Applied to the optical magnetic encoder according to any one of claims 1 to 6, the method comprises: After the optical magnetic encoder is powered on, the pulse signal output by each photoelectric sensor and the Hall signal output by each Hall sensor are obtained; The absolute angle of rotation of the optical magnetic encoder is determined according to the pulse signal and the Hall signal.
10. The absolute angle detection method according to claim 9, characterized in that: Determining the absolute angle of rotation of the optical magnetic encoder according to the pulse signal and the Hall signal includes: Combining the pulse levels currently output by each photoelectric sensor in sequence to obtain a coding combination, and determining the specific interval of the current magnetic pole according to the coding combination; Determine the relative angle of the current magnetic pole according to the Hall signal; The absolute angle at the current moment is calculated according to the specific interval and the relative angle.
11. The absolute angle detection method according to claim 10, characterized in that: The calculation formula for calculating the absolute angle at the current moment is as follows: θ=65536×N+θ2 Among them, θ represents the absolute angle at the current moment, N represents the specific interval of the current magnetic pole, and θ2 represents the relative angle.
12. The absolute angle detection method according to claim 10 or 11, characterized in that: The method further comprises: When the optical magnetic encoder is electrically stationary, controlling the photoelectric sensor to perform several detections and obtaining a coding combination for each detection; Determine whether there is an abnormal coding combination among the coding combinations obtained from several tests; If so, the optical magnetic encoder is controlled to rotate a preset angle.
13. The absolute angle detection method according to claim 12, characterized in that: The determining whether there is an abnormal coding combination among the coding combinations obtained through the multiple detections includes: Determining whether there are inconsistent coding combinations in the plurality of detections; If so, it is determined that the photoelectric sensor is located at a cutting edge between the light shielding area and the light transmitting area of the light shielding sheet.
14. A processor, characterized in that: include: At least one microcontroller; as well as, A memory communicatively connected to the at least one single-chip microcomputer; wherein, The memory stores instructions that can be executed by the at least one single-chip microcomputer, and the instructions are executed by the at least one single-chip microcomputer to enable the at least one single-chip microcomputer to execute the method according to any one of claims 9 to 13.
Citation Information
Patent Citations
High-resolution electromagnetic angle encoder with absolute zero position and preparation method thereof
CN115046572A
A photoelectric encoder and electrical equipment
CN218847244U