Gyroscope-code disc complementary filtering based turntable control method and device

By combining complementary filtering techniques of gyroscope and encoder sensor, a PID controller was constructed, which solved the problem of the turntable being difficult to stabilize under wind and waves with a single encoder sensor. This enabled fast and accurate control of the turntable's attitude angle, improving the system's reliability and response speed.

CN120406578BActive Publication Date: 2026-06-19BEIJING INST OF ENVIRONMENTAL FEATURES

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING INST OF ENVIRONMENTAL FEATURES
Filing Date
2025-05-08
Publication Date
2026-06-19

Smart Images

  • Figure CN120406578B_ABST
    Figure CN120406578B_ABST
Patent Text Reader

Abstract

This invention discloses a turntable control method and apparatus based on gyroscope-encoder complementary filtering, belonging to the field of control engineering. The method includes: acquiring the gyroscope attitude angle measurement value of the turntable; acquiring the encoder attitude angle measurement value of the turntable and determining the encoder state based on the encoder feedback signal; performing complementary filtering on the gyroscope attitude angle measurement value and the encoder attitude angle measurement value based on the encoder state to obtain a fused attitude angle quaternion estimate; calculating the pitch angle, roll angle, and yaw angle of the turntable based on the fused attitude angle quaternion estimate to construct a PID controller for steady-state control of the turntable attitude. This scheme determines the encoder state based on the encoder feedback signal, uses a complementary filtering algorithm to fuse the measurement results of the gyroscope and encoder, and then constructs a PID controller for steady-state control of the turntable, which can improve the accuracy, real-time performance, and reliability of turntable attitude angle measurement and control under wind and wave conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of control engineering technology, and in particular to a turntable control method and device based on gyroscope-encoder complementary filtering. Background Technology

[0002] With the continuous development of the economy and society, the water transport industry is also constantly progressing. To maintain the efficiency and safety of water transport, the regulatory work of maritime departments is indispensable. Currently, in actual supervision, maritime departments mainly monitor, track, and collect evidence from target objects using turntable equipment installed at the bow of enforcement vessels. However, unstable winds and waves on the sea surface can easily cause the turntable to become unstable, making it difficult to quickly control the turntable to maintain a stable state, thus posing challenges to evidence collection by law enforcement departments. While encoders can provide relatively accurate measurement results to address this turntable instability, their slow response speed makes them unable to reflect rapid changes in the turntable's attitude in a timely manner. Furthermore, they typically only use a single encoder sensor, which can severely affect system reliability in the event of a malfunction.

[0003] Therefore, there is an urgent need to provide a new method for controlling the turntable. Summary of the Invention

[0004] To address the problem that traditional methods using a single encoder sensor struggle to quickly control a turntable and maintain a steady state under windy and turbulent conditions, this invention provides a turntable control method and apparatus based on gyroscope-encoder complementary filtering.

[0005] On the one hand, a turntable control method based on gyroscope-code disk complementary filtering is provided, the method comprising:

[0006] Obtain the gyroscope attitude angle measurement value of the turntable;

[0007] The encoder attitude angle measurement value of the turntable is obtained, and the encoder status is determined based on the signal fed back by the encoder.

[0008] Based on the encoder state, complementary filtering is performed on the gyroscope attitude angle measurement value and the encoder attitude angle measurement value to obtain a fused attitude angle quaternion estimate.

[0009] The pitch, roll, and yaw angles of the turntable are calculated based on the fused attitude angle quaternion estimates to construct a PID controller for steady-state control of the turntable attitude.

[0010] On the other hand, a turntable control device based on gyroscope-code disk complementary filtering is provided, which is based on the steps described in any embodiment of the method in the specification. The device includes:

[0011] The acquisition unit is used to acquire the gyroscope attitude angle measurement value of the turntable;

[0012] The judgment unit is used to obtain the measured value of the encoder attitude angle of the turntable and judge the encoder status based on the signal fed back by the encoder.

[0013] The fusion unit is used to perform complementary filtering on the gyroscope attitude angle measurement value and the encoder attitude angle measurement value based on the encoder state to obtain a fused attitude angle quaternion estimate.

