Unmanned aerial vehicle rolling attitude control method and PID controller
By dynamically selecting control strategies based on the error and error change rate of the drone, and optimizing PID parameters with start-stop control and expert rule base, the stability and accuracy of the drone control in complex environments is solved. Problem, efficient and robust roll attitude control is achieved.
Patent Information
- Application Number
- CN202411716068.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-01-10
AI Technical Summary
It is difficult for drones to achieve high-precision and high-stability control in complex flight environments. The performance of traditional PID controllers is limited and it is difficult to adapt to dynamic changes and external environment uncertainty.
By establishing the mapping relationship between the roll angle error and error rate of error and multiple control strategies, dynamically selecting the control strategy, combining start-stop control and expert rule base to optimize PID control parameters, the rolling of the drone is achieved Fast and accurate control of angles.
It improves the stability and accuracy of the rolling attitude control of the drone, enhances the robustness and adaptability of the system, reduces the difficulty of debugging of the PID controller, and achieves rapid response and stable flight in complex environments.
Smart Images

Figure CN119292040A_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the field of unmanned aerial vehicle control, and more specifically, to a method for controlling the rolling attitude of an unmanned aerial vehicle and a PID controller. Background Art
[0002] With the rapid development of UAV technology, its application areas have been significantly broadened, showing significant advantages such as flexible operation and simple structure. However, UAVs face multiple challenges in attitude control in complex flight environments, and how to ensure the stability and controllability of flight attitude has become an urgent problem to be solved.
[0003] In view of the time-varying characteristics of UAVs during the modeling process, as well as the high independence and low external coupling of the peripheral devices of the control system, this complexity is not only reflected in the high dimensions and multiple levels within the system, but also due to the independent working modes between devices, the coupling difficulty of collaborative work is aggravated, and the limitations of traditional PID controllers are gradually revealed. Since PID control relies on fixed parameter adjustment, it is difficult to adapt to the dynamic changes of the UAV system and the uncertainty of the external environment in real time, so it is difficult to achieve the best control effect. In a complex and changeable flight environment, the performance of the PID controller is limited, and it is difficult to meet the requirements of UAVs for high-precision and high-stability control. In the prior art, an anti-disturbance control strategy based on radial basis function (RBF) neural network is proposed. Although this method shows significant advantages in UAVs dealing with complex nonlinear systems, in the case of rapidly changing environments or sudden changes in the dynamic characteristics of UAVs, the adaptability of RBF neural network still needs to be further optimized to enhance the robustness and stability of the control system. Summary of the invention
[0004] In order to solve the technical problems of low accuracy and efficiency of the above-mentioned UAV roll attitude control, the present invention provides solutions in the following aspects.
[0005] In a first aspect, the present invention provides a method for controlling the roll attitude of an unmanned aerial vehicle, which is applied to a PID controller and includes: establishing a mapping relationship between the error of the roll angle of the unmanned aerial vehicle, the error change rate and a plurality of preset control strategies, wherein the control strategy is used to control the output of the PID controller; determining the current error and the current error change rate of the roll angle of the unmanned aerial vehicle; determining the control strategy for the current error and the current error change rate based on the mapping relationship, and controlling the roll angle of the unmanned aerial vehicle based on the control strategy.
[0006] Furthermore, a mapping relationship between the error of the UAV roll angle, the error change rate and multiple control strategies is established, including: if the absolute value of the error is greater than a first threshold, a first control strategy is adopted, and the first control strategy includes: using start-stop control to adjust the error.
[0007] Furthermore, it also includes: if the product of the error and the error change rate is greater than 0, and the absolute value of the error is greater than a second threshold, a second control strategy is adopted, and the second control strategy includes: controlling the output of the PID controller according to a PID control parameter determined by a preset first coefficient and a preset expert rule base, and the first coefficient is greater than 1.
[0008] Furthermore, the second control strategy is:
[0009] u(k)=u(k-1)+ρ1{k p [e(k)-e(k-1)]+k i e(k)+k d [e(k)-2e(k-1)+e(k-2)]};
[0010] Wherein, u(k) is the output of the PID controller at the kth sampling time, u(k-1) is the output of the PID controller at the k-1th sampling time, ρ1 is the first coefficient, k p is the proportionality coefficient, k i is the integration coefficient, k d is the differential coefficient, e(k) is the error of the UAV roll angle at the kth sampling moment, e(k-1) is the error of the UAV roll angle at the k-1th sampling moment, and e(k-2) is the error of the UAV roll angle at the k-2th sampling moment.
[0011] Furthermore, it also includes: if the product of the error and the error change rate is greater than 0, and the absolute value of the error is less than a second threshold, a third control strategy is adopted, and the third control strategy includes: controlling the output of the PID controller according to PID control parameters determined according to a preset expert rule base.
[0012] Furthermore, it also includes: if the product of the error at the current sampling moment and the error change rate at the current sampling moment is less than 0, the product of the error at the current sampling moment and the error at the previous sampling moment is less than 0, and the absolute value of the error at the current sampling moment is greater than a second threshold, a fourth control strategy is adopted, and the fourth control strategy includes: controlling the output of the PID controller according to a preset second coefficient and a PID control parameter determined by a preset expert rule base, and the second coefficient is greater than 1.
[0013] Furthermore, the fourth control strategy is:
[0014] u(k)=u(k-1)+ρ2k p e m (k);
[0015] Wherein, u(k) is the output of the PID controller at the kth sampling time, u(k-1) is the output of the PID controller at the k-1th sampling time, and k p is the proportionality coefficient, e m (k) is the error extreme value of the UAV roll angle at the kth sampling moment, and ρ2 is the second coefficient.
[0016] Furthermore, it also includes: if the product of the error at the current sampling moment and the error change rate at the current sampling moment is less than 0, the product of the error at the current sampling moment and the error at the previous sampling moment is less than 0, and the absolute value of the error at the current sampling moment is less than a second threshold, a fifth control strategy is adopted, and the fifth control strategy includes: controlling the output of the PID controller according to a preset third coefficient and a PID control parameter determined by a preset expert rule base, and the third coefficient is less than 1.
[0017] Furthermore, it also includes: if the product of the error at the current sampling moment and the error change rate at the current sampling moment is less than 0, and the product of the error at the current sampling moment and the error at the previous sampling moment is greater than 0, adopting a sixth control strategy, the sixth control strategy including: maintaining the current output of the PID controller; if the absolute value of the error is less than or equal to a third threshold, adopting a seventh control strategy, the seventh control strategy including: adding an integral link in the output of the PID controller.
[0018] In a second aspect, the present invention provides a PID controller, comprising a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for controlling the roll attitude of an unmanned aerial vehicle described in the first aspect is implemented.
[0019] The beneficial effects of the present invention are as follows: the control method of the present invention dynamically selects the corresponding control strategy according to the error and error change rate of the roll angle of the UAV, and has strong adaptability. Moreover, each control strategy can output the corresponding control effect under specific conditions, so that the roll angle of the UAV can be adjusted quickly and accurately; in addition, by introducing the knowledge and experience of the expert rule base, the PID controller can more effectively deal with the uncertainty and interference of the system, thereby improving the stability and accuracy of the roll attitude control of the UAV. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0021] Figure 1 is a flow chart schematically illustrating a method for controlling a rolling attitude of a drone according to an embodiment of the present invention;
[0022] Figure 2 is a step response error curve diagram schematically showing an embodiment of the present invention;
[0023] Figure 3 is a flow chart schematically illustrating a rolling attitude control process of a drone according to an embodiment of the present invention;
[0024] Figure 4 is a diagram schematically showing a response curve obtained by a simulation experiment according to an embodiment of the present invention;
[0025] Figure 5 is a block diagram schematically showing a structure of a PID controller according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0027] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0028] Figure 1 FIG. 4 is a flow chart schematically illustrating a method for controlling a rolling attitude of a drone according to an embodiment of the present invention.
[0029] In a first aspect, the present invention provides a method for controlling a rolling attitude of an unmanned aerial vehicle, such as Figure 1 As shown, the method of the present invention comprises:
[0030] S101, establishing a mapping relationship between the error of the UAV roll angle, the error change rate and a plurality of preset control strategies.
[0031] In this embodiment, the control strategies include a first control strategy, a second control strategy, a third control strategy, a fourth control strategy, a fifth control strategy, a sixth control strategy and a seventh control strategy, which are used to control the output of the PID controller.
[0032] Furthermore, the mapping relationship between the error of the roll angle of the UAV, the error change rate and the multiple control strategies established includes: when the absolute value of the error of the roll angle is greater than the first threshold value (|e(k)|>H1), for example Figure 2 Part of the segment in area Ⅰ indicates that the error is large, then the first control strategy can be adopted. In this embodiment, the first control strategy includes: using start-stop control (Bang-Bang control) to control the roll angle of the UAV to adjust the error of the roll angle of the UAV. Specifically, the PID controller quickly adjusts the error of the roll angle according to the maximum or minimum output. At this time, the control of the roll angle of the UAV is equivalent to implementing open-loop control (that is, the output of the system is determined by the input, without considering the actual output of the system). Among them, the first threshold can be the error limit between the start-stop control (first control strategy) and other control strategies.
[0033] In one embodiment, the mapping relationship further includes: when the product of the error of the UAV roll angle and the error change rate is greater than 0, and the absolute value of the error of the UAV roll angle is greater than a second threshold value (e(k)Δe(k)>0,|e(k)|>H2, where e(k) is the error and Δe(k) is the error change rate), for example Figure 2 The partial segment of the middle II area indicates that the roll angle error is relatively large, and the error has a tendency to gradually increase. In this case, the second control strategy can be used to output a stronger control effect, thereby preventing the error of the roll angle of the drone from being further amplified. In one embodiment, the second threshold is the error limit between the control effect of the second control strategy and the control effect of other control strategies, and the second threshold is less than the first threshold (H2
[0034] In one embodiment, the second control strategy includes: controlling the output of the PID controller according to a preset first coefficient and a PID control parameter determined by a preset expert rule base. It is understood that the PID control parameter includes a proportional coefficient k p , integration coefficient k i and the differential coefficient k d ,It is understandable that the ID control parameters determined by the ,expert rule base are different under different conditions.
[0035] Specifically, under the control of the second control strategy, the PID controller output is:
[0036] u(k)=u(k-1)+ρ1{k p [e(k)-e(k-1)]+k i e(k)+k d [e(k)-2e(k-1)+e(k-2)]};
[0037] Wherein, u(k) is the output of the PID controller at the k-th sampling moment, u(k - 1) is the output of the PID controller at the (k - 1)-th sampling moment, and k p is the proportionality coefficient, k i is the integral coefficient, k d is the derivative coefficient, e(k) is the error of the roll angle of the UAV at the k-th sampling moment, e(k - 1) represents the error of the roll angle of the UAV at the (k - 1)-th sampling moment, e(k - 2) represents the error of the roll angle of the UAV at the (k - 2)-th sampling moment, ρ1 is the first coefficient, and ρ1 > 1.
[0038] It can be understood that setting the first coefficient greater than 1 can amplify the effect of traditional PID control, thus achieving a stronger control effect, reversing the trend of further error amplification, and quickly suppressing the error of the roll angle of the UAV. In addition, the preset expert rule base provides tuning rules and algorithms, which can automatically complete the tuning of PID control parameters and the selection of control strategies, thereby reducing the difficulty and complexity of PID controller debugging.
[0039] By adopting the second control strategy when the error is relatively large and the error has an increasing trend, the PID controller can output a stronger control effect, thereby quickly preventing the further amplification of the error of the roll angle of the UAV, and further improving the efficiency of the roll attitude control of the UAV.
[0040] In an alternative embodiment, the second control strategy can be adopted when the product of the error of the roll angle of the UAV and the error change rate is greater than 0, and the absolute value of the error of the roll angle of the UAV is greater than the second threshold and less than the first threshold (e(k)Δe(k) > 0, H2 < |e(k)| < H1).
[0041] In one embodiment, the mapping relationship further includes: when the product of the error of the roll angle of the UAV and the error change rate is greater than 0, and the absolute value of the error is less than the second threshold (e(k)Δe(k) > 0, |e(k)| < H2), for example Figure 2 in region VIII, it indicates that although the error of the roll angle of the UAV has a gradually increasing trend, the error itself is relatively small, and then the third control strategy can be adopted to prevent the error from further amplifying.
[0042] In one embodiment, the third control strategy includes: controlling the output of the PID controller according to the PID control parameters determined by the preset expert rule base. Specifically, under the control of the third control strategy, the output of the PID controller is:
[0043] u(k) = u(k - 1) + k p [e(k) - e(k - 1)] + k i e(k) + kd [e(k)-2e(k-1)+e(k-2)].
[0044] By adopting the third control strategy when the UAV roll angle error itself is small but has a tendency to increase, the error can be reversed from further amplification, while avoiding overshoot caused by excessive control intensity.
[0045] In one embodiment, the mapping relationship also includes: when the product of the error at the current sampling moment and the error change rate at the current sampling moment is less than 0, the product of the error at the current sampling moment and the error at the previous sampling moment is less than 0, and the absolute value of the error at the current sampling moment is greater than the second threshold (e(k)Δe(k)<0, e(k)Δe(k-1)<0, |e(k)|>H2), it indicates that the error is in an extreme value state, and the absolute value of the error itself is large, then the fourth control strategy can be adopted to output a stronger control effect on the error, thereby quickly reducing the error of the roll angle of the drone.
[0046] In one embodiment, the fourth control strategy includes: controlling the output of the PID controller according to the preset second coefficient and the PID control parameter determined by the preset expert rule base. Specifically, under the control of the fourth control strategy, the output of the PID controller is:
[0047] u(k)=u(k-1)+ρ2k p e m (k);
[0048] Wherein, u(k) is the output of the PID controller at the kth sampling time, u(k-1) is the output of the PID controller at the k-1th sampling time, and k p is the proportionality coefficient, e m (k) is the error extreme value of the UAV roll angle at the kth sampling moment, ρ2 is the second coefficient, and ρ2>1.
[0049] It should be noted that different UAV physical models use different first and second coefficients. The values of the first and second coefficients can be obtained by simulation testing or actual testing of the UAV model, and the appropriate values can be determined based on the actual output control effect. For example, the first coefficient can be set to 1.5 first, and the first coefficient can be increased or decreased accordingly based on the difference between the control effect of the second control strategy on the UAV and the target effect. When the target effect is achieved, the value at this time is the final value of the first coefficient. Similarly, the second coefficient is determined in the same way.
[0050] By setting the first coefficient and the second coefficient to be greater than 1, an enhanced control effect can be achieved, thereby quickly reducing the error.
[0051] In an alternative embodiment, the fourth control strategy may be adopted when the product of the error at the current sampling moment and the rate of change of the error at the current sampling moment is less than 0, the product of the error at the current sampling moment and the error at the previous sampling moment is less than 0, and the absolute value of the error at the current sampling moment is greater than the second threshold and less than the first threshold (e(k)Δe(k)<0, e(k)Δe(k - 1)<0, H2<|e(k)|<H1).
[0052] In one embodiment, the mapping relationship further includes: when the product of the error at the current sampling moment and the rate of change of the error at the current sampling moment is less than 0, the product of the error at the current sampling moment and the error at the previous sampling moment is less than 0, and the absolute value of the error at the current sampling moment is less than the second threshold (e(k)Δe(k)<0, e(k)Δe(k - 1)<0, |e(k)|<H2), it indicates that the error is in an extreme value state, and at the same time the absolute value of the error itself is small, then the fifth control strategy may be adopted to output a weaker control effect on the error.
[0053] In one embodiment, the fifth control strategy includes: controlling the output of the PID controller according to the preset third coefficient and the PID control parameters determined by the preset expert rule base. Specifically, under the control of the fifth control strategy, the output of the PID controller is:
[0054] u(k) = u(k - 1)+ρ3k p e m (k);
[0055] In the formula, u(k) is the output of the PID controller at the k-th sampling moment, u(k - 1) is the output of the PID controller at the (k - 1)-th sampling moment, k p is the proportional coefficient, e m (k) is the extreme value of the error of the roll angle of the UAV at the k-th sampling moment, ρ3 is the third coefficient, and ρ3<1.
[0056] It should be noted that the third coefficient needs to be determined and adjusted according to the actual physical model of the UAV, which is similar to the determination method of the first coefficient.
[0057] By setting the third coefficient to be less than 1, the effect of weakening control can be achieved, thereby preventing overshoot caused by overregulation.
[0058] In one embodiment, the mapping relationship also includes: when the product of the error at the current sampling moment and the error change rate at the current sampling moment is less than 0, and the product of the error at the current sampling moment and the error at the previous sampling moment is greater than 0 (e(k)Δe(k)<0, e(k)Δe(k-1)>0), for example, the process from area II to area III indicates that the error of the roll angle of the drone changes from a gradual increase to a gradual decrease, then the sixth control strategy can be adopted to gradually transition the roll angle to a stable state. In one embodiment, the sixth control strategy includes: maintaining the current output of the PID controller.
[0059] In one embodiment, the mapping relationship also includes: when the absolute value of the UAV roll angle error is less than or equal to the third threshold value (|e(k)|≤ε), it indicates that the error of the UAV roll angle enters the control dead zone (an interval set for the deviation range of the UAV roll angle, when the actual error of the roll angle is within this interval, the control system will not generate corresponding corrective control actions), that is, the error is within the allowable range, then the seventh control strategy can be adopted to eliminate the roll angle error, so that the roll angle of the UAV is as close as possible or stable near the set target roll angle.
[0060] In one embodiment, the seventh control strategy includes: adding an integral link to the output of the PID controller. Specifically, under the seventh control strategy, the output of the PID controller is:
[0061] u(k)=u(k-1)+k p [e(k)-e(k-1)]+k i e(k);
[0062] Wherein, u(k) is the output of the PID controller at the kth sampling time, u(k-1) is the output of the PID controller at the k-1th sampling time, and k p is the proportionality coefficient, k o is the integral coefficient, e(k) is the error of the UAV roll angle at the kth sampling moment, and e(k-1) is the error of the UAV roll angle at the k-1th sampling moment.
[0063] It should be noted that the third threshold needs to be determined and adjusted according to the actual physical model of the drone, which is similar to the determination method of the first coefficient.
[0064] It can be understood that the control strategies of the present invention are triggered only under specific conditions (different errors and error change rates) to achieve different control effects. By setting the first coefficient, the second coefficient, the third coefficient and the expert rule base, the control effect of the traditional PID controller is optimized, thereby improving the accuracy and efficiency of the UAV roll attitude control.
[0065] In summary, by real-time monitoring of the error and error change rate of the UAV roll angle, the corresponding control strategy is dynamically selected and the PID control parameters are automatically optimized, so as to adapt to the changing needs in the UAV roll attitude control process, and the system has strong adaptability; further, by introducing the knowledge and experience of the expert rule base, the PID controller can effectively deal with the uncertainty and interference of the system, and improve the stability of the UAV control; further, according to the setting rules and algorithms, the selection of the control strategy can be automatically completed, thereby reducing the difficulty of debugging the PID controller; in addition, the control method of the present invention is easy to implement.
[0066] S102: Determine the current error and current error change rate of the roll angle of the drone.
[0067] Specifically, in each detection cycle, the current error of the roll angle and the current error change rate can be determined according to the difference between the set target roll angle and the current roll angle of the drone.
[0068] In one embodiment, the roll angle of the drone can be collected in real time through a roll angle sensor (gyroscope).
[0069] S103: Determine a control strategy for the current error and the current error change rate according to the mapping relationship, and control the roll angle of the UAV according to the control strategy.
[0070] Specifically, the control process is as follows Figure 3 As shown, Figure 3 The mapping relationship between input (error and error change rate of the UAV roll angle) and output (control strategy, including PID control parameters) is intuitively demonstrated. Specifically, by continuously monitoring the error and error change rate of the UAV roll angle, the PID control parameters are adjusted online according to the preset expert rule library, ensuring accurate and efficient UAV roll attitude control under different conditions, thereby improving the stability and response speed of the UAV roll attitude control, enhancing the robustness and adaptability of the system, and providing a strong guarantee for the stable flight of the UAV in complex environments.
[0071] In order to verify the reliability of the UAV roll attitude control method proposed in the present invention, a simulation experiment was carried out using the software MATLAB (R2022a). Specifically, in this simulation experiment, the UAV roll attitude control model was simplified according to the small disturbance equation, and the simulation model adopted a second-order link:
[0072]
[0073] Among them, T x is the time constant, K xis the gain, G is the transfer function of the controlled object, and s is a complex variable. In the simulation process, set T x is 21, K x is 5, and the discretization period is 0.01 seconds (i.e., the interval between sampling moments is 0.01 seconds). Set the initial UAV roll angle to y = 0°, and the target UAV roll angle to yd = 40°.
[0074] When performing simulation, the controlled object model is first imported, and then the PID control program to which the UAV roll attitude control method of the present invention is applied is run to obtain a response curve, such as Figure 4 As shown. Figure 4 It can be seen that the roll angle of the UAV reaches and stabilizes at 40° at 177ms, indicating that after applying the control method of the present invention, the roll angle of the UAV can quickly reach and stabilize near the target roll angle without overshoot and oscillation, avoiding the instability of the equipment caused by the oscillation of the roll angle of the UAV, and also verifies the accuracy and efficiency of the control method of the present invention.
[0075] Therefore, the method of the present invention can realize the rapid, accurate and stable control of the roll angle of the UAV. In addition, the method of the present invention does not involve the mathematical model information of the UAV, thereby avoiding the time-varying characteristics of the physical model of the UAV and the problem that the parameters are difficult to obtain, thereby improving the design efficiency of the PID controller, and solving the problems that the existing roll angle controller requires a complete system model and the design is overly complex.
[0076] Figure 5 Schematically shows a structural block diagram of a PID controller according to this embodiment.
[0077] In a second aspect, the present invention also provides a PID controller. Figure 5 As shown, the PID controller includes a processor and a memory, the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for controlling the rolling attitude of an unmanned aerial vehicle according to the first aspect of the present invention is implemented.
[0078] The PID controller also includes other components well known to those skilled in the art, such as a communication interface, and the configuration and functions of the components are known in the art, so they will not be described in detail here.
[0079] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that may be used to store the required information and may be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0080] In the description of this specification, “plurality” means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0081] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A method for controlling the roll attitude of an unmanned aerial vehicle, the method being applied to a PID controller, characterized in that: include: Establishing a mapping relationship between the error of the roll angle of the UAV, the error change rate and a plurality of preset control strategies, wherein the control strategy is used to control the output of the PID controller; Determine the current error and current error rate of change of the UAV's roll angle; According to the mapping relationship, a control strategy for the current error and the current error change rate is determined, and the roll angle of the UAV is controlled according to the control strategy.
2. The method for controlling the rolling attitude of an unmanned aerial vehicle according to claim 1, characterized in that: A mapping relationship between the error of the roll angle of the drone, the error change rate and multiple control strategies is established, including: if the absolute value of the error is greater than a first threshold, a first control strategy is adopted, and the first control strategy includes: using start-stop control to adjust the error.
3. The method for controlling the rolling attitude of an unmanned aerial vehicle according to claim 2, characterized in that: Also includes: If the product of the error and the error change rate is greater than 0, and the absolute value of the error is greater than a second threshold, a second control strategy is adopted, and the second control strategy includes: controlling the output of the PID controller according to a preset first coefficient and a PID control parameter determined by a preset expert rule base, and the first coefficient is greater than 1.
4. The method for controlling the rolling attitude of an unmanned aerial vehicle according to claim 3, characterized in that: The second control strategy is: u(k)=u(k-1)+ρ1{k p [e(k)-e(k-1)]+k i e(k)+k d [e(k)-2e(k-1)+e(k-2)]}; Wherein, u(k) is the output of the PID controller at the kth sampling time, u(k-1) is the output of the PID controller at the k-1th sampling time, ρ1 is the first coefficient, k p is the proportionality coefficient, k i is the integration coefficient, k d is the differential coefficient, e(k) is the error of the UAV roll angle at the kth sampling moment, e(k-1) is the error of the UAV roll angle at the k-1th sampling moment, and e(k-2) is the error of the UAV roll angle at the k-2th sampling moment.
5. The method for controlling the rolling attitude of an unmanned aerial vehicle according to claim 2, characterized in that: Also includes: If the product of the error and the error change rate is greater than 0, and the absolute value of the error is less than a second threshold, a third control strategy is adopted, and the third control strategy includes: controlling the output of the PID controller according to PID control parameters determined by a preset expert rule base.
6. The method for controlling the rolling attitude of an unmanned aerial vehicle according to claim 2, characterized in that: Also includes: If the product of the error at the current sampling moment and the error change rate at the current sampling moment is less than 0, the product of the error at the current sampling moment and the error at the previous sampling moment is less than 0, and the absolute value of the error at the current sampling moment is greater than the second threshold, a fourth control strategy is adopted, and the fourth control strategy includes: controlling the output of the PID controller according to a preset second coefficient and a PID control parameter determined by a preset expert rule base, and the second coefficient is greater than 1.
7. The method for controlling the rolling attitude of an unmanned aerial vehicle according to claim 6, characterized in that: The fourth control strategy is: u(k)=u(k-1)+ρ2k p e m (k); Wherein, u(k) is the output of the PID controller at the kth sampling time, u(k-1) is the output of the PID controller at the k-1th sampling time, and k p is the proportionality coefficient, e m (k) is the error extreme value of the UAV roll angle at the kth sampling moment, and ρ2 is the second coefficient.
8. The method for controlling the rolling attitude of an unmanned aerial vehicle according to claim 2, characterized in that: Also includes: If the product of the error at the current sampling moment and the error change rate at the current sampling moment is less than 0, the product of the error at the current sampling moment and the error at the previous sampling moment is less than 0, and the absolute value of the error at the current sampling moment is less than the second threshold, a fifth control strategy is adopted, and the fifth control strategy includes: controlling the output of the PID controller according to a preset third coefficient and a PID control parameter determined by a preset expert rule base, and the third coefficient is less than 1.
9. The method for controlling the rolling attitude of an unmanned aerial vehicle according to claim 2, characterized in that: Also includes: If the product of the error at the current sampling moment and the error change rate at the current sampling moment is less than 0, and the product of the error at the current sampling moment and the error at the previous sampling moment is greater than 0, a sixth control strategy is adopted, and the sixth control strategy includes: maintaining the current output of the PID controller; If the absolute value of the error is less than or equal to the third threshold, a seventh control strategy is adopted, and the seventh control strategy includes: adding an integral link in the output of the PID controller.
10. A PID controller, characterized in that: It includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for controlling the rolling attitude of an unmanned aerial vehicle according to claims 1-9 is implemented.