Gimbal positioning method and apparatus, electronic device, and computer storage medium

By acquiring the positional relationship between the magnetic encoder and the zero-crossing detection element, and combining electrical signals and rotation control, the power-off position of the multi-pole magnetic encoder pan-tilt unit can be quickly restored. This solves the problem of long position recovery time for multi-pole magnetic encoders after power failure, and achieves faster position recovery.

WO2026123676A1PCT designated stage Publication Date: 2026-06-18ZHEJIANG UNIVIEW TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
ZHEJIANG UNIVIEW TECH CO LTD
Filing Date
2025-07-14
Publication Date
2026-06-18

AI Technical Summary

Technical Problem

Multi-pole magnetic encoders take a long time to return to the power-off position after a power outage and subsequent power-on, causing inconvenience for users.

Method used

By obtaining the distance between the power-off position of the magnetic encoder and the zero-crossing detection element, and combining it with the electrical signal of the magnetic encoder, the undetermined positions of multiple magnetic pole pairs are determined. The pan-tilt unit is then controlled to rotate in a specific direction to determine the power-off position. The zero-crossing detection element is used to detect the zero-crossing position to quickly restore the device to the power-off position.

🎯Benefits of technology

It shortens the time for the pan-tilt unit of a multi-pole magnetic encoder to return to the power-off position, improves the recovery speed after power-on, and solves the problem of long position recovery time for multi-pole magnetic encoders after power failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025108464_18062026_PF_FP_ABST
    Figure CN2025108464_18062026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of gimbal control, and provides a gimbal positioning method and apparatus, an electronic device, and a computer storage medium. A gimbal is provided with a zero-crossing detection element and a magnetic encoder comprising a plurality of magnetic pole pairs. The method comprises: acquiring a first electrical signal corresponding to a power-off position of a magnetic encoder at power-off, and a first distance between the power-off position and a zero-point position; upon re-energization, determining, on the basis of the first electrical signal, a plurality of power-off positions to be determined that have one-to-one correspondence to a plurality of magnetic pole pairs, and on the basis of a second electrical signal corresponding to a current position of the magnetic encoder, determining a plurality of current positions to be determined that have one-to-one correspondence to the plurality of magnetic pole pairs; determining a self-check rotation direction and a first self-check distance on the basis of the first distance and a second distance between a current position to be determined and a power-off position to be determined in any magnetic pole pair; and determining the power-off position on the basis of the self-check rotation direction and the first self-check distance.
Need to check novelty before this filing date? Find Prior Art

Description

Gimbal positioning methods, devices, electronic equipment, and computer storage media

[0001] Cross-reference to related applications

[0002] This application claims priority to Chinese Patent Application No. 2024118425762, filed on December 13, 2024, entitled “Gimbal Positioning Method, Apparatus, Electronic Device and Computer Storage Medium”, which is incorporated herein by reference in its entirety. Technical Field

[0003] This disclosure relates to the field of gimbal control technology, and in particular to a gimbal positioning method, device, electronic device, and computer storage medium. Background Technology

[0004] For pan-tilt-zoom (PTZ) products (such as PTZ cameras), especially thermal imaging PTZ products, the positioning accuracy requirements are high due to their large lens magnification and field of view. In this case, PTZ cameras equipped with magnetic encoders are usually used to improve the accuracy of the PTZ. At the same time, because magnetic encoders are relatively inexpensive, they are also often installed in the PTZ of network cameras.

[0005] Magnetic encoders come in two types: single-pole-pair encoders, which have one pole pair, and multi-pole-pair encoders, which have multiple pole pairs. In practice, multi-pole-pair encoders offer higher accuracy than single-pole-pair encoders. However, after a power outage and subsequent power restoration, the process of a multi-pole-pair encoder returning to its power-off position takes longer. For pan-tilt units (PTZs) equipped with multi-pole-pair encoders, this can cause considerable inconvenience for users. Summary of the Invention

[0006] This disclosure provides a pan-tilt positioning method, apparatus, electronic device, and computer storage medium to address the shortcomings of related technologies where, for pan-tilt units with multiple magnetic pole pairs and multi-pole pair magnetic encoders, the process of returning from the current position to the power-off position after power failure and re-powering is time-consuming. This aims to reduce the time required for pan-tilt units with multiple magnetic pole pairs and magnetic encoders to return to the power-off position after power-on, and to increase the speed at which pan-tilt units with multiple magnetic pole pairs and magnetic encoders return to the power-off position after power-on.

[0007] This disclosure provides a gimbal positioning method, in which a magnetic encoder and a zero-crossing detection element for detecting the zero point position are provided in the gimbal. The magnetic encoder includes multiple magnetic pole pairs. The method includes the following steps.

[0008] Acquire the first electrical signal corresponding to the power-off position of the magnetic encoder when the power is off, and the first distance between the power-off position and the zero point position of the zero-crossing detection element;

[0009] When power is restored, the multiple undetermined power-off positions corresponding to the multiple magnetic pole pairs are determined according to the first electrical signal, and the multiple undetermined current positions corresponding to the multiple magnetic pole pairs are determined according to the second electrical signal corresponding to the current position of the magnetic encoder.

[0010] For any target magnetic pole pair among the plurality of magnetic pole pairs, obtain the second distance between the target undetermined current position corresponding to the target magnetic pole pair and the target undetermined power-off position corresponding to the target magnetic pole pair;

[0011] Based on the first distance and the second distance, the self-test rotation direction and the first self-test distance are determined, and the gimbal is controlled to rotate along the self-test rotation direction by the first self-test distance;

[0012] Obtain the first detection result of the zero-crossing detection element during the rotation of the first self-test distance;

[0013] If the first detection result indicates that the zero point position has been detected, the power-off position is determined based on the zero point position, and the gimbal is controlled to rotate to the power-off position.

[0014] This disclosure also provides a gimbal positioning device, in which a magnetic encoder and a zero-crossing detection element for detecting the zero point position are provided in the gimbal. The magnetic encoder includes multiple magnetic pole pairs. The device includes the following modules: an acquisition module, a determination module, and a control module.

[0015] The acquisition module is configured to acquire the first electrical signal corresponding to the power-off position of the magnetic encoder when the power is off, and the first distance between the recorded power-off position and the zero-crossing detection element.

[0016] The determination module is configured to, upon power-on, determine multiple undetermined power-off positions corresponding to multiple magnetic pole pairs based on a first electrical signal, and determine multiple undetermined current positions corresponding to multiple magnetic pole pairs based on a second electrical signal corresponding to the current position of the magnetic encoder.

[0017] The acquisition module is also configured to acquire, for any target magnetic pole pair among multiple magnetic pole pairs, the second distance between the first current position corresponding to the target magnetic pole pair and the first de-energized position corresponding to the target magnetic pole pair.

[0018] The module is also configured to determine the self-test rotation direction and the first self-test distance based on the first distance and the second distance.

[0019] The control module is configured to control the pan-tilt unit to rotate along the self-test rotation direction by a first self-test distance, based on the first self-test distance determined by the determination module.

[0020] The acquisition module is also configured to acquire the first detection result of the zero-crossing detection element during the first self-test distance of the gimbal rotation controlled by the control module.

[0021] The determination module is also configured to determine the power-off position based on the zero-point position if the first detection result is that a zero-point position has been detected.

[0022] The control module is also configured to control the pan-tilt unit to rotate to the power-off position based on the power-off position determined by the determination module.

[0023] This disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-described gimbal positioning methods.

[0024] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the gimbal positioning method as described above.

[0025] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements any of the gimbal positioning methods described above. Attached Figure Description

[0026] Figure 1 is a schematic diagram of a single-pole pair magnetic encoder in related technologies.

[0027] Figure 2A is one of the schematic diagrams of a multi-pole pair magnetic encoder in related technologies.

[0028] Figure 2B is a second schematic diagram of a multi-pole pair magnetic encoder in related technologies.