[0014] The control unit is used to calculate the pitch angle, roll angle and yaw angle of the turntable based on the fused attitude angle quaternion estimate, so as to construct a PID controller to perform steady-state control of the turntable attitude.

[0015] On the other hand, a computer device is provided, the computer device including a memory and a processor, the memory for storing a computer program, and the processor for executing the computer program stored in the memory to implement the steps of the method described above.

[0016] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of the method described above.

[0017] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the method described above.

[0018] The technical solution provided by this invention can bring at least the following beneficial effects:

[0019] By combining the advantages of both gyroscopes and encoders, the system overcomes the reliability issues caused by using only a single encoder sensor. Furthermore, by determining the encoder state based on the feedback signal, and using a complementary filtering algorithm to fuse the measurement results from the gyroscope and encoder, a PID control system is constructed to perform steady-state control of the turntable. This improves the accuracy, real-time performance, and reliability of turntable attitude angle measurement and control under wind and wave conditions. Attached Figure Description

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

[0021] Figure 1 This is a flowchart of a turntable control method based on gyroscope-code disk complementary filtering provided by an embodiment of the present invention;

[0022] Figure 2This is a structural diagram of a turntable control device based on gyroscope-code disk complementary filtering provided in an embodiment of the present invention;

[0023] Figure 3 This is a hardware architecture diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

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

[0025] The following describes the specific implementation of the above concept.

[0026] Please refer to Figure 1 This invention provides a turntable control method based on gyroscope-code disk complementary filtering, the method comprising:

[0027] Step 100: Obtain the gyroscope attitude angle measurement value of the turntable;

[0028] Step 102: Obtain the measured value of the encoder attitude angle of the turntable, and determine the encoder status based on the signal fed back by the encoder;

[0029] Step 104: Based on the encoder state, perform complementary filtering on the gyroscope attitude angle measurement value and the encoder attitude angle measurement value to obtain the fused attitude angle quaternion estimate value;

[0030] Step 106: Calculate the pitch, roll and yaw angles of the turntable based on the fused attitude angle quaternion estimates, so as to construct a PID controller for steady-state control of the turntable attitude.

[0031] In this embodiment of the invention, by combining the advantages of both gyroscope and encoder, the shortcomings of insufficient system reliability caused by using only a single encoder sensor are overcome. Furthermore, by judging the encoder state based on the signal feedback from the encoder, and using a complementary filtering algorithm to fuse the measurement results of the gyroscope and encoder, PID control is constructed to perform steady-state control of the turntable, which can improve the accuracy, real-time performance, and reliability of turntable attitude angle measurement and control under wind and wave conditions.

[0032] The following description Figure 1 The execution method of each step is shown.

[0033] For step 100:

[0034] In this implementation, a MEMS gyroscope is used to directly acquire the attitude angle measurement value generated by the external force on the turntable. Here, external force refers to the combined effects of external forces such as wind, waves, and motors.

[0035] Regarding step 102:

[0036] In some implementations, the step "determine the encoder status based on the encoder feedback signal" includes steps S1-S3:

[0037] Step S1: Calculate the phase difference based on the sampled values ​​of the two orthogonal signals fed back by the encoder to determine the signal integrity status value;

[0038] Step S2: Determine the signal amplitude state value based on the average amplitude of the two orthogonal signals fed back by the encoder.

[0039] Step S3: Determine the encoder status based on the signal integrity status value and the signal amplitude status value.

[0040] In some implementations, the signal integrity status value in step S1 is determined in the following manner:

[0041]

[0042]

[0043] in, This is the signal integrity status value. For phase difference, , Two orthogonal signals fed back from the encoder , The sampled values, denoted as the allowable error range for phase difference, and N is the number of sampling points for each orthogonal signal.

[0044] In this embodiment, the signal integrity status value of the code disk is determined by calculating the phase difference between the two orthogonal signals fed back by the code disk, thereby realizing the quantification of the signal integrity status.

[0045] Due to phase difference error Caused angular error It can be approximated as:

[0046]

