Calibration method, calibration device and computer program product for a magnetic encoder

CN122590966APending Publication Date: 2026-08-18TP-LINK INT SHENZHEN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610831054.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-09
Publication Date
2026-08-18

AI Technical Summary

Benefits of technology

[0025] Based at least on the embodiments of this disclosure, known or inherent predefined rotations of actuators with predetermined step angles can be utilized, such as gimbal self-tests during camera power-on, printer homing, robot joint reset movements, and drone rotor tests. During these rotations, the detection of whether a lookup table or mapping table is invalid can be automatically triggered in a user-insensible manner, and the mapping table can be updated if it is invalid. This method can automatically detect mapping table failures without the need for precise mechanical angle measurements using third-party sensing devices, improving the applicability and timeliness of magnetic encoder nonlinear calibration, and without incurring additional calibration costs. The mapping table can be automatically maintained and updated throughout the entire lifecycle of the magnetic encoder. The calibration method, calibration device, and computer program product for magnetic encoders according to embodiments of this disclosure can be applied to the nonlinear calibration of devices such as sensors with output angle-related parameters, other types of angle encoders, such as potentiometers, inductive displacement sensors, and certain microelectromechanical systems (MEMS) gyroscopes, and can be applied to multiple fields such as industrial automation and automotive sensors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122590966A_ABST
    Figure CN122590966A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a calibration method, a calibration device and a computer program product for a magnetic encoder. The magnetic encoder is used to detect and output an angular position of an actuator with a predetermined step angle. The calibration method comprises: in response to a predefined rotation of the actuator, obtaining a current set of mechanical angles of the actuator and a current set of detected angles output by the magnetic encoder synchronously; querying a mapping table based on the current set of mechanical angles to determine a first set of recorded detected angles corresponding to the current set of mechanical angles, wherein the mapping table records a predefined mapping relationship between a plurality of recorded detected angles and a plurality of recorded mechanical angles corresponding to a full stroke rotation of the actuator, and the current set of mechanical angles is a subset of the plurality of recorded mechanical angles; and determining whether to update the mapping table based on a comparison between the current set of detected angles and the first set of recorded detected angles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to signal processing technology, and more specifically, to a calibration method, calibration apparatus, and computer program product for a magnetic encoder. Background Technology

[0002] Angle sensors are commonly used to measure the angular position, angular velocity, or angular acceleration of rotating parts, and are widely used in angle detection scenarios such as industrial control, motor drive, and robot positioning. Common types of angle sensors include four main types: photoelectric encoders, capacitive encoders, magnetoelectric encoders (also known as magnetic encoders), and inductive encoders. Among them, magnetic encoders have become the mainstream choice in motion control systems due to their advantages such as non-contact operation, high resolution, compact structure, durability, and reliability.

[0003] In actual assembly and use, factors such as magnet off-axis assembly, uneven magnetization, and sensor orthogonality errors cause a non-linear relationship between the detection angle output by the magnetic encoder and the actual mechanical angle of the actuator (e.g., motor). Therefore, the magnetic encoder needs to be calibrated. This non-linear relationship cannot generally be represented by a single function. Instead, a lookup table or mapping table is created to record key reference points, mapping the detection angle output by the magnetic encoder to the actual mechanical angle. This lookup table or mapping table can be used for subsequent corrections to the magnetic encoder output, thereby correcting the detection angle output by the magnetic encoder to the actual mechanical angle of the actuator and improving the accuracy of angular position detection. Summary of the Invention

[0004] This disclosure provides a calibration method, calibration apparatus, and computer program product for magnetic encoders. It can automatically trigger the detection of whether a lookup table or mapping table is faulty during known or inherent predefined rotations of actuators with predetermined step angles, such as gimbal self-tests during camera power-on, printer homing, robot joint reset movements, and drone rotor tests, in a user-insensitive manner. Furthermore, it can update the mapping table if it fails. This method can automatically detect mapping table failures without requiring precise mechanical angle measurements using third-party sensing devices, improving the applicability and timeliness of nonlinear calibration for magnetic encoders. Moreover, it eliminates the need for additional calibration costs and can automatically maintain and update the mapping table throughout the entire lifecycle of the magnetic encoder.

[0005] According to one aspect of this disclosure, a calibration method for a magnetic encoder is provided. The magnetic encoder can be used to detect and output the angular position of an actuator having a predetermined step angle. The calibration method may include: in response to a predefined rotation of the actuator, acquiring a set of current mechanical angles of the actuator and a set of currently detected angles synchronously output by the magnetic encoder; querying a mapping table based on the set of current mechanical angles to determine a first set of recorded detected angles corresponding to the set of current mechanical angles, wherein the mapping table records a predefined mapping relationship between multiple recorded detected angles and multiple recorded mechanical angles corresponding to the full stroke rotation of the actuator, and the set of current mechanical angles is a subset of the multiple recorded mechanical angles; and determining whether to update the mapping table based on a comparison between the set of current detected angles and the first set of recorded detected angles.

[0006] In some embodiments, determining whether to update the mapping table based on a comparison between the set of current detection angles and the set of first recorded detection angles may include: calculating a first relative deviation of each current detection angle relative to the corresponding first recorded detection angle in the set of first recorded detection angles to obtain a set of first relative deviations; and determining to update the mapping table in response to the fact that the number of first relative deviations exceeding a first relative deviation threshold in the set of first relative deviations is greater than a first quantity threshold.

[0007] In some embodiments, determining whether to update the mapping table based on a comparison between the current set of detection angles and the first set of recorded detection angles may include: calculating a first relative deviation of each current detection angle relative to the corresponding first recorded detection angle in the first set of recorded detection angles to obtain a set of first relative deviations; in response to the number of first relative deviations exceeding a first relative deviation threshold in the set of first relative deviations being greater than a first quantity threshold, controlling the actuator to perform a full-stroke rotation and acquiring multiple reference detection angles corresponding to multiple recorded mechanical angles; calculating a second relative deviation of each reference detection angle relative to the corresponding recorded detection angle in the multiple recorded detection angles to obtain a set of second relative deviations; and in response to the number of second relative deviations exceeding a second relative deviation threshold in the set of second relative deviations being greater than a second quantity threshold, determining to update the mapping table.

[0008] In some embodiments, determining whether to update the mapping table based on a comparison between the current set of detection angles and the first set of recorded detection angles may include: calculating a first absolute deviation of each current detection angle relative to the corresponding first recorded detection angle in the first set of recorded detection angles to obtain a set of first absolute deviations; and determining to update the mapping table in response to the sum of the set of first absolute deviations being greater than a first absolute deviation threshold.

[0009] In some embodiments, determining whether to update the mapping table based on a comparison between the current set of detection angles and the first set of recorded detection angles may include: calculating a first absolute deviation of each current detection angle relative to the corresponding first recorded detection angle in the first set of recorded detection angles to obtain a set of first absolute deviations; in response to the sum of the set of first absolute deviations being greater than a first absolute deviation threshold, controlling the actuator to perform a full-stroke rotation and acquiring multiple reference detection angles output by the magnetic encoder corresponding to multiple recorded mechanical angles; calculating a second absolute deviation of each reference detection angle relative to the corresponding recorded detection angle in the multiple recorded detection angles to obtain a set of second absolute deviations; and in response to the sum of the set of second absolute deviations being greater than a second absolute deviation threshold, determining to update the mapping table.

[0010] In some embodiments, the predefined rotation can be a full-stroke rotation.

[0011] In some embodiments, determining whether to update the mapping table based on a comparison between the current set of detection angles and the first set of recorded detection angles may include: calculating a first relative deviation of each current detection angle relative to the corresponding first recorded detection angle in the first set of recorded detection angles to obtain a set of first relative deviations; in response to the number of first relative deviations exceeding a first relative deviation threshold in the set of first relative deviations being greater than a first quantity threshold, calculating an absolute step difference between a first total drive step count of the actuator during mapping table establishment and a second total drive step count of the actuator during a predefined rotation; and in response to the absolute step difference being greater than a step loss threshold, determining to update the mapping table.

[0012] In some embodiments, determining whether to update the mapping table based on a comparison between the current set of detection angles and the first set of recorded detection angles may include: calculating a first absolute deviation of each current detection angle relative to the corresponding first recorded detection angle in the first set of recorded detection angles to obtain a set of first absolute deviations; in response to the sum of the set of first absolute deviations being greater than a first absolute deviation threshold, calculating an absolute step difference between a first total drive step count of the actuator during mapping table establishment and a second total drive step count of the actuator during a predefined rotation; and in response to the absolute step difference being greater than a step loss threshold, determining to update the mapping table.

[0013] In some embodiments, the calibration method may further include: controlling the actuator to rotate through its full stroke to obtain multiple recording mechanical angles and multiple recording detection angles synchronously output by the magnetic encoder; and establishing a mapping table based on the multiple recording mechanical angles and the multiple recording detection angles.

[0014] In some embodiments, updating the mapping table may include updating the detection angles of multiple records in the mapping table to the corresponding reference detection angles.

[0015] In some embodiments, the calibration method may further include storing a mapping table, which may include: calculating the absolute deviation between a current recording detection angle and a derived detection angle corresponding to the current recording detection angle among a plurality of recording detection angles, wherein the derived detection angle may be calculated based on linear interpolation of two recording detection angles adjacent to the current recording detection angle; deleting the current recording detection angle and its corresponding recording mechanical angle from the mapping table in response to the absolute deviation being less than or equal to a linear deviation threshold; and retaining the current recording detection angle and its corresponding recording mechanical angle in the mapping table in response to the absolute deviation being greater than the linear deviation threshold.

[0016] In some embodiments, during the full-stroke rotation of the actuator, the actuator can be driven in a subdivision mode, wherein the subdivision number of the predetermined step angle of the actuator can be positively correlated with the angular resolution of the magnetic encoder.

[0017] In some embodiments, acquiring multiple recording mechanical angles and multiple recording detection angles may include acquiring multiple recording mechanical angles and multiple recording detection angles when the actuator is in a state of uniform rotation.

[0018] In some embodiments, it can be determined whether to establish a mapping table based on multiple recording mechanical angles and multiple recording detection angles, based on whether the absolute value of the change in the actuator's drive current between adjacent sampling times is less than a current stability threshold and / or whether the absolute value of the change in the drive voltage between adjacent sampling times is less than a voltage stability threshold.

[0019] In some embodiments, establishing a mapping table may include: controlling the actuator to perform clockwise full-stroke rotation and counterclockwise full-stroke rotation respectively; establishing a first candidate mapping table based on multiple recorded mechanical angles of the actuator acquired during the clockwise full-stroke rotation and multiple clockwise detection angles synchronously output by the magnetic encoder, and establishing a second candidate mapping table based on multiple recorded mechanical angles of the actuator acquired during the counterclockwise full-stroke rotation and multiple counterclockwise detection angles synchronously output by the magnetic encoder; calculating the absolute value of the difference between the clockwise detection angle and the counterclockwise detection angle corresponding to the same recorded mechanical angle based on the first candidate mapping table and the second candidate mapping table to obtain a set of absolute angle differences; and using the first candidate mapping table or the second candidate mapping table as the mapping table in response to the fact that the number of absolute angle differences exceeding the angle deviation threshold in the set of absolute angle differences is less than the deviation number threshold.