[0029] Figure 3 is one of the flowcharts of the gimbal positioning method provided in the embodiments of this disclosure.

[0030] Figure 4 is a second schematic flowchart of the gimbal positioning method provided in this embodiment of the present disclosure.

[0031] Figure 5A is one of the schematic diagrams of relevant parameters in the positioning process of the magnetic encoder with two magnetic pole pairs in the gimbal positioning method provided in the embodiments of this disclosure.

[0032] Figure 5B is a schematic diagram of relevant parameters in the positioning process of the magnetic encoder with two magnetic pole pairs in the gimbal positioning method provided in this embodiment of the present disclosure.

[0033] Figure 5C is the third schematic diagram of relevant parameters in the positioning process of the magnetic encoder with two magnetic pole pairs in the gimbal positioning method provided in this embodiment of the present disclosure.

[0034] Figure 5D is the fourth of four schematic diagrams showing the relevant parameters in the positioning process of the magnetic encoder with two magnetic pole pairs in the gimbal positioning method provided in this embodiment of the present disclosure.

[0035] Figure 5E is the fifth of five schematic diagrams showing the relevant parameters in the positioning process of the magnetic encoder with two magnetic pole pairs in the gimbal positioning method provided in this embodiment of the present disclosure.

[0036] Figure 6A is one of the schematic diagrams of relevant parameters in the positioning process of the magnetic encoder with four magnetic pole pairs in the gimbal positioning method provided in the embodiments of this disclosure.

[0037] Figure 6B is a second schematic diagram of relevant parameters in the positioning process of the magnetic encoder with four magnetic pole pairs in the gimbal positioning method provided in this embodiment of the present disclosure.

[0038] Figure 6C is the third schematic diagram of relevant parameters in the positioning process of the magnetic encoder with four magnetic pole pairs in the gimbal positioning method provided in this embodiment of the present disclosure.

[0039] Figure 6D is the fourth of four schematic diagrams showing the relevant parameters in the positioning process of the magnetic encoder with four magnetic pole pairs in the gimbal positioning method provided in this embodiment of the present disclosure.

[0040] Figure 6E is the fifth of the schematic diagrams showing the relevant parameters in the positioning process of the magnetic encoder with four magnetic pole pairs in the gimbal positioning method provided in this embodiment of the present disclosure.

[0041] Figure 7 is a third flowchart illustrating the gimbal positioning method provided in this embodiment of the present disclosure.

[0042] Figure 8 is a fourth flowchart illustrating the gimbal positioning method provided in this embodiment of the present disclosure.

[0043] Figure 9 is a fifth flowchart illustrating the gimbal positioning method provided in this embodiment of the present disclosure.

[0044] Figure 10 is a schematic diagram of the gimbal positioning device provided in an embodiment of this disclosure.

[0045] Figure 11 is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0046] Figure 1 is a schematic diagram of a single-pole magnetic encoder. As shown in Figure 1, the single-pole magnetic encoder includes a permanent magnet and a chip made of soft magnetic ferrite material. An air gap is provided between the chip and the permanent magnet to allow the permanent magnet to rotate (e.g., counterclockwise rotation θ in Figure 1). A Hall sensor is provided on the chip to sense changes in the magnetic field on the permanent magnet and convert the magnetic field signal into a corresponding electrical signal.

[0047] In Figure 1, the permanent magnet has a pair of N and S poles. Because the magnetic field is different throughout the 360° range, the absolute position can be sensed within the 360° range, and the relative position (e.g., A) can also be detected. + and A - For a pair of relative positions, B + and B - For a pair of relative positions, C + and C - The Hall sensors (in a pair of relatively opposite positions) output electrical signals of equal magnitude but opposite direction. In this case, after a power outage and subsequent power restoration, the device can quickly and directly return to its position at the time of power failure.

[0048] For multi-pole pair magnetic encoders, the permanent magnet has m (m is a positive integer and m>1) pole pairs, such as the two pole pairs shown in Figure 2A (i.e., two pairs of poles, each pair including one N pole and one S pole), or the four pole pairs shown in Figure 2B, and so on. While multi-pole pair magnetic encoders can meet higher precision requirements, they cannot achieve absolute position sensing because the magnetic field of the same poles in each pair is the same; the spatial magnetic field is only different within a range of (360° / m). Absolute position can be sensed within this range. In this case, after power failure and re-powering, the entire machine needs to rotate 360° for self-testing to find the zero-point position corresponding to the optocoupler, establish the corresponding coordinate system, and then return to the power-off position. The entire process is time-consuming and the speed of determining the power-off position is slow.

[0049] In multi-pole magnetic encoders, since absolute position cannot be determined, a zero-crossing detection element is required to detect the zero point. The position of the zero-crossing detection element is the zero-point position (see the zero-point positions in Figures 2A and 2B).

[0050] Zero-crossing detection elements can be, for example, optical couplers (OC) or other circuit elements capable of zero-crossing detection.

[0051] The gimbal positioning method of this disclosure is described below with reference to Figures 3-6E.

[0052] It should be noted that the gimbal in this embodiment is provided with a rotary encoder and a zero-crossing detection element for detecting the zero point position. The rotary encoder includes multiple magnetic pole pairs.

[0053] Figure 3 is one of the flowcharts of the gimbal positioning method provided in this disclosure, and Figure 4 is another flowchart of the gimbal positioning method provided in an embodiment of this disclosure.

[0054] As shown in Figure 3, the method includes the following steps S401 to S406.

[0055] S401: Obtain the first electrical signal corresponding to the power-off position of the magnetic encoder when the power is off, and the first distance between the recorded power-off position and the zero-crossing detection element.

[0056] When the pan-tilt unit is powered on normally, each rotation of the gimbal causes the magnetic ring in the magnetic encoder to rotate. The magnetic encoder records this position and senses the corresponding electrical signal. In the event of a power outage, the last position recorded on the magnetic encoder is the power-off position, and the last electrical signal sensed by the magnetic encoder is the first electrical signal corresponding to the power-off position.

[0057] When recording position, the magnetic encoder records based on step angles. For example, the magnetic encoder records the zero position as 0. Then, using the zero position as a reference, for every step angle the pan-tilt unit rotates in a set direction (e.g., clockwise), the recorded position data increases by one step angle. Conversely, for every step angle the pan-tilt unit rotates in the opposite direction (e.g., counterclockwise if the set direction is clockwise), the recorded position data decreases by one step angle. For instance, if the pan-tilt unit rotates to the zero position and records it as 0, and the set direction is clockwise, and the pan-tilt unit rotates 3 step angles clockwise from the zero position, the recorded position is 3α (α is the angle corresponding to one step angle). If it continues to rotate 5 step angles clockwise from the current position, the recorded result becomes 8α. If it then rotates 3 step angles counterclockwise from this position, the recorded result becomes 5α (8α – 3α = 5α).

[0058] Once the power-off position is obtained, the first distance between the power-off position and the zero position can be determined based on the step angle. In this case, based on the recorded result of the power-off position (the number of step angles the power-off position has rotated from the zero position), the product of the recorded result and the arc length corresponding to the step angle can be obtained. This product is the arc length from the power-off position to the zero position, and this product is determined as the first distance.

[0059] It should be noted that for each magnetic encoder, the arc length corresponding to the step angle is fixed. Therefore, the step angle at a certain position on the magnetic encoder is proportional to the distance from that position to the zero point. Based on this, the distance from each position on the magnetic encoder to the zero point in this embodiment can also be replaced by the recording result corresponding to that position.

[0060] In this embodiment of the disclosure, for ease of explanation and understanding, the distance between any two positions on the magnetic encoder is defined as the length of the arc between the two positions.

[0061] Taking the two magnetic pole pairs shown in Figure 2A as an example, as shown in Figure 5A, the last position A0 of the magnetic encoder when the pan-tilt unit is powered off is taken as the power-off position. The first electrical signal corresponding to the power-off position A0 is obtained, and the first distance L1 between the power-off position A0 and the zero-crossing detector (optical coupler in Figure 5A) is obtained.