[0047] Therefore, in some implementations, the allowable error range of the phase difference is... Determined in the following manner:

[0048]

[0049] in, This represents the maximum angular error of the system turntable, which can be measured based on the actual situation of the turntable.

[0050] In some implementations, the signal amplitude state value in step S2 is determined in the following manner:

[0051]

[0052]

[0053] in, This represents the signal amplitude state value. , These are two quadrature signals fed back from the encoder. , average amplitude , The encoder outputs two quadrature signals respectively. , The average amplitude tolerance range value, where N is the number of sampling points for each orthogonal signal.

[0054] In this embodiment, the average amplitude of the two orthogonal signals fed back by the encoder is calculated to determine the encoder signal amplitude state value, thereby realizing the quantization of the signal amplitude state.

[0055] Due to signal amplitude error Caused angular error It can be approximated as:

[0056]

[0057] Therefore, in some implementations, the permissible error range of the signal average amplitude can be expressed as:

[0058]

[0059] in, This represents the maximum angular error of the system turntable, which can be measured based on the actual situation of the turntable.

[0060] In some implementations, the encoder status is determined in step S3 as follows:

[0061]

[0062] In the formula, In encoder state, Representative and, Represents or.

[0063] In this embodiment, signal integrity and amplitude are evaluated using two orthogonal signals based on encoder feedback to automatically determine whether the encoder is in a normal state. The encoder is considered normal only when both signal integrity and amplitude are normal; otherwise, it is considered abnormal. Furthermore, the encoder state is integrated into a complementary filtering algorithm between the gyroscope and the encoder, which avoids outputting encoder attitude angle measurements when the encoder state is abnormal, thereby further improving the accuracy of turntable control.

[0064] Regarding step 104:

[0065] In some implementations, step 104 may include steps B1-B5:

[0066] Step B1: Convert the gyroscope attitude angle measurement value and the encoder attitude angle measurement value into quaternions to obtain the gyroscope attitude angle quaternion estimate value and the encoder attitude angle quaternion estimate value.

[0067] In this step, we will first explain the process of converting the gyroscope attitude angle measurement value into a quaternion.

[0068] Gyroscope attitude angle measurement value It can be decomposed into a three-axis coordinate system as follows:

[0069]

[0070] Since the relationship between attitude angle and quaternion is:

[0071]

[0072] in, The derivative of a quaternion. It is a quaternion. This is quaternion multiplication. The attitude angle is denoted as .

[0073] Based on the above formula, the quaternion estimate of the gyroscope attitude angle is... Substituting and expanding the above equation, we get:

[0074]

[0075] in, This is the derivative of the quaternion estimate of the gyroscope attitude angle.

[0076] Based on the above expansion, the estimated value of the gyroscope attitude angle quaternion can be obtained by numerical integration methods such as the Euler method and the Runge-Kutta method. .

[0077] Next, the process of converting the encoder attitude angle measurement value into a quaternion will be explained.

[0078] Using encoder attitude angle measurement value Construct a rotation matrix :

[0079]

[0080] The quaternion estimate of the encoder attitude angle can be expressed as:

[0081]

[0082] Step B2: Design the high-pass filter required for fusion and the low-pass filter that incorporates the encoder state considerations.

[0083] In this step, the fusion expression for the fused attitude angle quaternion estimates is:

[0084]

[0085] in, To integrate the quaternion estimates of attitude angles, These are the weighting coefficients. This is a quaternion estimate of the gyroscope attitude angle. In encoder state, This is the quaternion estimate of the encoder attitude angle.

[0086] In this embodiment, the weighting coefficients are... The design is as follows: in the system It can be understood as a high-pass filter, used to extract the attitude angle change information of the gyroscope and reduce drift error; It can be understood as a low-pass filter, used to smooth the attitude angle measurement value of the encoder disk and reduce dynamic error.

[0087] Step B3: Input the estimated gyroscope attitude angle quaternion value into the high-pass filter to obtain the filtered estimated gyroscope attitude angle quaternion value.