[0020] In some embodiments, establishing a mapping table may further include: in response to the number of absolute angle differences in a set of absolute angle differences exceeding an angle deviation threshold being greater than or equal to a deviation number threshold, discarding the first candidate mapping table and the second candidate mapping table, and re-establishing the mapping table.

[0021] In some embodiments, updating the mapping table may include: controlling the actuator to rotate through its full stroke to obtain multiple reference detection angles corresponding to the outputs of a magnetic encoder with multiple recorded mechanical angles; and updating the multiple recorded detection angles in the mapping table to the corresponding reference detection angles.

[0022] According to another aspect of this disclosure, a calibration apparatus for a magnetic encoder is provided. The apparatus may include: a processor; a memory coupled to the processor; and computer program instructions stored in the memory, which, when executed by the processor, perform the methods described above.

[0023] According to another aspect of this disclosure, a computer program product is provided. This computer program product includes computer program instructions that, when executed by a processor, implement the methods described above.

[0024] According to another aspect of this disclosure, a camera is provided. The camera may include a magnetic encoder and the aforementioned calibration device.

[0025] Based at least on the embodiments of this disclosure, known or inherent predefined rotations of actuators with predetermined step angles can be utilized, such as gimbal self-tests during camera power-on, printer homing, robot joint reset movements, and drone rotor tests. During these rotations, the detection of whether a lookup table or mapping table is invalid can be automatically triggered in a user-insensible manner, and the mapping table can be updated if it is invalid. This method can automatically detect mapping table failures without the need for precise mechanical angle measurements using third-party sensing devices, improving the applicability and timeliness of magnetic encoder nonlinear calibration, and without incurring additional calibration costs. The mapping table can be automatically maintained and updated throughout the entire lifecycle of the magnetic encoder. The calibration method, calibration device, and computer program product for magnetic encoders according to embodiments of this disclosure can be applied to the nonlinear calibration of devices such as sensors with output angle-related parameters, other types of angle encoders, such as potentiometers, inductive displacement sensors, and certain microelectromechanical systems (MEMS) gyroscopes, and can be applied to multiple fields such as industrial automation and automotive sensors. Attached Figure Description

[0026] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to offer a further understanding of the embodiments of this disclosure and form part of the specification. The drawings, together with the embodiments of this disclosure, are used to explain this disclosure but do not constitute a limitation thereof. In the drawings, unless explicitly stated otherwise, the same reference numerals denote the same parts, steps, or elements.

[0027] Figure 1A schematic diagram showing the positional relationship between the actuator and the magnetic encoder according to an embodiment of the present disclosure is provided.

[0028] Figure 2 A flowchart of a calibration method for a magnetic encoder according to an embodiment of the present disclosure is shown;

[0029] Figure 3 A schematic diagram of a mapping table according to an embodiment of the present disclosure is shown;

[0030] Figure 4 Sub-steps of a calibration method according to an embodiment of the present disclosure are shown;

[0031] Figure 5 Sub-steps of a calibration method according to an embodiment of the present disclosure are shown;

[0032] Figure 6 Sub-steps of a calibration method according to an embodiment of the present disclosure are shown;

[0033] Figure 7 Sub-steps of a calibration method according to an embodiment of the present disclosure are shown;

[0034] Figure 8 Sub-steps of a calibration method according to an embodiment of the present disclosure are shown;

[0035] Figure 9 Sub-steps of a calibration method according to an embodiment of the present disclosure are shown;

[0036] Figure 10 Sub-steps of a calibration method according to an embodiment of the present disclosure are shown;

[0037] Figure 11 A schematic diagram illustrating the mapping relationships stored in the mapping table according to an embodiment of the present disclosure is shown in the form of data points in a two-dimensional coordinate system.

[0038] Figure 12 A schematic diagram of a calibration apparatus for a magnetic encoder according to an embodiment of the present disclosure is shown.

[0039] Those skilled in the art will understand that the elements in the accompanying drawings are illustrated for simplicity and clarity and are not necessarily drawn to scale. For example, the dimensions of some elements in the illustrations, block diagrams, or flowcharts may be exaggerated relative to other elements to aid in accurate understanding of this embodiment. Detailed Implementation

[0040] The technical solutions of this disclosure will now be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are part of, but not all, of the embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without any creative effort fall within the protection scope of this disclosure.

[0041] In the description of this disclosure, it should be noted that terms such as “first,” “second,” and “third” are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Similarly, words such as “a,” “an,” or “the” do not indicate a quantity limitation but rather indicate the presence of at least one. Words such as “including” or “comprising” mean that the element or object preceding the word encompasses those elements or objects listed following the word and their equivalents, without excluding other elements or objects.

[0042] In the description of this disclosure, unless otherwise expressly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; 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 refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0043] Furthermore, the technical features involved in the different embodiments of this disclosure described below can be combined with each other, as long as there is no conflict between them.

[0044] As mentioned earlier, a lookup table or mapping table is typically created to record some key reference points, mapping the detection angle output by the magnetic encoder to the actual mechanical angle. This reduces the nonlinear error of the magnetic encoder, which is the error caused by the nonlinear relationship between the detection angle output by the magnetic encoder and the actual mechanical angle of the actuator it measures. This process achieves magnetic encoder calibration. Typically, calibration is performed only once at the factory for devices containing magnetic encoders (such as stepper motors, pan-tilt cameras, etc.), and the aforementioned lookup table or mapping table representing the nonlinear relationship is stored. This stored lookup table or mapping table is not modified throughout the entire lifespan of the magnetic encoder.

[0045] Furthermore, current mainstream nonlinear calibration methods for magnetic encoders require the use of external high-precision third-party sensing devices, such as inertial measurement units (IMUs) and angle / position encoders, which are more precise than magnetic encoders. In actual calibration, the angle value output by the high-precision third-party sensing device is used as the true mechanical angle value. Combined with the detected angle value synchronously output by the magnetic encoder, a nonlinear mapping relationship between the two is established, and a fixed lookup table or mapping table is generated accordingly.

[0046] However, in subsequent practical use, issues such as magnet residual flux decay, magnet misalignment due to vibration, magnet damage, and interference from surrounding magnets may arise. These issues cause the correspondence between the magnetic encoder's detection angle and the actual mechanical angle to gradually transform into a new nonlinear relationship during user operation. The pre-stored fixed lookup table or mapping table becomes inapplicable, leading to errors in the encoder's output and, in severe cases, data failure. In other words, current calibration methods rely on single measurements from external high-precision sensing devices and cannot detect or resolve this post-factory change in nonlinear mapping. They also cannot automatically detect and correct defects caused by magnet damage, residual flux decay, or interference from surrounding magnets throughout the entire lifecycle of the magnetic encoder.

[0047] In view of this, this disclosure provides a calibration method, calibration apparatus, and computer program product for magnetic encoders. This method can utilize known or inherent predefined rotations of actuators with predetermined step angles, such as gimbal self-tests during camera power-on, printer homing, robot joint reset movements, and drone rotor tests. During these rotations, it automatically triggers detection of whether a lookup table or mapping table is faulty in a user-insensitive manner, and updates the mapping table if it fails. This approach can automatically detect mapping table failures without requiring precise mechanical angle measurements using third-party sensing devices, improving the applicability and timeliness of nonlinear calibration for magnetic encoders. Furthermore, it eliminates the need for additional calibration costs and can automatically maintain and update the mapping table throughout the entire lifecycle of the magnetic encoder. The calibration method, calibration apparatus, and computer program product for magnetic encoders according to embodiments of this disclosure can be applied to the nonlinear calibration of angle-dependent output sensors, such as potentiometers, inductive displacement sensors, and certain microelectromechanical systems (MEMS) gyroscopes, and can be applied in multiple fields such as industrial automation and automotive sensors.

[0048] Figure 1 A schematic diagram 100 illustrates the positional relationship between an actuator and a magnetic encoder according to an embodiment of the present disclosure. (As shown...) Figure 1 As shown, the magnetic encoder 120, as an angle sensor, is typically paired with a magnetic material (e.g., Figure 1 The magnetic ring 110 shown is used to detect changes in the magnetic field, thereby obtaining motion information of the rotating object. Magnetic materials, such as... Figure 1 The magnetic ring 110 shown is typically a ring-shaped or circular permanent magnet with a multi-pole magnetized grating (usually with N and S poles arranged) on its surface. It is directly or indirectly mounted on the rotating shaft or moving part being measured (i.e., the rotating object, for example...). Figure 1The actuator 130 shown moves along with it. The magnetic encoder 120 can be non-contactly spaced from the magnetic ring 110 (e.g., maintaining a preset air gap distance). When the magnetic ring 110 rotates with the shaft of the actuator 130, the magnetic encoder 120 can sense the change in the magnetic field generated by the magnetic ring 110, and calculate and output the corresponding detection angle signal based on the change in the magnetic field. In the embodiments of this disclosure, the actuator 130 can be, for example, an actuator with a predetermined step angle, such as a stepper motor, a oscillating electromagnetic driver, or other device with a fixed deflection angle that can realize a quantitative angular rotation, so that its actual mechanical angle can be easily calculated based on the cumulative number of steps of the actuator. Taking a stepper motor as an example, it is an actuator that converts electrical pulses into angular displacement. When the stepper driver receives a pulse signal, it drives the stepper motor to rotate a fixed step angle in a set direction. The rotation of the stepper motor is a step-by-step operation with fixed angles.

[0049] Figure 2 A flowchart of a calibration method 200 for a magnetic encoder according to an embodiment of the present disclosure is shown. The magnetic encoder here can be the one described above. Figure 1 The described magnetic encoder 120 can be used to detect and output the angular position of an actuator 130 with a predetermined step angle. The calibration method 200 according to embodiments of this disclosure can utilize known or inherent predefined rotations of such actuator 130, such as gimbal self-tests during camera power-on, printer homing, robot joint reset movements, and drone rotor tests. Since the step angle of the actuator is known, and the start and end angular positions of the predefined rotation are also known, multiple mechanical angular positions of the actuator during the predefined rotation can be easily obtained. This allows for automatic triggering of checks on whether a lookup table or mapping table is invalid in a user-insensitive manner, and, in the event of a mapping table failure, updating the mapping table. Specifically, as... Figure 2 As shown, calibration method 200 may include steps S210 to S230.

[0050] In step S210, in response to the actuator 130 performing a predefined rotation, the set of current mechanical angles of the actuator 130 and the set of current detected angles synchronously output by the magnetic encoder 120 can be obtained. As described above, since the actuator 130 has a predetermined step angle, the mechanical angle it has rotated through can be determined correspondingly after each step of operation, and the starting and ending angle positions of the predefined rotation are also known. Therefore, the actual mechanical angle corresponding to the current position can be easily and quickly calculated based on the cumulative number of steps during the operation of the actuator 130. During the predefined rotation of the actuator 130, two sets of corresponding data can be collected synchronously in real time. On the one hand, the current mechanical angles mc of the actuator 130, which are converted from the cumulative number of steps of the actuator 130, are obtained. iThis allows us to obtain the set of current mechanical angles MC = {mc1, mc2, ..., mc...} i , ...mc k On the other hand, it synchronously reads the real-time output of each current detection angle ac from the magnetic encoder 120 corresponding to each current mechanical angle. i This allows us to obtain the set of current detection angles AC = {ac1, ac2, ..., ac3}. i , ...ac k}. The i and k mentioned above are positive integers greater than 1, and the current mechanical angle mc i and the current detection angle ac i It's a one-to-one correspondence.