[0062] As shown in Figure 5A, the first distance L1 is the length of the arc from the power-off position A0 to the zero point position O (marked as the red arc in Figure 5A).

[0063] Taking the four magnetic pole pairs shown in Figure 2B as an example, as shown in Figure 6A, the last position D0 of the magnetic encoder when the pan-tilt unit is powered off is taken as the power-off position. The first electrical signal corresponding to the power-off position D0 is obtained, and the first distance L2 between the power-off position D0 and the zero-crossing detector (optical coupler in Figure 6A) is obtained.

[0064] As shown in Figure 6A, the first distance L2 is the length of the arc from the power-off position D0 to the zero point position O (marked as the red arc in Figure 6A).

[0065] S402: After power is restored, multiple undetermined power-off positions corresponding to multiple magnetic pole pairs are determined according to the first electrical signal, and multiple undetermined current positions corresponding to multiple magnetic pole pairs are determined according to the second electrical signal corresponding to the current position of the magnetic encoder.

[0066] After a power outage, due to many uncontrollable external factors, such as moving the camera or flipping the camera, the magnetic encoder in the camera will vibrate. Under these circumstances, the magnetic encoder will inevitably rotate when the power is restored compared to when the power is off, resulting in a rotational angular displacement. Therefore, the current position of the magnetic encoder after power is restored is usually no longer the position when the power is off.

[0067] The process of determining multiple undetermined power-off positions based on the first electrical signal can be as follows: among the multiple electrical signals sensed by the magnetic encoder, the target position corresponding to the target electrical signal with the same first electrical signal is obtained, and the target position is determined as the undetermined power-off position, thus obtaining multiple undetermined power-off positions.

[0068] Multiple undetermined power-off positions correspond one-to-one with multiple magnetic pole pairs. The reason is as follows: In the multiple magnetic pole pairs of the magnetic encoder, the overall spatial magnetic field of each pole pair is the same, but the spatial magnetic field corresponding to each point in the overall spatial magnetic field of each pole pair is different. This results in different electrical signals corresponding to each point in the overall spatial magnetic field of each pole pair. Given the first electrical signal of the power-off position, a position corresponding to the first electrical signal can be determined in the overall spatial magnetic field of each pole pair; this position is the undetermined power-off position. For multiple pole pairs, multiple undetermined power-off positions can be obtained.

[0069] For example, based on the power-off position A0 shown in Figure 5A, among the multiple electrical signals sensed by the magnetic encoder, the electrical signal that is the same as the first electrical signal corresponding to the power-off position A0 is determined, and the position corresponding to the electrical signal is determined as the undetermined power-off position, resulting in positions A1 and A2 as shown in Figure 5B.

[0070] Positions A1 and A2 are both undetermined power-off positions, thus yielding two undetermined power-off positions. Positions A1 and A2 correspond to different magnetic pole pairs.

[0071] It should be noted that the power outage position A0 shown in Figure 5B is only for the purpose of illustrating the power outage position. In reality, A0 may be at position A1 or position A2.

[0072] For example, based on the power-off position D0 shown in Figure 6A, among the multiple electrical signals sensed by the magnetic encoder, the position corresponding to the first electrical signal that is the same as the power-off position D0 is determined, resulting in positions D1, D2, D3 and D4 as shown in Figure 6B.

[0073] It should be noted that the power outage position D0 shown in Figure 6B is only for the purpose of illustrating the power outage position. In reality, the power outage position D0 may be at position D1, or it may be at position D2, position D3 or position D4.

[0074] Similarly, without finding the zero-point position corresponding to the optocoupler, the multi-pole pair magnetic encoder cannot determine its absolute current position. Therefore, by obtaining the second electrical signal corresponding to the current position of the magnetic encoder, multiple undetermined current positions corresponding to multiple pole pairs can be determined based on the second electrical signal.

[0075] As shown in Figure 5C, based on the second electrical signal, multiple undetermined current positions corresponding to the second electrical signal are determined: position C1 and position C2.

[0076] As shown in Figure 6C, based on the second electrical signal, multiple undetermined current positions corresponding to the second electrical signal are determined: position E1, position E2, position E3, and position E4.

[0077] S403: For any target magnetic pole pair among multiple magnetic pole pairs, obtain the second distance between the target current position corresponding to the target magnetic pole pair and the target de-energization position corresponding to the target magnetic pole pair.

[0078] Multiple pending power-off locations and multiple pending current locations may be distributed in the same polarity of multiple magnetic pole pairs.

[0079] For example, as shown in Figure 5C, in a magnetic encoder with two pole pairs, multiple undetermined power-off positions and multiple undetermined current positions are distributed in the N poles of multiple pole pairs. Taking the pole pair formed by poles S1 and N1 as the target pole pair, the target undetermined power-off position is position A1, and the target undetermined current position is position C1. In this case, the distance L3 between position A1 and position C1 is obtained. L3 is the second distance, which is the length of the arc between position A1 and position C1 (marked as the green arc in Figure 5C).

[0080] For example, as shown in Figure 6C, in a magnetic encoder with four pole pairs, multiple undetermined power-off positions and multiple undetermined current positions are distributed in the S poles of multiple pole pairs. Taking the pole pair formed by poles S3 and N3 as the target pole pair, the target undetermined power-off position is position D1, and the target undetermined current position is position E1. In this case, the distance L4 between position D1 and position E1 is obtained. Distance L4 is the second distance, which is the length of the arc between position D1 and position E1 (marked as the green arc in Figure 6C).

[0081] Multiple pending power-off locations and multiple pending current locations may also be distributed among multiple magnetic pole pairs with different polarities.

[0082] For example, as shown in Figure 5D, in a magnetic encoder with two pole pairs, multiple undetermined power-off positions (positions A1 and A2 in Figure 5D) are located in the N poles of multiple pole pairs, and multiple undetermined current positions (positions C1 and C2 in Figure 5D) are located in the S poles of multiple pole pairs. Taking the pole pair formed by poles S1 and N1 as the target pole pair, the target undetermined power-off position is position A1, and the target undetermined current position is position C2. In this case, the distance L5 between position A1 and position C2 is obtained. L5 is the second distance, which is the length of the arc between position A1 and position C1 (marked as the blue arc in Figure 5D).

[0083] For example, as shown in Figure 6D, in a magnetic encoder with four pole pairs, multiple undetermined power-off positions (positions D1, D2, D3, and D4 in Figure 6D) are located in the S poles of multiple pole pairs, and multiple undetermined current positions (positions E1, E2, E3, and E4 in Figure 6D) are located in the N poles of multiple pole pairs. Taking the pole pair formed by poles S3 and N3 as the target pole pair, the target undetermined power-off position is position D1, and the target undetermined current position is position E1. In this case, the distance L6 between position D1 and position E1 is obtained. L6 is the second distance, which is the length of the arc between position D1 and position E1 (marked as the blue arc in Figure 6D).

[0084] S404: Based on the first distance and the second distance, determine the self-test rotation direction and the first self-test rotation distance, and control the gimbal to rotate along the self-test rotation direction and the first self-test rotation distance.

[0085] The self-test rotation direction can be clockwise or counterclockwise.

[0086] The first self-check rotation distance can be the sum of the first distance and the second distance, or it can be the difference between the first distance and the second distance.

[0087] To minimize the time required for gimbal positioning, it's necessary to determine the actual current position (the actual current position) passing through the zero point while rotating the minimum distance. In some embodiments, if the first distance is greater than the second distance, the self-test rotation direction is determined to be clockwise, and the first self-test rotation distance is the difference between the first and second distances. The specific reasons are as follows.

[0088] When the first distance is greater than the second distance, the target's current position may be located between the target's current position and the zero-crossing detection element, as shown in Figure 5C (for 2 magnetic pole pairs) and Figure 6C (for 4 magnetic pole pairs).

