A method, device and equipment for restoring attitude angle

After the gimbal collides, the correction value of the direction vector is calculated based on the angular velocity and acceleration values, and the attitude angle is quickly restored. This solves the problem of attitude angle errors and image jitter caused by sudden changes in the gimbal's motion state, and improves the stability and stability of the gimbal. Image quality.

CN113568438BActive Publication Date: 2024-08-23HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202110751159.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-02
Publication Date
2024-08-23
Estimated Expiration
2041-07-02

AI Technical Summary

Technical Problem

When the gimbal's motion state changes suddenly, the angular velocity values ​​collected by the IMU are discontinuous, resulting in incorrect attitude angles, inability to effectively control the gimbal, and skewed camera images.

Method used

After the gimbal collides, determine the predicted direction vector and actual direction vector based on the angular velocity value, calculate the target correction value, correct the angular velocity value, and determine whether the attitude angle has recovered. If it recovers, update the attitude angle. Otherwise, return to the previous cycle and try again. .

Benefits of technology

Quickly restore the attitude angle, improve the stability and anti-interference ability of the gimbal, avoid image distortion and jitter, and optimize the image quality collected by the camera.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113568438B
    Figure CN113568438B
Patent Text Reader

Abstract

The present application provides a method, device and equipment for recovering an attitude angle, the method comprising: after determining that a collision occurs with the gimbal, determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle, determining the actual direction vector of the gimbal based on the acceleration value of the current cycle, and determining the target correction value based on the predicted direction vector and the actual direction vector; correcting the angular velocity value based on the target correction value, and determining whether the attitude angle of the gimbal has been recovered based on the corrected angular velocity value; if so, determining the target attitude angle based on the corrected angular velocity value, and determining the attitude angle of the gimbal based on the target attitude angle in the next cycle after the current cycle; if not, taking the next cycle after the current cycle as the current cycle, and returning to perform the operation of determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle. Through the technical solution of the present application, after a collision occurs with the gimbal, the correct attitude angle can be obtained, the wrong attitude angle can be quickly recovered, and the stability of the gimbal can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of pan / tilt control, and in particular to a method, device and equipment for recovering an attitude angle. Background Art

[0002] The working principle of the anti-shake gimbal is that when the gimbal moves forward (backward), the gimbal bracket moves backward (forward), so that the front and back direction of the camera fixed on the gimbal remains unchanged. When the gimbal moves left (right), the gimbal bracket moves right (left), so that the left and right direction of the camera fixed on the gimbal remains unchanged. When the gimbal moves upward (downward), the gimbal bracket moves downward (upward), so that the up and down direction of the camera fixed on the gimbal remains unchanged.

[0003] The gimbal is usually equipped with measurement sensors, such as IMU (Inertial Measurement Unit). IMU is a six-axis inertial measurement sensor that can collect the acceleration and angular velocity values ​​of the gimbal. The attitude angle of the gimbal can be obtained based on the angular velocity value. Taking the attitude angle in the forward and backward direction as an example, this attitude angle can represent the movement of the gimbal in the forward and backward direction. Based on the movement of the gimbal in the forward and backward direction, the movement of the gimbal bracket is controlled to keep the forward and backward direction of the camera fixed on the gimbal unchanged.

[0004] In summary, knowing the attitude angle of the gimbal is a prerequisite for effective control of the gimbal. However, during the use of the gimbal, sudden changes in motion state are inevitable, such as running, violent shaking or falling. These sudden changes in motion state will cause the gimbal to collide, making the angular velocity values ​​collected by the IMU discontinuous and resulting in large jump values. When the attitude angle of the gimbal is determined based on the discontinuous angular velocity values, the attitude angle may be wrong, that is, an incorrect attitude angle is obtained, which makes it impossible to effectively control the gimbal. The images collected by the cameras deployed on the gimbal will show undesirable phenomena such as skew and jitter. Summary of the invention

[0005] The present application provides a method for restoring an attitude angle, which is applied to a device including a measuring sensor and a gimbal, wherein the measuring sensor periodically collects acceleration values ​​and angular velocity values ​​of the gimbal, and the method comprises:

[0006] After determining that the gimbal collides, determining a predicted direction vector of the gimbal based on an angular velocity value of a current period, determining an actual direction vector of the gimbal based on an acceleration value of the current period, and determining a target correction value based on the predicted direction vector and the actual direction vector;

[0007] Correcting the angular velocity value based on the target correction value to obtain a corrected angular velocity value, and determining whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value;

[0008] If yes, determining the target attitude angle of the gimbal based on the corrected angular velocity value, and determining the attitude angle of the gimbal based on the target attitude angle in a cycle after the current cycle;

[0009] If not, the cycle after the current cycle is taken as the current cycle, and the operation of determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle is returned to be executed.

[0010] Exemplarily, the determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle includes: determining an initial quaternion of the current cycle based on the angular velocity value of the current cycle and an initial quaternion of a previous cycle of the current cycle, wherein the initial quaternion of the current cycle includes 4 vector values;

[0011] Determine a predicted direction vector of the gimbal based on four vector values ​​in the initial quaternion;

[0012] Among them, if the current cycle is the first cycle after the gimbal collides, the initial quaternion of the previous cycle of the current cycle is the initial quaternion when the gimbal collides, and the initial quaternion is determined based on the initial attitude angle when the gimbal collides.

[0013] Exemplarily, the determining the actual direction vector of the gimbal based on the acceleration value of the current cycle includes: determining the acceleration modulus based on the acceleration value of the current cycle;

[0014] An actual direction vector of the gimbal is determined based on the acceleration value and the acceleration modulus.

[0015] Exemplarily, the determining the target correction value based on the predicted direction vector and the actual direction vector includes: determining an error vector between the predicted direction vector and the actual direction vector;

[0016] The target correction value is determined based on the configured correction parameter value and the error vector.

[0017] Exemplarily, the determining whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value includes: determining the target quaternion of the current cycle based on the corrected angular velocity value and the target quaternion of the previous cycle of the current cycle; wherein, if the current cycle is the first cycle after the gimbal collides, the target quaternion of the previous cycle of the current cycle is the target quaternion when the gimbal collides, and the target quaternion is determined based on the initial attitude angle of the gimbal when the gimbal collides;

[0018] If the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is less than a preset threshold, it is determined that the attitude angle of the gimbal has been restored;

[0019] If the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is not less than a preset threshold, it is determined that the attitude angle of the gimbal has not been restored.

[0020] Exemplarily, the determining that the gimbal collides includes:

[0021] Determine the acceleration modulus based on the acceleration value of the current cycle;

[0022] Determining an angular velocity modulus based on the angular velocity value of the current period;

[0023] Determining an angular velocity modulus target value based on the angular velocity modulus;

[0024] If the angular velocity modulus target value is greater than the angular velocity modulus threshold value, and / or the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold value, it is determined that the gimbal has collided.

[0025] Exemplarily, determining the angular velocity modulus target value based on the angular velocity modulus includes:

[0026] Performing a scale transformation on the angular velocity modulus to obtain a first angular velocity modulus value;

[0027] Determine the second angular velocity modulus value of the current period based on the first angular velocity modulus value; wherein, if the first angular velocity modulus value is greater than the limit maximum value, the second angular velocity modulus value is the limit maximum value; if the first angular velocity modulus value is less than the limit minimum value, the second angular velocity modulus value is the limit minimum value; if the first angular velocity modulus value is not less than the limit minimum value and not greater than the limit maximum value, the second angular velocity modulus value is the first angular velocity modulus value;

[0028] The angular velocity modulus target value is determined based on the second angular velocity modulus value of the current cycle and the second angular velocity modulus values ​​of N consecutive cycles before the current cycle.

[0029] The present application provides a device for restoring an attitude angle, which is applied to a device including a measuring sensor and a gimbal, wherein the measuring sensor periodically collects acceleration values ​​and angular velocity values ​​of the gimbal, and the device includes:

[0030] a determination module, configured to, after determining that the gimbal has collided, determine a predicted direction vector of the gimbal based on an angular velocity value of a current period, determine an actual direction vector of the gimbal based on an acceleration value of the current period, and determine a target correction value based on the predicted direction vector and the actual direction vector;

[0031] a processing module, configured to correct the angular velocity value based on the target correction value to obtain a corrected angular velocity value, and determine whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value;

[0032] A recovery module is used to determine the target attitude angle of the gimbal based on the corrected angular velocity value if the attitude angle has been restored, and determine the attitude angle of the gimbal based on the target attitude angle in a period after the current period; if the attitude angle has not been restored, the period after the current period is used as the current period, and the determination module is triggered to determine the predicted direction vector of the gimbal based on the angular velocity value of the current period.

[0033] Exemplarily, when the determining module determines that the gimbal collides, it is specifically used to:

[0034] Determine the acceleration modulus based on the acceleration value of the current cycle;

[0035] Determining an angular velocity modulus based on the angular velocity value of the current period;

[0036] Determining an angular velocity modulus target value based on the angular velocity modulus;

[0037] If the angular velocity modulus target value is greater than the angular velocity modulus threshold value, and / or the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold value, it is determined that the gimbal has collided.

[0038] The present application provides an attitude angle recovery device, comprising a gimbal and a measuring sensor, wherein the measuring sensor periodically collects acceleration values ​​and angular velocity values ​​of the gimbal; the device further comprises: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the following steps:

[0039] After determining that the gimbal collides, determining a predicted direction vector of the gimbal based on an angular velocity value of a current period, determining an actual direction vector of the gimbal based on an acceleration value of the current period, and determining a target correction value based on the predicted direction vector and the actual direction vector;

[0040] Correcting the angular velocity value based on the target correction value to obtain a corrected angular velocity value, and determining whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value;

[0041] If yes, determining the target attitude angle of the gimbal based on the corrected angular velocity value, and determining the attitude angle of the gimbal based on the target attitude angle in a cycle after the current cycle;

[0042] If not, the cycle after the current cycle is taken as the current cycle, and the operation of determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle is returned to be executed.

[0043] It can be seen from the above technical scheme that in the embodiment of the present application, after the gimbal collides, the predicted direction vector of the gimbal can be determined based on the angular velocity value, the actual direction vector of the gimbal can be determined based on the acceleration value, the target correction value can be determined based on the predicted direction vector and the actual direction vector, the angular velocity value is corrected based on the target correction value, and the target attitude angle of the gimbal is determined based on the corrected angular velocity value, so as to obtain the correct attitude angle, quickly restore the wrong attitude angle, quickly repair the attitude angle error phenomenon, improve the stability and anti-interference ability of the gimbal, and effectively control the gimbal based on the correct attitude angle. The image captured by the camera deployed on the gimbal will not have undesirable phenomena such as picture skew and jitter. The image captured by the camera is optimized, the picture stability is improved, and the problem of image skew and inability to recover or slow recovery caused by the gimbal collision is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments of the present application or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present application.

[0045] Figure 1 is a schematic diagram of a working area of ​​a pan / tilt platform in one embodiment of the present application;

[0046] Figure 2 is a schematic diagram of angular velocity values ​​during a collision process in one embodiment of the present application;

[0047] Figure 3 is a schematic flow chart of a method for restoring an attitude angle in one embodiment of the present application;

[0048] Figure 4A and Figure 4B is a schematic diagram of a mechanical anti-shake function in one implementation of the present application;

[0049] Figure 5 It is a schematic diagram of the processing flow of gimbal stabilization in one embodiment of the present application;

[0050] Figure 6 It is a structural schematic diagram of a posture angle recovery device in one embodiment of the present application;

[0051] Figure 7 This is a hardware structure diagram of an attitude angle recovery device in one implementation of the present application. DETAILED DESCRIPTION

[0052] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, rather than limiting the present application. The singular forms of "a", "said" and "the" used in the present application and claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.

[0053] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "at..." or "when..." or "in response to determination".

[0054] The embodiment of the present application proposes a method for restoring an attitude angle, which can be applied to an image acquisition device, which may include but is not limited to a pan / tilt, a camera, and a measurement sensor. A camera is also called a camera, which is used to acquire images of a target scene. It may be a network camera, an analog camera, etc. There is no restriction on the type of the camera, as long as it can acquire images. The pan / tilt may be an anti-shake pan / tilt (also called a mechanical anti-shake pan / tilt), which can use a mechanical device to control the movement of the camera to eliminate the shaking of the image.

[0055] The gimbal can achieve stable support for the camera by rotating on three axes (such as the roll axis, pitch axis and yaw axis, etc.). For example, the gimbal can move in the front and back directions, in the up and down directions, and in the left and right directions. Through movement in these directions, stable support for the camera is achieved.

[0056] For example, the camera can be fixed on the pan-tilt head, that is, the positional relationship between the camera and the pan-tilt head does not change. When the pan-tilt head rotates, the camera will also rotate with the pan-tilt head, or in other words, when the camera rotates, the pan-tilt head will also rotate with the camera. For example, when the pan-tilt head rotates to the left, the camera will also rotate to the left, when the pan-tilt head rotates upward, the camera will also rotate upward, and when the pan-tilt head rotates forward, the camera will also rotate forward. From the above, it can be seen that by controlling the rotation direction of the pan-tilt head, the camera rotates in that direction, and then the camera collects images at different positions.

[0057] In order to achieve the mechanical anti-shake function, when the pan / tilt moves forward (backward), the pan / tilt bracket moves backward (forward), so that the front and rear direction of the camera fixed on the pan / tilt remains unchanged. When the pan / tilt moves left (right), the pan / tilt bracket moves right (left), so that the left and right direction of the camera on the pan / tilt remains unchanged. When the pan / tilt moves upward (downward), the pan / tilt bracket moves downward (upward), so that the up and down direction of the camera on the pan / tilt remains unchanged.

[0058] In order to realize the mechanical anti-shake function, a measurement sensor is usually deployed on the gimbal, which is used to periodically collect the acceleration and angular velocity values ​​of the gimbal, such as the acceleration and angular velocity values ​​in the front and back directions, the acceleration and angular velocity values ​​in the up and down directions, and the acceleration and angular velocity values ​​in the left and right directions. For example, the measurement sensor may include but is not limited to IMU, etc. There is no restriction on the type of the measurement sensor, as long as it can collect acceleration and angular velocity values. IMU is used as an example to explain later. IMU is a six-axis inertial measurement sensor that can collect acceleration and angular velocity values ​​of the gimbal.

[0059] When the gimbal moves forward (backward), the attitude angle of the gimbal in the forward and backward directions can be obtained based on the angular velocity value in the forward and backward directions. This attitude angle represents the movement of the gimbal in the forward and backward directions. The movement of the gimbal bracket is controlled based on the attitude angle in the forward and backward directions of the gimbal, so that the forward and backward directions of the camera fixed on the gimbal remain unchanged.

[0060] Similarly, when the gimbal moves to the left (right), the attitude angle of the gimbal in the left and right directions can be obtained based on the angular velocity values ​​in the left and right directions, and the gimbal bracket is controlled to move based on the attitude angles in the left and right directions, so that the left and right directions of the camera fixed on the gimbal remain unchanged. And when the gimbal moves upward (downward), the attitude angle of the gimbal in the up and down directions can be obtained based on the angular velocity values ​​in the up and down directions, and the gimbal bracket is controlled to move based on the attitude angles in the up and down directions, so that the up and down directions of the camera fixed on the gimbal remain unchanged.

[0061] In one possible implementation, the mechanical anti-shake function involves processes such as attitude angle calculation, PID (Proportion Integral Differential) control and motor drive. During the attitude angle calculation process, the angular velocity value can be used to obtain the attitude angle of the gimbal, but this attitude angle has a limited range, that is, the attitude angle is within the limited range. Therefore, the gimbal needs to limit the rotation of the three axes, that is, the gimbal cannot rotate a full circle (360 degrees), which is conducive to the calculation of the attitude angle and can adapt to scene requirements.