[0051] In step S220, the set of current mechanical angles MC={mc1, mc2, ..., mc2} obtained in step S210 can be used as a basis. i , ...mc k} Query the mapping table to determine the set of first recorded detection angles AR={ar1, ar2, ..., ar2} corresponding to the set of current mechanical angles. i , ...ar k As mentioned above, before using a magnetic encoder to determine the angular position of the actuator, a mapping table is usually generated and stored that reflects the nonlinear mapping relationship between the detection angle output by the magnetic encoder and the actual mechanical angle of the actuator. This table records some key reference points and maps the detection angle output by the magnetic encoder to the actual mechanical angle, thereby reducing the nonlinear error of the magnetic encoder. In subsequent use, the detection angle value output by the magnetic encoder in real time can be mapped to the mechanical angle using common methods such as table lookup and interpolation. Figure 3 A schematic diagram of a mapping table 300 according to an embodiment of the present disclosure is shown. (As follows) Figure 3 As shown, the mapping table 300 can record multiple recorded detection angles {a01, a02, ..., a0} corresponding to the full stroke rotation of the actuator 130. i , ...a0 n} and multiple recorded mechanical angles {m01, m02, ..., m0 i , ...m0 n A predefined mapping relationship exists between}, where n is a positive integer greater than or equal to k, and can depend on the actuator's rotational speed, the magnetic encoder's sampling rate, etc. Furthermore, the set of current mechanical angles MC = {mc1, mc2, ..., mc...} i , ...mc k} can be multiple recorded mechanical angles {m01, m02, ..., m0} i , ...m0 nA subset of}. The full-stroke rotation of the actuator mentioned here refers to the continuous rotation of the actuator's output shaft / rotating shaft from its extreme starting position to its extreme ending position, with a rotation angle range of 0° to 360°. The predefined rotation mentioned above can be any angle within the full-stroke rotation range, or it can be a complete full-stroke rotation. It can be understood that due to multiple recorded mechanical angles {m01, m02…m0}... i , ...m0 n} Corresponding to the full stroke rotation of the actuator, during the predefined rotation of the actuator, the set of current detection angles output by the magnetic encoder can be read at the same sampling position (i.e., the same mechanical angle position) as when the actuator performs its full stroke rotation during the establishment of mapping table 300, such that the set of corresponding current mechanical angles MC = {mc1, mc2, ..., mc...} i , ...mc k} represents multiple recorded mechanical angles {m01, m02, ..., m0}. i , ...m0 n A subset of}.

[0052] In some embodiments, during a predefined rotation of the actuator, the set of current detection angles output by the magnetic encoder can be read at the same sampling rate and at the same sampling position (i.e., the same mechanical angle position) as during the full-stroke rotation of the actuator when the mapping table 300 is established, such that the acquired set of current mechanical angles MC = {mc1, mc2, ..., mc...} i , ...mc k The consecutive current mechanical angles mc in} i With multiple recorded mechanical angles {m01, m02, ..., m0} i , ...m0 n The continuous recording of mechanical angles m0 in} i One-to-one correspondence.

[0053] The set of current mechanical angles MC = {mc1, mc2, ..., mc3} obtained in step S210 can be used as the basis for determining the current mechanical angles. i , ...mc k The current mechanical angles mc are arranged in an orderly manner in} i To retrieve keywords, the mapping table 300 is traversed to determine the set MC={mc1, mc2, ..., mc...} corresponding to the current mechanical angle. i , ...mc k The set of the first recorded detection angles corresponding to} is AR={ar1,ar2,……ar}. i , ...ar k It is understandable that, due to the multiple recorded detection angles {a01, a02, ..., a0}, i , ...a0 nThe set of mechanical angles corresponding to the full stroke rotation of the actuator and the current mechanical angle is MC = {mc1, mc2, ..., mc...} i , ...mc k} represents multiple recorded mechanical angles {m01, m02, ..., m0}. i , ...m0 n The subset of}, therefore, by querying mapping table 300, the set of the first record detection angles AR={ar1,ar2,……ar} is determined. i , ...ar k} can be multiple record detection angles {a01, a02, ..., a0} recorded in mapping table 300. i , ...a0 n A subset of}.

[0054] Return to reference Figure 2 After determining the set of first recorded detection angles in step S220, in step S230, the set of current detection angles AC={ac1, ac2, ..., ac3} obtained in step S210 can be used as a basis for further determination. i , ...ac k The set AR = {ar1, ar2, ..., ar2} of the first recording detection angles determined in step S220. i , ...ar k The comparison of} determines whether to update mapping table 300. It can be understood that the current set of detected angles AC = {ac1, ac2, ..., ac3} i , ...ac k The set of angles detected by the first record is AR = {ar1, ar2, ..., ar...} i , ...ar k The set MC = {mc1, mc2, ..., mc} corresponding to the same current mechanical angle i , ...mc k The first set of recorded detection angles is AR = {ar1, ar2, ..., ar...}. i , ...ar k This includes the actuator's full-stroke rotation during the previously established mapping table stage, at various mechanical angles mc. i At the corresponding angular position, the magnetic encoder outputs values ​​corresponding to various mechanical angles mc. i The corresponding historical detection angles; and the set of current detection angles AC = {ac1, ac2, ..., ac3} i , ...ac k This includes the magnetic encoder outputting various mechanical angles mc during the current predefined rotation of the actuator. i A one-to-one real-time detection angle. Therefore, the set of current detection angles AC = {ac1, ac2, ..., ac3} i, ...ac k The various angle values ​​ac in} i The set of angles detected by the first record is AR = {ar1, ar2, ..., ar...} i , ...ar k The various angle values ​​ar in} i It is a one-to-one correspondence. If the nonlinear mapping relationship between the detection angle of the magnetic encoder and the mechanical angle of the actuator, as represented by mapping table 300, remains valid, then the set of current detection angles AC = {ac1, ac2, ..., ac3} i , ...ac k The set of angles detected by the first record is AR = {ar1, ar2, ..., ar...} i , ...ar k The corresponding angle values ​​in the set AC should be basically consistent; otherwise, if the mapping relationship fails, the current set of detected angles AC = {ac1, ac2, ..., ac3} will be invalid. i , ...ac k The set of angles detected by the first record is AR = {ar1, ar2, ..., ar...} i , ...ar k In each pair of corresponding angle values ​​in}, at least one angle value pair will have a significant deviation. Therefore, in S230, the current set of detected angles AC={ac1, ac2, ..., ac3} can be used as a basis for determining the angles. i , ...ac k The set of angles detected by the first record is AR = {ar1, ar2, ..., ar...} i , ...ar k By comparing the mappings, it can be determined whether the mapping relationship represented by mapping table 300 is valid, and thus whether mapping table 300 needs to be updated.

[0055] Unlike traditional methods that only perform a single calibration and store a mapping table for nonlinear calibration when a device containing a magnetic encoder leaves the factory, the calibration method 200 according to this disclosure utilizes predefined rotations of the actuator, such as inherent periodic rotations (e.g., gimbal self-test when a camera is powered on, printer repositioning, robot joint reset movement, and drone rotor testing), to trigger a check on whether the mapping table remains valid. This achieves "user-unnoticed self-maintenance" and can utilize this predefined rotation to complete the self-check and update of the mapping table's validity throughout the entire lifecycle of the magnetic encoder. The accuracy of the mapping relationship can be confirmed periodically without user intervention or awareness, solving the problem of nonlinear mapping relationship failure that may occur during user use due to magnet damage, decay of the magnet's residual magnetic flux, magnet assembly position misalignment, or interference from surrounding magnets.

[0056] According to embodiments of this disclosure, there can be multiple ways to base the current detection angle set AC = {ac1, ac2, ..., ac3} on the current detection angle set AC = {ac1, ac2, ..., ac3}. i , ...ac k The set of angles detected by the first record is AR = {ar1, ar2, ..., ar...} i , ...ar k By comparing the values ​​of}, it is determined whether the mapping relationship represented by mapping table 300 is valid, and thus whether mapping table 300 should be updated. Figures 4 to 9 Sub-steps of step S230 according to embodiments of the present disclosure are shown respectively.

[0057] In some embodiments, it can be based on each current detection angle ac i With the corresponding first recorded detection angle ar i The comparison is used to determine whether the mapping table should be updated. For this purpose, such as... Figure 4 As shown, in some embodiments, step S230 may include sub-steps S2301 to S2302.

[0058] In sub-step S2301, each current detection angle ac can be calculated. i The set of detection angles relative to the first recorded angle is AR = {ar1, ar2, ..., ar...} i , ...ar k The first record detection angle ar in} i First relative deviation Rdiff i = |ac i -ar i | / ar i To obtain a first set of relative deviations {Rdiff1, Rdiff2, ..., Rdiff} i , ...Rdiff k}

[0059] In substep S2302, in response to the first set of relative deviations {Rdiff1, Rdiff2, ..., Rdiff...} i , ...Rdiff k The first relative deviation Rdiff exceeds the first relative deviation threshold RDTH1. i If the number of values ​​exceeds the first quantity threshold NTH1, then updating the mapping table 300 is determined. For example, the first relative deviation threshold RDTH1 can be set to 10%, and the first quantity threshold NTH1 can be set to 2, so that as long as there are 2 first relative deviations Rdiff, the mapping table 300 can be updated. iIf the value is greater than 10%, then mapping table 300 needs to be updated. It is understood that setting the first relative deviation threshold RDTH1 to 10% and the first quantity threshold NTH1 to 2 is merely an example. Those skilled in the art can flexibly adjust the specific values ​​of the two thresholds according to the actuator's operating conditions, the magnetic encoder's detection accuracy requirements, and the actual usage environment. When this judgment condition is met, it indicates that the current detection angle output by the magnetic encoder (i.e., {ac1, ac2...ac...)) is... i , ...ac k}) and the previously measured reference angles (i.e., {ar1, ar2...ar) i , ...ar k The individual deviation of the actuator has exceeded the normal allowable range, and the original nonlinear correspondence between the actuator's mechanical angle and the magnetic encoder's detection angle has significantly shifted. The original mapping table 300 can no longer accurately reflect the actual correspondence between the two. Timely triggering of the mapping table update process can effectively eliminate detection errors caused by various factors such as magnet damage, attenuation of the magnet's residual magnetic flux, magnet assembly position misalignment, and interference from surrounding magnets, ensuring the accuracy of subsequent actuator angle positioning. Conversely, if the first relative deviation threshold RDTH1 is exceeded, the first relative deviation Rdiff... i If the number is less than or equal to the first quantity threshold NTH1, then it can be determined that mapping table 300 is still applicable, and no update operation is required. The existing mapping table can be used directly to complete the normal angle conversion and control logic.

[0060] In reference Figure 4 In the described embodiment, the determination of whether to update the mapping table is based on the degree of individual deviation of the current detection angle from the corresponding first record detection angle. This is particularly suitable for application scenarios that are sensitive to the failure of the mapping relationship between individual first record detection angles and corresponding record mechanical angles in the mapping table, and can promptly detect local distortions in the mapping relationship.

[0061] In some embodiments, the detection angle can be based on the current detection angle ac i Relative to the corresponding first record detection angle ar i The overall deviation is used to determine whether to update the mapping table. For this purpose, such as... Figure 5 As shown, in some embodiments, step S230 may include sub-steps S2303 to S2304.

[0062] In sub-step S2303, each current detection angle ac can be calculated. i The set of detection angles relative to the first recorded angle is AR = {ar1, ar2, ..., ar...} i , ...ar k The first record detection angle ar in} iFirst absolute deviation Adiff i = |ac i -ar i |, to obtain a set of first absolute deviations {Adiff1, Adiff2, ..., Adiff i ...Adiff k}