[0089] In the scenario shown in Figure 5C, to determine the actual current position passing through the zero point with the minimum rotation distance, since position C1 is the closest undetermined current position to the optical coupler, we can assume that position C1 is the actual current position. In this case, we can rotate the gimbal clockwise by L1-L3 (the first distance is L1, the second distance is L3, and the result of L1-L3 is the arc length between OC1 and C2). If the optical coupler detects the zero point, meaning the optical coupler detects that the actual current position has passed through the optical coupler, then position C1 is the actual current position. If the optical coupler does not detect the zero point, meaning the actual current position has not passed through the optical coupler, then position C1 is not the actual current position. In this case, by elimination, we can directly determine that position C2 is the actual current position. Obviously, the above method can determine the actual current position with the minimum rotation distance, and thus determine the power-off position based on the actual current position, thereby saving the time spent in the gimbal positioning process.

[0090] In the case shown in Figure 6C, to determine if the actual current position passes through the zero point with the minimum rotation distance, since position E1 is the closest unknown current position to the optical coupler, we can assume that position E1 is the actual current position. In this case, we can rotate the gimbal clockwise by L2-L4 (the first distance is L2, the second distance is L4, and the result of L2-L4 is the arc length between OE1). If the optical coupler detects the zero point, that is, if the optical coupler detects that the actual current position has passed through the optical coupler, then position E1 is the actual current position. If the optical coupler does not detect the zero point, that is, if the actual current position has not passed through the optical coupler, we can quickly rule out the case that position E1 is the actual current position (after ruling out position E1 as the actual current position, how to determine the actual current position is explained in the examples for S407 to S410 below, which will not be elaborated here). The above method can determine if the actual current position passes through the zero point with the minimum rotation distance, thereby saving the time spent in the gimbal positioning process.

[0091] Similarly, in order to minimize the time required for gimbal positioning, in some embodiments, when the first distance is less than the second distance, the self-test rotation direction is determined to be clockwise, and the first self-test distance is the sum of the first and second distances; or, when the first distance is less than the second distance, the self-test rotation direction is determined to be counterclockwise, and the first self-test distance is the difference between the first and second distances. The specific reasons are as follows.

[0092] When the first distance is less than the second distance, for a magnetic encoder with two pole pairs, two situations will occur, as shown in Figure 5D and Figure 5E. For a magnetic encoder with four pole pairs, two situations will occur, as shown in Figure 6D and Figure 6E.

[0093] First, let's explain the scenario shown in Figure 5D. As shown in Figure 5D, to determine if the actual current position passes through the zero point while minimizing rotation distance, position C2 is the nearest potential current position to the optical coupler. We can assume that position C2 is the actual current position. In this case, we can rotate the gimbal clockwise by L5+L1 (the first distance is L1, the second distance is L5, and the result of L5+L1 is the arc length between C2 and O2). If the optical coupler detects the zero point, meaning the optical coupler detects that the actual current position has passed through the optical coupler, then position C2 is the actual current position. If the optical coupler does not detect the zero point, meaning the actual current position has not passed through the optical coupler, then position C1 is not the actual current position. In this case, we can directly determine that position C1 is the actual current position using the process of elimination. Obviously, the above method can determine if the actual current position passes through the zero point while minimizing rotation distance, thus saving time spent on the gimbal positioning process.

[0094] The following explanation addresses the scenario shown in Figure 5E. As shown in Figure 5E, to determine if the actual current position passes through the zero point with the minimum rotation distance, position C1 is the nearest potential current position to the optical coupler. We can assume position C1 is the actual current position, and the second distance is the length corresponding to the blue arc in Figure 5E. In this case, the gimbal can be rotated counterclockwise by L7-L1 (the first distance is L1, the second distance is L7, and the result of L7-L1 is the arc length between OC1). If the optical coupler detects the zero point, meaning the actual current position has passed through the optical coupler, then position C1 is the actual current position. If the optical coupler does not detect the zero point, meaning the actual current position has not passed through the optical coupler, then position C1 is not the actual current position. In this case, by elimination, position C2 can be directly determined as the actual current position. Clearly, this method can determine if the actual current position passes through the zero point with the minimum rotation distance, thus saving time spent on the gimbal positioning process.

[0095] The following explanation addresses the scenario shown in Figure 6D. As shown in Figure 6D, to determine if the actual current position passes through the zero point with the minimum rotation distance, since position E1 is the closest undetermined current position to the optical coupler, we can assume that position E1 is the actual current position. In this case, we can rotate the gimbal clockwise by L2+L6 (the first distance is L2, the second distance is L6, and the result of L2+L6 is the arc length between OE1). If the optical coupler detects the zero point, meaning the optical coupler detects that the actual current position has passed through the optical coupler, then position E1 is the actual current position. If the optical coupler does not detect the zero point, meaning the actual current position has not passed through the optical coupler, we can quickly rule out the possibility that position E1 is the actual current position (after ruling out position E1 as the actual current position, how to determine the actual current position is explained in the examples for S407 to S410 later, which will not be elaborated here). The above method can determine if the actual current position passes through the zero point with the minimum rotation distance, thus saving time spent in the gimbal positioning process.

[0096] The case shown in Figure 6E will be explained next. As shown in Figure 6E, to determine if the actual current position passes through the zero point with the minimum rotation distance, since position E1 is the closest unknown current position to the optical coupler, we can assume that position E1 is the actual current position. The second distance corresponds to the length of the blue arc in Figure 6E. In this case, we can rotate the gimbal counterclockwise by L8-L2 (the first distance is L2, the second distance is L8, and the result of L8-L2 is the arc length between OE1). If the optical coupler detects the zero point, that is, if the optical coupler detects that the actual current position has passed through the optical coupler, then position E1 is the actual current position. If the optical coupler does not detect the zero point, that is, if the actual current position has not passed through the optical coupler, we can quickly rule out the case that position E1 is the actual current position (after ruling out position E1 as the actual current position, how to determine the actual current position is explained in the examples for S407 to S410 below, which will not be elaborated here). The above method can determine if the actual current position passes through the zero point with the minimum rotation distance, thereby saving the time spent in the gimbal positioning process.

[0097] S405: Obtain the first detection result of the zero-crossing detection element during the first self-test distance rotation.

[0098] The first detection result of the zero-crossing detection element includes: zero point position detected, and zero point position not detected.

[0099] The detection of the zero point position specifically refers to the target's current position passing through the zero-crossing detection element.

[0100] The statement "zero point not detected" specifically means that the target's current position has not passed through the zero-crossing detection element.

[0101] If the first detection result indicates that a zero-point position has been detected, execute S406.

[0102] S406: If the first detection result is that the zero point position is detected, determine the power-off position based on the zero point position and control the pan-tilt unit to rotate to the power-off position.

[0103] Determine the zero point position based on the actual current position. Based on the zero point position and the first distance, the gimbal can be controlled to rotate clockwise to the power-off position, thus completing the power-off reset of the gimbal.