[0062] Take the attitude angle in a certain direction (such as left and right, up and down, front and back, etc.) as an example, see Figure 1 As shown in the figure, the working area of ​​the gimbal is divided into the anti-shake working angle area, the limit angle area and the boundary angle area. The limit angle refers to the maximum angle that the gimbal can rotate. It is controlled by the mechanical structure and the gimbal can only rotate freely within the limit angle. The anti-shake working angle refers to the angle controlled by the algorithm. The gimbal can perform anti-shake work within this range. The boundary angle refers to the angle between the edge of the limit angle and the edge of the anti-shake working angle. The boundary angle is a buffer reserved to prevent the gimbal from hitting the edge of the limit angle.

[0063] When the boundary angle is small (due to size limitations, the boundary angle is small, such as 5 degrees), the gimbal collides with the mechanical limit due to sudden changes in external force ( Figure 1 When the gimbal is restored to the anti-shake working angle range, the anti-shake function will fail due to the attitude angle distortion.

[0064] For example, during the use of the gimbal, sudden changes in motion states are inevitable, such as running, violent shaking or falling. These sudden changes in motion states will cause the gimbal to collide (that is, the gimbal rotates to the limit or suddenly falls and causes collision), that is, the gimbal collides with the mechanical limit and causes collision failure (that is, after the gimbal collides, the attitude angle is wrong and the anti-shake failure occurs). In other words, the angular velocity values ​​collected by the IMU are discontinuous and there are large jump values. When determining the attitude angle of the gimbal based on the discontinuous angular velocity values, the attitude angle may be wrong, that is, an erroneous attitude angle is obtained (that is, attitude angle distortion), which makes it impossible to effectively control the gimbal. The images collected by the camera fixed on the gimbal will show undesirable phenomena such as skew and jitter.

[0065] For example, due to the mechanical limit of the gimbal, collision and limit phenomenon will inevitably occur during the use of the gimbal. The collision itself is an instantaneous physical phenomenon, which will cause a large jump in the angular velocity value collected by the IMU. The attitude angle is obtained based on the integration of the angular velocity value. When the angular velocity value jumps greatly, it will cause serious errors in the attitude angle solution. Figure 2 As shown in the figure, it is the angular velocity value collected by the IMU during the collision. The x-axis is the collection frequency, which is 500 Hz, and the y-axis is the angular velocity value in rad / s.

[0066] from Figure 2 It can be seen that when a collision occurs, the continuity of the angular velocity value is severely reduced, and the maximum interval of the angular velocity value reaches 8 rad / s, while the general angular velocity value interval is 0.01 rad / s. This huge jump in angular velocity value will cause serious errors in the integration of the attitude angle, that is, an incorrect attitude angle will be obtained.

[0067] In view of the above problems, a method for recovering the attitude angle is proposed in the embodiment of the present application, which is a method for quickly recovering the attitude angle after the gimbal fails due to collision. In the present embodiment, the gimbal is provided with a mechanical limit, which can touch the mechanical limit when the gimbal is working. After touching the mechanical limit, if the attitude angle is distorted, the gimbal will be tilted. At this time, the attitude angle recovery method of the embodiment of the present application is triggered, which can quickly return the gimbal to the normal position (e.g., return to the normal position within 1-2 seconds) without human intervention, that is, without human reset, restart and other operations.

[0068] In the embodiment of the present application, a target correction value can be determined based on the predicted direction vector and the actual direction vector, the angular velocity value can be corrected based on the target correction value, and the target attitude angle of the pan / tilt can be determined based on the corrected angular velocity value, thereby obtaining a correct attitude angle, quickly recovering an incorrect attitude angle, improving the stability and anti-interference capability of the pan / tilt, and preventing undesirable phenomena such as image skew and jitter from occurring for images captured by a camera fixed on the pan / tilt, optimizing the quality of images captured by the camera, improving image stability, and solving problems such as image skew that cannot be recovered or is recovered slowly when the pan / tilt collides (such as an instantaneous collision of the pan / tilt). When a collision of the pan / tilt is detected and the image is skewed, it can be quickly recovered without human intervention.

[0069] The technical solution of the embodiments of the present application is described below in conjunction with specific embodiments.

[0070] In the embodiment of the present application, a method for restoring an attitude angle is proposed, which is applied to a device including a measuring sensor and a gimbal, such as an image acquisition device, which may include but is not limited to a gimbal, a camera and a measuring sensor (such as an IMU). The measuring sensor periodically collects acceleration values ​​and angular velocity values ​​of the gimbal, see Figure 3 FIG. 4 is a flow chart of a method for restoring the attitude angle, and the method may include:

[0071] Step 301, after determining that the gimbal collides, determine the predicted direction vector of the gimbal based on the angular velocity value of the current period, determine the actual direction vector of the gimbal based on the acceleration value of the current period, and determine the target correction value corresponding to the angular velocity value based on the predicted direction vector and the actual direction vector.

[0072] In a possible implementation, the predicted direction vector of the gimbal is determined based on the angular velocity value of the current cycle, which may include but is not limited to the following methods: based on the angular velocity value of the current cycle and the initial quaternion of the previous cycle of the current cycle, the initial quaternion of the current cycle includes 4 vector values; based on the 4 vector values ​​in the initial quaternion of the current cycle, the predicted direction vector of the gimbal is determined. Exemplarily, if the current cycle is the first cycle after the gimbal collides, the initial quaternion of the previous cycle of the current cycle may be the initial quaternion when the gimbal collides, and the initial quaternion is determined based on the initial attitude angle when the gimbal collides.

[0073] For example, assuming that it is determined that the gimbal collides in period T0, the initial attitude angle of the gimbal is determined based on the angular velocity value of period T0, that is, the initial attitude angle of the gimbal when the collision occurs (the initial attitude angle may include roll angle, pitch angle and heading angle), and the initial attitude angle is converted into an initial quaternion of period T0, that is, the initial quaternion when the gimbal collides, and the initial quaternion may include 4 vector values.

[0074] If the current cycle is the first cycle T1 after the gimbal collides, then the initial quaternion of cycle T1 is determined based on the angular velocity value of cycle T1 and the initial quaternion of the previous cycle of cycle T1 (i.e., the initial quaternion when the gimbal collides), the predicted direction vector of the gimbal is determined based on the initial quaternion of cycle T1, and the initial quaternion of cycle T1 is stored. If the current cycle is the second cycle T2 after the gimbal collides, then the initial quaternion of cycle T2 is determined based on the angular velocity value of cycle T2 and the initial quaternion of the previous cycle T1 of cycle T2, the predicted direction vector of the gimbal is determined based on the initial quaternion of cycle T2, and the initial quaternion of cycle T2 is stored, that is, the stored initial quaternion of cycle T1 is replaced.

[0075] If the current period is the third period T3 after the gimbal collides, the initial quaternion of period T3 is determined based on the angular velocity value of period T3 and the initial quaternion of the previous period T2 of period T3, the predicted direction vector of the gimbal is determined based on the initial quaternion of period T3, and the initial quaternion of period T3 is stored, that is, replacing the stored initial quaternion of period T2, and so on.

[0076] In a possible implementation, determining the actual direction vector of the gimbal based on the acceleration value of the current period may include but is not limited to the following methods: determining the acceleration modulus based on the acceleration value of the current period, and determining the actual direction vector of the gimbal based on the acceleration value and the acceleration modulus.

[0077] In a possible implementation, determining a target correction value corresponding to the angular velocity value based on the predicted direction vector and the actual direction vector may include, but is not limited to, the following methods: determining an error vector between the predicted direction vector and the actual direction vector, and determining the target correction value based on the configured correction parameter value and the error vector, i.e., the target correction value corresponding to the angular velocity value.

[0078] Step 302: Correct the angular velocity value of the current cycle based on the target correction value to obtain a corrected angular velocity value, and determine whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value.

[0079] If yes, then step 303 may be executed; if no, then step 304 may be executed.

[0080] In a possible implementation, determining whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value may include, but is not limited to, the following methods: determining the target quaternion of the current cycle based on the corrected angular velocity value and the target quaternion of the previous cycle of the current cycle; illustratively, if the current cycle is the first cycle after the gimbal collides, the target quaternion of the previous cycle of the current cycle may be the target quaternion when the gimbal collides, and the target quaternion is determined based on the initial attitude angle when the gimbal collides. Then, if the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is less than a preset threshold, it can be determined that the attitude angle of the gimbal has been restored; if the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is not less than the preset threshold, it can be determined that the attitude angle of the gimbal has not been restored.

[0081] For example, assuming that it is determined that the gimbal collides in period T0, the initial attitude angle of the gimbal is determined based on the angular velocity value of period T0, that is, the initial attitude angle when the gimbal collides, and the initial attitude angle is converted into a target quaternion of period T0 (the target quaternion is also the initial quaternion of period T0), that is, the target quaternion when the gimbal collides, and the target quaternion can include 4 vector values.

[0082] If the current cycle is the first cycle T1 after the gimbal collision, the target quaternion of cycle T1 is determined based on the corrected angular velocity value of cycle T1 (not the angular velocity value before correction) and the target quaternion of the previous cycle of cycle T1 (i.e., the target quaternion when the gimbal collision occurred), and the target quaternion of cycle T1 is stored. If the current cycle is the second cycle T2 after the gimbal collision, the target quaternion of cycle T2 is determined based on the corrected angular velocity value of cycle T2 and the target quaternion of the previous cycle T1 of cycle T2, and the target quaternion of cycle T2 is stored, and so on.

[0083] Step 303, determining the target attitude angle of the gimbal based on the corrected angular velocity value, and determining the attitude angle of the gimbal based on the target attitude angle in a cycle after the current cycle, that is, the attitude angle of the subsequent cycle.

[0084] For example, the attitude angle of the gimbal has been restored in the current cycle. Therefore, the target attitude angle of the gimbal can be determined based on the corrected angular velocity value, and the target attitude angle of the current cycle is already an accurate attitude angle. In the cycle after the current cycle, the attitude angle of the gimbal can be determined based on the target attitude angle. That is to say, on the basis of the target attitude angle, the attitude angle of the cycle after the current cycle is directly determined based on the angular velocity value of the cycle after the current cycle, and there is no restriction on this determination method.

[0085] Step 304 , taking the cycle after the current cycle as the current cycle, and returning to perform the operation of determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle, that is, returning to perform step 301 .

[0086] In a possible implementation, for step 301, determining that the gimbal has collided may include, but is not limited to, the following methods: determining the acceleration modulus based on the acceleration value of the current cycle, determining the angular velocity modulus based on the angular velocity value of the current cycle, and determining the angular velocity modulus target value based on the angular velocity modulus. Then, if the angular velocity modulus target value is greater than the angular velocity modulus threshold, and / or the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold, it is determined that the gimbal has collided.

[0087] In the above embodiment, the angular velocity modulus target value is determined based on the angular velocity modulus, which may include but is not limited to the following methods: scaling the angular velocity modulus to obtain a first angular velocity modulus value; determining a second angular velocity modulus value of the current cycle based on the first angular velocity modulus value; wherein, if the first angular velocity modulus value is greater than the limit maximum value, the second angular velocity modulus value is the limit maximum value; if the first angular velocity modulus value is less than the limit minimum value, the second angular velocity modulus value is the limit minimum value; if the first angular velocity modulus value is not less than the limit minimum value and not greater than the limit maximum value, the second angular velocity modulus value is the first angular velocity modulus value. Then, the angular velocity modulus target value may be determined based on the second angular velocity modulus value of the current cycle and the second angular velocity modulus values ​​of N consecutive cycles before the current cycle.

[0088] It can be seen from the above technical scheme that in the embodiment of the present application, after the gimbal collides, the predicted direction vector of the gimbal can be determined based on the angular velocity value, the actual direction vector of the gimbal can be determined based on the acceleration value, the target correction value can be determined based on the predicted direction vector and the actual direction vector, the angular velocity value is corrected based on the target correction value, and the target attitude angle of the gimbal is determined based on the corrected angular velocity value, so as to obtain the correct attitude angle, quickly restore the wrong attitude angle, quickly repair the attitude angle error phenomenon, improve the stability and anti-interference ability of the gimbal, and effectively control the gimbal based on the correct attitude angle. The image captured by the camera deployed on the gimbal will not have undesirable phenomena such as picture skew and jitter. The image captured by the camera is optimized, the picture stability is improved, and the problem of image skew and inability to recover or slow recovery caused by the gimbal collision is solved.

[0089] The following describes the posture angle recovery method of the embodiment of the present application in combination with specific application scenarios.

[0090] In a possible implementation, the mechanical anti-shake function may involve processes such as attitude angle calculation, PID control and motor drive, see Figure 4A As shown in the figure, the acceleration and angular velocity values ​​of the gimbal can be collected by IMU. In the process of attitude angle solution, the attitude angle of the gimbal can be determined based on the acceleration and angular velocity values ​​of the gimbal. In the process of PID control and motor drive, the gimbal can be controlled based on the attitude angle of the gimbal, that is, the gimbal can be controlled to rotate so that the direction of the camera fixed on the gimbal remains unchanged.

[0091] On this basis, see the examples in this application. Figure 4BAs shown, a collision detection process and an attitude angle recovery process are added. In the collision detection process, it can be determined whether the gimbal has collided based on the acceleration value and angular velocity value of the gimbal and the attitude angle of the gimbal. If yes, the attitude angle recovery process is executed. If not, the attitude angle recovery process does not need to be executed. In the attitude angle recovery process, the attitude angle of the gimbal can be restored, and PID control and motor drive processes can be executed based on the restored attitude angle.

[0092] For example, see Figure 5 As shown, it is a processing flow chart of gimbal anti-shake, which mainly involves the collision detection process and the attitude angle recovery process. The processing flow of gimbal anti-shake may include the following steps:

[0093] Step 501, obtaining the acceleration value and angular velocity value of the gimbal from the IMU.

[0094] For example, IMU can periodically collect the acceleration and angular velocity values ​​of the gimbal. Therefore, in each cycle, the acceleration and angular velocity values ​​of the gimbal can be obtained from IMU, which are three-axis acceleration values ​​and three-axis angular velocity values, such as the acceleration value in the front-to-back direction, the acceleration value in the up-down direction, the acceleration value in the left-to-right direction, the angular velocity value in the front-to-back direction, the angular velocity value in the up-down direction, and the angular velocity value in the left-to-right direction. The three-axis acceleration value and the three-axis angular velocity value can be recorded as a respectively. x ,a y ,a z ,ω x ,ω y ,ω z .

[0095] When the acceleration value and angular velocity value of each cycle are obtained, this cycle can be recorded as the current cycle, and subsequent steps can be performed based on the acceleration value and angular velocity value of the current cycle. For example, when the acceleration value and angular velocity value of cycle T1 are obtained, the current cycle is cycle T1. When the acceleration value and angular velocity value of cycle T2 are obtained, the current cycle is cycle T1, and the previous cycle of the current cycle is cycle T1, and so on.

[0096] Step 502, determining the acceleration modulus (ie, the acceleration modulus of the current cycle) based on the acceleration value of the current cycle, and determining the angular velocity modulus (ie, the angular velocity modulus of the current cycle) based on the angular velocity value of the current cycle.

[0097] For example, the acceleration modulus can be determined using formula (1), and the angular velocity modulus can be determined using formula (2). The unit of the acceleration modulus is m / s, and the unit of the angular velocity modulus is rad / s.

[0098]

[0099]

[0100] a x ,a y ,a z Indicates the three-axis acceleration value of the current cycle, a norm Indicates the acceleration modulus of the current cycle, ω x ,ω y ,ω z Indicates the three-axis angular velocity value of the current cycle, ω norm Indicates the angular velocity modulus of the current cycle.

[0101] For example, the acceleration modulus is used to indicate the total acceleration of the gimbal in the current cycle, and can describe whether there is a sudden change in the motion state of the gimbal. The larger the acceleration modulus, the more violent the motion of the gimbal (or the greater the inertial force it is subjected to). The angular velocity modulus is used to indicate the total angular velocity of the gimbal in the current cycle, and can measure the rotation state of the gimbal. The larger the angular velocity modulus, the more violent the rotation of the gimbal. In summary, the acceleration modulus and angular velocity modulus can indicate the motion state of the gimbal in the current cycle.

[0102] Step 503: Determine an angular velocity modulus target value based on the angular velocity modulus.

[0103] For example, in step 503, the following steps may be used to determine the target value of the angular velocity modulus:

[0104] Step 5031: perform a scale transformation on the angular velocity modulus to obtain a first angular velocity modulus value.

[0105] For example, the angular velocity modulus can be scaled based on formula (3) to obtain the first angular velocity modulus value. In formula (3), λ0 is a scaling factor, which can be configured according to experience, such as 0.06, 0.08, etc. There is no restriction on this scaling factor. ω′ norm is the first angular velocity modulus value.

[0106] ω′ norm =λ0ω norm Formula (3)

[0107] Step 5032: Determine the second angular velocity modulus value of the current period based on the first angular velocity modulus value.

[0108] For example, as shown in formula (4), if the first angular velocity modulus value is greater than the limit maximum value, the second angular velocity modulus value is the limit maximum value. If the first angular velocity modulus value is less than the limit minimum value, the second angular velocity modulus value is the limit minimum value. If the first angular velocity modulus value is not less than the limit minimum value and not greater than the limit maximum value, the second angular velocity modulus value is the first angular velocity modulus value.

[0109]

[0110] In formula (4), λ max The maximum limit value can be configured based on experience, such as 0.1, 0.11, etc. There is no restriction on this maximum limit value. min It is the minimum limit value, which can be configured according to experience, such as 0.005, 0.006, etc. There is no restriction on this minimum limit value.

[0111] Exemplarily, by scaling and limiting the angular velocity modulus of the gimbal (i.e., the combined angular velocity, which is a vector with magnitude and direction, and only the magnitude is taken during calculation, then the angular velocity modulus is the magnitude of the combined angular velocity), statistics and processing are facilitated, thereby improving processing efficiency.

[0112] Step 5033: Determine the target angular velocity modulus value based on the second angular velocity modulus value of the current cycle and the second angular velocity modulus values ​​of N consecutive cycles (N may be a positive integer) before the current cycle.

[0113] For example, the second angular velocity modulus value of the current cycle and the second angular velocity modulus values ​​of N consecutive cycles before the current cycle are summed up, and the summed value is used as the angular velocity modulus target value. The angular velocity modulus target value is subsequently recorded as In this step, the total angular velocity within 1 second (IMU outputs data 500 times within 1 second) can be counted (that is, the value of N is 500), thereby describing the rotation law of the gimbal within 1 second. The larger the angular velocity modulus target value is, the higher the gimbal continues to rotate at a high speed within 1 second.

[0114] At this point, based on steps 5031 to 5033, the target value of the angular velocity modulus can be determined.

[0115] Step 504: Determine whether the gimbal has collided based on the angular velocity modulus target value and the acceleration modulus. If yes, then execute step 505; if no, then wait for the next cycle and return to step 501.

[0116] For example, if the angular velocity modulus target value is greater than the angular velocity modulus threshold, and the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold, it is determined that the gimbal has collided. Alternatively, if the angular velocity modulus target value is greater than the angular velocity modulus threshold, it is determined that the gimbal has collided. Alternatively, if the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold, it is determined that the gimbal has collided. Of course, the above are just a few examples, and there is no limitation on this determination method.

[0117] For example, the angular velocity modulus target value is greater than the angular velocity modulus threshold value, which can be expressed by formula (5), and the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold value, which can be expressed by formula (6). In formula (6), the specified acceleration value is 9.8, that is, the acceleration due to gravity.

[0118]

[0119] |a norm -9.8|>a max Formula (6)

[0120] For example, ω max It is used to indicate the angular velocity modulus threshold, which can be configured based on experience, such as 48, 50, etc. There is no limit on this angular velocity modulus threshold. max It is used to indicate the acceleration modulus threshold. It can be configured based on experience, such as 3, 3.5, 4, etc. There is no restriction on this acceleration modulus threshold.

[0121] From the above, we can see that if the sum of the total angular velocities of the gimbal within one second is greater than a threshold value (i.e., satisfying Formula 5), ​​it means that the gimbal continues to rotate at a high speed within this second, and the combined acceleration of the gimbal (excluding gravity, so minus 9.8) is greater than a threshold value (i.e., satisfying Formula 6), it means that the gimbal has a sudden change in motion state, that is, Formula (5) and Formula (6) are abstractions of collision. For example, we can consider the physical process of collision. A rotating object (the gimbal is rotating) is continuously rotating at a high speed before the collision (i.e., the sum of the combined angular velocities within 1 second is large). After colliding with another object (i.e., the mechanical limit of the gimbal), it will suddenly stop (i.e., the motion state has a sudden change). At this point, the physical process of collision is completed.

[0122] Step 505: after determining that the gimbal has collided, determine the predicted direction vector of the gimbal based on the angular velocity value of the current cycle, and the predicted direction vector may be a predicted gravity direction vector.

[0123] For example, in step 505, the following steps may be used to determine the prediction direction vector:

[0124] Step 5051: When the gimbal collides, determine the initial attitude angle of the gimbal based on the angular velocity value when the gimbal collides, and convert the initial attitude angle into an initial quaternion when the gimbal collides. The initial attitude angle includes a roll angle, a pitch angle, and a heading angle, etc. The initial quaternion may include 4 vector values.

[0125] For example, after a gimbal collision is detected, the initial attitude angle of the gimbal can be determined based on the angular velocity value when the gimbal collides. The initial attitude angle can be obtained by an attitude solution algorithm without any restrictions. It is assumed that the initial attitude angle of the gimbal is [φ0, θ0, ψ0], namely the roll angle, pitch angle and heading angle.

[0126] It should be noted that due to the collision, the initial attitude angle of the gimbal will have a large error, that is, the initial attitude angle will be distorted. This is explained below. The initial attitude angle is the integral of the angular velocity value. The meaning of the integral is that the current attitude angle is obtained by summing the historical attitude angles. When a collision occurs, the angular velocity value output by the IMU will jump. This is the characteristic of the device itself. See Figure 2 As shown in the figure, this jump will cause a large error in the currently calculated angular velocity value, and this error will always exist in the subsequent attitude angle. When the gimbal returns to the anti-shake angle working area, the gimbal compensation will be wrong due to the large error in the attitude angle, resulting in undesirable phenomena such as skew, that is, the image will shake and blur due to the gimbal error.

[0127] After obtaining the initial attitude angle of the gimbal, the initial attitude angle can be converted into the initial quaternion Q0 when the gimbal collides. The initial quaternion Q0 can be a matrix with four rows and one column, that is, it can include 4 vector values. See formula (7), which is an example of converting the initial attitude angle into the initial quaternion Q0.

[0128]

[0129] It can be seen from formula (7) that the initial quaternion Q0 can be determined based on the initial attitude angle [φ0, θ0, ψ0]. In formula (7), the first row of the matrix can be recorded as the vector value q0, the second row of the matrix can be recorded as the vector value q1, the third row of the matrix can be recorded as the vector value q2, and the fourth row of the matrix can be recorded as the vector value q3. Obviously, the initial quaternion Q0 can include the vector value q0, the vector value q1, the vector value q2, and the vector value q3.

[0130] Step 5052: In each cycle after the gimbal collides, the initial quaternion of the current cycle is determined based on the angular velocity value of the current cycle and the initial quaternion of the previous cycle of the current cycle. The initial quaternion of the current cycle may include 4 vector values. Exemplarily, if the current cycle is the first cycle after the gimbal collides, the initial quaternion of the previous cycle of the current cycle is the initial quaternion when the gimbal collides, and the initial quaternion is determined based on the initial attitude angle when the gimbal collides.

[0131] For example, in step 5051, the initial quaternion Q0 when the gimbal collides has been obtained. In the first period T1 after the gimbal collides, the initial quaternion Q1 of period T1 can be iterated based on the initial quaternion Q0 when the gimbal collides. In the second period T2 after the gimbal collides, the initial quaternion Q2 of period T2 can be iterated based on the initial quaternion Q1 of period T1, and so on.

[0132] For example, referring to formula (8), it is an example of determining the initial quaternion of the current cycle based on the initial quaternion of the previous cycle. Of course, this is just an example and there is no limitation on this determination method.

[0133]

[0134] Assuming the current cycle is cycle T1, then Q k-1 is the initial quaternion Q0 when the gimbal collides, Q k is the initial quaternion Q1 of period T1, ω x ,ω y ,ω z is the three-axis angular velocity value of period T1, Δt is the data acquisition period of IMU, and the data acquisition period can be 0.002, etc., without limitation. Obviously, based on the initial quaternion Q0 when the gimbal collides and the three-axis angular velocity value of period T1, the initial quaternion Q1 of period T1 can be obtained, which includes vector value q0, vector value q1, vector value q2, and vector value q3.

[0135] Assuming the current cycle is cycle T2, then Q k-1 is the initial quaternion Q1 of period T1, Q k is the initial quaternion Q2 of period T2, ω x ,ω y ,ω z is the three-axis angular velocity value of period T2. Obviously, based on the initial quaternion Q1 of period T1 and the three-axis angular velocity value of period T2, the initial quaternion Q2 of period T2 can be obtained.

[0136] By analogy, for each current cycle, the initial quaternion of the current cycle can be determined based on the angular velocity value of the current cycle and the initial quaternion of the previous cycle of the current cycle, which will not be described in detail here.

[0137] Step 5053: determine the predicted direction vector of the gimbal based on the four vector values ​​in the initial quaternion of the current cycle, and store the initial quaternion of the current cycle (for use in the next cycle iteration). The predicted direction vector may be a predicted gravity direction vector. For example, see formula (9), which is an example of determining the predicted direction vector G. The predicted direction vector G is a matrix with three rows and one column.

[0138]

[0139] In formula (9), q0, q1, q2, q3 are the four vector values ​​in the initial quaternion of the current cycle. Obviously, based on the four vector values ​​in the initial quaternion, the predicted direction vector G can be obtained. The first row matrix of the predicted direction vector G can be recorded as the vector value G 11 , the second row matrix of the prediction direction vector G can be recorded as the vector value G 21 , the third row matrix of the prediction direction vector G can be recorded as the vector value G 31 .

[0140] For example, the gimbal will be in a state of approximately stillness immediately after the collision (consider two objects colliding at high speed. After the collision, the two objects will lose mechanical energy and will be in a state of relative stillness. Of course, if external force is applied afterwards, they will still not be still. What is considered here is the moment after the collision, such as within 0.5 seconds). In this state, it can be considered that the gimbal is only affected by gravity. Then, the value measured by the IMU is only the acceleration of gravity. The correction amount of the attitude angle can be calculated based on the acceleration value of the IMU and the vertical downward characteristic of gravity. In other words, the predicted direction vector of the gimbal can be determined first, that is, the predicted gravity direction vector.

[0141] Exemplarily, when the predicted direction vector of the gimbal is determined based on the four vector values ​​in the initial quaternion Q1 with a period of T1, q0, q1, q2, and q3 in the above formula (9) are the four vector values ​​in the initial quaternion Q1; when the predicted direction vector of the gimbal is determined based on the four vector values ​​in the initial quaternion Q2 with a period of T2, q0, q1, q2, and q3 in the above formula (9) are the four vector values ​​in the initial quaternion Q2, and so on.

[0142] In summary, based on step 5052 and step 5053, the predicted direction vector of the gimbal can be determined.

[0143] Step 506: After determining that the gimbal has collided, determine the actual direction vector of the gimbal based on the acceleration value of the current cycle. The actual direction vector may be the actually measured gravity direction vector.

[0144] For example, the acceleration modulus of the current cycle can be determined based on the acceleration value of the current cycle. As shown in the above formula (1), to determine the acceleration modulus a norm After obtaining the acceleration modulus, the actual direction vector of the gimbal, that is, the actual measured gravity direction vector, can be determined based on the acceleration value and the acceleration modulus. For example, referring to formula (10), an example of determining the actual direction vector gm is a matrix with three rows and one column.

[0145]

[0146] In formula (10), a x ,a y ,a z Indicates the three-axis acceleration value of the current cycle, a norm Indicates the acceleration modulus of the current cycle, and the first row of the actual direction vector gm is recorded as the vector value g 11 , the second row of the actual direction vector gm is recorded as the vector value g 21 , the third row of the actual direction vector gm is recorded as vector value g 31 .

[0147] Step 507, determine the target correction value corresponding to the angular velocity value based on the predicted direction vector and the actual direction vector. For example, the error vector between the predicted direction vector and the actual direction vector may be determined first, as shown in formula (11), which is an example of determining the error vector. Then, the target correction value corresponding to the angular velocity value may be determined based on the configured correction parameter value and the error vector.

[0148]

[0149] In formula (11), G 11 , G 21 and G 31 It can be the vector value in the prediction direction vector G, g 11 , g 21 and g 31 It can be the vector value in the actual direction vector gm. Obviously, based on the vector value in the predicted direction vector G and the vector value in the actual direction vector gm, the error vector ex can be determined.

[0150] Exemplarily, the actual direction vector gm is the gravity direction vector measured by IMU (theoretically, the actual direction vector gm only has gravity, and the vector sum of the three axes of the gravity direction vector measured by IMU should be 9.8 of gravity, but the device and the actual object will not be strictly stationary, so there will be errors). Therefore, the attitude angle correction of the gimbal can be calculated based on the error vector ex between the actual direction vector gm and the predicted direction vector G.

[0151] In practical applications, the correction parameter value P can be pre-configured, and there is no restriction on the value of the correction parameter value P, which can be arbitrarily configured according to experience, such as 5.3, 5.4, etc. On this basis, the target correction value can be determined based on the correction parameter value P and the error vector ex, for example, the target correction value can be P*ex.

[0152] Step 508: Correct the angular velocity value of the current cycle based on the target correction value to obtain a corrected angular velocity value. For example, the angular velocity value can be corrected using formula (12). In formula (12), ω x ,ω y ,ω z is the three-axis angular velocity value of the current cycle, and ω is the corrected angular velocity value.

[0153]

[0154] Step 509, based on the corrected angular velocity value of the current cycle and the target quaternion of the previous cycle of the current cycle, determine the target quaternion of the current cycle. Exemplarily, if the current cycle is the first cycle after the gimbal collision, the target quaternion of the previous cycle of the current cycle is the target quaternion when the gimbal collision occurs, and the target quaternion is determined based on the initial attitude angle when the gimbal collision occurs.

[0155] For example, in step 5051, the initial quaternion Q0 when the gimbal collides has been obtained. The initial quaternion Q0 when the gimbal collides can also be used as the target quaternion when the gimbal collides. Obviously, the method for determining the target quaternion can refer to the above step 5051, which will not be repeated here.

[0156] In the first cycle T1 after the gimbal collides, the target quaternion of cycle T1 can be iterated based on the corrected angular velocity value of cycle T1 and the target quaternion when the gimbal collides. In the second cycle T2 after the gimbal collides, the target quaternion of cycle T2 can be iterated based on the corrected angular velocity value of cycle T2 and the target quaternion of cycle T1, and so on. For example, referring to formula (8), an example of determining the target quaternion of the current cycle is provided, and this determination method is not limited.

[0157] As shown in formula (8), assuming that the current cycle is cycle T1, then Q k-1 is the target quaternion when the gimbal collides, Q k is the target quaternion with period T1, ω x ,ω y ,ω z is the corrected three-axis angular velocity value of period T1, and Δt is the data acquisition period of the IMU. Obviously, based on the target quaternion when the gimbal collides and the corrected angular velocity value of period T1, the target quaternion of period T1 can be obtained. Assuming that the current period is period T2, then Q k-1 is the target quaternion of period T1, Q k is the target quaternion with period T2, ω x ,ω y ,ω zis the corrected three-axis angular velocity value of period T2. Obviously, based on the target quaternion of period T1 and the corrected angular velocity value of period T2, the target quaternion of period T2 can be obtained, and so on.

[0158] Step 510, based on the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle, determine whether the attitude angle of the gimbal has been restored. If so, execute step 511; if not, execute step 512.

[0159] In a possible implementation, if the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is less than a preset threshold, it can be determined that the attitude angle of the gimbal has been restored. Alternatively, if the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is not less than a preset threshold, it can be determined that the attitude angle of the gimbal has not been restored.

[0160] For example, as shown in formula (13), the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle can be calculated first. On this basis, if the absolute value of the difference is less than the preset threshold, it means that the attitude angle of the gimbal has been restored, and the loop is exited. If the absolute value of the difference is not less than the preset threshold, it means that the attitude angle of the gimbal has not been restored, and the loop is not exited, and the above steps are repeated.

[0161]

[0162] In formula (13), Indicates the target quaternion of the current cycle, Indicates the target quaternion of the previous cycle of the current cycle, Q error Represents a preset threshold, which can be configured based on experience, such as

[0163] Exemplarily, after a collision occurs in the gimbal, the gimbal will be in a stable state for a short time (such as 0.5s), and the acceleration value can be combined with the actual downward characteristic of gravity to obtain a correction value (i.e., a target correction value). The angular velocity value is corrected based on the correction value, and the angular velocity values ​​of multiple cycles can be corrected, thereby continuously reducing the error of the attitude angle, that is, the residual is controlled to be less than a certain threshold (i.e., the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is less than a preset threshold), thereby achieving a rapid recovery effect without the need for human intervention. The gimbal can continue to work normally, and can quickly recover from the phenomenon that the attitude angle error caused by the collision causes poor gimbal anti-shake effect.

[0164] Step 511, determining a target attitude angle of the gimbal based on the corrected angular velocity value of the current cycle, and determining an attitude angle of the gimbal based on the target attitude angle in a cycle after the current cycle.

[0165] For example, after obtaining the corrected angular velocity value, the target attitude angle of the gimbal can be determined based on the corrected angular velocity value. The target attitude angle can be obtained by an attitude solution algorithm, and there is no restriction on this.

[0166] For example, the attitude angle of the gimbal has been restored in the current cycle, so the target attitude angle of the gimbal can be determined based on the corrected angular velocity value, and the target attitude angle of the current cycle is already an accurate attitude angle. In the cycle after the current cycle, the attitude angle of the gimbal can be determined based on the target attitude angle. That is to say, based on the target attitude angle, the attitude angle of the cycle after the current cycle is directly determined based on the angular velocity value of the cycle after the current cycle, and there is no restriction on this determination method. In the subsequent process, the attitude angle of the gimbal can be determined based on the angular velocity value collected by the IMU, and this determination method will not be repeated.

[0167] Step 512, taking the cycle after the current cycle as the current cycle, and returning to execute step 505, that is, after obtaining the acceleration value and angular velocity value of the cycle after the current cycle, execute step 505 and subsequent steps based on the acceleration value and angular velocity value, which will not be repeated here.

[0168] Based on the same application concept as the above method, an attitude angle recovery device is proposed in the embodiment of the present application, which is applied to a device including a measuring sensor and a gimbal, wherein the measuring sensor periodically collects acceleration values ​​and angular velocity values ​​of the gimbal, see Figure 6 As shown, it is a schematic diagram of the structure of the device, and the device includes:

[0169] A determination module 61 is used to determine the predicted direction vector of the gimbal based on the angular velocity value of the current cycle, determine the actual direction vector of the gimbal based on the acceleration value of the current cycle, and determine a target correction value based on the predicted direction vector and the actual direction vector after determining that the gimbal has collided. A processing module 62 is used to correct the angular velocity value based on the target correction value to obtain a corrected angular velocity value, and determine whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value. A recovery module 63 is used to determine the target attitude angle of the gimbal based on the corrected angular velocity value if the attitude angle has been restored, and determine the attitude angle of the gimbal based on the target attitude angle in a cycle after the current cycle. If the attitude angle has not been restored, the cycle after the current cycle is used as the current cycle, triggering the determination module 61 to determine the predicted direction vector of the gimbal based on the angular velocity value of the current cycle.

[0170] Exemplarily, when the determination module 61 determines the predicted direction vector of the gimbal based on the angular velocity value of the current cycle, it is specifically used to: determine the initial quaternion of the current cycle based on the angular velocity value of the current cycle and the initial quaternion of the previous cycle of the current cycle, the initial quaternion of the current cycle including 4 vector values; determine the predicted direction vector of the gimbal based on the 4 vector values ​​in the initial quaternion; wherein, if the current cycle is the first cycle after the gimbal collides, the initial quaternion of the previous cycle of the current cycle is the initial quaternion when the gimbal collides, and the initial quaternion is determined based on the initial attitude angle of the gimbal when the collision occurs.

[0171] Exemplarily, when the determination module 61 determines the actual direction vector of the gimbal based on the acceleration value of the current period, it is specifically used to: determine the acceleration modulus based on the acceleration value of the current period; determine the actual direction vector of the gimbal based on the acceleration value and the acceleration modulus.

[0172] Exemplarily, when determining the target correction value based on the predicted direction vector and the actual direction vector, the determination module 61 is specifically used to: determine the error vector between the predicted direction vector and the actual direction vector; and determine the target correction value based on the configured correction parameter value and the error vector.

[0173] Exemplarily, when the processing module 62 determines whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value, it is specifically used to: determine the target quaternion of the current cycle based on the corrected angular velocity value and the target quaternion of the previous cycle of the current cycle; wherein, if the current cycle is the first cycle after the gimbal collides, then the target quaternion of the previous cycle of the current cycle is the target quaternion when the gimbal collides, and the target quaternion is determined based on the initial attitude angle of the gimbal when the collision occurs; if the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is less than a preset threshold, it is determined that the attitude angle of the gimbal has been restored; if the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is not less than the preset threshold, it is determined that the attitude angle of the gimbal has not been restored.

[0174] Exemplarily, when the determination module 61 determines that the gimbal has collided, it is specifically used to: determine the acceleration modulus based on the acceleration value of the current period; determine the angular velocity modulus based on the angular velocity value of the current period; determine the angular velocity modulus target value based on the angular velocity modulus; if the angular velocity modulus target value is greater than the angular velocity modulus threshold value, and / or the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold value, then it is determined that the gimbal has collided.

[0175] Exemplarily, when the determination module 61 determines the target angular velocity modulus value based on the angular velocity modulus, it is specifically used to: scale the angular velocity modulus to obtain a first angular velocity modulus value; determine the second angular velocity modulus value of the current period based on the first angular velocity modulus value; wherein, if the first angular velocity modulus value is greater than the limit maximum value, the second angular velocity modulus value is the limit maximum value; if the first angular velocity modulus value is less than the limit minimum value, the second angular velocity modulus value is the limit minimum value; if the first angular velocity modulus value is not less than the limit minimum value and not greater than the limit maximum value, the second angular velocity modulus value is the first angular velocity modulus value; determine the target angular velocity modulus value based on the second angular velocity modulus value of the current period and the second angular velocity modulus values ​​of N consecutive periods before the current period.

[0176] Based on the same application concept as the above method, an attitude angle recovery device is proposed in the embodiment of the present application, including a gimbal and a measuring sensor, wherein the measuring sensor periodically collects the acceleration value and angular velocity value of the gimbal; see Figure 7 As shown, the device further includes: a processor 71 and a machine-readable storage medium 72, wherein the machine-readable storage medium 72 stores machine-executable instructions that can be executed by the processor 71; the processor 71 is used to execute the machine-executable instructions to implement the following steps:

[0177] After determining that the gimbal collides, determining a predicted direction vector of the gimbal based on an angular velocity value of a current period, determining an actual direction vector of the gimbal based on an acceleration value of the current period, and determining a target correction value based on the predicted direction vector and the actual direction vector;

[0178] Correcting the angular velocity value based on the target correction value to obtain a corrected angular velocity value, and determining whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value;

[0179] If yes, determining the target attitude angle of the gimbal based on the corrected angular velocity value, and determining the attitude angle of the gimbal based on the target attitude angle in a cycle after the current cycle;

[0180] If not, the cycle after the current cycle is taken as the current cycle, and the operation of determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle is returned to be executed.

[0181] Based on the same application concept as the above method, an embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the attitude angle recovery method disclosed in the above example of the present application can be implemented.

[0182] The above-mentioned machine-readable storage medium may be any electronic, magnetic, optical or other physical storage device, which may contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.

[0183] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0184] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0185] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0186] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0187] Moreover, these computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0189] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for restoring an attitude angle, characterized in that: Applied to a device including a measuring sensor and a gimbal, wherein the measuring sensor periodically collects acceleration values ​​and angular velocity values ​​of the gimbal, the method comprises: After determining that the gimbal collides, determining a predicted direction vector of the gimbal based on an angular velocity value of a current period, determining an actual direction vector of the gimbal based on an acceleration value of the current period, and determining a target correction value based on the predicted direction vector and the actual direction vector; Correcting the angular velocity value based on the target correction value to obtain a corrected angular velocity value, and determining whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value; If yes, determining the target attitude angle of the gimbal based on the corrected angular velocity value, and determining the attitude angle of the gimbal based on the target attitude angle in a cycle after the current cycle; If not, taking the next cycle after the current cycle as the current cycle, and returning to perform the operation of determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle; Wherein, the determining that the gimbal collides comprises: Determine the acceleration modulus based on the acceleration value of the current period; determine the angular velocity modulus based on the angular velocity value of the current period; determine the angular velocity modulus target value based on the angular velocity modulus; if the angular velocity modulus target value is greater than the angular velocity modulus threshold value, and / or the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold value, then determine that the gimbal has collided.