[0088] Since the gyroscope's feedback signal is a high-frequency signal, a high-pass filter is used to filter the gyroscope's attitude angle quaternion estimate, allowing the gyroscope to play a primary measurement role when the wind and waves are large. Conversely, the encoder signal is a low-frequency signal, so a low-pass filter is used to filter the encoder's attitude angle quaternion estimate, allowing the encoder to play a primary measurement role when the wind and waves are small. By designing high-pass and low-pass filters, the output of the fused attitude angle quaternion estimate can be tailored to different wind and wave intensities, enabling the turntable attitude control to adapt to varying wind and wave environments, prioritizing accuracy in low waves and speed and reliability in high waves. Furthermore, incorporating the encoder status into the low-pass filter not only allows for automatic encoder status determination but also ensures that the gyroscope plays a primary measurement role when the encoder malfunctions, improving the reliability of the control system.

[0089] In some implementations, the high-pass filter filters the gyroscope attitude angle quaternion estimate in the following manner:

[0090]

[0091]

[0092] Substituting, we get:

[0093]

[0094] In the formula, This is the filtered quaternion estimate of the gyroscope attitude angle. Let be the transfer function of the high-pass filter. This is a quaternion estimate of the gyroscope attitude angle. It is a time constant. ω is the angular frequency.

[0095] In this embodiment, a high-pass filter is used to filter the quaternion estimate of the gyroscope attitude angle, which allows the gyroscope to play a major measurement role when the wind and waves are large, ensuring the positioning speed and positioning reliability when the waves are large.

[0096] Step B4: Input the encoder state and encoder attitude angle quaternion estimate into the low-pass filter to obtain the filtered encoder attitude angle quaternion estimate.

[0097] In some implementations, the low-pass filter filters the quaternion estimate of the encoder attitude angle in the following manner:

[0098]

[0099]

[0100] Substituting, we get:

[0101]

[0102] In the formula, This is the quaternion estimate of the encoder disk attitude angle after filtering. Let be the transfer function of the low-pass filter. In encoder state, This is the quaternion estimate of the encoder attitude angle. It is a time constant. ω is the angular frequency.

[0103] In this embodiment, a low-pass filter is used to filter the quaternion estimate of the encoder attitude angle, which allows the encoder to play a major measurement role when the wind and waves are small. In addition, the encoder status can be added to improve the accuracy of the fusion output.

[0104] Step B5: Summate the filtered gyroscope attitude angle quaternion estimate and the filtered encoder attitude angle quaternion estimate to obtain the fused attitude angle quaternion estimate.

[0105] Finally, by summing, the fused attitude angle quaternion estimate is obtained. :

[0106]

[0107] In the formula, It is a time constant. Angular frequency, This is a quaternion estimate of the gyroscope attitude angle. In encoder state, This is the quaternion estimate of the encoder attitude angle.

[0108] This invention combines the advantages of two types of sensors through a complementary filtering algorithm, avoiding the problem of low system reliability caused by a single encoder sensor. Specifically, the gyroscope attitude angle quaternion estimate is input into a high-pass filter and the encoder attitude angle quaternion estimate is input into a low-pass filter, and then summed. This enables the system to achieve the effect that the gyroscope output dominates the system output when a high-frequency signal is input, and the encoder output dominates the system output when a low-frequency signal is input. Furthermore, when the encoder fails, the gyroscope output dominates the system output. This results in a turntable control technology with high measurement accuracy, fast response speed, and high reliability.

[0109] Regarding step 106:

[0110] In this embodiment of the invention, the attitude angle quaternion estimate is fused. It can be represented as:

[0111]

[0112] In the formula, , , and To integrate the expanded values ​​of the attitude angle quaternion estimates, , and This is the imaginary part.

[0113] The fused attitude angle quaternion estimate is converted into pitch angle. Roll angle Yaw angle , respectively represented as:

[0114]

[0115]

[0116]

[0117] Next, a PID controller is constructed to perform steady-state control of the turntable's attitude.

[0118] Pitch angle Roll angle Yaw angle The outputs of the PID controller are respectively , , And respectively represented as:

[0119]

[0120]

[0121]