[0063] In substep S2304, in response to the sum of the first set of absolute deviations Σ(Adiff1+Adiff2+……+Adiff) i +……+Adiff k If the first absolute deviation threshold ADTH1 is greater than the first absolute deviation threshold ADTH1, then the mapping table 300 is updated. For example, the first absolute deviation threshold ADTH1 can be based on the detection angle ar of each first record. i The sum Σ(ar1+ar2+……+ar i +……+ar k To set it, for example, set it to Σ(ar1 + ar2 + ... + ar) i +……+ ar k 5% of the total. It is understood that the above threshold setting is merely an example, and those skilled in the art can flexibly adjust its specific value or calculation method according to the actuator's operating conditions, the magnetic encoder's detection accuracy requirements, and the actual usage environment. When this judgment condition is met, it indicates that the current magnetic encoder output detection angle (i.e., {ac1, ac2...ac...) is 5%. i , ...ac k}) and the previously measured reference angles (i.e., {ar1, ar2...ar) i , ...ar k The overall deviation of the actuator's mechanical angle has exceeded the normal allowable range. The original nonlinear correspondence between the actuator's mechanical angle and the magnetic encoder's detection angle has shifted significantly, and the original mapping table 300 can no longer accurately reflect the actual correspondence between the two. In this case, timely triggering of the mapping table update process can effectively eliminate detection errors caused by various factors such as magnet damage, attenuation of the magnet's residual magnetic flux, magnet assembly position misalignment, and interference from surrounding magnets, ensuring the accuracy of subsequent actuator angle positioning. Conversely, if the above judgment conditions are not met, it can be determined that mapping table 300 is still applicable, and no update operation is required. The existing mapping table can be directly used to complete normal angle conversion and control logic.

[0064] In reference Figure 5In the described embodiment, the decision to update the mapping table is based on the overall deviation of the current detection angle from the corresponding first recorded detection angle. This is particularly suitable for scenarios where all or most of the correspondences / mapping relationships within the mapping table have failed. By judging based on the overall trend, the mapping table can be updated in advance before its quality deteriorates to the point of affecting control accuracy.

[0065] In some embodiments, with reference Figure 4 In the described embodiments, once a first set of relative deviations {Rdiff1, Rdiff2, ..., Rdiff} is established... i , ...Rdiff k The first relative deviation Rdiff exceeds the first relative deviation threshold RDTH1. i If the number of values ​​exceeds the first threshold NTH1, it is determined that the mapping table 300 is different and needs to be updated. A secondary check can be performed to further determine whether to update the mapping table, thus avoiding updates due to a single, accidental error. Therefore, such as... Figure 6 As shown, in some embodiments, step S230 may include sub-steps S2301, S2305 to S2307.

[0066] Sub-step S2301 and reference Figure 4 The description is the same, that is, in sub-step S2301, each current detection angle ac can be calculated. i The set of detection angles relative to the first recorded angle is AR = {ar1, ar2, ..., ar...} i , ...ar k The first record detection angle ar in} i First relative deviation Rdiff i = |ac i -ar i | / ar i To obtain a first set of relative deviations {Rdiff1, Rdiff2, ..., Rdiff} i , ...Rdiff k}

[0067] Next, unlike sub-step S2302, in sub-step S2305, in response to the first set of relative deviations {Rdiff1, Rdiff2, ..., Rdiff...} i , ...Rdiff k The first relative deviation Rdiff exceeds the first relative deviation threshold RDTH1. i If the quantity is greater than the first quantity threshold NTH1, the actuator 130 can be controlled to rotate through its full stroke and acquire the corresponding mechanical angles {m01, m02, ..., m0}. i , ...m0n The magnetic encoder 120 outputs multiple reference detection angles {aref1, aref2, ..., aref} i , ...aref n As mentioned above, multiple recorded mechanical angles {m01, m02, ..., m0} i , ...m0 n The data is obtained during the full stroke rotation of the actuator when mapping table 300 is established. Therefore, it can be obtained at the same sampling position (i.e., the same mechanical angle position {m01, m02...m0) during the full stroke rotation of the actuator when mapping table 300 is established. i , ...m0 n The detection angles output by the magnetic encoder are read from the above-mentioned multiple reference detection angles {aref1, aref2, ..., aref} and used as reference detection angles. i , ...aref n}

[0068] Then, in sub-steps S2306 and S2307, calculations and comparisons similar to those involved in sub-steps S2301 and S2302 are performed for each of the multiple reference detection angles. Specifically, in sub-step S2306, the aref of each reference detection angle can be calculated. i Relative to multiple recording detection angles {a01, a02, ..., a0} i , ...a0 n The corresponding recorded detection angle a0 in} i The second relative deviation R'diff i = |aref i -a0 i | / a0 i To obtain a set of second relative deviations {R'diff1, R'diff2, ..., R'diff} i , ...R'diff n}

[0069] In substep S2307, in response to the set of second relative deviations {R'diff1, R'diff2, ..., R'diff} i , ...R'diff n The second relative deviation R'diff in the value exceeds the second relative deviation threshold RDTH2. iIf the number of values ​​is greater than the second relative deviation threshold NTH2, then updating the mapping table 300 is determined. For example, the second relative deviation threshold RDTH2 can be the same as or different from the aforementioned first relative deviation threshold RDTH1. For example, the second relative deviation threshold RDTH2 can also be set to 10%, and the second quantity threshold NTH2 can be the same as or different from the aforementioned first quantity threshold NTH1. For example, the second quantity threshold NTH2 can be set to 3, such that as long as there are 3 second relative deviations R'diff... i If the value is greater than 10%, then mapping table 300 needs to be updated. It is understood that setting the second relative deviation threshold RDTH2 to 10% and the second quantity threshold NTH2 to 3 is merely an example. Those skilled in the art can flexibly adjust the specific values ​​of the two thresholds according to the actuator's operating conditions, the magnetic encoder's detection accuracy requirements, and the actual usage environment.

[0070] Relative to reference Figure 4 The described embodiments, with reference to Figure 6 In the described embodiment, steps S2305 to S2307 additionally implement a secondary verification based on the full-stroke rotation of the control actuator to avoid updating the mapping table due to a single accidental error.

[0071] In some embodiments, with reference Figure 5 In the described embodiment, once the sum of a first set of absolute deviations Σ(Adiff1+Adiff2+……+Adiff) i +……+Adiff k If the deviation is greater than the first absolute deviation threshold ADTH1, it is determined that the mapping table 300 is different and needs to be updated. A secondary check can be performed to further determine whether to update the mapping table, thus avoiding updates due to a single, accidental error. Therefore, as follows... Figure 7 As shown, in some embodiments, step S230 may include sub-steps S2303, S2308 to S2310.

[0072] Sub-step S2303 and reference Figure 5 The description is the same, that is, in sub-step S2303, each current detection angle ac can be calculated. i The set of detection angles relative to the first recorded angle is AR = {ar1, ar2, ..., ar...} i , ...ar k The first record detection angle ar in} i First absolute deviation Adiff i = |ac i -ar i |, to obtain a set of first absolute deviations {Adiff1, Adiff2, ..., Adiff i ...Adiffk}

[0073] Next, unlike sub-step S2304, in sub-step S2308, in response to the sum of the first set of absolute deviations Σ(Adiff1+Adiff2+……+Adiff) i +……+Adiff k If the deviation is greater than the first absolute deviation threshold ADTH1, the actuator 130 can be controlled to rotate through its full stroke and acquire the corresponding mechanical angles {m01, m02, ..., m0}. i , ...m0 n The magnetic encoder 120 outputs multiple reference detection angles {aref1, aref2, ..., aref} i , ...aref n As mentioned above, multiple recorded mechanical angles {m01, m02, ..., m0} i , ...m0 n The data is obtained during the full stroke rotation of the actuator when mapping table 300 is established. Therefore, it can be obtained at the same sampling position (i.e., the same mechanical angle position {m01, m02...m0) during the full stroke rotation of the actuator when mapping table 300 is established. i , ...m0 n The detection angles output by the magnetic encoder are read from the above-mentioned multiple reference detection angles {aref1, aref2, ..., aref} and used as reference detection angles. i , ...aref n}

[0074] Then, in sub-steps S2309 and S2310, calculations and comparisons similar to those involved in sub-steps S2303 and S2304 are performed for each of the multiple reference detection angles. Specifically, in sub-step S2309, the aref of each reference detection angle can be calculated. i Relative to multiple recording detection angles {a01, a02, ..., a0} i , ...a0 n The corresponding recorded detection angle a0 in} i The second absolute deviation A'diff i = |aref i -a0 i |, to obtain a set of second absolute deviations {A'diff1, A'diff2, ..., A'diff} i , ...A'diff n}

[0075] In substep S2310, in response to the set of second absolute deviations {A'diff1, A'diff2, ..., A'diff} i, ...A'diff n If the sum of the values ​​of the records is greater than the second absolute deviation threshold ADTH2, then updating the mapping table 300 can be determined. For example, the second absolute deviation threshold ADTH2 can be based on multiple recorded detection angles a0. i The sum Σ(a01+a02+……+a0) i +……+a0 n To set it, for example, set it to Σ(a01+a02+……+a0) i +……+a0 n 5% of the value. It is understood that the above threshold setting method is only an example, and those skilled in the art can flexibly adjust its specific value or calculation method according to the actuator operating conditions, magnetic encoder detection accuracy requirements and actual use environment.

[0076] Relative to reference Figure 5 The described embodiments, with reference to Figure 7 In the described embodiment, steps S2308 to S2310 additionally implement a secondary verification based on the full-stroke rotation of the control actuator to avoid updating the mapping table due to a single accidental error.

[0077] As mentioned above, the predefined rotation can be any angle within the full stroke rotation range, or it can be a complete full stroke rotation. When the predefined rotation is a full stroke rotation, the secondary verification can be performed by comparing the total number of drive steps of the actuator during the mapping table establishment period with the total number of drive steps of the actuator during the predefined rotation period. That is, based on the deviation between the total drive steps in the two cases, it can be determined whether the actuator has lost step, causing the nonlinear mapping relationship to fail, thereby determining that the mapping table needs to be updated. Therefore, as... Figure 8 As shown, in some embodiments, step S230 may include sub-steps S2301, S2311, and S2312.

[0078] Sub-step S2301 and reference Figure 4 The description is the same. In sub-step S2301, each current detection angle ac can be calculated. i The set of detection angles relative to the first recorded angle is AR = {ar1, ar2, ..., ar...} i , ...ar k The first record detection angle ar in} i First relative deviation Rdiff i = |ac i -ar i | / ar i To obtain a first set of relative deviations {Rdiff1, Rdiff2, ..., Rdiff} i , ...Rdiff k}