[0104] The gimbal positioning method disclosed herein includes a magnetic encoder and a zero-crossing detection element for detecting the zero-point position. The magnetic encoder comprises multiple magnetic pole pairs. This method acquires a first electrical signal corresponding to the power-off position of the magnetic encoder when power is off, and a first distance between the recorded power-off position and the zero-point position of the zero-crossing detection element. Upon power restoration, multiple undetermined power-off positions corresponding to the multiple magnetic pole pairs are determined based on the first electrical signal, and multiple undetermined current positions corresponding to the multiple magnetic pole pairs are determined based on the second electrical signal corresponding to the current position of the magnetic encoder. For any target magnetic pole pair among the multiple magnetic pole pairs, a second distance is acquired between the target undetermined current position corresponding to the target magnetic pole pair and the target undetermined power-off position corresponding to the target magnetic pole pair. Based on the first and second distances, a self-test rotation direction and a first self-test distance are determined, and the gimbal is controlled to rotate along the self-test rotation direction for the first self-test distance. A first detection result of the zero-crossing detection element is acquired during the rotation of the first self-test distance. If the first detection result indicates that a zero-point position has been detected, the power-off position is determined based on the zero-point position, and the gimbal is controlled to rotate to the power-off position. Therefore, in this embodiment of the present disclosure, when resetting the power-off position based on the magnetic encoder in the gimbal, the gimbal does not need to rotate one full turn to reset the power-off position. This disclosure can shorten the distance that the gimbal needs to rotate during the power-off position reset process, thereby effectively shortening the time required for the power-off position reset process. This effectively solves the problem in the related art that for gimbals with multiple magnetic pole pairs magnetic encoders, the process of restoring from the current position to the power-off position after power failure and power restoration is time-consuming. It achieves the purpose of reducing the time required for gimbals with multiple magnetic pole pairs magnetic encoders to restore to the power-off position after power restoration and improving the speed at which gimbals with multiple magnetic pole pairs magnetic encoders restore to the power-off position after power restoration.

[0105] In some embodiments, if the first detection result in S405 is that no zero point position is detected, S405 can also obtain the number of targets with undetermined current positions that have not been detected by the zero detection element. If the number of targets is greater than 1, it indicates that the remaining undetermined current positions are not unique, and therefore the actual current position cannot be determined from the remaining undetermined current positions, and S407 is executed.

[0106] If the target quantity is equal to 1, it means that the remaining undetermined current position is unique. In this case, the remaining undetermined current position can be determined as the actual current position, and S410 can be executed.

[0107] For example, in the case shown in Figure 5C, since the magnetic encoder has only two magnetic pole pairs, if the first detection result is that no zero position is detected, it means that the actual current position is not position C1. In this case, the only remaining undetermined current position is position C2. Position C2 is directly determined as the actual current position, and then S410 is executed.

[0108] S407: If the first detection result is that no zero point position is detected and the number of targets with unknown current positions that have not been detected by the zero detection element is greater than 1, the distance between two adjacent unknown power-off positions is determined as the second self-test distance.

[0109] S408: Control the pan-tilt unit to continue rotating along the self-test rotation direction for the second self-test distance.

[0110] Specifically, control the gimbal to continue rotating along the self-test rotation direction for a second self-test distance, and then execute S409.

[0111] S409: Determine the actual current position based on the second self-test distance and the second detection result of the zero-crossing detection element obtained during the rotation of the second self-test distance.

[0112] The second detection result includes: zero point position detected, and zero point position not detected.

[0113] The detection of the zero point position specifically refers to the target's current position passing through the zero-crossing detection element.

[0114] The statement "zero point not detected" specifically means that the target's current position has not passed through the zero-crossing detection element.

[0115] In some embodiments, if the second detection result indicates that a zero-point position has been detected, it means that the target's current position has passed the zero-crossing detection element. Based on the zero-point position, the power-off position is determined, and the pan-tilt unit is controlled to rotate to the power-off position, so as to achieve the purpose of quickly restoring the multi-pole pair magnetic encoder to the power-off position after it is re-energized.

[0116] In some embodiments, if the second detection result is that no zero point position is detected, as shown in FIG7, the following S701 to S703 can be executed.

[0117] S701: Obtain the number of targets at multiple pending current positions that have not been detected by the zero detection element.

[0118] S702: Determine if the target quantity is greater than 1.

[0119] If the target quantity is greater than 1, execute S408 again; if the target quantity is equal to 1, execute S703.

[0120] This indicates that the remaining pending current positions are not unique, and therefore the actual current position cannot be determined from the remaining pending current positions. In this case, it is necessary to continue to determine the actual current position from the remaining pending current positions, that is, to execute S408 again to rotate to the next pending current position that has not yet been detected and determine whether the pending current position is the actual current position.

[0121] S703: When the number of targets is equal to 1, the pending current position that has not been detected by the zero detection element is determined as the actual current position.

[0122] If the target quantity is equal to 1, it means that the remaining undetermined current position is unique. In this case, the gimbal will not be rotated any further, and the remaining undetermined current position will be directly determined as the actual current position.

[0123] In some embodiments, as shown in FIG8, determining whether the target quantity is greater than 1 in S702 can be achieved through S801 to S805.

[0124] S801: Get the total cumulative rotation distance.

[0125] S802: Obtain the difference between the rotation distance of one full rotation of the gimbal and the total cumulative rotation distance to get the distance to be rotated.

[0126] S803: Determine whether the distance to be rotated is greater than the second self-check distance and less than twice the second self-check distance.

[0127] If the judgment result is yes, that is, the distance to be rotated is greater than the second self-check distance but less than twice the second self-check distance, execute S804; if the judgment result is no, that is, the distance to be rotated is greater than twice the second self-check distance, execute S805.

[0128] S804: Determine the target quantity to be equal to 1.

[0129] S805: Determine the target quantity is greater than 1.

[0130] In some embodiments, the number of magnetic pole pairs is greater than 2. After obtaining the second detection result of the zero-crossing detection element during the rotation of the second self-test distance, as shown in FIG9, it can be determined by S901 to S904 whether the number of targets is greater than 1.

[0131] S901: Get the number of times the second self-check distance of rotation is executed.

[0132] S902: If the second detection result is that the zero point position has not been passed, determine whether the number of executions is equal to the set number of executions.

[0133] The number of attempts is set to be less than the number of pole pairs, and the difference between the number of attempts and the number of pole pairs is 2. For example, if the number of pole pairs is 4, the number of attempts would be 2.

[0134] If the judgment result is yes, that is, the number of executions equals the set number of times, execute S903; if the judgment result is no, that is, the number of executions does not equal the set number of times, execute S904.

[0135] S903: The target quantity is set to 1.

[0136] S904: Determine the target quantity is greater than 1.

[0137] The following is an exemplary description of S407 to S409 above.

[0138] For example, as shown in Figure 6C, multiple magnetic pole pairs include 4 magnetic pole pairs, with a first self-test distance L. 自检1 =L2-L4. After controlling the pan-tilt unit to rotate clockwise, the first detection result is that no zero point position was detected. No zero point position was found within the distance range of (L2-L4), indicating that position E1 is not the actual current position. The remaining undetermined current positions are position E2, position E3, and position E4. The actual current position may be among position E2, position E3, and position E4. In this case, the number of remaining undetermined current positions is 3, which is not 1. The distance Z between the two undetermined power-off positions is taken as the second self-test distance. The pan-tilt unit is rotated clockwise by the second self-test distance to confirm whether position E2 is the actual current position.

[0139] The process of confirming position E2 is as follows: First, control the gimbal to rotate clockwise by the second self-test distance. If the second detection result during this rotation is that the zero point position is detected, it means that the zero point position has been found within the distance range of (L4-L2+Z), and position E2 is determined as the actual current position. If the second detection result during this rotation is that the zero point position is not detected, it means that the zero point position has not been found within the distance range of (L4-L2+Z), and position E2 is not the actual current position. The remaining undetermined current positions are position E3 and position E4. In this case, the number of targets for the remaining undetermined current positions is 2, not 1. Second, control the gimbal to continue rotating clockwise by the second self-test distance to confirm position E3.

[0140] Similarly, the process of confirming position E3 is as follows: The gimbal is rotated clockwise for the second time by the second self-test distance. If the second detection result during this rotation is that the zero point position is detected, it means that the zero point position has been found within the distance range of (L4-L2+2Z), and position E3 is determined as the actual current position. If the second detection result during this rotation is that the zero point position is not detected, it means that the zero point position has not been found within the distance range of (L4-L2+2Z), and position E3 is not the actual current position. The only remaining undetermined current position is position E4. In this case, the number of remaining undetermined current positions is 1. In this case, it is not necessary to detect position E4 (positions E1, E2, and E3 have been excluded as actual current positions, and the only remaining position E4 must be the actual current position). Position E4 can be directly determined as the actual current position. In subsequent steps (corresponding to S410), the undetermined power-off position in the magnetic pole pair where the actual current position is located can be determined as the power-off position. The gimbal is rotated to the power-off position to achieve a quick reset after power is restored.