[0122] In the formula, It is a proportionality coefficient. It is the integral coefficient. These are differential coefficients, which can be understood as being related to the pitch angle. Roll angle and yaw angle In a PID controller, different proportional coefficients, integral coefficients, and derivative coefficients can be set.

[0123] Please refer to Figure 2 This invention provides a turntable control device based on gyroscope-code disk complementary filtering, the device comprising:

[0124] Acquisition unit 201 is used to acquire the gyroscope attitude angle measurement value of the turntable;

[0125] The judgment unit 202 is used to acquire the measured value of the encoder attitude angle of the turntable and judge the encoder status based on the signal fed back by the encoder.

[0126] The fusion unit 203 is used to perform complementary filtering on the gyroscope attitude angle measurement value and the encoder attitude angle measurement value based on the encoder state to obtain the fused attitude angle quaternion estimate value.

[0127] Control unit 204 is used to calculate the pitch angle, roll angle and yaw angle of the turntable based on the fused attitude angle quaternion estimate, so as to construct a PID controller to perform steady-state control of the turntable attitude.

[0128] In one embodiment of the present invention, when the judgment unit 202 performs a signal judgment of the code disk state based on the code disk feedback, it is used to:

[0129] Based on the sampled values ​​of two orthogonal signals fed back by the encoder, the phase difference is calculated to determine the signal integrity status value;

[0130] The signal amplitude state value is determined based on the average amplitude of the two orthogonal signals fed back by the encoder.

[0131] The encoder status is determined based on the signal integrity status value and the signal amplitude status value.

[0132] In one embodiment of the present invention, the signal integrity status value in the determination unit 202 is determined in the following manner:

[0133]

[0134]

[0135] in, This is the signal integrity status value. For phase difference, , Two orthogonal signals fed back from the encoder , The sampled values, denoted as the allowable error range for phase difference, and N is the number of sampling points for each orthogonal signal.

[0136] In one embodiment of the present invention, the fusion unit 203 is configured to perform:

[0137] The gyroscope attitude angle measurement value and the encoder attitude angle measurement value are converted into quaternions respectively to obtain the gyroscope attitude angle quaternion estimate value and the encoder attitude angle quaternion estimate value;

[0138] Design the high-pass filter required for fusion and the low-pass filter that incorporates the encoder state considerations;

[0139] Input the gyroscope attitude angle quaternion estimate into a high-pass filter to obtain the filtered gyroscope attitude angle quaternion estimate;

[0140] Input the encoder state and encoder attitude angle quaternion estimate into the low-pass filter to obtain the filtered encoder attitude angle quaternion estimate.

[0141] The filtered gyroscope attitude angle quaternion estimate and the filtered encoder attitude angle quaternion estimate are summed to obtain the fused attitude angle quaternion estimate.

[0142] In one embodiment of the present invention, the high-pass filter in the fusion unit 203 filters the gyroscope attitude angle quaternion estimate in the following manner:

[0143]

[0144]

[0145] Substituting, we get:

[0146]

[0147] In the formula, This is the filtered quaternion estimate of the gyroscope attitude angle. Let be the transfer function of the high-pass filter. This is a quaternion estimate of the gyroscope attitude angle. It is a time constant. ω is the angular frequency.

[0148] In one embodiment of the present invention, the low-pass filter in the fusion unit 203 filters the quaternion estimate of the encoder attitude angle in the following manner:

[0149]

[0150]

[0151] Substituting, we get:

[0152]

[0153] In the formula, This is the quaternion estimate of the encoder disk attitude angle after filtering. Let be the transfer function of the low-pass filter. In encoder state, This is the quaternion estimate of the encoder attitude angle. It is a time constant. ω is the angular frequency.

[0154] It should be noted that the above device embodiments and method embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0155] Embodiments of this application also provide a computer device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The processor loads and executes the at least one instruction, at least one program, code set, or instruction set to implement the turntable control method based on gyroscope-code disk complementary filtering provided in the above-described method embodiments.

[0156] Embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the turntable control method based on gyroscope-code disk complementary filtering provided in the above-described method embodiments.

