A pan / tilt angle calculation method, device, electronic device and storage medium
By acquiring initial data and utilizing Kalman filtering and the Rodriguez rotation formula, the problem of noise interference in the attitude angle calculation of UAV gimbals was solved, achieving more accurate attitude angle calculation and stability augmentation control.
Patent Information
- Application Number
- CN202511094633.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-06
AI Technical Summary
In existing technologies, the attitude angle calculation of UAV gimbals is affected by noise interference, which leads to unstable attitude calculation results and reduces gimbal stability. In particular, it is difficult to accurately calculate the real gravitational acceleration under large-scale maneuvering conditions.
By acquiring initial gravitational acceleration and angular velocity data, and using Kalman filtering and the Rodriguez rotation formula, the gravitational acceleration data is reconstructed. Combined with the observation model and the carrier coordinate system, the true gravitational acceleration and gimbal attitude angle are determined, reducing noise interference.
It improves the accuracy and stability of gimbal attitude angle calculation, enhances the gimbal's stabilization control capability, reduces the impact of noise interference, and ensures the stability of the gimbal in complex environments.
Smart Images

Figure CN120596769B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of unmanned aerial vehicle (UAV) control, and in particular to a gimbal angle calculation method, apparatus, electronic device, and storage medium. Background Technology
[0002] With technological advancements and the booming development of the drone industry, gimbal applications are becoming increasingly common. However, drone flight inevitably generates significant noise, and the data from the gimbal's built-in sensors is also mixed with noise. This noise interference can affect the gimbal's angle calculations. For instance, when using an accelerometer to calibrate the gyroscope's angular velocity error on a drone gimbal, noise interference from other directions can cause instability in attitude calculations, thus reducing the gimbal's stability. Therefore, under conditions of extensive maneuvering, noise processing is crucial to accurately reproduce the true gravitational acceleration and effectively improve the gimbal's stabilization and control capabilities.
[0003] Currently, no effective solution has been proposed for the problem of accurately calculating the attitude angle of the drone gimbal in related technologies. Summary of the Invention
[0004] This application provides a gimbal angle calculation method, apparatus, electronic device, and storage medium to at least solve the problem of how to accurately calculate the attitude angle of a UAV gimbal in related technologies.
[0005] Firstly, embodiments of this application provide a method for calculating the angle of a gimbal.
[0006] In some embodiments, the gimbal angle calculation method includes:
[0007] Acquire initial gravitational acceleration data and initial angular velocity data;
[0008] Based on the initial gravitational acceleration data and the initial angular velocity data, the reconstructed gravitational acceleration data is determined;
[0009] The observation model is determined based on the initial gravitational acceleration data, and the actual gravitational acceleration data is determined based on the reconstructed gravitational acceleration data and the observation model.
[0010] The gimbal coordinate gravitational acceleration is obtained, and the gimbal attitude angle is determined based on the gimbal coordinate gravitational acceleration and the actual gravitational acceleration data.
[0011] In some embodiments, determining the observation model based on the initial gravitational acceleration data, and determining the true gravitational acceleration data based on the reconstructed gravitational acceleration data and the observation model, includes:
[0012] The initial gravitational acceleration data is determined as Kalman-filtered measurement data to define the observation model;
[0013] Kalman filtering is applied to the reconstructed gravitational acceleration data and the observation model to determine the true gravitational acceleration data.
[0014] In some embodiments, determining the initial gravitational acceleration data as Kalman-filtered measurement data to determine the observation model includes:
[0015] The initial gravitational acceleration data is determined as the measurement data using Kalman filtering. Based on the measurement data, observation noise, and observation matrix, the observation model is determined.
[0016] In some embodiments, determining the reconstructed gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data includes:
[0017] Based on the initial gravitational acceleration data and the initial angular velocity data, the theoretical gravitational acceleration data is determined;
[0018] Based on the theoretical gravitational acceleration data and the initial angular velocity data, the reconstructed gravitational acceleration data is determined.
[0019] In some embodiments, determining the theoretical gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data includes:
[0020] The angular velocity antisymmetric matrix is determined based on the initial angular velocity data, and the state transition formula is determined based on the initial gravitational acceleration data and the angular velocity antisymmetric matrix.
[0021] Based on the state transition formula and the initial value of gravitational acceleration, the theoretical gravitational acceleration data are determined.
[0022] In some embodiments, determining the reconstructed gravitational acceleration data based on the theoretical gravitational acceleration data and the initial angular velocity data includes:
[0023] Determine the transfer noise covariance matrix based on the initial angular velocity data;
[0024] Based on the transfer noise covariance matrix and the theoretical gravitational acceleration data, the reconstructed gravitational acceleration data is determined.
[0025] In some embodiments, obtaining the carrier coordinate gravitational acceleration and determining the gimbal attitude angle based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data includes:
[0026] Obtain the gravitational acceleration at the coordinates of the carrier, and determine the angle error based on the gravitational acceleration at the coordinates of the carrier and the actual gravitational acceleration data;
[0027] The gimbal attitude angle is determined based on the angle error and the fourth-order Runge-Kutta method.
[0028] Secondly, embodiments of this application provide a gimbal angle calculation device.
[0029] In some embodiments, the gimbal angle calculation device includes an initial data acquisition module, a reconstructed acceleration determination module, a true acceleration determination module, and a gimbal attitude angle determination module.
[0030] The initial data acquisition module is used to acquire initial gravitational acceleration data and initial angular velocity data;
[0031] The reconstructed acceleration determination module is used to determine the reconstructed gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data.
[0032] The true acceleration determination module is used to determine the observation model based on the initial gravitational acceleration data, and to determine the true gravitational acceleration data based on the reconstructed gravitational acceleration data and the observation model.
[0033] The gimbal attitude angle determination module is used to obtain the carrier coordinate gravitational acceleration and determine the gimbal attitude angle based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data.
[0034] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the gimbal angle calculation method as described in the first aspect above.
[0035] Fourthly, embodiments of this application provide a storage medium storing a computer program that, when executed by a processor, implements the gimbal angle calculation method as described in the first aspect above.
[0036] Compared to related technologies, the gimbal angle calculation method, apparatus, electronic device, and storage medium provided in this application, by acquiring initial gravitational acceleration data and initial angular velocity data, determining reconstructed gravitational acceleration data based on the initial gravitational acceleration data and initial angular velocity data, determining an observation model based on the initial gravitational acceleration data, further determining the true gravitational acceleration data based on the reconstructed gravitational acceleration data and observation model, obtaining the carrier coordinate gravitational acceleration, and determining the gimbal attitude angle based on the carrier coordinate gravitational acceleration and the true gravitational acceleration data, solves the problem of how to accurately calculate the attitude angle of the UAV gimbal, reduce noise interference, restore the true gravitational acceleration, and effectively improve the gimbal stabilization and control capabilities.
[0037] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0039] Figure 1 This is a hardware structure block diagram of the terminal of the gimbal angle calculation method according to an embodiment of this application;
[0040] Figure 2 This is a flowchart of a gimbal angle calculation method according to an embodiment of this application;
[0041] Figure 3 This is a flowchart of a gimbal angle calculation method according to a preferred embodiment of this application;
[0042] Figure 4 This is a structural block diagram of a gimbal angle calculation device according to an embodiment of this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application. Furthermore, it is understood that although the efforts made in such a development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, modifications to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.
[0044] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it refer to independent or alternative embodiments that are mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments unless there is a conflict.
[0045] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application means two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The terms “first,” “second,” “third,” etc., used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.
[0046] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. Taking running on a terminal as an example, Figure 1 This is a hardware structure block diagram of the terminal for the gimbal angle calculation method according to an embodiment of the present invention. For example... Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0047] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the gimbal angle calculation method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0048] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0049] This embodiment provides a method for calculating the angle of a gimbal. Figure 2 This is a flowchart of the gimbal angle calculation method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:
[0050] Step S201: Obtain initial gravitational acceleration data and initial angular velocity data.
[0051] In this embodiment, raw data from the accelerometer-inertial measurement unit (CIM) is acquired, and a low-pass filter is used to remove high-frequency noise from the raw data. The CIM typically consists of an accelerometer and a gyroscope. The accelerometer measures acceleration, and when stationary, it is only subject to gravitational acceleration. The gyroscope measures rotational angular velocity. The accelerometer can calculate the tilt angle by performing arctangent calculations on the three-axis acceleration data, but this is easily affected by motion interference. The gyroscope can obtain the tilt angle by integrating the angular velocity data, but this introduces accumulated errors. Therefore, attitude calculation combines accelerometer and gyroscope data. The accelerometer acquires acceleration, and the gyroscope acquires angular velocity. A low-pass filter is used to filter both velocities to determine the filtered initial gravitational acceleration data, denoted by α, and the filtered initial angular velocity data, denoted by ω.
[0052] Step S202: Determine the reconstructed gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data.
[0053] In this embodiment, the exponential form of the Rodrigues rotation formula is used to describe the relationship between gravitational acceleration and rotation angle. Specifically, if any vector p in space rotates around a unit rotation axis with a unit angular velocity ω for time t... Taking the derivative of this vector, we can see that... initial conditions Integrating the above formula, we get: This refers to the exponential form of the Rodriguez rotation formula. In this embodiment, by substituting the gravitational acceleration data into p in the formula and the angular velocity data into ω in the formula, the reconstructed gravitational acceleration data can be determined based on the initial gravitational acceleration data, the initial angular velocity data, and the exponential form of the Rodriguez rotation formula.
[0054] Step S203: Determine the observation model based on the initial gravitational acceleration data, and determine the actual gravitational acceleration data based on the reconstructed gravitational acceleration data and the observation model.
[0055] Kalman filtering is a method for estimating true gravitational acceleration using both calculated and measured data. In this embodiment, the calculated data can be the reconstructed gravitational acceleration obtained by using the Rodriguez rotation formula, initial gravitational acceleration, and angular velocity, while the measured data is data obtained from accelerometer measurements. The calculated data is calibrated using the measured data, and the Kalman gain is calculated to determine the gain of the calculated and measured data, thereby determining the final corrected data to be used. The initial gravitational acceleration data α after accelerometer filtering can be used as the measured data for Kalman filtering to determine the observation model, and the corrected true gravitational acceleration data can be determined based on the reconstructed gravitational acceleration data and the observation model.
[0056] The true gravitational acceleration data can be estimated by adjusting the values of the gyroscope transfer noise covariance matrix Q and the accelerometer observation noise covariance matrix R. The gravitational acceleration is updated in real time using the following formula:
[0057]
[0058]
[0059]
[0060]
[0061] Optimal state estimation refers to the process of extracting the true state of a system from noisy observation data using mathematical methods. Its core objective is to minimize the statistical properties of the estimation error (such as mean square error) under given conditions. In the above formula, k is the Kalman filter gain. In this embodiment, the system state variable at time k is estimated using the optimal estimated state at time k-1. Here, the system state variable is the actual gravitational acceleration, i.e., the gravitational acceleration at time k is estimated using the gravitational acceleration at time k-1 based on Kalman filtering. The initial gravitational acceleration is set to... P k for The covariance matrix is given by: R is the observation noise covariance matrix, H is the observation matrix, F is the state transition matrix, and Q is the transition noise covariance matrix.
[0062] Step S204: Obtain the carrier coordinate gravitational acceleration, and determine the gimbal attitude angle based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data.
[0063] When the gimbal is centered, the ideal three-axis gravitational acceleration data for the drone is: , where g n Let gravitational acceleration be the acceleration due to gravity in the geodetic coordinate system. Then, the formula for calculating gravitational acceleration in the carrier coordinate system is as follows: V b The carrier coordinates are the gravitational acceleration in the carrier coordinate system. Let be the direction cosine matrix. Represented using quaternions as follows:
[0064]
[0065] Furthermore, the gravitational acceleration of the carrier coordinates is obtained, and the gimbal attitude angle is determined based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data.
[0066] Through the above steps, this embodiment of the application obtains initial gravitational acceleration data and initial angular velocity data. Based on the initial gravitational acceleration data and initial angular velocity data, it determines reconstructed gravitational acceleration data and determines an observation model based on the initial gravitational acceleration data. Then, based on the observation model, it updates the fused reconstructed gravitational acceleration data by combining accelerometer observation data to determine the true gravitational acceleration data. This achieves the purpose of obtaining the true gravitational acceleration by fusing gyroscope angular velocity data with accelerometer data. Furthermore, it obtains the carrier coordinate gravitational acceleration and, based on the carrier coordinate gravitational acceleration and the true gravitational acceleration data, uses the true gravitational acceleration data to calibrate the gyroscope error, performs attitude solving, and determines the gimbal attitude angle.
[0067] In drone applications, the gimbal mounted on the drone needs to maintain a horizontal and forward orientation. This requires real-time calculation of the gimbal's tilt angles in three directions and timely rotation of the gimbal motors to counteract the tilt. However, traditional methods neglect the fact that accelerometers are susceptible to external interference from propeller / motion acceleration, leading to discrepancies between the synthesized vector of acceleration data from the three axes and the actual gravitational acceleration. Consequently, the calibrated gyroscope data also contains deviations, resulting in abnormal fluctuations in the gimbal's attitude angle. This application addresses this issue by separating the gravitational acceleration from the accelerometer data, using gravitational acceleration to calibrate the gyroscope's error, and ultimately obtaining the true angle of the gimbal. Based on Kalman filtering and the Rodriguez rotation formula, it obtains accurate gravitational acceleration data, improving the algorithm's reliability, making the gimbal tilt angle calculation more accurate, and enhancing image stability. This solves the problem of accurately calculating the drone gimbal's attitude angle, reduces noise interference, restores the true gravitational acceleration, and effectively improves the gimbal's stabilization and control capabilities.
[0068] In some embodiments, step S203 includes:
[0069] Step S2031: The initial gravitational acceleration data is determined as the measurement data for Kalman filtering in order to determine the observation model.
[0070] In this embodiment, the initial gravitational acceleration data α after accelerometer filtering is used as the measurement data for Kalman filtering to determine the observation model, and the corrected true gravitational acceleration data is determined based on the reconstructed gravitational acceleration data and the observation model.
[0071] Step S2032: Perform Kalman filtering on the reconstructed gravitational acceleration data and the observation model to determine the true gravitational acceleration data.
[0072] In this embodiment, the reconstructed gravitational acceleration data includes the transfer noise covariance matrix of the gyroscope, and the observation model includes the observation noise covariance matrix of the accelerometer. Therefore, by performing Kalman filtering on the reconstructed gravitational acceleration data and the observation model, the transfer noise covariance matrix and the observation noise covariance matrix are adjusted to determine the true gravitational acceleration data.
[0073] Through the above steps, the initial gravitational acceleration data is determined as the measurement data for Kalman filtering to determine the observation model. Kalman filtering is then applied to the reconstructed gravitational acceleration data and the observation model to determine the true gravitational acceleration data, thereby improving the accuracy of the gimbal angle calculation.
[0074] In some embodiments, step S2031 includes:
[0075] Step S2131: The initial gravitational acceleration data is determined as the measurement data for Kalman filtering. Based on the measurement data, observation noise, and observation matrix, the observation model is determined.
[0076] Specifically, in this embodiment, the initial gravitational acceleration data α after accelerometer filtering is used as the measurement data Z for Kalman filtering, which yields... Where the subscripts x, y, and z represent the three-axis projection data of the accelerometer, the observation model is: Z k =H k ×α k +V k , , where V k To observe the noise, V represents k It follows a Gaussian distribution with mean 0 and variance R, where m represents the matrix dimension, indicating an m×1 zero vector matrix here. Preferably, m is 3, and R is usually an m×m matrix. Thus, V k That is, it is an m-dimensional multivariate Gaussian distribution, H k For the observation matrix:
[0077]
[0078] Through the above steps, this embodiment of the application determines the initial gravitational acceleration data as Kalman filter measurement data, and determines the observation model based on the measurement data, observation noise, and observation matrix, providing a specific method for determining the observation model, improving model reliability, and demonstrating high feasibility.
[0079] In some embodiments, step S202 includes:
[0080] Step S2021: Determine the theoretical gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data.
[0081] In this embodiment, the exponential form of the nonlinear Rodriguez rotation formula is linearized, and theoretical gravitational acceleration data is determined based on the linearized Rodriguez rotation formula, according to the initial gravitational acceleration data and the initial angular velocity data.
[0082] Step S2022: Determine the reconstructed gravitational acceleration data based on the theoretical gravitational acceleration data and the initial angular velocity data.
[0083] Based on the initial angular velocity data, the transfer noise covariance matrix is determined. Based on the theoretical gravitational acceleration data and the transfer noise covariance matrix, the reconstructed gravitational acceleration data is determined.
[0084] Through the above steps, this embodiment of the application determines the theoretical gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data before determining the reconstructed gravitational acceleration data. This modularizes the data calculation, facilitates debugging, and improves feasibility and accuracy.
[0085] In some embodiments, step S2021 includes:
[0086] Step S2121: Determine the antisymmetric matrix of angular velocity based on the initial angular velocity data, and determine the state transition formula based on the initial gravitational acceleration data and the antisymmetric matrix of angular velocity.
[0087] In this embodiment, the exponential form of the nonlinear Rodrigues rotation formula is linearized, and by using Taylor expansion and discarding higher-order data of degree three and above, the following formula is obtained: ,in, Let θ be the identity matrix and θ be the angle between the spatial vector and the coordinate system. In this embodiment, the initial gravitational acceleration data is substituted into this spatial vector. The angle between gravitational acceleration and the geodetic coordinate system. Angular velocity antisymmetric matrix Assuming that in the initial state, the acceleration data measured by the accelerometer is the initial value of gravitational acceleration g0, which is a standard g value, i.e., the gimbal remains stationary upon power-up, and the angle between the two frames captured by the drone is extremely small, according to the principle of small angle approximation, the time t taken to rotate the included angle θ can be used to replace the included angle θ, thus obtaining the state transition formula. .
[0088] Step S2221: Determine the theoretical gravitational acceleration data based on the state transition formula and the initial value of gravitational acceleration.
[0089] Following on from the above, based on Rodriguez's rotation formula and state transition formula, the theoretical gravitational acceleration data can be determined using the following formula: , where g k Let g be the theoretical gravitational acceleration at time k. The initial value of gravitational acceleration g0 is a standard g value. The time interval between time k and time k+1 is t.
[0090] Through the above steps, this application embodiment determines the state transition formula based on the antisymmetric matrix of angular velocity, and determines the theoretical gravitational acceleration data based on the state transition formula and the initial value of gravitational acceleration, thereby providing a feasible method for determining theoretical gravitational acceleration data. Furthermore, it converts the nonlinear Rodrigues rotation formula function into a linear function, which can be directly used with Kalman filtering, improving computational efficiency and saving resources.
[0091] In some embodiments, step S2022 includes:
[0092] Step S2122: Determine the transfer noise covariance matrix based on the initial angular velocity data.
[0093] In this embodiment of the application, the state vector of the Kalman filter is assumed to be the three-axis components of gravitational acceleration, i.e. Then the state transition equation is , Among them, W k The transfer noise covariance matrix is used to describe the error in angular velocity during theoretical calculations. The transfer noise is expressed as having a mean of 0 and a variance of Q. k The distribution is Gaussian, where n represents the matrix dimension, indicating that it is an n×1 zero vector matrix. Preferably, n can be 3. k Here is the state transition matrix: .
[0094] Step S2222: Determine the reconstructed gravitational acceleration data based on the transfer noise covariance matrix and the theoretical gravitational acceleration data.
[0095] Based on the transfer noise covariance matrix and theoretical gravitational acceleration data, the state transition equation is determined. The state transition equation can be viewed as a recursive formula, using the system variable data from the previous moment to obtain the system variable data for the next moment. In this embodiment, the system variable data can be the three-axis components of gravitational acceleration. Furthermore, since the UAV is initially stationary on the ground, the initial three-axis components of gravitational acceleration can be set to [0, 0, -9.81]. Further, based on the state transition equation, reconstructed gravitational acceleration data, including angular velocity errors, is determined.
[0096] Through the above steps, this embodiment of the application determines the transfer noise covariance matrix based on the initial angular velocity data. The transfer noise covariance matrix is used to describe the error of angular velocity during theoretical calculation, i.e., noise interference. Based on the transfer noise covariance matrix and theoretical gravitational acceleration data, the reconstructed gravitational acceleration data is determined to further eliminate noise interference and improve the accuracy of attitude calculation.
[0097] In some embodiments, step S204 includes:
[0098] Step S2041: Obtain the carrier coordinate gravitational acceleration, and determine the angle error based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data.
[0099] In this embodiment, the formula for calculating gravitational acceleration in the carrier coordinate system is as follows: , For the coordinates of the carrier, gravitational acceleration, The gravitational acceleration in the geodetic coordinate system is the ideal gravitational acceleration data for the three axes when the gimbal is centered. , The direction cosine matrix is represented using quaternions as follows:
[0100]
[0101] The cross product of the carrier coordinate gravitational acceleration and the actual gravitational acceleration data is performed, and g and V are normalized. For small angles, approximating θ, the angle error can be obtained. It is used to calibrate gyroscope errors.
[0102] Step S2042: Determine the gimbal attitude angle based on the angle error and the fourth-order Runge-Kutta method.
[0103] In this embodiment of the application, after pi compensation of the angle θ, the true angular velocity data can be obtained, and the quaternion is updated using the fourth-order Runge-Kutta method, specifically as follows: ,in,
[0104] , , ,
[0105] Based on the real-time updated quaternions, the gimbal attitude angle can be determined as follows:
[0106] Pitch angle
[0107] Roll angle
[0108] Through the above steps, this embodiment of the application obtains the carrier coordinate gravitational acceleration, determines the angle error based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data, and uses the fourth-order Runge-Kutta method to determine the gimbal attitude angle. Compared with the commonly used first-order Runge-Kutta method, the calculation accuracy is higher and more accurate.
[0109] The embodiments of this application will be described and illustrated below through preferred embodiments.
[0110] Figure 3 This is a preferred flowchart of the gimbal angle calculation method according to an embodiment of this application, such as... Figure 3 As shown, the method for calculating the gimbal angle includes the following steps:
[0111] Step S301: Obtain initial gravitational acceleration data and initial angular velocity data, and determine theoretical gravitational acceleration data based on the initial gravitational acceleration data and initial angular velocity data;
[0112] Step S302: Determine the reconstructed gravitational acceleration data based on the theoretical gravitational acceleration data and the initial angular velocity data;
[0113] Step S303: Determine the initial gravitational acceleration data as Kalman filtered measurement data, and determine the observation model based on the measurement data, observation noise, and observation matrix;
[0114] Step S304: Perform Kalman filtering on the reconstructed gravitational acceleration data and the observation model to determine the true gravitational acceleration data;
[0115] Step S305: Obtain the carrier coordinate gravitational acceleration, and determine the gimbal attitude angle based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data.
[0116] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0117] This embodiment also provides a gimbal angle calculation device, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the terms "module," "unit," "subunit," etc., can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0118] Figure 4 This is a structural block diagram of the gimbal angle calculation device according to an embodiment of this application, such as... Figure 4 As shown, the device includes an initial data acquisition module 10, a reconstructed acceleration determination module 20, a true acceleration determination module 30, and a gimbal attitude angle determination module 40.
[0119] Initial data acquisition module 10 is used to acquire initial gravitational acceleration data and initial angular velocity data;
[0120] The reconstructed acceleration determination module 20 is used to determine the reconstructed gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data.
[0121] The true acceleration determination module 30 is used to determine the observation model based on the initial gravitational acceleration data, and to determine the true gravitational acceleration data based on the reconstructed gravitational acceleration data and the observation model.
[0122] The gimbal attitude angle determination module 40 is used to obtain the carrier coordinate gravitational acceleration and determine the gimbal attitude angle based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data.
[0123] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.
[0124] This embodiment also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0125] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0126] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0127] Acquire initial gravitational acceleration data and initial angular velocity data;
[0128] Based on the initial gravitational acceleration data and the initial angular velocity data, the reconstructed gravitational acceleration data is determined;
[0129] The observation model is determined based on the initial gravitational acceleration data, and the actual gravitational acceleration data is determined based on the reconstructed gravitational acceleration data and the observation model.
[0130] Obtain the carrier's coordinate gravitational acceleration, and determine the gimbal's attitude angle based on the carrier's coordinate gravitational acceleration and the actual gravitational acceleration data.
[0131] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0132] Furthermore, in conjunction with the gimbal angle calculation methods in the above embodiments, this application embodiment can provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the gimbal angle calculation methods in the above embodiments.
[0133] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0134] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0135] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for calculating the angle of a gimbal, characterized in that, Includes the following steps: Acquire initial gravitational acceleration data and initial angular velocity data; Based on the initial gravitational acceleration data and the initial angular velocity data, the reconstructed gravitational acceleration data is determined; The initial gravitational acceleration data is determined as Kalman-filtered measurement data to define the observation model; Kalman filtering is applied to the reconstructed gravitational acceleration data and the observation model to determine the true gravitational acceleration data; The gimbal coordinate gravitational acceleration is obtained, and the gimbal attitude angle is determined based on the gimbal coordinate gravitational acceleration and the actual gravitational acceleration data.
2. The gimbal angle calculation method according to claim 1, characterized in that, The step of determining the initial gravitational acceleration data as Kalman-filtered measurement data to determine the observation model includes: The initial gravitational acceleration data is determined as the measurement data using Kalman filtering. Based on the measurement data, observation noise, and observation matrix, the observation model is determined.
3. The gimbal angle calculation method according to claim 1 or claim 2, characterized in that, The step of determining the reconstructed gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data includes: Based on the initial gravitational acceleration data and the initial angular velocity data, the theoretical gravitational acceleration data is determined; Based on the theoretical gravitational acceleration data and the initial angular velocity data, the reconstructed gravitational acceleration data is determined.
4. The gimbal angle calculation method according to claim 3, characterized in that, The step of determining the theoretical gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data includes: The angular velocity antisymmetric matrix is determined based on the initial angular velocity data, and the state transition formula is determined based on the initial gravitational acceleration data and the angular velocity antisymmetric matrix. Based on the state transition formula and the initial value of gravitational acceleration, the theoretical gravitational acceleration data are determined.
5. The gimbal angle calculation method according to claim 4, characterized in that, The step of determining the reconstructed gravitational acceleration data based on the theoretical gravitational acceleration data and the initial angular velocity data includes: Determine the transfer noise covariance matrix based on the initial angular velocity data; Based on the transfer noise covariance matrix and the theoretical gravitational acceleration data, the reconstructed gravitational acceleration data is determined.
6. The gimbal angle calculation method according to claim 5, characterized in that, The step of obtaining the carrier coordinate gravitational acceleration and determining the gimbal attitude angle based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data includes: Obtain the gravitational acceleration at the coordinates of the carrier, and determine the angle error based on the gravitational acceleration at the coordinates of the carrier and the actual gravitational acceleration data; The gimbal attitude angle is determined based on the angle error and the fourth-order Runge-Kutta method.
7. A gimbal angle calculation device, used to implement the gimbal angle calculation method as described in any one of claims 1 to 6, characterized in that, It includes an initial data acquisition module, a reconstructed acceleration determination module, a true acceleration determination module, and a gimbal attitude angle determination module: The initial data acquisition module is used to acquire initial gravitational acceleration data and initial angular velocity data; The reconstructed acceleration determination module is used to determine the reconstructed gravitational acceleration data based on the initial gravitational acceleration data and the initial angular velocity data. The true acceleration determination module is used to determine the observation model based on the initial gravitational acceleration data, and to determine the true gravitational acceleration data based on the reconstructed gravitational acceleration data and the observation model. The gimbal attitude angle determination module is used to obtain the carrier coordinate gravitational acceleration and determine the gimbal attitude angle based on the carrier coordinate gravitational acceleration and the actual gravitational acceleration data.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the gimbal angle calculation method according to any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the gimbal angle calculation method according to any one of claims 1 to 6 when running.
Citation Information
Patent Citations
Motion state monitoring method and device, computer equipment and storage medium
CN118816936A
Self-Adaptive Horizontal Attitude Measurement Method based on Motion State Monitoring
US20220326017A1