[0079] In substep S2311, in response to the first set of relative deviations {Rdiff1, Rdiff2, ..., Rdiff} i , ...Rdiff k The first relative deviation Rdiff exceeds the first relative deviation threshold RDTH1. i If the number of steps exceeds the first threshold NTH1, the absolute step difference Ndiff = |N1-N2| between the first total drive steps N1 of the actuator 130 during the establishment of the mapping table 300 and the second total drive steps N2 of the actuator 130 during the predefined rotation can be calculated. The first total drive steps N1 indicates the number of drive steps corresponding to the actuator completing a single full-stroke rotation when the mapping table 300 is established, and the second total drive steps N2 indicates the number of drive steps corresponding to the actuator completing a single full-stroke rotation when the predefined rotation is currently being executed. Since the predefined rotation in this embodiment is also a full-stroke rotation, the second total drive steps N2 actually indicates the number of drive steps corresponding to the current actuator completing a single full-stroke rotation, while the absolute step difference Ndiff can indicate the number of steps lost by the actuator during the two consecutive full-stroke rotations.

[0080] In sub-step S2312, in response to the absolute step difference Ndiff being greater than the out-of-step threshold OTH, it can be determined that the mapping table 300 can be updated. The out-of-step threshold OTH indicates the allowed number of out-of-step steps. For example, the out-of-step threshold OTH can be set to 2. It is understood that setting the out-of-step threshold OTH to 2 is only an example, and those skilled in the art can flexibly adjust the specific value of this threshold according to the actuator operating conditions, the magnetic encoder detection accuracy requirements, and the actual usage environment.

[0081] Combined on the above Figure 8 In the described embodiment, a relative deviation is used to make the judgment in sub-step S2311. Alternatively, it can be done as described with reference to Figure 5 As described in the embodiment, absolute deviation is used for judgment. Thus, Figure 9 As shown, in some embodiments, step S230 may include sub-steps S2303, S2313, and S2314.

[0082] Sub-step S2303 and reference Figure 5 The description is the same. In sub-step S2303, each current detection angle ac can be calculated. i The set of detection angles relative to the first recorded angle is AR = {ar1, ar2, ..., ar...} i , ...ar k The first record detection angle ar in} i First absolute deviation Adiff i= |ac i -ar i |, to obtain a set of first absolute deviations {Adiff1, Adiff2, ..., Adiff i ...Adiff k}

[0083] In substep S2313, in response to the sum of the first set of absolute deviations Σ(Adiff1+Adiff2+……+Adiff) i +……+Adiff k If the absolute deviation is greater than the first absolute deviation threshold ADTH1, the absolute step difference Ndiff = |N1-N2| between the first total drive steps N1 of the actuator 130 during the establishment of the mapping table 300 and the second total drive steps N2 of the actuator 130 during the predefined rotation can be calculated. The first total drive steps N1 indicates the number of drive steps corresponding to the actuator completing a single full-stroke rotation when the mapping table 300 is established, and the second total drive steps N2 indicates the number of drive steps corresponding to the actuator completing a single full-stroke rotation when the predefined rotation is currently being executed. Since the predefined rotation in this embodiment is also a full-stroke rotation, the second total drive steps N2 actually indicates the number of drive steps corresponding to the current actuator completing a single full-stroke rotation, while the absolute step difference Ndiff can indicate the number of steps lost by the actuator during the two consecutive full-stroke rotations.

[0084] In sub-step S2314, in response to the absolute step difference Ndiff being greater than the out-of-step threshold OTH, it can be determined that the mapping table 300 can be updated. Sub-step S2314 corresponds to the above reference. Figure 8 The described sub-step S2312. The out-of-step threshold OTH can indicate the number of out-of-step steps allowed. For example, the out-of-step threshold OTH can be set to 2. It is understood that setting the out-of-step threshold OTH to 2 as described above is only an example, and those skilled in the art can flexibly adjust the specific value of this threshold according to the actuator operating conditions, the detection accuracy requirements of the magnetic encoder, and the actual use environment.

[0085] Combined on the above Figure 8 and Figure 9 In the described embodiment, a simple secondary check can be performed by determining whether the actuator has lost synchronization in order to ultimately determine whether the mapping table should be updated.

[0086] As described above, the mapping table representing the nonlinear relationship can be calibrated once at the factory using an external high-precision sensing device and stored. However, this increases cost. Therefore, according to embodiments of this disclosure, the mapping table can be automatically generated and established without the need for precise mechanical angle measurements using third-party sensing devices. (Return to Reference) Figure 2 And as Figure 2 As further shown, calibration method 200 may further include steps S240 to S250 to automatically establish mapping table 300. It is understood that steps S240 to S250 may be performed before step S210.

[0087] In step S240, the actuator 130 can be controlled to rotate through its full stroke to obtain the aforementioned multiple recorded mechanical angles {m01, m02, ..., m0}. i , ...m0 n} and multiple recording and detection angles {a01, a02, ..., a0} synchronously output by the magnetic encoder 120. i , ...a0 n Since the actuator 130 has a predetermined step angle, the mechanical angle it rotates through can be determined corresponding to each completed step. Therefore, based on the cumulative number of steps during the operation of the actuator 130, the actual mechanical angle corresponding to each completed step can be easily and quickly calculated, i.e., the multiple recorded mechanical angles {m01, m02, ..., m0} mentioned above. i , ...m0 n Using this mechanical angular position as the sampling position, the detection angle output by the magnetic encoder 120 is synchronously read as the above-mentioned multiple recorded detection angles {a01, a02, ..., a0}. i , ...a0 n Then, in step S250, based on the above-mentioned multiple recorded mechanical angles {m01, m02...m0}, i , ...m0 n} and the above-mentioned multiple recorded detection angles {a01, a02……a0} i , ...a0 n Establish the aforementioned mapping table 300. In this way, the mapping table can be automatically generated and established throughout the entire lifecycle of the magnetic encoder without the need for precise mechanical angle measurements using third-party sensing devices.

[0088] As described above, in step S230, it can be determined whether to update the mapping table 300. If it is determined that the mapping relationship in the mapping table is invalid, then the mapping table needs to be updated. Here, a process similar to that used to establish the mapping table can be adopted, that is, controlling the actuator 130 to perform a full-stroke rotation and acquiring multiple mechanical angles and multiple detection angles to update the mapping table. That is, updating the mapping table may include, firstly, controlling the actuator 130 to perform the aforementioned full-stroke rotation to acquire the corresponding multiple recorded mechanical angles {m01, m02, ..., m0}. i , ...m0 n The magnetic encoder 120 outputs multiple reference detection angles {aref1, aref2, ..., aref} i , ...arefn In other words, the detection angles output by the magnetic encoder can be read at the same sampling rate and at the same sampling position (i.e., the same mechanical angle position) as during the full stroke rotation of the actuator when mapping table 300 is established. i , ...aref n}), so that the acquired multiple reference detection angles {aref1, aref2, ..., aref i , ...aref n} and multiple recorded mechanical angles {m01, m02, ..., m0 i , ...m0 n} and multiple recorded detection angles {a01, a02, ..., a0} i , ...a0 n Each record is mapped one-to-one. Then, the angles {a01, a02, ..., a0} in the mapping table 300 can be detected. i , ...a0 n Update to the corresponding reference detection angle {aref1, aref2, ..., aref} i , ...aref n}

[0089] As described above, if a secondary verification is performed, sub-steps S2305 and S2308 each include controlling the actuator 130 to rotate through its full stroke and acquiring the corresponding multiple recorded mechanical angles {m01, m02, ..., m0}. i , ...m0 n The magnetic encoder 120 outputs multiple reference detection angles {aref1, aref2, ..., aref} i , ...aref n}, thereby obtaining multiple reference detection angles {aref1, aref2, ..., aref} i , ...aref n} can be directly used to update the mapping table. That is, in reference... Figure 6 and Figure 7 In the described embodiment, if updating the mapping table 300 is determined in steps S2307 and S2310 respectively, then the multiple reference detection angles {aref1, aref2, ..., aref} obtained in sub-steps S2305 and S2308 can be used directly. i , ...aref n In this case, updating the mapping table as described above may include detecting angles {a01, a02, ..., a0} from multiple records in mapping table 300. i , ...a0 n} Updated to the corresponding reference detection angle {aref1, aref2, ..., aref} obtained in step S2307 or S2310 i , ...aref n}

[0090] Return to reference Figure 2 .like Figure 2 As further shown, calibration method 200 may also include step S260 of storing mapping table 300. It can be understood that although step S260 is shown as storing the initially established mapping table after step S250, it may also be performed after step S230, which determines that the mapping table needs updating, to store the updated mapping table. In embodiments of this disclosure, angles {a01, a02…a0} can be detected based on multiple records in the aforementioned mapping table. i , ...a0 n The angle value features of the mapping table are used to adaptively compress and store the data, thereby reducing storage requirements. Specifically, in the embodiments of this disclosure, the angles {a01, a02, ..., a0} are detected by judging multiple records. i , ...a0 n To determine whether to delete the middle detection angle from the mapping table, we need to check whether the detection angles of three consecutive records in the map conform to a linear relationship. Figure 10 A sub-step of step S260 according to an embodiment of the present disclosure is shown, which relates to adaptive compressed storage of the mapping table. Figure 11 A schematic diagram illustrating the mapping relationships stored in the mapping table according to an embodiment of this disclosure is shown in a two-dimensional coordinate system using data points. Figure 11 In the diagram, the horizontal axis represents the mechanical angle of the actuator (representing the actual physical position of the shaft, corresponding to the multiple recorded mechanical angles mentioned above), and the vertical axis represents the detection angle of the magnetic encoder (corresponding to the multiple recorded detection angles mentioned above). Figure 11 In the table, A1 to A5 are discrete mapping points stored in the mapping table. The ordinate of each point corresponds to the recorded detection angle a0. i-1 a0 i a0 i+1 a0 i+2 a0 i+3 The horizontal axis corresponds to the mechanical angle m0 of its associated actuator. i-1 m0 i m0 i+1 m0 i+2 m0 i+3 It can be understood that the sampling time for the mechanical angle of the horizontal axis and the recording detection angle of the vertical axis corresponding to each of the mapping points A1 to A5 is the same. When the above discrete mapping points are obtained through sampling under the conditions of uniform actuator rotation and a constant sampling interval of the magnetic encoder (i.e., a fixed sampling rate), as shown... Figure 11 The mechanical angles m0 corresponding to A1 to A5 are shown below. i-1 m0 i m0 i+1 m0 i+2 m0 i+3 The points are evenly spaced on the horizontal axis. It can be understood that if the above conditions are not met (i.e., the actuator rotates at a constant speed and the magnetic encoder has the same sampling interval), the mechanical angles corresponding to the obtained discrete mapping points will not be evenly distributed on the horizontal axis. The following section combines... Figure 10 and Figure 11 This specification describes an adaptive compression storage scheme for mapping tables based on embodiments of the present disclosure. It will be understood that, although the following is combined with… Figure 11 The above conditions have been described. However, regardless of whether the above conditions are met (i.e., the actuator rotates at a constant speed and the magnetic encoder has the same sampling interval), the adaptive compression storage scheme described below can be used to store the mapping table.