[0141] For example, as shown in Figure 6D, multiple magnetic pole pairs include 4 magnetic pole pairs, with a first self-test distance L. 自检1 =L2+L6. After controlling the pan-tilt unit to rotate clockwise, the first detection result is that no zero point position was detected. No zero point position was found within the distance range of (L2+L6), indicating that position E1 is not the actual current position. The remaining undetermined current positions are position E2, position E3, and position E4. The actual current position may be among position E2, position E3, and position E4. In this case, the number of remaining undetermined current positions is 3, which is not 1. The distance Z between the two undetermined power-off positions is taken as the second self-test distance. The pan-tilt unit is controlled to rotate clockwise by the second self-test distance to confirm whether position E4 is the actual current position.

[0142] The process of confirming position E4 is as follows: First, control the gimbal to rotate clockwise by the second self-test distance. If the second detection result during this rotation is that the zero point position is detected, it means that the zero point position has been found within the distance range of (L2+L6+Z), and position E4 is determined as the actual current position. If the second detection result during this rotation is that the zero point position is not detected, it means that the zero point position has not been found within the distance range of (L2+L6+Z), and position E4 is not the actual current position. The remaining undetermined current positions are position E2 and position E3. In this case, the number of targets for the remaining undetermined current positions is 2, not 1. Second, control the gimbal to continue rotating clockwise by the second self-test distance to confirm position E3.

[0143] Similarly, the process of confirming position E3 is as follows: The gimbal is rotated clockwise by the second self-test distance. If the second detection result during this rotation is that a zero point position is detected, it means that a zero point position has been found within the distance range of (L2+L6+2Z), and position E3 is determined as the actual current position. If the second detection result during this rotation is that a zero point position is not detected, it means that a zero point position has not been found within the distance range of (L2+L6+2Z), and position E3 is not the actual current position. The only remaining undetermined current position is position E2. In this case, the number of remaining undetermined current positions is 1. In this case, it is not necessary to detect position E2 (positions E1, E3, and E4 have been excluded as actual current positions, and the only remaining position E2 must be the actual current position). Position E2 can be directly determined as the actual current position. In subsequent steps (corresponding to S410), the undetermined power-off position in the magnetic pole pair where the actual current position is located can be determined as the power-off position. The gimbal is rotated to the power-off position to achieve a quick reset after power is restored.

[0144] For example, as shown in Figure 6E, multiple magnetic pole pairs include 4 magnetic pole pairs, with a first self-test distance L. 自检1 =L8-L2. After controlling the pan-tilt unit to rotate counterclockwise, the first detection result is that no zero point position was detected. No zero point position was found within the distance range of (L8-L2), indicating that position E1 is not the actual current position. The remaining undetermined current positions are position E2, position E3, and position E4. The actual current position may be among position E2, position E3, and position E4. In this case, the number of remaining undetermined current positions is 3, which is not 1. The distance Z between the two undetermined power-off positions is taken as the second self-test distance. The pan-tilt unit is rotated counterclockwise by the second self-test distance to confirm whether position E4 is the actual current position.

[0145] The process of confirming position E4 is as follows: First, control the gimbal to rotate counterclockwise by the second self-test distance. If the second detection result during this rotation is that the zero point position is detected, it means that the zero point position has been found within the distance range of (L8-L2+Z), and position E2 is determined as the actual current position. If the second detection result during this rotation is that the zero point position is not detected, it means that the zero point position has not been found within the distance range of (L8-L2+Z), and position E2 is not the actual current position. The remaining undetermined current positions are position E3 and position E4. In this case, the number of targets for the remaining undetermined current positions is 2, not 1. Second, control the gimbal to continue rotating clockwise by the second self-test distance to confirm position E3.

[0146] Similarly, the process of confirming position E3 is as follows: The gimbal is rotated counterclockwise by the second self-test distance. If the second detection result during this rotation is that a zero point position is detected, it means that a zero point position has been found within the distance range of (L8-L2+2Z), and position E3 is determined as the actual current position. If the second detection result during this rotation is that a zero point position is not detected, it means that a zero point position has not been found within the distance range of (L8-L2+2Z), and position E3 is not the actual current position. The only remaining undetermined current position is position E4. In this case, the number of remaining undetermined current positions is 1. In this case, it is not necessary to detect position E4 (positions E1, E2, and E3 have been excluded as actual current positions, and the only remaining position E4 must be the actual current position). Position E2 can be directly determined as the actual current position. In subsequent steps (corresponding to S410), the undetermined power-off position in the magnetic pole pair where the actual current position is located can be determined as the power-off position. The gimbal is rotated to the power-off position to achieve a quick reset after power is restored.

[0147] As can be seen from the above examples, in this embodiment of the disclosure, for a gimbal with a magnetic encoder having multiple magnetic pole pairs, after power failure and power restoration, the gimbal no longer needs to rotate one full turn to return to the power failure position. The power failure position can be determined by rotating a distance less than one full turn, thus achieving the goal of quickly returning the gimbal to the power failure position after power restoration.

[0148] S410: Control the pan-tilt unit to rotate to the power-off recovery position based on the actual current position.

[0149] The position of the optical coupler is determined based on the actual current position. Based on the position of the optical coupler and the first distance, the gimbal can be controlled to rotate clockwise to the power-off position, thus completing the power-off reset of the gimbal.

[0150] Based on the gimbal positioning method provided in this disclosure, for a magnetic encoder with two pole pairs, self-testing and power-off memory functions can be completed within a 180° range without optocouplers. For a magnetic encoder with four pole pairs, self-testing and power-off memory functions can be completed within a 90° range without optocouplers. For a magnetic encoder with n pole pairs, self-testing and power-off memory functions can be completed within a 360° / n range without optocouplers. In this case, the rotation distance required by the gimbal during the power-off position reset process can be shortened, thereby effectively shortening the time required for the power-off position reset process. This achieves the goal of reducing the time required for a gimbal with multiple pole pairs of magnetic encoders to return to the power-off position after power-on and increasing the speed at which a gimbal with multiple pole pairs of magnetic encoders returns to the power-off position after power-on.

[0151] The gimbal positioning device provided in this disclosure is described below. The gimbal positioning device described below can be referred to in correspondence with the gimbal positioning method described above.

[0152] Figure 10 is a schematic diagram of the gimbal positioning device provided in an embodiment of this disclosure. The gimbal is equipped with a magnetic encoder and a zero-crossing detection element for detecting the zero point position. The magnetic encoder includes multiple magnetic pole pairs. As shown in Figure 10, the gimbal positioning device 1000 includes: an acquisition module 1001, a determination module 1002, and a control module 1003.

[0153] The acquisition module 1001 is configured to acquire the first electrical signal corresponding to the power-off position of the magnetic encoder when the power is off, and the first distance between the recorded power-off position and the zero point position of the zero-crossing detection element.

[0154] The determination module 1002 is configured to, upon power-on, determine multiple undetermined power-off positions corresponding to multiple magnetic pole pairs based on a first electrical signal, and determine multiple undetermined current positions corresponding to multiple magnetic pole pairs based on a second electrical signal corresponding to the current position of the magnetic encoder.

[0155] The acquisition module 1001 is also configured to acquire, for any target magnetic pole pair among multiple magnetic pole pairs, the second distance between the first current position corresponding to the target magnetic pole pair and the first de-energized position corresponding to the target magnetic pole pair.

[0156] The determination module 1002 is also configured to determine the self-test rotation direction and the first self-test distance based on the first distance and the second distance.

[0157] The control module 1003 is configured to control the pan-tilt unit to rotate along the self-test rotation direction by a first self-test distance, based on the first self-test distance determined by the determining module.