2. The method according to claim 1, characterized in that The step of determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle includes: Determine an initial quaternion of the current cycle based on the angular velocity value of the current cycle and the initial quaternion of the previous cycle of the current cycle, wherein the initial quaternion of the current cycle includes 4 vector values; Determine a predicted direction vector of the gimbal based on four vector values ​​in the initial quaternion; Among them, if the current cycle is the first cycle after the gimbal collides, the initial quaternion of the previous cycle of the current cycle is the initial quaternion when the gimbal collides, and the initial quaternion is determined based on the initial attitude angle when the gimbal collides.

3. The method according to claim 1, characterized in that The determining the actual direction vector of the gimbal based on the acceleration value of the current cycle includes: Determine the acceleration modulus based on the acceleration value of the current cycle; An actual direction vector of the gimbal is determined based on the acceleration value and the acceleration modulus.

4. The method according to claim 1, characterized in that: The determining of the target correction value based on the predicted direction vector and the actual direction vector comprises: determining an error vector between the predicted direction vector and the actual direction vector; The target correction value is determined based on the configured correction parameter value and the error vector.

5. The method according to claim 1, characterized in that The determining whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value comprises: Based on the corrected angular velocity value and the target quaternion of the previous cycle of the current cycle, determine the target quaternion of the current cycle; wherein, if the current cycle is the first cycle after the gimbal collides, the target quaternion of the previous cycle of the current cycle is the target quaternion when the gimbal collides, and the target quaternion is determined based on the initial attitude angle of the gimbal when the gimbal collides; If the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is less than a preset threshold, it is determined that the attitude angle of the gimbal has been restored; If the absolute value of the difference between the target quaternion of the current cycle and the target quaternion of the previous cycle of the current cycle is not less than a preset threshold, it is determined that the attitude angle of the gimbal has not been restored.