[0091] like Figure 10 As shown, step S260 may include sub-steps S2601 to S2603.

[0092] In sub-step S2601, for multiple recorded detection angles {a01, a02, ..., a0}, i , ...a0 n Any record detection angle a0 in} i Here it is referred to as the current recorded detection angle a0. i The current recorded detection angle a0 can be calculated. i and the current recorded detection angle a0 i The corresponding derivation of the detection angle a0 i’ The absolute deviation between Mdiff i =|a0 i -a0 i’ |. Derivation of the detection angle a0 i’ It can be based on the detection angle a0 of the current record. i The detection angles of two adjacent records (a0) i-1 and a0 i+1 It is calculated using linear interpolation. For example, it can be calculated as a0. i’ = a0 i-1 +(a0 i+1 - a0 i-1 )×(m0 i - m0 i-1 ) / (m0 i+1 -m0 i-1 It can be understood that, under the above conditions (i.e., the actuator rotates at a constant speed and the magnetic encoder has the same sampling interval), a0 i’Equal to the current recorded detection angle a0 i The detection angles of two adjacent records (a0) i-1 and a0 i+1 The median of ), i.e., a0 i’ = ((a0 i-1 +a0 i+1 ) / 2). Absolute deviation Mdiff i It can indicate a0 i-1 a0 i a0 i+1 The degree of linear deviation between the three values.

[0093] In substep S2602, in response to the absolute deviation Mdiff i If the current record's detection angle a0 is less than or equal to the linear deviation threshold LTH, it is deleted from mapping table 300. i and its corresponding recording mechanical angle m0 i If the absolute deviation Mdiff i If the value is less than or equal to the linear deviation threshold LTH, it indicates that there are three adjacent sampling points a0. i-1 a0 i a0 i+1 The relationship between them is approximately linear, with the intermediate value a0. i Its two values ​​a0 before and after i-1 and a0 i+1 The linear deviation is extremely small. In this case, the intermediate value a0 i It can be based on the two values ​​a0 before and after. i-1 and a0 i+1 The data is restored using linear interpolation, therefore it does not need to be stored separately in mapping table 300. The detection angle a0 is deleted from mapping table 300. i and its corresponding recording mechanical angle m0 i This can effectively compress the data size of the mapping table and reduce storage overhead. For example, combined with... Figure 11 As shown in the coordinate system, A1, A2, and A3 are three equally spaced mapping sampling points on the horizontal axis, where point A2 (corresponding to the recording detection angle a0) is the most significant. i ) represents the current sampling point in the middle position. When the recording detection angle (a0) corresponding to A2 is... i The median of the recorded detection angles corresponding to points A1 and A3 ((a0) i-1 +a0 i+1 The absolute deviation Mdiff between ) / 2) i =|(a0 i -(a0 i-1 +a0 i+1When the angle of point A1, A2, and A3 is less than or equal to the linear deviation threshold LTH, it indicates that points A1, A2, and A3 are essentially on the same straight line. The angle value of point A2 can be obtained by linear interpolation between A1 and A3, so there is no need to store it independently. Therefore, it is not necessary to store it in the mapping table. Figure 11 The recording detection angle a0 corresponding to point A2 in the diagram i And record mechanical angle m0 i This is done to compress the data volume of the mapping table and reduce storage overhead. Furthermore, it can be seen that... Figure 11 The record detection angle a0 corresponding to data point A4 in the data is i+2 And record mechanical angle m0 i+2 It can also be deleted from mapping table 300. For cases where the detection angle output by the magnetic encoder changes with the mechanical angle of the actuator in a linear relationship defined by the linear deviation threshold LTH, this method of compressing the mapping table can theoretically reduce the number of elements in the mapping table from the original n sampling points to only 2 sampling points, thereby realizing the design concept of exchanging smaller precision errors for larger storage space compression.

[0094] Compared to sub-step S2602, in sub-step S2603, in response to the absolute deviation Mdiff i If the deviation is greater than the linear deviation threshold LTH, the current recorded detection angle a0 can be retained in mapping table 300. i and its corresponding recording mechanical angle m0 i If the absolute deviation Mdiff i If the value is greater than the linear deviation threshold LTH, it indicates that the three adjacent sampling points a0 i-1 a0 i a0 i+1 The relationships between them are not linear; this set of angle sampling data exhibits significant nonlinear deviation and does not belong to a stationary linear variation range. In this case, the median value a0 i Unable to base on two values ​​a0 i-1 and a0 i+1 The detection angle a0 is recorded because it is restored using linear interpolation. i and its corresponding recording mechanical angle m0 i This preserves useful data for subsequent use in calibrating the detection angle output by the magnetic encoder to the actual mechanical angle based on the mapping table. For example, combined with Figure 11 As shown in the coordinate system, A2, A3, and A4 are three equally spaced mapping sampling points on the horizontal axis, where point A3 (corresponding to the recording detection angle a0) i+1 The current sampling point is located in the middle position. When the recording detection angle (a0) corresponding to A3 is... i+1 The median of the recorded detection angles corresponding to points A2 and A4 (a0)i +a0 i+2 ) / 2, corresponding to Figure 11 The absolute deviation Mdiff between point A3' in the middle) i+1 =|(a0 i+1 -(a0 i +a0 i+2 When the angle value of point A2, A3, and A4 is greater than the linear deviation threshold LTH, it indicates that points A2, A3, and A4 are not on the same straight line. The angle value of point A3 cannot be obtained by linear interpolation between A2 and A4, therefore it needs to be stored independently. Therefore, it can be retained in the mapping table. Figure 11 The recording detection angle a0 corresponding to point A3 in the diagram i+1 And record mechanical angle m0 i+1 This is to preserve useful data for calibrating the detection angle output by the magnetic encoder to the actual mechanical angle based on the mapping table in subsequent use.

[0095] Understandable, although Figure 10 Step S2603 is shown as following step S2602, but in reality, the two can be based on the absolute deviation Mdiff. i The decision to execute depends on the magnitude of the linear deviation threshold LTH.

[0096] The aforementioned linear deviation threshold LTH can be flexibly set according to the accuracy requirements of the actual application scenario, the resolution of the magnetic encoder, the mechanical characteristics of the actuator, and the performance constraints of the system. For example, its value can be determined by combining the minimum detection step size of the magnetic encoder and the maximum allowable angle error of the system, or a balance can be achieved between data compression rate and angle restoration accuracy through multiple sets of experimental data measurements or simulation tests. In some embodiments, differentiated linear deviation thresholds can also be set according to different actuator operating ranges.

[0097] After the mapping table is compressed and stored, it can be used in subsequent applications to map / calibrate the real-time output detection angle of the magnetic encoder to the actual mechanical angle position of the actuator. Specifically, during actual data mapping, the current output detection angle value Aread of the magnetic encoder can be read in real time. i Read the value Aread i Using this as a retrieval benchmark, the compressed and simplified mapping table is traversed and searched. From all the record detection angle data stored in the table in an ordered manner, a set of left and right boundary endpoints adjacent to the read value is quickly located, i.e., the detection angle a0 of the left neighboring record. p Detection angle a0 with the adjacent record on the right q This determines the current read value Aread. i The range of the interval [a0] p , a0q After determining the boundary endpoints and intervals, use a0 p a0 q Using the corresponding mechanical angle data of each as the interpolation reference, and flexibly selecting an appropriate interpolation method based on the accuracy requirements of the actual application scenario, including linear interpolation or higher-order nonlinear interpolation algorithms, the detection angle value Aread output by the current magnetic encoder is calculated. i The corresponding mechanical angle values. In this way, the data storage volume can be reduced and the table lookup operation overhead can be lowered by compressing the mapping table, and interpolation can be used to fill in missing data in the interval, ensuring the continuity and accuracy of the angle mapping results.

[0098] As described above, the mapping table can be established through steps S240 and S250. In the embodiments of this disclosure, a series of table establishment reliability mechanisms are also considered to eliminate or mitigate the impact of deviations caused by loss of synchronization during the establishment of the mapping table.

[0099] According to a reliability mechanism, actuator 130 can be controlled to rotate through full stroke via microstepping during the mapping table establishment. That is, in some embodiments, actuator 130 can be driven in microstepping mode during the full stroke rotation control in step S240. The number of microsteps for the predetermined step angle of actuator 130 can be positively correlated with the resolution of magnetic encoder 120. Taking a stepper motor with a predetermined step angle of 1.8° as an example, its step angle can be subdivided into 256 equal parts or higher. With the high microstepping drive mode, on the one hand, the quantitative control accuracy of the theoretical cumulative angle of the stepper motor can be effectively improved; on the other hand, the cumulative angle error of the stepper motor can be averaged or suppressed within a single full stroke rotation (e.g., 360°) cycle, resulting in extremely high angle consistency of the stepper motor in short cycles.

[0100] In practical applications, the subdivision of the predetermined step angle of the actuator 130 can be positively correlated with the angular resolution of the magnetic encoder 120. The higher the angular resolution of the magnetic encoder, the larger the subdivision of the step angle required by the actuator, in order to ensure the quantization accuracy of the conversion between the actuator's drive steps and the mechanical angle, and to match the detection accuracy of the magnetic encoder.

[0101] According to another reliability mechanism, only the mechanical angles and detection angles acquired during the uniform rotation period of the actuator 130 during its full-stroke rotation can be used as valid sample data to establish a mapping table. This means discarding the detection angle data and corresponding mechanical angle data output by the magnetic encoder at the beginning and end stages of the actuator's full-stroke rotation (corresponding to acceleration / deceleration). This is because the overall operating speed is dynamically changing during the instant and transition period when the actuator changes from stationary to rotating and from motion to stationary, causing significant jitter in the angle signal output of the magnetic encoder. If the detection angle data obtained under these conditions is used to establish the mapping relationship, it will reduce the accuracy of the mapping table, causing significant errors in subsequent angle conversion / calibration. Therefore, in some embodiments, acquiring multiple recorded mechanical angles and multiple recorded detection angles in step S240 may include acquiring multiple recorded mechanical angles and multiple recorded detection angles when the actuator is in a uniform rotation state, thereby ensuring the accuracy of subsequent angle conversion / calibration. The actuator can be determined to be in the start-stop phase or the uniform rotation phase using various known methods. For example, the actuator's drive electrical parameters, rotational speed, angular acceleration, and other data can be combined to determine whether the actuator is in the start-stop phase or the uniform rotation phase.

