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

By acquiring the electrical signal of the magnetic encoder and the zero-crossing detection element, the self-test rotation direction and distance are calculated, and the pan-tilt unit is controlled to quickly return to the power-off position. This solves the problem of long time consumption of multi-pole magnetic encoders after power failure and improves the utilization efficiency of the pan-tilt unit.

CN122219624APending Publication Date: 2026-06-16ZHEJIANG UNIVIEW TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411842576.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2026-06-16

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 acquiring the electrical signal of the magnetic encoder and the zero-crossing detection element when the power is off, the undetermined positions of multiple magnetic pole pairs are determined. Based on the electrical signal and distance, the self-test rotation direction and distance are calculated, and the pan-tilt unit is controlled to rotate to the power-off position, thus shortening the reset time.

Benefits of technology

This technology enables multi-pole pair magnetic encoder pan-tilt units to quickly return to the power-off position after being powered on, reducing rotation distance and time and improving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122219624A_ABST
    Figure CN122219624A_ABST
Patent Text Reader

Abstract

The application provides a gimbal positioning method and device, electronic equipment and computer storage medium, and relates to the technical field of gimbal control. A zero-crossing detection element and a magnetic encoder including multiple magnetic pole pairs are arranged in the gimbal. The method comprises the following steps: acquiring a first electric signal of a power-off position of the magnetic encoder when power is off, and a first distance between the power-off position and a zero point position. When power is reconnected, multiple to-be-determined power-off positions corresponding to the multiple magnetic pole pairs are determined according to the first electric signal. Multiple to-be-determined current positions corresponding to the multiple magnetic pole pairs are determined according to a second electric signal of a current position of the magnetic encoder. A self-check rotation direction and a first self-check distance are determined according to the first distance and a second distance between the to-be-determined current position and the to-be-determined power-off position in any magnetic pole pair. The power-off position is determined according to the self-check rotation direction and the first self-check distance. The application can improve the speed of the gimbal provided with the multiple magnetic pole pair magnetic encoder to return to the power-off position after power is turned on.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention 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

[0002] 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 (Internet Protocol Cameras, IPCs).

[0003] 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

[0004] This invention provides a gimbal positioning method, device, electronic device, and computer storage medium to address the shortcomings of existing technologies where, for gimbals 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. The invention aims to reduce the time required for gimbals 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 gimbals with multiple magnetic pole pairs and magnetic encoders return to the power-off position after power-on.

[0005] This invention provides 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 includes multiple magnetic pole pairs. The method includes the following steps.

[0006] The system 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-crossing detection element. When power is restored, it determines multiple undetermined power-off positions corresponding to multiple magnetic pole pairs based on the first electrical signal, and 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 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 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 acquires 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-crossing position has been detected, it determines the power-off position based on the zero-crossing position and controls the pan-tilt unit to rotate to the power-off position.

[0007] According to a gimbal positioning method provided by the present invention, 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 indicates that no zero point position was 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, determining the distance between two adjacent undetermined power-off positions as the second self-test distance, and controlling the gimbal to continue rotating the second self-test distance along the self-test rotation direction; 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; and controlling the gimbal to rotate to the power-off position based on the actual current position.

[0008] According to a gimbal positioning method provided by the present invention, the actual current position is determined based on a second self-test distance and a second detection result obtained by a zero-crossing detection element during the rotation of the second self-test distance. The method includes: if the second detection result indicates that a zero-point position has been detected, determining a power-off position based on the zero-point position and controlling the gimbal to rotate to the power-off position; if the second detection result indicates that a zero-point position has not been detected and the number of targets among multiple pending current positions is greater than 1, executing the control of the gimbal to continue rotating along the self-test rotation direction for the second self-test distance and subsequent steps again; if the second detection result indicates that a zero-point position has not been detected and the number of targets is equal to 1, determining the pending current position that has not been detected by the zero-crossing detection element as the actual current position.

[0009] According to a gimbal positioning method provided by the present invention, 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 no zero point position is detected and the number of targets of the pending current position that has not been detected by the zero detection element 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; and the gimbal is controlled to rotate to the power-off position according to the actual current position.