6. The method according to claim 1, characterized in that The determining the angular velocity modulus target value based on the angular velocity modulus comprises: Performing a scale transformation on the angular velocity modulus to obtain a first angular velocity modulus value; Determine the second angular velocity modulus value of the current period based on the first angular velocity modulus value; wherein, if the first angular velocity modulus value is greater than the limit maximum value, the second angular velocity modulus value is the limit maximum value; if the first angular velocity modulus value is less than the limit minimum value, the second angular velocity modulus value is the limit minimum value; if the first angular velocity modulus value is not less than the limit minimum value and not greater than the limit maximum value, the second angular velocity modulus value is the first angular velocity modulus value; The angular velocity modulus target value is determined based on the second angular velocity modulus value of the current cycle and the second angular velocity modulus values ​​of N consecutive cycles before the current cycle.

7. A device for restoring an attitude angle, characterized in that: Applicable to a device including a measuring sensor and a gimbal, wherein the measuring sensor periodically collects acceleration values ​​and angular velocity values ​​of the gimbal, and the device includes: a determination module, configured to, after determining that the gimbal has collided, determine a predicted direction vector of the gimbal based on an angular velocity value of a current period, determine an actual direction vector of the gimbal based on an acceleration value of the current period, and determine a target correction value based on the predicted direction vector and the actual direction vector; a processing module, configured to correct the angular velocity value based on the target correction value to obtain a corrected angular velocity value, and determine whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value; A recovery module, configured to determine the target attitude angle of the gimbal based on the corrected angular velocity value if the attitude angle has been recovered, and determine the attitude angle of the gimbal based on the target attitude angle in a cycle after the current cycle; if the attitude angle has not been recovered, use the cycle after the current cycle as the current cycle, and trigger the determination module to determine the predicted direction vector of the gimbal based on the angular velocity value of the current cycle; Wherein, when the determining module determines that the gimbal collides, it is specifically used to: Determine the acceleration modulus based on the acceleration value of the current cycle; Determining an angular velocity modulus based on the angular velocity value of the current period; Determining an angular velocity modulus target value based on the angular velocity modulus; If the angular velocity modulus target value is greater than the angular velocity modulus threshold value, and / or the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold value, it is determined that the gimbal has collided.