[0102] Under certain operating conditions, the actuator may still experience step loss even during uniform rotation. In this case, the collected mechanical angle and detection angle data cannot be used to establish the mapping table, and the mapping table establishment process needs to be re-executed, i.e., steps S240 and S250 need to be re-executed. The presence of step loss during the uniform rotation phase can be determined by monitoring the changes in the actuator's drive current and drive voltage, thus determining the usability of the data collected during this phase. Typically, when the actuator is in uniform rotation and no step loss occurs, the actuator's drive current and drive voltage will remain stable without any sudden changes.

[0103] Accordingly, in some embodiments, it can be determined whether to establish a mapping table 300 based on the multiple recorded mechanical angles and multiple recorded detection angles obtained when the actuator is in a uniform rotation state, based on whether the absolute value of the change in the drive current of the actuator 130 between adjacent sampling times is less than the current stability threshold and / or whether the absolute value of the change in the drive voltage of the actuator 130 between adjacent sampling times is less than the voltage stability threshold. This is to eliminate the influence of step loss on the mapping table, ensure that the sample data used to establish the mapping table are all taken from the stable operating condition of the actuator without step loss, and ensure the reliability and calibration accuracy of the finally generated mapping table.

[0104] Specifically, if the absolute value of the change in driving current between adjacent sampling times, Δi, is less than the current stabilization threshold It and / or the absolute value of the change in driving voltage between adjacent sampling times, Δv, is less than the voltage stabilization threshold Vt, then it can be determined that no synchronization loss has occurred, and mapping table 300 can be established based on the multiple recorded mechanical angles and multiple recorded detection angles obtained when the actuator is in a uniform rotation state. Conversely, if the absolute value of the change in driving current between adjacent sampling times, Δi, is greater than or equal to the current stabilization threshold It, or the absolute value of the change in driving voltage between adjacent sampling times, Δv, is greater than or equal to the voltage stabilization threshold Vt, then it can be determined that synchronization loss has occurred, and mapping table 300 cannot be established based on the multiple recorded mechanical angles and multiple recorded detection angles obtained when the actuator is in a uniform rotation state. Instead, the mapping table establishment process needs to be re-executed.

[0105] The aforementioned current stabilization thresholds It and Vt can be flexibly set according to the noise level of the drive signal. For example, the current stabilization threshold It can be set as a multiple of the peak-to-peak noise In of the drive current, and the voltage stabilization threshold Vt can be set as a multiple of the peak-to-peak noise Vn of the drive voltage. As an example, the current stabilization threshold It can be equal to 2 × In, and the voltage stabilization threshold Vt can be equal to 2 × Vn.

[0106] According to another reliability mechanism, a "two-way verification" mechanism can be used during the mapping table establishment phase. Specifically, during the mapping table establishment phase, the actuator can be controlled to perform full-stroke rotation in both clockwise and counterclockwise directions, and two mapping tables can be compared, one established based on the mechanical angles and the other on the detection angles acquired during the clockwise and counterclockwise full-stroke rotations. If the deviation between the two detection angles output by the magnetic encoder corresponding to the same mechanical angle is too large, it indicates that a loss of synchronization has occurred during the clockwise and / or counterclockwise full-stroke rotation. In this case, the acquired data can be discarded and the mapping table establishment process can be re-executed.

[0107] Therefore, in some embodiments, the establishment of the mapping table involved in step S250 above may include, firstly, controlling the actuator 130 to perform clockwise full-stroke rotation and counterclockwise full-stroke rotation respectively. Then, a first candidate mapping table can be established based on multiple recorded mechanical angles of the actuator 130 acquired during the clockwise full-stroke rotation and multiple clockwise detection angles synchronously output by the magnetic encoder, and a second candidate mapping table can be established based on multiple recorded mechanical angles of the actuator 130 acquired during the counterclockwise full-stroke rotation and multiple counterclockwise detection angles synchronously output by the magnetic encoder. It is understood that the multiple recorded mechanical angles of the actuator acquired during the clockwise full-stroke rotation and the multiple recorded mechanical angles of the actuator acquired during the counterclockwise full-stroke rotation may correspond separately. For example, the first and second recorded mechanical angles of the actuator acquired during the clockwise full-stroke rotation may be the same as the last and second-to-last recorded mechanical angles of the actuator acquired during the counterclockwise full-stroke rotation, respectively, because the two rotations cover the same stroke, only the rotation directions are opposite.

[0108] Next, based on the first and second candidate mapping tables mentioned above, the absolute values ​​of the differences between the clockwise and counterclockwise detection angles corresponding to the same recorded mechanical angle can be calculated to obtain a set of absolute angle differences. It can be understood that if no step loss occurs during the full clockwise and counterclockwise rotation, each absolute angle difference in the above set of absolute angle differences can approach zero or be within a very small reasonable range.

[0109] Therefore, in subsequent judgments, if the number of absolute angle differences exceeding the angle deviation threshold AoDTH in this set of absolute angle differences is less than the deviation quantity threshold DNTH, it indicates that the two rotation processes are stable, the detection data is reliable, and no synchronization loss has occurred. In this case, either the first candidate mapping table or the second candidate mapping table can be used as the aforementioned mapping table. Conversely, if the number of absolute angle differences exceeding the angle deviation threshold AoDTH in this set of absolute angle differences is greater than or equal to the deviation quantity threshold DNTH, it indicates that synchronization loss may occur during clockwise full-stroke rotation and / or counterclockwise full-stroke rotation. Therefore, the first candidate mapping table and the second candidate mapping table should be discarded, and the process of establishing the mapping table should be repeated until a mapping table that meets the requirements is obtained.

[0110] The angle deviation threshold AoDTH mentioned above can be reasonably set according to the actual application scenario and hardware characteristics of the actuator, such as by combining motor shaft clearance, structural gear tolerances, and empirical values, for example, setting it to 2°. The deviation quantity threshold DNTH can also be flexibly set according to actual needs, such as by the angle range of the actuator's full stroke rotation, sampling density, and angle detection accuracy requirements. For example, the deviation quantity threshold DNTH can be set to 5% of the total number of samples, etc.

[0111] The calibration method 200 according to embodiments of this disclosure utilizes predefined rotations of the actuator, such as inherent periodic rotations (e.g., gimbal self-checks when a camera is powered on, printer repositioning, robot joint reset movements, and drone rotor tests), to trigger a check on whether the mapping table remains valid. This achieves "user-unnoticed self-maintenance" and can utilize this predefined rotation to complete the self-check and update of the mapping table's validity throughout the entire lifecycle of the magnetic encoder. The accuracy of the mapping relationship can be confirmed periodically without user intervention or awareness, solving the problem of nonlinear mapping relationship failure that may occur during user operation due to magnet damage, magnet residual flux attenuation, magnet assembly position misalignment, or interference from surrounding magnets. Furthermore, the calibration method 200 according to embodiments of this disclosure can automatically generate and update the mapping table throughout the entire lifecycle of the magnetic encoder without requiring precise mechanical angle measurements using third-party sensing devices. Moreover, the calibration method 200 according to embodiments of this disclosure can also employ an adaptive compression scheme to store the mapping table, thereby reducing data storage volume and lowering storage overhead. In addition, the calibration method 200 according to the embodiments of this disclosure can eliminate or mitigate the impact of deviations caused by loss of synchronization during the mapping table establishment process by combining the above-mentioned series of table establishment reliability mechanisms.

[0112] Embodiments of this disclosure also provide a calibration apparatus for a magnetic encoder. Figure 12 A schematic diagram of a calibration apparatus 1200 for a magnetic encoder according to an embodiment of the present disclosure is shown. The calibration apparatus 1200 can be used to perform, for example, the method 200 described above.

[0113] like Figure 12 As shown, the calibration device 1200 may include a processor 1210 and a memory 1220. The processor 1210 is communicatively coupled to the memory 1220 and is configured to perform the method 200 discussed above.

[0114] Examples of processor 1210 include microprocessors, microcontrollers, digital signal processors (DSPs), field-programmable gate arrays (FPGAs), programmable logic devices (PLDs), state machines, gated logic, discrete hardware circuits, and other suitable hardware configured to perform the various functions described in this disclosure.

[0115] Processor 1210 can execute software. Software should be broadly interpreted as instructions, instruction sets, code, code segments, program code, programs, subroutines, software modules, application programs, software applications, software packages, routines, subroutines, objects, executable files, execution threads, procedures, functions, etc., regardless of whether it is referred to as software, firmware, middleware, microcode, hardware description languages, or otherwise. The software may reside on memory 1220.

[0116] Memory 1220 may be a non-transitory computer-readable medium. Non-transitory computer-readable media include, for example, magnetic storage devices (e.g., hard disks, floppy disks, magnetic stripes), optical disks (e.g., optical discs (CDs) or digital versatile optical discs (DVDs)), smart cards, flash memory devices (e.g., cards, memory cards, or key drives), random access memory (RAM), read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), registers, removable disks, and any other suitable medium for storing software and / or instructions that can be accessed and read by a computer. Memory 1220 may reside in processor 1210, be external to processor 1210, or be distributed across multiple entities including processor 1210. Memory 1220 may be embodied in a computer program product. For example, a computer program product may include a computer-readable medium in packaging material. Those skilled in the art will recognize how the functionality described throughout this disclosure can be implemented based on the specific application and overall design constraints imposed on the overall system.

[0117] Furthermore, according to another embodiment of this disclosure, a computer program product for a magnetic encoder is disclosed. As an example, the computer program product may include program instructions that can be executed by a processor. When executed, the program instructions cause the processor to perform one or more of the processes described above; details are omitted here for brevity.

[0118] According to another embodiment of this disclosure, a camera is disclosed. The camera may include a magnetic encoder and the aforementioned calibration device 1200 for calibrating the magnetic encoder. It is understood that, in addition to the magnetic encoder and calibration device 1200, the camera may also include a lens module, a pan-tilt unit supporting the lens module, and an actuator for driving the pan-tilt unit. The actuator may be an actuator with a predetermined step angle, and the aforementioned magnetic encoder and calibration device 1200 may be included in the actuator. In some embodiments, the actuator may be a stepper motor.

[0119] This invention can be a system, method, and / or computer program product at any possible level of integration technical detail. The computer program product may include computer-readable program instructions for causing a processor to perform various aspects of this disclosure.

[0120] Unless otherwise stated, an element mentioned in the singular is not intended to mean "one and only one," but rather "one or more." Similarly, a plural reference to an element does not mean "more than one," but rather "one or more," unless otherwise stated or contradicting description elsewhere. Terms such as "if," "when," and "although" should be interpreted as "under the condition of," rather than implying an immediate temporal relationship or response. That is, these phrases, such as "when," do not imply an immediate action in response to an action occurring or during an action, but merely imply that an action will occur if the condition is met, but does not require a specific or immediate time constraint for the action to occur. Combinations, such as "at least one of A, B, or C," "one or more of A, B, or C," "at least one of A, B, and C," "one or more of A, B, and C," and "A, B, C, or any combination thereof," include any combination of A, B, and / or C, and may include multiple A, multiple B, or multiple C. Combinations such as “at least one of A, B or C”, “one or more of A, B or C”, “at least one of A, B and C”, “one or more of A, B and C” and “A, B, C or any combination thereof” can be only A, only B, only C, A and B, A and C, B and C or A, B and C, wherein any such combination may contain one or more members of A, B or C.