[0010] According to a gimbal positioning method provided by the present invention, a self-test rotation direction and a first self-test distance are determined based on a first distance and a second distance, including: when 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; 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 distance and the second distance; 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 distance and the second distance.

[0011] According to a gimbal positioning method provided by the present invention, 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: obtaining the cumulative total rotation distance; obtaining the difference between the circumferential rotation distance of one rotation of the gimbal and the cumulative total rotation distance to obtain the distance to be rotated; and determining the target quantity as 1 if the distance to be rotated is greater than the second self-test distance but less than twice the second self-test distance.

[0012] According to a gimbal positioning method provided by the present invention, the number of magnetic pole pairs of multiple 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, the method further includes: obtaining the number of times the rotation of the second self-test distance is executed; if the second detection result is that the zero point position has not been passed, and the number of executions is equal to the set number, the target number 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.

[0013] The present invention also provides 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 includes multiple magnetic pole pairs. The device includes the following modules: an acquisition module, a determination module, and a control module.

[0014] The acquisition module is used 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.

[0015] The determination module is used to determine multiple undetermined power-off positions corresponding to multiple magnetic pole pairs based on a first electrical signal when power is restored, and to 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.

[0016] The acquisition module is also used 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.

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

[0018] The control module is used 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.

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

[0020] The determination module is also used 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.

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

[0022] The present invention 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.

[0023] The present invention 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.

[0024] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the gimbal positioning method as described above.

[0025] The present invention provides a gimbal positioning method, device, electronic device, and computer storage medium. 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 present invention 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. When power is restored, 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. In this embodiment of the invention, 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 invention can shorten the distance 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 prior 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. This invention aims to reduce the time required for gimbals with multiple magnetic pole pairs magnetic encoders to restore to the power-off position after power restoration and to improve the speed at which gimbals with multiple magnetic pole pairs magnetic encoders restore to the power-off position after power restoration. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

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

[0028] Figure 2A This is one of the schematic diagrams of multi-pole pair magnetic encoders in related technologies.

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

[0030] Figure 3This is one of the flowcharts illustrating the gimbal positioning method provided in this embodiment of the invention.

[0031] Figure 4 This is the second flowchart of the gimbal positioning method provided in the embodiments of the present invention.

[0032] Figure 5A This 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 this embodiment of the invention.

[0033] Figure 5B This is the second 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 invention.

[0034] Figure 5C This 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 invention.

[0035] Figure 5D This is the fourth 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 invention.

[0036] Figure 5E This is the fifth 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 invention.

[0037] Figure 6A This 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 this embodiment of the invention.

[0038] Figure 6B This is the 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 invention.

[0039] Figure 6C This 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 invention.

[0040] Figure 6D This is the fourth 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 invention.

[0041] Figure 6E This is the fifth 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 invention.

[0042] Figure 7 This is the third flowchart of the gimbal positioning method provided in the embodiments of the present invention.

[0043] Figure 8 This is the fourth flowchart of the gimbal positioning method provided in the embodiments of the present invention.

[0044] Figure 9 This is the fifth flowchart of the gimbal positioning method provided in the embodiments of the present invention.

[0045] Figure 10 This is a schematic diagram of the gimbal positioning device provided in an embodiment of the present invention.

[0046] Figure 11 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0048] Figure 1 This is a schematic diagram of a single-pole pair magnetic encoder. Figure 1 As shown, a 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., ...). Figure 1 (Rotate counterclockwise by θ). A Hall sensor is installed 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.

[0049] Figure 1 A permanent magnet has a pair of N and S poles. Because the magnetic field is different throughout a 360° range, it is possible to sense absolute position and relative position (e.g., A) within a 360° range. + 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.

[0050] For multi-pole pair magnetic encoders, the permanent magnet of the multi-pole pair magnetic encoder is equipped with m (m is a positive integer and m>1) pole pairs, for example Figure 2A The two magnetic pole pairs shown (i.e., two pairs of magnetic poles, each pair including an N pole and a S pole), or as... Figure 2B The four magnetic pole pairs shown are an example. 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 magnetic field only differs within a 360° / m range, within which absolute position can be sensed. 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.