8. An attitude angle recovery device, characterized in that: The device comprises a gimbal and a measuring sensor, wherein the measuring sensor periodically collects acceleration values ​​and angular velocity values ​​of the gimbal; the device further comprises: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the following steps: After determining that the gimbal collides, determining a predicted direction vector of the gimbal based on an angular velocity value of a current period, determining an actual direction vector of the gimbal based on an acceleration value of the current period, and determining a target correction value based on the predicted direction vector and the actual direction vector; Correcting the angular velocity value based on the target correction value to obtain a corrected angular velocity value, and determining whether the attitude angle of the gimbal has been restored based on the corrected angular velocity value; If yes, determining the target attitude angle of the gimbal based on the corrected angular velocity value, and determining the attitude angle of the gimbal based on the target attitude angle in a cycle after the current cycle; If not, taking the next cycle after the current cycle as the current cycle, and returning to perform the operation of determining the predicted direction vector of the gimbal based on the angular velocity value of the current cycle; Wherein, the determining that the gimbal collides comprises: Determine the acceleration modulus based on the acceleration value of the current period; determine the angular velocity modulus based on the angular velocity value of the current period; determine the angular velocity modulus target value based on the angular velocity modulus; if the angular velocity modulus target value is greater than the angular velocity modulus threshold value, and / or the absolute value of the difference between the acceleration modulus and the specified acceleration value is greater than the acceleration modulus threshold value, then determine that the gimbal has collided.

Citation Information

Patent Citations

  • Pan-tilt, and control method and apparatus for pan-tilt motor

    CN106953553A

  • Pan-tilt attitude detection method and device

    CN106959110A

  • Angle estimation method and device for equipment, camera module and aircraft

    CN109000612A

  • Calibration method and device, aerial photography equipment and storage medium

    CN110782496A

  • Holder position calibration detection method, device and system

    CN112135124A