[0121] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible structures, functions, and operations of the methods and apparatus according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, a program segment, or a portion of code containing at least one executable instruction for implementing a specified logical function. It should also be noted that in some alternative embodiments, the functions described in a block may occur in a different order than those described in the accompanying drawings. For example, two blocks shown consecutively may actually be executed in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware system that performs the specified function or operation, or by a combination of dedicated hardware and computer instructions.

[0122] The various embodiments described in this disclosure are for illustrative purposes and are not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope of the described embodiments. The terminology used herein is chosen to best explain the principles of the embodiments, their practical application, or improvements to techniques found in the market, or to enable those skilled in the art to understand the embodiments disclosed herein.

[0123] Throughout the description and claims of this specification, the word “comprising” and variations thereof, such as “comprising” and “including,” means “including, but not limited to,” and are not intended to exclude, for example, other additives, components, integers, or steps. “Exemplary” means “an example of a preferred or ideal implementation and is not intended to convey its indication.” “Like” is not used in a limiting sense but for interpretative purposes.

[0124] As used in this disclosure, the term "determine" can include a variety of operations. For example, "determine," calculation, operation, processing, derivation, investigation, search (e.g., searching in a table, database, or other data structure), and ascertainment are all considered "determine." Additionally, "determine" also refers to receiving (e.g., receiving information), sending (e.g., sending information), inputting, outputting, and accessing (e.g., accessing data in memory). Furthermore, "determine" can also refer to parsing, selecting, picking, opening, and comparing. In other words, several actions can be considered "determine."

[0125] As used in this disclosure, terms such as “connection,” “coupling,” or any variations thereof refer to any direct or indirect connection or combination between two or more units, which may include situations where one or more intermediate units exist between two units that are “connected” or “coupled” to each other. The coupling or connection between units may be physical or logical, or a combination of both. As used in this disclosure, two units may be considered electrically connected by means of one or more wires, cables, and / or printing, and as numerous non-limiting and non-exhaustive examples, may be “connected” or “coupled” to each other by means of electromagnetic energy in the radio frequency region, microwave region, and / or light (visible and invisible) region, etc.

[0126] The present disclosure has been described in detail above; however, it will be apparent to those skilled in the art that the present disclosure is not limited to the embodiments described herein. The present disclosure may be implemented in modified and altered forms without departing from the spirit and scope of the present disclosure as defined by the claims.

Claims

1. A calibration method for a magnetic encoder, the magnetic encoder being used to detect and output the angular position of an actuator having a predetermined step angle, the calibration method comprising: In response to the actuator performing a predefined rotation, the set of current mechanical angles of the actuator and the set of current detection angles synchronously output by the magnetic encoder are obtained; Based on the set of current mechanical angles, a mapping table is queried to determine the set of first recorded detection angles corresponding to the set of current mechanical angles. The mapping table records a predefined mapping relationship between multiple recorded detection angles and multiple recorded mechanical angles corresponding to the full stroke rotation of the actuator. The set of current mechanical angles is a subset of the multiple recorded mechanical angles. as well as Based on the comparison between the current set of detection angles and the first set of recorded detection angles, it is determined whether to update the mapping table.

2. The calibration method according to claim 1, wherein, Based on a comparison between the current set of detected angles and the first set of recorded detected angles, determining whether to update the mapping table includes: Calculate the first relative deviation of each current detection angle relative to the corresponding first recorded detection angle in the set of first recorded detection angles to obtain a set of first relative deviations; and In response to the fact that the number of first relative deviations exceeding a first relative deviation threshold in the set of first relative deviations is greater than a first quantity threshold, it is determined to update the mapping table.

3. The calibration method according to claim 1, wherein, Based on a comparison between the current set of detected angles and the first set of recorded detected angles, determining whether to update the mapping table includes: Calculate the first relative deviation of each current detection angle relative to the corresponding first recorded detection angle in the set of first recorded detection angles to obtain a set of first relative deviations; In response to the fact that the number of first relative deviations exceeding a first relative deviation threshold in the set of first relative deviations is greater than a first quantity threshold, the actuator is controlled to perform the full stroke rotation and acquire multiple reference detection angles corresponding to the output of the magnetic encoder of the multiple recorded mechanical angles; Calculate the second relative deviation of each reference detection angle relative to the corresponding recorded detection angle among the plurality of recorded detection angles to obtain a set of second relative deviations; and In response to the fact that the number of second relative deviations exceeding a second relative deviation threshold in the set of second relative deviations is greater than a second quantity threshold, it is determined to update the mapping table.

4. The calibration method according to claim 1, wherein, Based on a comparison between the current set of detected angles and the first set of recorded detected angles, determining whether to update the mapping table includes: Calculate the first absolute deviation of each current detection angle relative to the corresponding first recorded detection angle in the set of first recorded detection angles to obtain a set of first absolute deviations; and In response to the sum of the first set of absolute deviations being greater than the first absolute deviation threshold, the mapping table is determined to be updated.

5. The calibration method according to claim 1, wherein, Based on a comparison between the current set of detected angles and the first set of recorded detected angles, determining whether to update the mapping table includes: Calculate the first absolute deviation of each current detection angle relative to the corresponding first recorded detection angle in the set of first recorded detection angles to obtain a set of first absolute deviations; In response to the sum of the first set of absolute deviations being greater than the first absolute deviation threshold, the actuator is controlled to perform the full stroke rotation and acquire multiple reference detection angles corresponding to the output of the magnetic encoder of the multiple recorded mechanical angles; Calculate the second absolute deviation of each reference detection angle relative to the corresponding recorded detection angle among the plurality of recorded detection angles to obtain a set of second absolute deviations; and In response to the sum of the set of second absolute deviations being greater than the second absolute deviation threshold, the mapping table is determined to be updated.

6. The calibration method according to claim 1, wherein, The predefined rotation is a full-stroke rotation.

7. The calibration method according to claim 6, wherein, Based on a comparison between the current set of detected angles and the first set of recorded detected angles, determining whether to update the mapping table includes: Calculate the first relative deviation of each current detection angle relative to the corresponding first recorded detection angle in the set of first recorded detection angles to obtain a set of first relative deviations; In response to the fact that the number of first relative deviations exceeding a first relative deviation threshold in the set of first relative deviations is greater than a first quantity threshold, the absolute step difference between the first total drive steps of the actuator during the mapping table establishment period and the second total drive steps of the actuator during the predefined rotation period is calculated; and In response to the absolute step difference being greater than the step loss threshold, the mapping table is determined to be updated.

8. The calibration method according to claim 6, wherein, Based on a comparison between the current set of detected angles and the first set of recorded detected angles, determining whether to update the mapping table includes: Calculate the first absolute deviation of each current detection angle relative to the corresponding first recorded detection angle in the set of first recorded detection angles to obtain a set of first absolute deviations; In response to the sum of the first set of absolute deviations being greater than a first absolute deviation threshold, the absolute step difference between the first total drive steps of the actuator during the mapping table establishment period and the second total drive steps of the actuator during the predefined rotation period is calculated; and In response to the absolute step difference being greater than the step loss threshold, the mapping table is determined to be updated.

9. The calibration method according to claim 1, further comprising: The actuator is controlled to perform the full-stroke rotation to obtain the plurality of recorded mechanical angles and the plurality of recorded detection angles synchronously output by the magnetic encoder; as well as The mapping table is established based on the multiple recording mechanical angles and the multiple recording detection angles.

10. The calibration method according to claim 3 or 5, wherein, Updating the mapping table includes: Update the detection angles of the multiple records in the mapping table to the corresponding reference detection angles.

11. The calibration method according to claim 1, further comprising storing the mapping table, wherein storing the mapping table includes: Calculate the absolute deviation between the current record detection angle and the derived detection angle corresponding to the current record detection angle among the plurality of record detection angles, wherein the derived detection angle is calculated based on the linear interpolation of two record detection angles adjacent to the current record detection angle; In response to the absolute deviation being less than or equal to the linear deviation threshold, the current recorded detection angle and its corresponding recorded mechanical angle are deleted from the mapping table; as well as In response to the absolute deviation being greater than the linear deviation threshold, the current recorded detection angle and its corresponding recorded mechanical angle are retained in the mapping table.

12. The calibration method according to claim 9, wherein, During the full-stroke rotation of the actuator, the actuator is driven in a subdivision mode, wherein the subdivision number of the predetermined step angle of the actuator is positively correlated with the angular resolution of the magnetic encoder.

13. The calibration method according to claim 9, wherein, Acquiring the plurality of recorded mechanical angles and the plurality of recorded detection angles includes acquiring the plurality of recorded mechanical angles and the plurality of recorded detection angles when the actuator is in a state of uniform rotation.

14. The calibration method according to claim 13, wherein, Whether the mapping table should be established based on the plurality of recorded mechanical angles and the plurality of recorded detection angles is determined based on whether the absolute value of the change in the actuator's drive current between adjacent sampling times is less than a current stability threshold and / or whether the absolute value of the change in the drive voltage between adjacent sampling times is less than a voltage stability threshold during the period when the actuator is in the uniform rotation state.

15. The calibration method according to claim 9, wherein, Establishing the mapping table includes: The actuator is controlled to rotate clockwise and counterclockwise in full stroke respectively; A first candidate mapping table is established based on the multiple recorded mechanical angles of the actuator obtained during the clockwise full-stroke rotation and the multiple clockwise detection angles synchronously output by the magnetic encoder; and a second candidate mapping table is established based on the multiple recorded mechanical angles of the actuator obtained during the counterclockwise full-stroke rotation and the multiple counterclockwise detection angles synchronously output by the magnetic encoder. Based on the first candidate mapping table and the second candidate mapping table, calculate the absolute value of the difference between the clockwise and counterclockwise detection angles corresponding to the same recorded mechanical angle to obtain a set of absolute angle differences; and If the number of absolute angle differences exceeding the angle deviation threshold in the set of absolute angle differences is less than the deviation number threshold, the first candidate mapping table or the second candidate mapping table is used as the mapping table.

16. The calibration method according to claim 15, wherein, Establishing the mapping table also includes: In response to the fact that the number of absolute angle differences exceeding the angle deviation threshold in the set of absolute angle differences is greater than or equal to the deviation number threshold, the first candidate mapping table and the second candidate mapping table are discarded, and the mapping table is re-established.

17. The calibration method according to claim 1, wherein, Updating the mapping table includes: Controlling the actuator to perform the full-stroke rotation to obtain multiple reference detection angles corresponding to the output of the magnetic encoder of the multiple recorded mechanical angles; and Update the detection angles of the multiple records in the mapping table to the corresponding reference detection angles.

18. A calibration device for a magnetic encoder, comprising: processor; Memory coupled to the processor; as well as Computer program instructions stored in the memory, which, when executed by the processor, perform the method according to any one of claims 1-17.

19. A computer program product comprising computer program instructions that, when executed by a processor, implement the method according to any one of claims 1-17.

20. A camera, comprising a magnetic encoder and a calibration device according to claim 18.