[0051] In multi-pole magnetic encoders, since absolute position cannot be determined, a zero-crossing detection element is needed to achieve zero-point detection. The position of the zero-crossing detection element is the zero-point position (see [reference]). Figure 2A and Figure 2B (Midpoint position).

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

[0053] The following is combined Figures 3-6E The gimbal positioning method of the present invention is described.

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

[0055] Figure 3 This is one of the flowcharts illustrating the gimbal positioning method provided by the present invention. Figure 4 This is the second flowchart of the gimbal positioning method provided in the embodiments of the present invention.

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

[0057] 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.

[0058] 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.

[0059] 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α).

[0060] Once the power-off position is obtained, the first distance between the power-off position and the zero point position can be determined based on the step angle. In this case, the product of the recorded power-off position (the number of step angles the power-off position has rotated from the zero point position) 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 point position, and this product is determined as the first distance.

[0061] 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, in the embodiments of the present invention, the distance from each position on the magnetic encoder to the zero point can also be replaced by the recording result corresponding to that position.

[0062] In this embodiment of the invention, 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 those two positions.

[0063] by Figure 2A Taking the two magnetic pole pairs shown as an example, as Figure 5A As shown, 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 power-off position A0 and the zero-crossing detector are obtained. Figure 5A The first distance L1 between the zero point position O corresponding to the optical coupler (in the middle is the optical coupler).

[0064] like Figure 5A As shown, the first distance L1 is the arc segment from the power-off position A0 to the zero point position O. Figure 5A The length of the arc marked in red.

[0065] by Figure 2BTaking the four magnetic pole pairs shown as an example, as Figure 6A As shown, 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 power-off position D0 and the zero-crossing detector are obtained. Figure 6A The first distance L2 between the zero point position O corresponding to the optical coupler (in the middle is the optical coupler).

[0066] like Figure 6A As shown, the first distance L2 is the arc segment from the power-off position D0 to the zero point position O. Figure 6A The length of the arc marked in red.

[0067] 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.

[0068] 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.

[0069] 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.

[0070] 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.

[0071] For example, based on Figure 5A In the diagram, at power-off position A0, among multiple electrical signals sensed by the magnetic encoder, the electrical signal that matches the first electrical signal corresponding to power-off position A0 is determined. The position corresponding to this electrical signal is then identified as the pending power-off position, resulting in the following... Figure 5B Positions A1 and A2 are shown.

[0072] 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.

[0073] It should be noted that, Figure 5B The power outage position A0 is shown only to illustrate the power outage position. In reality, A0 may be at position A1 or position A2.

[0074] For example, based on Figure 6A The power-off position D0 shown is determined by identifying the position corresponding to the first electrical signal that is identical to the power-off position D0 among multiple electrical signals sensed by the magnetic encoder, resulting in the following: Figure 6B Positions D1, D2, D3, and D4 are shown.

[0075] It should be noted that, Figure 6B The power outage position D0 is shown only to illustrate 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.

[0076] 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.

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

[0078] like Figure 6C As shown, 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.

[0079] 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.

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

[0081] For example, such as Figure 5CAs shown, 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 arc between position A1 and position C1. Figure 5C The length of the circle marked in green.

[0082] For example, such as Figure 6C As shown, 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 arc between position D1 and position E1. Figure 6C The length of the circle marked in green.

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