[0158] The acquisition module 1001 is also configured to acquire the first detection result of the zero-crossing detection element during the process of the control module controlling the gimbal to rotate the first self-test distance.

[0159] The determination module 1002 is also configured to determine the power-off position based on the zero-point position when the first detection result is that a zero-point position has been detected.

[0160] The control module 1003 is also configured to control the pan-tilt unit to rotate to the power-off position based on the power-off position determined by the determining module.

[0161] The gimbal positioning device disclosed herein includes a magnetic encoder and a zero-crossing detection element for detecting the zero-point position. The magnetic encoder comprises multiple magnetic pole pairs. This device can acquire a first electrical signal corresponding to the power-off position of the magnetic encoder when power is off, and a first distance between the recorded power-off position and the zero-point position of the zero-crossing detection element. Upon power restoration, it determines multiple undetermined power-off positions corresponding to the multiple magnetic pole pairs based on the first electrical signal, and determines multiple undetermined current positions corresponding to the multiple magnetic pole pairs based on the second electrical signal corresponding to the current position of the magnetic encoder. For any target magnetic pole pair among the multiple magnetic pole pairs, it acquires a second distance between the target undetermined current position corresponding to the target magnetic pole pair and the target undetermined power-off position corresponding to the target magnetic pole pair. Based on the first and second distances, it determines a self-test rotation direction and a first self-test distance, and controls the gimbal to rotate along the self-test rotation direction for the first self-test distance. It acquires a first detection result of the zero-crossing detection element during the rotation of the first self-test distance. If the first detection result indicates that a zero-point position has been detected, it determines the power-off position based on the zero-point position and controls the gimbal to rotate to the power-off position. Therefore, in this embodiment of the present disclosure, when resetting the power-off position based on the magnetic encoder in the gimbal, the gimbal does not need to rotate one full turn to reset the power-off position. This disclosure can shorten the distance that the gimbal needs to rotate during the power-off position reset process, thereby effectively shortening the time required for the power-off position reset process. This solves the problem in the related art that for gimbals with multiple magnetic pole pairs magnetic encoders, the process of restoring from the current position to the power-off position after power failure and power restoration is time-consuming. It achieves the goal of reducing the time required for gimbals with multiple magnetic pole pairs magnetic encoders to restore to the power-off position after power restoration and improving the speed at which gimbals with multiple magnetic pole pairs magnetic encoders restore to the power-off position after power restoration.

[0162] Figure 11 illustrates a schematic diagram of the physical structure of an electronic device. As shown in Figure 11, the electronic device may include: a processor 1110, a communication interface 1120, a memory 1130, and a communication bus 1140. The processor 1110, communication interface 1120, and memory 1130 communicate with each other via the communication bus 1140. The processor 1110 can call logical instructions in the memory 1130 to execute a gimbal positioning method. The gimbal is equipped with a magnetic encoder and a zero-crossing detection element for detecting the zero-point position. The magnetic encoder includes multiple magnetic pole pairs. The method includes: acquiring a first electrical signal corresponding to the power-off position of the magnetic encoder when power is off, and a first distance between the recorded power-off position and the zero-point position of the zero-crossing detection element; upon power restoration, determining multiple undetermined power-off positions corresponding one-to-one with the multiple magnetic pole pairs based on the first electrical signal, and determining multiple magnetic pole pairs based on the second electrical signal corresponding to the current position of the magnetic encoder. Multiple pending current positions are matched one-to-one; for any target magnetic pole pair among multiple magnetic pole pairs, a second distance is obtained between the target pending current position corresponding to the target magnetic pole pair and the target pending power-off position corresponding to the target magnetic pole pair; based on the first distance and the second distance, the self-test rotation direction and the first self-test distance are determined, and the gimbal is controlled to rotate along the self-test rotation direction for the first self-test distance; the first detection result of the zero-crossing detection element is obtained during the rotation of the first self-test distance; if the first detection result is that the zero point position is detected, the power-off position is determined based on the zero point position, and the gimbal is controlled to rotate to the power-off position.

[0163] Furthermore, the logical instructions in the aforementioned memory 1130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in each embodiment of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0164] On the other hand, this disclosure also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the gimbal positioning method provided by the above methods. The gimbal is equipped with a magnetic encoder and a zero-crossing detection element for detecting the zero-point position. The magnetic encoder includes multiple magnetic pole pairs. The method includes: acquiring a first electrical signal corresponding to the power-off position of the magnetic encoder when power is off, and a first distance between the recorded power-off position and the zero-point position of the zero-crossing detection element; and when power is restored, determining multiple pending power-offs corresponding to the multiple magnetic pole pairs one-to-one based on the first electrical signal. The system determines multiple undetermined current positions corresponding to multiple magnetic pole pairs based on the second electrical signal corresponding to the current position of the magnetic encoder. For any target magnetic pole pair among the multiple magnetic pole pairs, it obtains a second distance between the target undetermined current position corresponding to the target magnetic pole pair and the target undetermined power-off position corresponding to the target magnetic pole pair. Based on the first distance and the second distance, it determines the self-test rotation direction and the first self-test distance, and controls the pan-tilt unit to rotate along the self-test rotation direction for the first self-test distance. It obtains the first detection result of the zero-crossing detection element during the rotation of the first self-test distance. If the first detection result indicates that a zero-point position has been detected, it determines the power-off position based on the zero-point position and controls the pan-tilt unit to rotate to the power-off position.

[0165] In another aspect, this disclosure also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the gimbal positioning method provided by the methods described above. The gimbal includes a magnetic encoder and a zero-crossing detection element for detecting the zero-point position. The magnetic encoder includes multiple magnetic pole pairs. The method includes: acquiring a first electrical signal corresponding to the power-off position of the magnetic encoder when power is off, and a first distance recorded between the power-off position and the zero-crossing detection element; upon power restoration, determining multiple undetermined power-off positions corresponding one-to-one with the multiple magnetic pole pairs based on the first electrical signal, and determining the current position of the magnetic encoder... The corresponding second electrical signal is used to determine multiple undetermined current positions corresponding to multiple magnetic pole pairs; for any target magnetic pole pair among the multiple magnetic pole pairs, the second distance between the target undetermined current position corresponding to the target magnetic pole pair and the target undetermined power-off position corresponding to the target magnetic pole pair is obtained; based on the first distance and the second distance, the self-test rotation direction and the first self-test distance are determined, and the gimbal is controlled to rotate along the self-test rotation direction for the first self-test distance; the first detection result of the zero-crossing detection element is obtained during the rotation of the first self-test distance; if the first detection result is that the zero point position is detected, the power-off position is determined based on the zero point position, and the gimbal is controlled to rotate to the power-off position.

[0166] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0167] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in each of the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure.

Claims

1. A gimbal positioning method, wherein the gimbal is equipped with a magnetic encoder and a zero-crossing detection element for detecting the zero-point position, the magnetic encoder comprising multiple magnetic pole pairs, the method comprising: Acquire the first electrical signal corresponding to the power-off position of the magnetic encoder when the power is off, and the first distance between the power-off position and the zero point position of the zero-crossing detection element; When power is restored, the multiple undetermined power-off positions corresponding to the multiple magnetic pole pairs are determined according to the first electrical signal, and the multiple undetermined current positions corresponding to the multiple magnetic pole pairs are determined according to the second electrical signal corresponding to the current position of the magnetic encoder. For any target magnetic pole pair among the plurality of magnetic pole pairs, obtain the second distance between the target undetermined current position corresponding to the target magnetic pole pair and the target undetermined power-off position corresponding to the target magnetic pole pair; Based on the first distance and the second distance, the self-test rotation direction and the first self-test distance are determined, and the gimbal is controlled to rotate along the self-test rotation direction by the first self-test distance; Obtain the first detection result of the zero-crossing detection element during the rotation of the first self-test distance; If the first detection result indicates that the zero point position has been detected, the power-off position is determined based on the zero point position, and the gimbal is controlled to rotate to the power-off position.

