Magnetic encoder and angle detection method for a magnetic encoder
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BENGBU SINOMAGS TECH CO LTD
- Filing Date
- 2026-05-22
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]本发明提供了一种磁编码器及磁编码器的角度检测方法,以解决磁编码器可靠性差和难以判断单路检测是否存在偏差的问题
本发明提供的磁编码器,通过采用两路检测路径方式,即第一磁场发生器与第一磁传感器配合实现一路检测,第二磁场发生器与第二磁传感器配合实现另一路检测,可以实现角度检测的冗余备份,避免了单一检测路径路障导致角度检测失效、检测可靠性差的问题,提升了磁编码器的抗故障能力,同时通过第二处理单元集中完成第一角度值和第二角度值的超差判定,能够及时发现磁编码器检测的偏差和故障,确保角度检测的精度。相较于单一磁编码器检测方案,精度可以提升10%以上。
Smart Images

Figure CN122523942A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of magnetic encoder technology, and more specifically to a magnetic encoder and a method for detecting the angle of the magnetic encoder. Background Technology
[0002] A magnetic encoder is a high-precision sensor that measures rotational or linear position, velocity, and acceleration by detecting changes in a magnetic field. Due to its advantages such as strong anti-interference capability, good environmental adaptability (resistant to dust and humidity), fast response speed, and compact structure, magnetic encoders are widely used in angle detection scenarios under harsh working conditions.
[0003] Currently, magnetic encoders mostly use a single path to detect magnetic signals to obtain angle values. However, on the one hand, if the detection element malfunctions, it will directly lead to inaccurate angle detection results or even failure of the magnetic encoder, resulting in poor reliability. On the other hand, it is difficult to determine whether there is a deviation in the results of single-path detection, such as the offset caused by operating errors that cause the disk or detection element to deviate from the expected position. Summary of the Invention
[0004] This invention provides a magnetic encoder and a method for detecting the angle of the magnetic encoder, in order to solve the problems of poor reliability of magnetic encoders and difficulty in determining whether there is a deviation in single-channel detection.
[0005] In a first aspect, the present invention provides a magnetic encoder, comprising: a first magnetic field generator disposed on a motor shaft and rotating with the motor shaft; a first magnetic sensor located above the first magnetic field generator, used to detect the magnetic field generated by the first magnetic field generator and send the detected first magnetic information to a first processing unit; a second magnetic field generator disposed on the motor shaft and rotating with the motor shaft; a second magnetic sensor located above the second magnetic field generator, used to detect the magnetic field generated by the second magnetic field generator and send the detected second magnetic information to a second processing unit; a first processing unit electrically connected to the first magnetic sensor and the second processing unit, used to convert the received first magnetic information into a first angle value and send the first angle value to the second processing unit; the second processing unit is also electrically connected to the second magnetic sensor, used to convert the received second magnetic information into a second angle value, and also used to compare the first angle value and the second angle value, and if the difference between the first angle value and the second angle value is greater than or equal to a preset threshold, then while outputting the first angle value and the second angle value, an abnormality flag is output.
[0006] In one optional embodiment, the second magnetic field generator includes an incremental code track, and the second magnetic sensor includes a first magnetic detection unit; the incremental code track includes a plurality of alternating first magnetic poles and second magnetic poles, adjacent first magnetic poles and second magnetic poles form a pair, and a pair corresponds to a coding area; the first magnetic detection unit is located above the incremental code track and is used to detect the magnetic field generated by the incremental code track and send the obtained first detection information to the second processing unit, wherein the second magnetic information includes the first detection information.
[0007] In one optional implementation, the first magnetic detection unit includes a first magnetic probe and a first rotation probe located above the incremental code track; the first magnetic probe is used to detect the magnetic signal generated by the incremental code track, and the first rotation probe is used to detect the number of rotations of the incremental code track, wherein the first detection information includes the magnetic signal detected by the first magnetic probe and the number of rotations detected by the first rotation probe.
[0008] In one optional embodiment, the number of first magnetic probes is multiple and / or the number of first turn probes is multiple, the multiple first magnetic probes are arranged at intervals along the circumference of the incremental code track, and the multiple first turn probes are arranged at intervals above the incremental code track.
[0009] In one optional embodiment, the second magnetic field generator further includes a pseudo-random binary sequence code track, and the second magnetic sensor further includes a second magnetic detection unit; the pseudo-random binary sequence code track includes multiple magnetic poles arranged according to a pseudo-random binary sequence, and the distance or angle between two adjacent magnetic poles corresponds to the length or angle of the coding region; the second magnetic detection unit is located above the pseudo-random binary sequence code track and is used to detect the magnetic field generated by the pseudo-random binary sequence code track, and send the obtained second detection information to the second processing unit. The second magnetic information includes first detection information and second detection information. The second detection information is used to locate the target coding region from multiple coding regions, and the first detection information is used to locate the position within the target coding region.
[0010] In one alternative implementation, the first magnetic field generator is a magnetic disc, which includes a first magnetic pole and a second magnetic pole disposed opposite to each other.
[0011] In this embodiment, the magnetic disc has only one pair of magnetic poles, which is simple in structure, has a uniform and smooth magnetic field distribution, high linearity in angle detection, and small error.
[0012] In one optional embodiment, the first magnetic sensor includes a second magnetic probe and a second rotation probe located above the magnetic disc; the second magnetic probe is used to detect the magnetic signal generated by the magnetic disc, and the second rotation probe is used to detect the number of rotations of the magnetic disc, wherein the first magnetic information includes the magnetic signal detected by the second magnetic probe and the number of rotations detected by the second rotation probe.
[0013] In one alternative implementation, there are multiple second-turn probes, which are spaced apart circumferentially along the magnetic disc.
[0014] In one alternative implementation, the detection accuracy of the second magnetic sensor is greater than that of the first magnetic sensor.
[0015] In one optional implementation, if the difference between the first angle value and the second angle value is less than a preset threshold, the second processing unit outputs a normal flag and the second angle value.
[0016] In one optional implementation, if the difference between the first angle value and the second angle value is less than a preset threshold, the second processing unit outputs the first angle value and the second angle value while simultaneously outputting a normal flag. The first angle value is used for redundancy verification, and the second angle value is used as a position reference.
[0017] In one optional implementation, both the first processing unit and the second processing unit are SIL2 level microcontroller units, and the first processing unit and the second processing unit are electrically connected through a serial peripheral interface. The second processing unit is connected to a controller or display through a 485 bus.
[0018] In one optional embodiment, the magnetic encoder further includes a first signal amplification module, a first filtering module, a second signal amplification module, and a second filtering module; the first magnetic sensor is electrically connected to the first processing unit after being connected to the first signal amplification module and the first filtering module; the second magnetic sensor is electrically connected to the second processing unit after being connected to the second signal amplification module and the second filtering module.
[0019] Secondly, the present invention provides an angle detection method for a magnetic encoder, applied to a second processing unit in a magnetic encoder according to the first aspect above or any corresponding embodiment thereof. The method includes: receiving a first angle value from a first processing unit and second magnetic information from a second magnetic sensor, wherein the first angle value is determined by the first processing unit based on the first magnetic information detected by the first magnetic sensor; converting the second magnetic information into a second angle value; comparing the first angle value and the second angle value; and if the difference between the first angle value and the second angle value is greater than or equal to a preset threshold, outputting an anomaly flag while outputting the first angle value and the second angle value.
[0020] The magnetic encoder and its angle detection method provided by this invention have the following advantages: The magnetic encoder provided by this invention employs a dual-path detection method: a first magnetic field generator and a first magnetic sensor work together for one detection path, while a second magnetic field generator and a second magnetic sensor work together for the other. This provides redundant backup for angle detection, avoiding the problems of angle detection failure and poor reliability caused by obstacles in a single detection path, thus improving the magnetic encoder's fault resistance. Simultaneously, a second processing unit centrally performs out-of-tolerance judgment on the first and second angle values, enabling timely detection of deviations and faults in the magnetic encoder's detection, ensuring the accuracy of angle detection. Compared to a single magnetic encoder detection scheme, the accuracy can be improved by more than 10%.
[0021] The angle data interaction between two SIL2-level MCUs connected via SPI not only meets industrial safety standards but also simplifies the system structure, avoids the problem of multiple MCUs working together chaotically, reduces hardware costs, and enables independent processing and synchronous verification of dual signals, thereby improving the stability, security, and synchronization of signal processing.
[0022] Meanwhile, by synchronously outputting two angle data channels (normal state) calculated by the MCU via the 485 bus or two data channels plus an anomaly flag (out-of-tolerance state), the dual mode of SPI data transmission and 485 data output is clarified, realizing real-time data transmission and fault tracing, and avoiding the problem of single data transmission and no fault feedback in related technologies of magnetic encoders. Attached Figure Description
[0023] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0024] Figure 1 This is a structural block diagram of a magnetic encoder according to an embodiment of the present invention; Figure 2 This is a partial structural schematic diagram of a magnetic encoder according to an embodiment of the present invention; Figure 3 This is a top view of a partial structure of a magnetic encoder according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of the first magnetic generator and the first magnetic sensor according to an embodiment of the present invention; Figure 5 This is a schematic diagram of another magnetic encoder according to an embodiment of the present invention; Figure 6 This is a flowchart illustrating an angle detection method for a magnetic encoder according to an embodiment of the present invention.
[0025] Reference numerals: 110, First magnetic field generator; 120, First magnetic sensor; 121, Second magnetic probe; 122, Second rotation probe; 130, Second magnetic field generator; 131, Incremental code track; 132, Pseudo-random binary sequence code track; 140, Second magnetic sensor; 141, First magnetic detection unit; 1411, First magnetic probe; 1412, First rotation probe; 142, Second magnetic detection unit; 1421, Third magnetic probe; 150, First processing unit; 160, Second processing unit; 170, Base; 180, First signal amplification module; 190, First filtering module; 200, Second signal amplification module; 210, Second filtering module; 220, Communication transceiver device. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] In the description of this invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0028] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0029] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can also refer to the internal connection of two components; and they can refer to a wireless connection or a wired connection. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0030] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0031] In fields such as industrial automation, precision instruments, and intelligent equipment, angle detection using magnetic encoders is one of the core technologies. Their detection accuracy and stability directly determine the operational accuracy and reliability of the equipment. Compared to traditional photoelectric encoders, magnetic encoders are better suited to the demands of complex industrial environments and are widely used in angle detection scenarios under harsh conditions.
[0032] In practical applications, the magnetic encoder detection method with a single magnetic signal source (i.e., a single detection path) has problems such as poor reliability and difficulty in determining whether there is a deviation in single-path detection, making it difficult to meet the requirements of high-end equipment for angle detection redundancy and reliability.
[0033] This invention provides a magnetic encoder and an angle detection method for the magnetic encoder. By incorporating a dual-channel magnetic signal generator and processing unit, the stability and fault tolerance of angle detection can be improved. The magnetic encoder provided by this invention can be applied to magnetic encoders in fields such as industrial automation, precision instruments, and intelligent equipment, and is particularly suitable for scenarios with high requirements for angle detection accuracy, reliability, and safety levels.
[0034] like Figure 1 As shown, the magnetic encoder provided by the present invention includes a first magnetic field generator 110, a first magnetic sensor 120, a second magnetic field generator 130, a second magnetic sensor 140, a first processing unit 150, and a second processing unit 160.
[0035] Specifically, a first magnetic field generator 110 is mounted on the motor shaft (not shown in the figure) and rotates with the motor shaft. A first magnetic sensor 120 is located above the first magnetic field generator 110 and is used to detect the magnetic field generated by the first magnetic field generator 110, and send the detected first magnetic information to the first processing unit 150. A second magnetic field generator 130 is mounted on the motor shaft and rotates with the motor shaft. A second magnetic sensor 140 is located above the second magnetic field generator 130 and is used to detect the magnetic field generated by the second magnetic field generator 130, and send the detected second magnetic information to the second processing unit 160.
[0036] The first magnetic sensor 120 and the first magnetic field generator 110 are arranged at intervals, with one being movable and the other being fixed, that is, the first magnetic sensor 120 and the first magnetic field generator 110 move relative to each other; similarly, the second magnetic sensor 140 and the second magnetic field generator 130 are arranged at intervals, with one being movable and the other being fixed, that is, the second magnetic sensor 140 and the second magnetic field generator 130 move relative to each other.
[0037] This invention does not specifically limit the structural form of the magnetic field generator and the magnetic sensors (first magnetic sensor 120 and second magnetic sensor 140), as long as the magnetic field generator can generate a magnetic field and the magnetic sensors can detect magnetic information. The magnetic field generator (first magnetic field generator 110 and second magnetic field generator 130) can be a magnetic ring structure. When the magnetic field generator is a magnetic ring structure, the magnetic encoder also includes a base 170 (see...). Figure 2 The base is fixed on the motor shaft, and the magnetic ring structure is fixed on the base.
[0038] The first processing unit 150 is electrically connected to the first magnetic sensor 120, the second processing unit 160 is electrically connected to the second magnetic sensor 140, the first processing unit 150 and the second processing unit 160 are electrically connected, and the second processing unit is also electrically connected to external devices (such as controllers, displays, etc.).
[0039] The first processing unit 150 is used to convert the received first magnetic information into a first angle value and send the first angle value to the second processing unit 160; the second processing unit 160 is used to convert the received second magnetic information into a second angle value, and is also used to compare the first angle value and the second angle value. If the difference between the first angle value and the second angle value is greater than or equal to a preset threshold, an abnormality flag is output while outputting the first angle value and the second angle value to an external device; if the difference between the first angle value and the second angle value is less than the preset threshold, a normality flag is output while outputting the first angle value and the second angle value to an external device.
[0040] The first processing unit 150 converts the first magnetic information into an angle calculation algorithm for a first angle value. This algorithm can be designed with reference to relevant technologies or according to actual conditions. The second processing unit 160 converts the second magnetic information into an angle calculation algorithm for a second angle value. This algorithm can also be designed with reference to relevant technologies or according to actual conditions. For example, the angle calculation algorithm can be a magnetic signal phase analysis algorithm or other algorithms.
[0041] Anomaly indicators are used to suggest abnormalities in the angle detection of the magnetic encoder, facilitating timely troubleshooting by staff (such as magnetic sensor or magnetic field generator position misalignment, magnetic sensor malfunction, processing unit malfunction, etc.). The preset threshold is a pre-defined maximum allowable angle deviation, which can be determined based on factors such as the magnetic sensor's accuracy deviation, installation deviation, and temperature drift.
[0042] When the encoder leaves the factory, the first angle value and the second angle value are set to have a phase difference. The preset threshold is ±Maximum error angle, It can be any value; the maximum error angle can be 0 or any value greater than 0. The specific value is set according to actual needs. For example, The angle can be 90°. The waveforms of the first angle value and the second angle value have a 90° phase difference, which makes it easier to compare and judge. At this time, the preset threshold can be 90°±2°.
[0043] The magnetic encoder provided in this embodiment adopts a two-path detection method, namely, the first magnetic field generator 110 and the first magnetic sensor 120 cooperate to achieve one path detection, and the second magnetic field generator 130 and the second magnetic sensor 140 cooperate to achieve the other path detection. This can achieve redundant backup for angle detection, avoid the problem of angle detection failure and poor detection reliability caused by roadblocks in a single detection path, and improve the fault resistance of the magnetic encoder. At the same time, the second processing unit 160 centrally completes the out-of-tolerance judgment of the first angle value and the second angle value, which can promptly detect the deviation and fault of the magnetic encoder detection and ensure the accuracy of angle detection.
[0044] Optionally, the detection accuracy of the second magnetic sensor is greater than that of the first magnetic sensor.
[0045] Furthermore, if the difference between the first angle value and the second angle value is less than a preset threshold, the second processing unit can output only the second angle value as the final detection result while outputting a normal indicator. The normal indicator is used to indicate that the angle detection of the magnetic encoder is normal and can be used normally.
[0046] In some embodiments, if the difference between the first angle value and the second angle value is less than a preset threshold, the second processing unit may also output the first angle value and the second angle value at the same time as outputting the normal identifier. In this case, the first angle value is used for redundancy verification, and the second angle value is used as a position reference for subsequent calculations.
[0047] In this embodiment, the second angle value obtained by the second magnetic sensor with higher accuracy is used as the position reference, and the first angle value obtained by the first magnetic sensor with lower accuracy is used as the redundancy check. This not only provides a reasonable basis for dual-path angle consistency judgment and fault detection, but also reduces costs.
[0048] In some alternative implementations, the second magnetic field generator 130 may include an incremental code track 131, and the second magnetic sensor 140 may include a first magnetic detection unit 141.
[0049] See Figure 2 and Figure 3 The incremental code channel 131 includes multiple alternating first magnetic poles and second magnetic poles. Adjacent first magnetic poles and second magnetic poles form a pair of poles, and a pair of poles corresponds to a coding area. The first magnetic detection unit 141 is disposed above the incremental code channel 131 and is used to detect the magnetic field generated by the incremental code channel 131 and send the obtained first detection information to the second processing unit 160. The second magnetic information includes the first detection information.
[0050] The first and second magnetic poles have different magnetic properties. The first magnetic pole can be an N pole (N for short), in which case the second magnetic pole can be an S pole (S for short); alternatively, the first magnetic pole can be an S pole, in which case the second magnetic pole is an N pole. The two types of magnetic poles are of the same size and are arranged alternately along the relative movement direction, which refers to the direction of movement between the second magnetic field generator and the second magnetic sensor. When the incremental code track 131 includes N N poles and N S poles, an adjacent N pole and an S pole form a pole pair, ultimately forming N pole pairs. These N pole pairs correspond to N regions on the incremental code track, or in other words, the N pole pairs divide the incremental code track into N regions, each of which can also be called a coding region. Figure 2 As shown, the incremental code channel uses a magnetic ring structure, and the angle corresponding to one of its coding regions is 360° / N.
[0051] In other alternative implementations, such as Figure 2 and Figure 3The second magnetic field generator 130 includes not only the incremental code channel 131, but also the pseudo-random binary sequence (PRBS) code channel 132. The second magnetic sensor 140 includes not only the first magnetic detection unit 141, but also the second magnetic detection unit 142, which can further improve the detection accuracy.
[0052] Specifically, the pseudo-random binary sequence code track 132 includes multiple magnetic poles arranged according to a pseudo-random binary sequence, and the distance or angle between two adjacent magnetic poles corresponds to the length or angle of the coding region. A second magnetic detection unit 142 is disposed above the pseudo-random binary sequence code track 132 and is used to detect the magnetic field generated by the pseudo-random binary sequence code track 132, and send the obtained second detection information to the second processing unit 160. The second magnetic information includes first detection information and second detection information. The second detection information is used to locate the target coding region from multiple coding regions, and the first detection information is used to locate the position within the target coding region.
[0053] It should be noted that the incremental code channel is divided into N regions by N pole pairs. The PRBS code channel references the division of the incremental code channel to perform binary encoding on its own code channel. The PRBS code channel is encoded as a coding sequence composed of N binary numbers. The area covered by each binary number is called the coding region. The PRBS code channel has a total of N coding regions, which correspond one-to-one with the regions of the incremental code channel. In this coding sequence composed of binary numbers, the N pole can correspond to the binary number "1", and the S pole can correspond to the binary number "0". Therefore, the first and second magnetic poles are arranged according to the pseudo-random binary sequence obtained from the encoding result.
[0054] Both the incremental code track and the PRBS code track can be magnetic ring structures. When using a magnetic ring structure, the incremental code track 131 can be fixed to the outer periphery of the base 170, and the pseudo-random binary sequence code track 132 can be fixed to the inner periphery of the base 170; alternatively, the pseudo-random binary sequence code track 132 can be fixed to the outer periphery of the base 170, in which case the incremental code track 131 can be fixed to the inner periphery of the base 170. The two code tracks can be spaced a certain distance apart or placed adjacent to each other, forming a structure like... Figure 2 and Figure 3 The double magnetic ring structure shown.
[0055] Multiple coding regions are divided within the incremental code channel. The PRBS code channel is divided with reference to the regions of the incremental code channel, facilitating region positioning. During positioning, the magnetic field signals sensed by the second magnetic sensor (first magnetic detection unit 141 and second magnetic detection unit 142) are analyzed and determined. The information detected by the second magnetic detection unit 142 is used to determine which coding region it belongs to, and the information detected by the first magnetic detection unit 141 is used to determine which point within the current coding region (the specific location of the target coding region). Specific processing methods can be found in relevant technologies and will not be elaborated upon here.
[0056] Furthermore, such as Figure 2 and Figure 3 As shown, the first magnetic detection unit 141 includes a first magnetic probe 1411 and a first rotation count probe 1412 located above the incremental code track 131. The first magnetic probe 1411 is used to detect the magnetic signal generated by the incremental code track, and the first rotation count probe 1412 is used to detect the number of rotations of the incremental code track. The first detection information includes the magnetic signal and the number of rotations. The second magnetic detection unit 142 may include at least one third magnetic probe 1421 disposed above the PRBS code track. The second detection information includes the magnetic signal.
[0057] The present invention does not limit the number of the first magnetic probe 1411, the first turn-counting probe 1412, and the third magnetic probe 1421; they can be set according to actual needs, and there can be one or more. When there are multiple first magnetic probes 1411, the multiple first magnetic probes 1411 are arranged at intervals along the circumference of the incremental code track 131. When there are multiple first turn-counting probes 1412, the multiple first turn-counting probes 1412 are arranged at intervals above the incremental code track 131. When there are multiple third magnetic probes 1421, the multiple third magnetic probes 1421 are arranged at intervals along the circumference of the PRBS code track.
[0058] Furthermore, such as Figure 2 As shown, the first magnetic field generator 110 is a magnetic disc, which includes a first magnetic pole and a second magnetic pole arranged opposite each other. The first magnetic pole can be an N magnetic pole (abbreviated as N pole), in which case the second magnetic pole can be an S magnetic pole (abbreviated as S pole); the first magnetic pole can also be an S pole, in which case the second magnetic pole is an N pole. The magnetic disc has only one pair of magnetic poles, has a simple structure, a uniform and smooth magnetic field distribution, high linearity in angle detection, and small error.
[0059] Specifically, such as Figure 4 As shown, the first magnetic sensor 120 includes a second magnetic probe 121 and a second rotation probe 122 located above the magnetic disc. The second magnetic probe 121 is used to detect the magnetic signal generated by the magnetic disc, and the second rotation probe 122 is used to detect the number of rotations of the magnetic disc.
[0060] The present invention does not limit the number of the second magnetic probe 121 and the second turn probe 122, and can set one or more according to actual needs. When there are multiple second turn probes 122, the multiple second turn probes 122 are arranged at intervals along the circumference of the magnetic disc. When there are multiple second magnetic probes 121, the multiple second magnetic probes 121 are arranged at intervals above the magnetic disc.
[0061] The magnetic probes (first magnetic probe, second magnetic probe, and third magnetic probe) and the number of turns probes (first number of turns probe and second number of turns probe) use magnetic induction elements. The magnetic induction elements can be tunnel magnetoresistance (TMR) elements, giant magnetoresistance (GMR) elements, anisotropic magnetoresistance (AMR) elements, or Hall elements. The magnetic probes and number of turns probes can be selected according to actual needs.
[0062] TMR elements are characterized by high sensitivity, high detection accuracy, low power consumption, and small size. They can accurately capture weak magnetic field signals and can be used to form a high-precision magnetic encoder detection structure, further improving the accuracy of angle detection.
[0063] In some alternative implementations, both the first processing unit 150 and the second processing unit 160 are SIL2 level microcontroller units (MCUs). The first processing unit and the second processing unit are electrically connected via a Serial Peripheral Interface (SPI), and the second processing unit is connected to a controller or display via a 485 bus.
[0064] In this embodiment, two SIL2-level MCUs (MCU_A and MCU_B) connected via SPI achieve angle data interaction, which not only meets industrial safety standards but also simplifies the system structure, avoids the problem of multiple MCUs working together in a chaotic manner, and enables independent processing and synchronous verification of dual signals, thereby improving the stability, security, and synchronization of signal processing.
[0065] Meanwhile, by synchronously outputting two angle data channels calculated by MCU_A and MCU_B (normal state) or two data channels plus an anomaly flag (out-of-tolerance state) via the 485 bus, the dual mode of SPI data transmission and 485 data output is clarified, realizing real-time data transmission and fault tracing, and avoiding the problem of single data transmission and no fault feedback in magnetic encoders in related technologies.
[0066] In some alternative implementations, such as Figure 5As shown, the magnetic encoder also includes a first signal amplification module 180, a first filtering module 190, a second signal amplification module 200, and a second filtering module 210.
[0067] The first magnetic sensor 120 is connected to the first signal amplification module 180 and the first filter module 190, and then electrically connected to the first processing unit 150; the second magnetic sensor 140 is connected to the second signal amplification module 200 and the second filter module 210, and then electrically connected to the second processing unit 160.
[0068] Specifically, one end of the first signal amplification module 180 is connected to the first magnetic sensor 120, and the other end is connected to one end of the first filtering module 190. The other end of the first filtering module 190 is connected to the first processing unit 150. The first signal amplification module amplifies the first magnetic information received from the first magnetic sensor and outputs the amplified first magnetic information to the first filtering module 190. The first filtering module 190 filters out noise from the amplified first magnetic information. One end of the second signal amplification module 200 is connected to the second magnetic sensor 140, and the other end is connected to one end of the second filtering module 210. The other end of the second filtering module 210 is connected to the second processing unit 160. The second signal amplification module 200 amplifies the second magnetic information received from the second magnetic sensor and outputs the amplified second magnetic information to the second filtering module 210. The second filtering module 210 filters out noise from the amplified second magnetic information.
[0069] Furthermore, such as Figure 5 As shown, the magnetic encoder also includes a communication transceiver 220, and the second processing unit is connected to an external device (controller or display) via a 485 bus and the communication transceiver 220.
[0070] It should be noted that the magnetic encoder provided by the present invention also includes a power supply module, a shielding shell, and a base. The power supply module is used to stably supply power to the first processing unit, the second processing unit, the first magnetic sensor, the second magnetic sensor, and the 485 bus module. The shielding shell is used to reduce external electromagnetic interference, protect the magnetic sensor and the processing unit, and avoid interfering with the signal acquisition and angle calculation of the magnetic encoder. The base is used to fix the first magnetic field generator (magnetic disc), the second magnetic field generator (code strip), and the dual magnetic sensors, ensuring that the relative positions of the magnetic sensors, the code strip, and the magnetic disc are stable, and avoiding the impact of positional offset on the detection accuracy of the magnetic encoder.
[0071] The following describes in detail the working process of the magnetic encoder provided by the present invention, taking the first processing unit as MCU_A, the second processing unit as MCU_B, the first magnetic field generator as a magnetic disc, and the second magnetic field generator as a code strip (incremental code track and PRBS code track).
[0072] S1. Initialization: After the magnetic encoder is powered on, the two SIL2 level MCUs (MCU_A, MCU_B), dual magnetic sensors (first magnetic sensor (magnetic sensor 1), second magnetic sensor (magnetic sensor 2)) and 485 bus module are initialized. The preset magnetic encoder angle calculation algorithm, the two-way angle over-tolerance judgment threshold (such as 90±2°), SPI transmission parameters (baud rate, data bits, stop bits, etc.) and 485 transmission parameters are configured in the MCU.
[0073] S2. Signal Acquisition: Magnetic sensor 1 acquires the magnetic signal (magnetic information) of the magnetic disc in real time, converts the acquired analog magnetic signal into a digital signal, and transmits it to MCU_A; Magnetic sensor 2 acquires the magnetic signal of the code tape in real time, converts the acquired analog magnetic signal into a digital signal, and transmits it to MCU_B.
[0074] S3, Angle Calculation: MCU_A receives the magnetic signal from magnetic sensor 1 and converts the magnetic signal into a corresponding angle value (denoted as ) using a preset first magnetic encoder angle calculation algorithm. ); MCU_B receives the magnetic signal from magnetic sensor 2, and converts the magnetic signal into a corresponding angle value (denoted as ) using a preset second magnetic encoder angle calculation algorithm. ).
[0075] S4. Data Transmission and Tolerance Detection: MCU_A transmits its calculated angle value via SPI. Real-time transmission to MCU_B; MCU_B receives angle values. Then, compare it with the angle value calculated for itself. Compare the two angle values to determine if they exceed the tolerance limit (i.e., determine...). Whether it exceeds the range of 90±2° (the out-of-tolerance threshold can be finely adjusted as needed), complete the cross-validation and out-of-tolerance judgment of the dual-path angle.
[0076] S5. Data Output: MCU_B transmits the angle value calculated by MCU_A via the 485 bus. , self-calculated angle value Synchronous output to external devices; if the angle values of the two paths are determined to be too far out of tolerance, MCU_B will output... , At the same time, an anomaly indicator is attached to remind staff to troubleshoot the problem (such as magnetic sensor position misalignment, magnetic sensor failure, MCU failure, SPI transmission anomaly, etc.).
[0077] For example, if the out-of-tolerance is too large, the encoder state SF=01; if If the value is less than the preset threshold, the encoder status SF=00; MCU_B sends a response message through the 485 bus. The message information includes the encoder status byte (1 byte), the angle detected by magnetic sensor 2 (3 bytes), the number of encoder revolutions (2 bytes), the angle detected by magnetic sensor 1 (2 bytes), and the CRC check byte (1 byte).
[0078] The present invention also provides an angle detection method for a magnetic encoder, which can be used in the second processing unit of any of the above embodiments. Figure 6 This is a flowchart illustrating an angle detection method for a magnetic encoder according to an embodiment of the present invention, as shown below. Figure 6 As shown, the process includes the following steps: Step S601: Receive a first angle value from the first processing unit and second magnetic information from the second magnetic sensor.
[0079] The first angle value is determined by the first processing unit based on the first magnetic information detected by the first magnetic sensor.
[0080] Step S602: Convert the second magnetic information into a second angle value.
[0081] Specifically, the second processing unit can convert the second magnetic information into a second angle value using a preset magnetic encoder angle calculation algorithm (such as a magnetic signal phase analysis algorithm).
[0082] Step S603: Compare the first angle value and the second angle value.
[0083] Specifically, the first angle value is denoted as The second angle value is denoted as Comparing the first angle value and the second angle value is used to determine Does it exceed the preset threshold? The preset threshold is the maximum allowable angle deviation set in advance. The preset threshold can be determined based on factors such as the accuracy deviation of the magnetic sensor, installation deviation, and temperature drift.
[0084] Step S604: If the difference between the first angle value and the second angle value is greater than or equal to a preset threshold, an anomaly flag is output at the same time as the first angle value and the second angle value are output.
[0085] The anomaly indicator is used to indicate an anomaly in the angle detection of the magnetic encoder, facilitating timely troubleshooting by staff (such as magnetic sensor position misalignment, magnetic sensor malfunction, or first processing unit failure). If the difference between the first angle value and the second angle value is less than a preset threshold, a normal indicator is output simultaneously with the first and second angle values, indicating that the angle detection of the magnetic encoder is normal.
[0086] The angle detection method for magnetic encoders provided in this embodiment outputs the angle value only after the second processing unit has completed the out-of-tolerance judgment of the first and second angle values. This can promptly detect deviations and faults in the detection of a single-channel magnetic encoder and ensure the accuracy of angle detection.
[0087] The magnetic encoder and its angle detection method provided by this invention have the following advantages, which can improve the performance and practicality of the magnetic encoder angle detection system: (1) Significantly improved reliability: The dual-redundancy design of two sets of magnetic field generators, magnetic sensors and processing units (SIL2 MCU) enables the two detection paths to work independently. MCU_A and MCU_B communicate with each other via SPI. Even if one of the probes or MCUs fails, the other path can continue to work (MCU_B can detect abnormalities and output fault prompts), avoiding overall system failure, reducing the risk of equipment downtime, and adapting to the needs of high-reliability industrial scenarios.
[0088] (2) Higher detection accuracy: The dual-channel design has the advantages of high sensitivity and high accuracy. Combined with the out-of-tolerance judgment mechanism of MCU_B, it can promptly detect the small deviations of single-channel magnetic encoder detection, eliminate the influence of fault factors on detection accuracy, and ensure the accuracy of angle detection. Compared with the single magnetic encoder detection scheme, the accuracy is improved by more than 10% (the specific improvement can be further improved according to the probe model and algorithm optimization).
[0089] (3) Meets safety compliance requirements: Both MCUs are SIL2 level, which meets industrial safety standards and can be applied to scenarios with clear safety requirements (such as rail transit and industrial automation control), avoiding the problem of insufficient safety level of magnetic encoders in related technologies and reducing safety hazards.
[0090] (4) The system structure is simplified and has good coordination: Only two MCUs are set up, with clear division of labor and efficient data transmission through SPI, which avoids the problem of multiple MCUs coordinating chaotically, simplifies the system structure, reduces hardware costs, and improves the synchronization and coordination of dual signals.
[0091] (5) Improved maintenance convenience: MCU_B synchronously outputs two angle data channels of MCU_A and MCU_B and an abnormality indicator. When an abnormality is detected, the staff can quickly trace the source of the fault through the output data (whether it is a magnetic sensor, MCU, SPI transmission or 485 bus transmission abnormality) without disassembling the equipment for a comprehensive inspection, which greatly improves maintenance efficiency and reduces maintenance costs.
[0092] (6) Strong environmental adaptability: The magneto-electric encoder (with magnetic sensor) has the advantages of resisting dust, moisture and electromagnetic interference. With the shielded shell design, it can adapt to harsh industrial environments. Compared with photoelectric encoder solutions, it has stronger environmental adaptability and a wider range of applications.
[0093] (7) Good expandability: MCU_B can reserve an interface to facilitate the addition of data storage, remote monitoring and other functions in the future; the 485 bus has the characteristics of long transmission distance and strong anti-interference ability, and can be adapted to external devices with different distances. The SPI interface has a fast transmission rate, which facilitates the subsequent optimization of data transmission efficiency and meets the application needs of different scenarios.
[0094] While exemplary embodiments and their advantages have been described in detail, those skilled in the art can make various changes, substitutions, and modifications to these embodiments without departing from the spirit of the invention and the scope of protection defined by the appended claims. Such modifications and variations all fall within the scope defined by the appended claims. For other examples, those skilled in the art should readily understand that the order of process steps can be changed while remaining within the scope of the invention.
[0095] Furthermore, the scope of this invention is not limited to the processes, mechanisms, manufacturing methods, material compositions, means, methods, and steps of the specific embodiments described in the specification. From the disclosure of this invention, those skilled in the art will readily understand that any existing or future processes, mechanisms, manufacturing methods, material compositions, means, methods, or steps that perform substantially the same function or obtain substantially the same results as the corresponding embodiments described in this invention can be applied according to this invention. Therefore, the appended claims are intended to include these processes, mechanisms, manufacturing methods, material compositions, means, methods, or steps within their scope of protection.
Claims
1. A magnetic encoder, characterized in that, include: The first magnetic field generator is mounted on the motor shaft and rotates with the motor shaft; A first magnetic sensor is located above the first magnetic field generator and is used to detect the magnetic field generated by the first magnetic field generator and send the detected first magnetic information to the first processing unit. A second magnetic field generator is mounted on the motor shaft and rotates with the motor shaft; The second magnetic sensor is located above the second magnetic field generator and is used to detect the magnetic field generated by the second magnetic field generator and send the detected second magnetic information to the second processing unit. The first processing unit is electrically connected to the first magnetic sensor and the second processing unit, and is used to convert the received first magnetic information into a first angle value and send the first angle value to the second processing unit; The second processing unit is also electrically connected to the second magnetic sensor and is used to convert the received second magnetic information into a second angle value. It is also used to compare the first angle value and the second angle value. If the difference between the first angle value and the second angle value is greater than or equal to a preset threshold, an abnormality flag is output at the same time as the first angle value and the second angle value are output.
2. The magnetic encoder according to claim 1, characterized in that, The second magnetic field generator includes an incremental code track, and the second magnetic sensor includes a first magnetic detection unit; The incremental code track includes multiple alternating first magnetic poles and second magnetic poles, with adjacent first magnetic poles and second magnetic poles forming a pole pair, and a pole pair corresponding to a coding region. The first magnetic detection unit is located above the incremental code track and is used to detect the magnetic field generated by the incremental code track and send the obtained first detection information to the second processing unit, wherein the second magnetic information includes the first detection information.
3. The magnetic encoder according to claim 2, characterized in that, The first magnetic detection unit includes a first magnetic probe and a first rotation probe located above the incremental code track; The first magnetic probe is used to detect the magnetic signal generated by the incremental code track, and the first rotation probe is used to detect the number of rotations of the incremental code track. The first detection information includes the magnetic signal detected by the first magnetic probe and the number of rotations detected by the first rotation probe.
4. The magnetic encoder according to claim 3, characterized in that, The number of the first magnetic probes is multiple and / or the number of the first number of turns probes is multiple, the multiple first magnetic probes are arranged at circumferential intervals along the incremental code track, and the multiple first number of turns probes are arranged at intervals above the incremental code track.
5. The magnetic encoder according to claim 2, characterized in that, The second magnetic field generator further includes a pseudo-random binary sequence code track, and the second magnetic sensor further includes a second magnetic detection unit; The pseudo-random binary sequence code track includes multiple magnetic poles arranged according to a pseudo-random binary sequence, and the distance or angle between two adjacent magnetic poles corresponds to the length or angle of the coding region. The second magnetic detection unit is located above the pseudo-random binary sequence code track and is used to detect the magnetic field generated by the pseudo-random binary sequence code track and send the obtained second detection information to the second processing unit. The second magnetic information includes the first detection information and the second detection information. The second detection information is used to locate the target coding region from the multiple coding regions, and the first detection information is used to locate the position within the target coding region.
6. The magnetic encoder according to any one of claims 1 to 5, characterized in that, The first magnetic field generator is a magnetic disc, which includes a first magnetic pole and a second magnetic pole arranged opposite to each other.
7. The magnetic encoder according to claim 6, characterized in that, The first magnetic sensor includes a second magnetic probe and a second turn probe located above the magnetic disc; The second magnetic probe is used to detect the magnetic signal generated by the magnetic disc, and the second rotation probe is used to detect the number of rotations of the magnetic disc. The first magnetic information includes the magnetic signal detected by the second magnetic probe and the number of rotations detected by the second rotation probe.
8. The magnetic encoder according to claim 7, characterized in that, The number of second-turn probes is multiple, and the multiple second-turn probes are arranged at intervals along the circumference of the magnetic disc.
9. The magnetic encoder according to any one of claims 1 to 5, characterized in that, The detection accuracy of the second magnetic sensor is greater than that of the first magnetic sensor.
10. The magnetic encoder according to claim 9, characterized in that, If the difference between the first angle value and the second angle value is less than the preset threshold, the second processing unit outputs a normal flag and the second angle value.
11. The magnetic encoder according to claim 9, characterized in that, If the difference between the first angle value and the second angle value is less than the preset threshold, the second processing unit outputs the first angle value and the second angle value while simultaneously outputting a normal indicator. The first angle value is used for redundancy verification, and the second angle value is used as a position reference.
12. The magnetic encoder according to any one of claims 1 to 5, characterized in that, Both the first processing unit and the second processing unit are SIL2 level microcontroller units. The first processing unit and the second processing unit are electrically connected through a serial peripheral interface. The second processing unit is connected to a controller or display through a 485 bus.
13. The magnetic encoder according to any one of claims 1 to 5, characterized in that, The magnetic encoder further includes a first signal amplification module, a first filtering module, a second signal amplification module, and a second filtering module; The first magnetic sensor is connected to the first signal amplification module and the first filtering module, and then electrically connected to the first processing unit; the second magnetic sensor is connected to the second signal amplification module and the second filtering module, and then electrically connected to the second processing unit.
14. An angle detection method for a magnetic encoder, characterized in that, The second processing unit applied in the magnetic encoder according to any one of claims 1 to 13, the method comprising: The system receives a first angle value from a first processing unit and second magnetic information from a second magnetic sensor, wherein the first angle value is determined by the first processing unit based on the first magnetic information detected by the first magnetic sensor. The second magnetic information is converted into a second angle value; Compare the first angle value and the second angle value; If the difference between the first angle value and the second angle value is greater than or equal to a preset threshold, an anomaly flag is output at the same time as the first angle value and the second angle value are output.