[0084] For example, such as Figure 5D As shown, in a magnetic encoder with two pole pairs, there are multiple undetermined power-off positions ( Figure 5D Positions A1 and A2 are located in the N pole of multiple magnetic pole pairs, and multiple undetermined current positions ( Figure 5D Positions C1 and C2 are located in the S pole of multiple magnetic pole pairs. Taking the magnetic pole pair formed by S1 and N1 as the target magnetic 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 arc between position A1 and position C1. Figure 5D The length of the circle marked in blue.

[0085] For example, such as Figure 6D As shown, in a magnetic encoder with four pole pairs, there are multiple undetermined power-off positions ( Figure 6D Positions D1, D2, D3, and D4 are located in the S pole of multiple magnetic pole pairs, and multiple undetermined current positions ( Figure 6DPositions E1, E2, E3, and E4 are located in the N pole of multiple magnetic pole pairs. Taking the magnetic pole pair formed by magnetic poles S3 and N3 as the target magnetic 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 arc between position D1 and position E1 (…). Figure 6D The length of the circle marked in blue.

[0086] 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.

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

[0088] 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.

[0089] 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 minimizing the rotation 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.

[0090] If the first distance is greater than the second distance, the target's current position may be located between the target's current power-off position and the zero-crossing detection element, such as... Figure 5C As shown in Figure 6 (the case with 2 magnetic pole pairs) and Figure 6C (the case with 4 magnetic pole pairs).

[0091] exist Figure 5C In the scenario shown, 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 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 L2). 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.

[0092] exist Figure 6C In the scenario shown, 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-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~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.

[0093] 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.

[0094] When the first distance is less than the second distance, for a magnetic encoder with two pole pairs, the following will occur: Figure 5D and Figure 5E The two scenarios are shown. For a magnetic encoder with four pole pairs, the following will occur: Figure 6D and Figure 6E The two scenarios shown.

[0095] First of all Figure 5D The following explanation will be provided in the case shown. For example... Figure 5DAs shown, to determine if the actual current position passes through the zero point while minimizing rotation distance, position C2 is the closest undetermined current position to the optical coupler. We can assume 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 L5+L1 is the arc length between C2 and O2). If the optical coupler detects the zero point, meaning 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. Clearly, this method can determine if the actual current position passes through the zero point while minimizing rotation distance, thus saving time spent on gimbal positioning.

[0096] Next Figure 5E The following explanation will be provided in the case shown. For example... Figure 5E As shown, to determine the actual current position passing through the zero point while minimizing the rotation distance, position C1 is the undetermined current position closest to the optical coupler position. We can assume position C1 is the actual current position, and the second distance is... Figure 5E The length corresponding to the blue arc in the middle can be determined by rotating the gimbal 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 position, 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 position, 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. Obviously, the above method can determine that the actual current position has passed through the zero point position with the minimum rotation distance, thus saving the time spent in the gimbal positioning process.

[0097] Next Figure 6D The following explanation will be provided in the case shown. For example... Figure 6DAs shown, 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, 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~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, thereby saving the time spent in the gimbal positioning process.

[0098] Next Figure 6E The following explanation will be provided in the case shown. For example... Figure 6E As shown, to determine the actual current position passing through the zero point while minimizing the 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, and the second distance corresponds to... Figure 6E The length of the blue arc can be determined by rotating 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 position, 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 position, that is, if the actual current position has not passed through the optical coupler, then the case where position E1 is the actual current position can be quickly ruled out. (After ruling out position E1 as the actual current position, how to determine the actual current position is explained in the examples for S407~S410 below, which will not be elaborated here.) The above method can determine that the actual current position has passed through the zero point position with the minimum rotation distance, thereby saving the time spent in the gimbal positioning process.

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

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

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

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

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

[0104] 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.

[0105] 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.

[0106] The gimbal positioning method provided by this invention includes a magnetic encoder and a zero-crossing detection element for detecting the zero-point position in the gimbal. The magnetic encoder includes multiple magnetic pole pairs. This invention can obtain 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. When power is restored, multiple undetermined power-off positions corresponding to the multiple magnetic pole pairs are determined according to the first electrical signal, and 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 multiple magnetic pole pairs, a second distance is obtained 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, 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 obtained 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 according to the zero-point position, and the gimbal is controlled to rotate to the power-off position. Therefore, in this embodiment of the invention, 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 invention can shorten the distance 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 prior 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. This 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.

[0107] 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.

[0108] 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.

[0109] For example, for such Figure 5C As shown, since the magnetic encoder has only two magnetic pole pairs, if the first detection result is that the zero position is not 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.

[0110] 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.

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

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

[0113] 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.

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

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

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

[0117] 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.

[0118] In some embodiments, if the second detection result indicates that no zero-point position was detected, such as Figure 7 As shown, S701~S703 can be executed.

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

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

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

[0122] 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.

[0123] 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.

[0124] 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.

[0125] In some embodiments, such as Figure 8 As shown, in S702, determining whether the number of targets is greater than 1 can be achieved through S801~S805.

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

[0127] 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.

[0128] 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.

[0129] 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.

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

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

[0132] 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 follows: Figure 9 As shown, whether the number of targets is greater than 1 can be determined by S901~S904.

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

[0134] 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.

[0135] 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 is set to 2.

[0136] 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.

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

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

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

[0140] For example, such as Figure 6C As shown, the multiple magnetic pole pairs include 4 magnetic pole pairs, and the 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.

[0141] 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.

[0142] 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.

[0143] For example, such as Figure 6D As shown, the multiple magnetic pole pairs include 4 magnetic pole pairs, and the 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.

[0144] 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.

[0145] 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 (L2+L6+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 (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.

[0146] For example, such as Figure 6E As shown, the multiple magnetic pole pairs include 4 magnetic pole pairs, and the 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.

[0147] 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.

[0148] 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 the zero point position is detected, it means that the 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 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+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.

[0149] As can be seen from the above examples, in this embodiment of the invention, 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.

[0150] S410: Based on the actual current position, control the pan-tilt unit to rotate to the position after power failure.

[0151] 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.

[0152] Based on the gimbal positioning method provided in this invention, 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.

[0153] The gimbal positioning device provided by the present invention is described below. The gimbal positioning device described below can be referred to in correspondence with the gimbal positioning method described above.

[0154] Figure 10 This is a schematic diagram of the gimbal positioning device provided in an embodiment of the present invention. 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, such as... Figure 10 As shown, the gimbal positioning device 1000 includes: an acquisition module 1001, a determination module 1002, and a control module 1003.

[0155] The acquisition module 1001 is used 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.

[0156] The determination module 1002 is used to determine multiple undetermined power-off positions corresponding to multiple magnetic pole pairs based on a first electrical signal when power is restored, and to 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.

[0157] The acquisition module 1001 is also used 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.

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

[0159] The control module 1003 is used to control the pan-tilt unit to rotate along the self-test rotation direction by the first self-test distance determined by the determining module.

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

[0161] The determination module 1002 is also used 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.

[0162] The control module 1003 is also used to control the pan-tilt unit to rotate to the power-off position according to the power-off position determined by the determining module.

[0163] The gimbal positioning device provided by this invention includes a magnetic encoder and a zero-crossing detection element for detecting the zero-point position. The magnetic encoder includes multiple magnetic pole pairs. This invention 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. When power is restored, 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 distance and the second distance, 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 invention, 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 invention can shorten the distance 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 prior 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. This 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.

[0164] Figure 11 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 11As shown, 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 logic 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.

[0165] 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 the present invention, essentially, or the part that contributes to the prior art, or a part 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 the various embodiments of the present invention. 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.

[0166] On the other hand, the present invention 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 according to 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.

[0167] In another aspect, the present invention 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-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 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.

[0168] 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.

[0169] 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 part that contributes to the prior art, 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 the various embodiments or some parts of the embodiments.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention 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 the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these 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 the present invention.

Claims

1. A gimbal positioning method, characterized in that, 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: 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, characterized in that, 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, characterized in that, 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 is 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 control of the gimbal to continue rotating along the self-test rotation direction by the second self-test distance and subsequent steps is executed again; if the second detection result is 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, characterized in that, 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, characterized in that, 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, characterized in that, 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, characterized in that, 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, characterized in that, 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 device includes: The acquisition module is used 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 power-off position and the zero point position of the zero-crossing detection element. The determination module is used to determine, upon power restoration, a plurality of undetermined power-off positions corresponding to the plurality of magnetic pole pairs based on the first electrical signal, and to determine a plurality of undetermined current positions corresponding to the plurality of 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 used to control the gimbal to rotate along the self-test rotation direction by the first self-test distance based on the first self-test distance determined by the determining module. The acquisition module is also used 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. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the gimbal positioning method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the gimbal positioning method as described in any one of claims 1 to 7.