[0157] Embodiments of this application also provide a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium and executes the computer program, causing the computer device to perform any of the turntable control methods based on gyroscope-code disk complementary filtering described in the above embodiments.

[0158] For ease of description, the above devices or apparatuses are described separately according to their functions, divided into various modules or units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0159] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of the embodiments of this application.

[0160] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0161] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A turntable control method based on gyroscope-encoder complementary filtering, characterized in that, include: Obtain the gyroscope attitude angle measurement value of the turntable; The encoder attitude angle measurement value of the turntable is obtained, and the encoder status is determined based on the signal fed back by the encoder. Based on the encoder state, complementary filtering is performed on the gyroscope attitude angle measurement value and the encoder attitude angle measurement value to obtain a fused attitude angle quaternion estimate. The pitch, roll, and yaw angles of the turntable are calculated based on the fused attitude angle quaternion estimates to construct a PID controller for steady-state control of the turntable attitude. The step of determining the encoder status based on the signal feedback from the encoder includes: Based on the sampled values ​​of the two orthogonal signals fed back by the encoder, the phase difference is calculated to determine the signal integrity status value; The signal amplitude state value is determined based on the average amplitude of the two orthogonal signals fed back by the encoder. Based on the signal integrity status value and the signal amplitude status value, determine the encoder status; The step of performing complementary filtering on the gyroscope attitude angle measurement and the encoder attitude angle measurement based on the encoder state to obtain a fused attitude angle quaternion estimate includes: The gyroscope attitude angle measurement value and the encoder attitude angle measurement value are converted into quaternions respectively to obtain the gyroscope attitude angle quaternion estimate value and the encoder attitude angle quaternion estimate value; Design the high-pass filter required for fusion and the low-pass filter that incorporates the encoder state considerations; The estimated gyroscope attitude angle quaternion value is input into the high-pass filter to obtain the filtered estimated gyroscope attitude angle quaternion value. The encoder state and the estimated quaternion value of the encoder attitude angle are input into the low-pass filter to obtain the filtered estimated quaternion value of the encoder attitude angle. The filtered gyroscope attitude angle quaternion estimate and the filtered encoder attitude angle quaternion estimate are summed to obtain the fused attitude angle quaternion estimate.

2. The method as described in claim 1, characterized in that, The signal integrity status value is determined in the following manner: in, This is the signal integrity status value. For phase difference, , The two orthogonal signals fed back by the encoder disk , The sampled values, denoted as the allowable error range for phase difference, and N is the number of sampling points for each orthogonal signal.

3. The method as described in claim 1, characterized in that, The high-pass filter filters the gyroscope attitude angle quaternion estimate in the following manner: Substituting, we get: In the formula, This is the filtered quaternion estimate of the gyroscope attitude angle. Let be the transfer function of the high-pass filter. This is the quaternion estimate of the gyroscope attitude angle. It is a time constant. ω is the angular frequency.

4. The method as described in claim 1, characterized in that, The low-pass filter filters the quaternion estimate of the encoder attitude angle in the following manner: Substituting, we get: In the formula, This is the quaternion estimate of the encoder disk attitude angle after filtering. Let be the transfer function of the low-pass filter. In encoder state, The quaternion estimate of the encoder attitude angle. It is a time constant. ω is the angular frequency.

5. A turntable control device based on gyroscope-code disk complementary filtering, used to implement the steps of the method described in any one of claims 1-4, characterized in that, include: The acquisition unit is used to acquire the gyroscope attitude angle measurement value of the turntable; The judgment unit is used to obtain the measured value of the encoder attitude angle of the turntable and judge the encoder status based on the signal fed back by the encoder. The fusion unit is used to perform complementary filtering on the gyroscope attitude angle measurement value and the encoder attitude angle measurement value based on the encoder state to obtain a fused attitude angle quaternion estimate. The control unit is used to calculate the pitch angle, roll angle and yaw angle of the turntable based on the fused attitude angle quaternion estimate, so as to construct a PID controller to perform steady-state control of the turntable attitude.

6. A computer device, characterized in that, The computer device includes a memory and a processor. The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the steps of the method according to any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1-4.

8. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1-4.