2. The gimbal positioning method according to claim 1, wherein, After obtaining the first detection result of the zero-crossing detection element during the rotation of the first self-test distance, the method further includes: If the first detection result is that the zero point position is not detected and the number of targets with undetermined current positions that have not been detected by the zero-crossing detection element is greater than 1, the distance between two adjacent undetermined power-off positions is determined as the second self-test distance, and the gimbal is controlled to continue rotating along the self-test rotation direction to the second self-test distance. The actual current position is determined based on the second self-test distance and the second detection result of the zero-crossing detection element obtained during the rotation of the second self-test distance; Based on the actual current position, control the gimbal to rotate to the power-off position.

3. The gimbal positioning method according to claim 2, wherein, The step of determining the actual current position based on the second self-test distance and the second detection result of the zero-crossing detection element obtained during the rotation of the second self-test distance includes: If the second detection result indicates that the zero point position has been detected, the power-off position is determined based on the zero point position, and the pan-tilt unit is controlled to rotate to the power-off position. If the second detection result indicates that the zero point position is not detected and the number of targets among the plurality of pending current positions is greater than 1, the gimbal is controlled to continue rotating along the self-test rotation direction for the second self-test distance and subsequent steps are executed again; if the second detection result indicates that the zero point position is not detected and the number of targets is equal to 1, the pending current position that has not been detected by the zero-crossing detection element is determined as the actual current position.

4. The gimbal positioning method according to claim 1, wherein, After obtaining the first detection result of the zero-crossing detection element during the rotation of the first self-test distance, the method further includes: If the first detection result is that the zero point position is not detected and the number of targets whose current positions have not been detected by the zero-crossing detection element is equal to 1, the current position whose current position has not been detected by the zero-crossing detection element is determined as the actual current position. Based on the actual current position, control the gimbal to rotate to the power-off position.

5. The gimbal positioning method according to claim 1, wherein, The step of determining the self-test rotation direction and the first self-test distance based on the first distance and the second distance includes: If the first distance is greater than the second distance, the self-test rotation direction is determined to be clockwise, and the first self-test distance is the difference between the first distance and the second distance; If the first distance is less than the second distance, the self-test rotation direction is determined to be clockwise, and the first self-test distance is the sum of the first distance and the second distance; or, if the first distance is less than the second distance, the self-test rotation direction is determined to be counterclockwise, and the first self-test distance is the difference between the first distance and the second distance.

6. The gimbal positioning method according to claim 2, wherein, After obtaining the second detection result of the zero-crossing detection element during the rotation of the second self-test distance, the method further includes: Obtain the total cumulative rotation distance; The difference between the circumferential rotation distance of the gimbal and the total cumulative rotation distance is used to obtain the distance to be rotated; If the distance to be rotated is greater than the second self-test distance but less than twice the second self-test distance, the number of targets is determined to be 1.

7. The gimbal positioning method according to claim 2, wherein, After the number of magnetic pole pairs in the plurality of magnetic pole pairs is greater than 2, and after obtaining the second detection result of the zero-crossing detection element during the rotation of the second self-test distance, the method further includes: Obtain the number of times the second self-check distance rotation is executed; If the second detection result indicates that the zero point position has not been passed, and the number of executions is equal to the set number, the target quantity is determined to be 1; wherein the set number is less than the number of magnetic pole pairs, and the set number differs from the number of magnetic pole pairs by 2.

8. A gimbal positioning device, wherein the gimbal is provided with a magnetic encoder and a zero-crossing detection element for detecting the zero-point position, the magnetic encoder comprising a plurality of magnetic pole pairs, the device comprising: The acquisition module is configured to acquire a first electrical signal corresponding to the power-off position of the magnetic encoder when the power is off, and a first distance between the power-off position and the zero-crossing detection element. The determination module is configured to, upon power-on, determine multiple undetermined power-off positions corresponding to the multiple magnetic pole pairs based on the first electrical signal, and determine multiple undetermined current positions corresponding to the multiple magnetic pole pairs based on the second electrical signal corresponding to the current position of the magnetic encoder. The acquisition module is further configured to acquire, for any target magnetic pole pair among the plurality of magnetic pole pairs, a second distance between the target pending current position corresponding to the target magnetic pole pair and the target pending power-off position corresponding to the target magnetic pole pair; The determining module is further configured to determine the self-test rotation direction and the first self-test distance based on the first distance and the second distance; The control module is configured to control the gimbal to rotate along the self-test rotation direction by the first self-test distance determined by the determining module. The acquisition module is further configured to acquire the first detection result of the zero-crossing detection element during the process of the control module controlling the gimbal to rotate the first self-test distance; The determining module is further configured to determine the power-off position based on the zero-point position when the first detection result indicates that the zero-point position has been detected; The control module is further configured to control the gimbal to rotate to the power-off position based on the power-off position determined by the determining module.

9. The gimbal positioning device according to claim 8, wherein, The device further includes a first rotation control module, which is configured as follows: If the first detection result is that the zero point position is not detected and the number of targets with undetermined current positions that have not been detected by the zero-crossing detection element is greater than 1, the distance between two adjacent undetermined power-off positions is determined as the second self-test distance, and the gimbal is controlled to continue rotating along the self-test rotation direction to the second self-test distance. The actual current position is determined based on the second self-test distance and the second detection result of the zero-crossing detection element obtained during the rotation of the second self-test distance; Based on the actual current position, control the gimbal to rotate to the power-off position.

10. The gimbal positioning device according to claim 9, wherein, The first rotation control module is further configured as follows: If the second detection result indicates that the zero point position has been detected, the power-off position is determined based on the zero point position, and the pan-tilt unit is controlled to rotate to the power-off position. If the second detection result indicates that the zero point position is not detected and the number of targets among the plurality of pending current positions is greater than 1, the gimbal is controlled to continue rotating along the self-test rotation direction for the second self-test distance and subsequent steps are executed again; if the second detection result indicates that the zero point position is not detected and the number of targets is equal to 1, the pending current position that has not been detected by the zero-crossing detection element is determined as the actual current position.

11. The gimbal positioning device according to claim 8, wherein, The device further includes a second rotation control module, which is configured as follows: If the first detection result is that the zero point position is not detected and the number of targets whose current positions have not been detected by the zero-crossing detection element is equal to 1, the current position whose current position has not been detected by the zero-crossing detection element is determined as the actual current position. Based on the actual current position, control the gimbal to rotate to the power-off position.

12. The gimbal positioning device according to claim 8, wherein, The determining module is specifically configured as follows: If the first distance is greater than the second distance, the self-test rotation direction is determined to be clockwise, and the first self-test distance is the difference between the first distance and the second distance; If the first distance is less than the second distance, the self-test rotation direction is determined to be clockwise, and the first self-test distance is the sum of the first distance and the second distance; or, if the first distance is less than the second distance, the self-test rotation direction is determined to be counterclockwise, and the first self-test distance is the difference between the first distance and the second distance.

13. The gimbal positioning device according to claim 9, wherein, The first rotation control module is further configured as follows: Obtain the total cumulative rotation distance; The difference between the circumferential rotation distance of the gimbal and the total cumulative rotation distance is used to obtain the distance to be rotated; If the distance to be rotated is greater than the second self-test distance but less than twice the second self-test distance, the number of targets is determined to be 1.

14. The gimbal positioning device according to claim 9, wherein, The number of magnetic pole pairs in the plurality of magnetic pole pairs is greater than 2, and the first rotation control module is further configured to: Obtain the number of times the second self-check distance rotation is executed; If the second detection result indicates that the zero point position has not been passed, and the number of executions is equal to the set number, the target quantity is determined to be 1; wherein the set number is less than the number of magnetic pole pairs, and the set number differs from the number of magnetic pole pairs by 2.

15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the gimbal positioning method as described in any one of claims 1 to 7.

16. A computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the gimbal positioning method as described in any one of claims 1 to 7.