Design and verification of controller for a small coaxial dual-rotor aircraft

In recent years, coaxial dual-rotor aircraft has attracted much attention due to its unique aerodynamic layout. However, it is difficult to miniaturize the coaxial dual-rotor aircraft that relies on the principle of periodic pitch variation due to complex structure and control difficulties. This study proposes a small cylindrical coaxial dual-rotor aircraft based on a vector motor seat. For the control problems of such coaxial dual-rotor aircraft, a position and attitude controller based on neural networks and adaptive cascaded PID control is designed. A control system model was established and tested using MATLAB/Simulink. The proposed control scheme’s soundness and efficiency were confirmed by creating a prototype and performing flight trials. The results show that compared with the classic PID controller, the control effect of the controller has improved by 36.3% to 54.6%. In the centripetal rotation flight simulation experiment, the displacement error does not exceed 0.2 m, the speed error does not exceed 0.05 m/s, and the attitude angle error does not exceed 0.01 rad. This validates the effectiveness of the designed controller, indicating that the controller can enhance the stability of the system and achieve stable hovering and flight.


Introduction
The cylindrical coaxial dual-rotor aircraft, a recent development in aviation, mainly utilizes the lift from the spinning of its upper and lower rotors to fly.This unique design allows for vertical take-off and landing, stable hovering, as well as slow-paced flights at low altitudes [1] .Compared with multi-rotor aircraft, the mechanical structure of the cylindrical coaxial dual-rotor aircraft is more compact, and its foldable rotors are more portable; compared with single-rotor aircraft, it has higher hovering efficiency [2]   .Considering all the above characteristics, the coaxial dual-rotor aircraft is an excellent aircraft configuration scheme, and scholars at home and abroad have conducted a lot of research on it.Husnic designed a flight control system for a miniature coaxial manned helicopter based on the multivariable tracking and H2 control theory, verifying that the controller has stability, tracking ability, minimal transient error, and robustness [3] .Koehl et al. conducted research on the robustness of the position and attitude flight of a coaxial contra-rotating drone based on disturbance observer-based control [4] .Yuan et  al. proposed a robust tracking control strategy based on the dynamic feedback linearization method, established the mathematical model of the coaxial unmanned helicopter, and designed the controller.The simulation of trajectory tracking under disturbance conditions verified that the designed controller has good control performance and robustness [5] .Feng et al. established a drone attitude dynamics model based on the Newton-Euler method and designed a finite-time sliding mode controller.The controller IOP Publishing doi:10.1088/1742-6596/2764/1/012014 2 was verified to have good tracking performance and robustness through MATLAB/SimMechanics simulation [6] .Huang et al. conducted a holistic design of a spherical coaxial rotor aircraft controlled by air rudder, including control algorithms and flight tests [7] .Shi et al. designed a coaxial dual-rotor attitude controller based on the Fuzzy-PID algorithm, and through simulation verified that this control method can improve the system's static and dynamic characteristics and has good adaptability [8] .Chen et al. realized the adaptation of the inner loop parameters of the cascaded PID controller based on fuzzy control.The simulation results show that this control algorithm is superior to traditional PID control [9] .The above research focuses on the control of coaxial dual-rotor aircraft based on the principle of periodic pitch variation, providing a rich theoretical basis for the design of controllers.However, due to the complex structure and large number of parts involved in the principle of periodic pitch variation, it is difficult to achieve miniaturization and lightweight design.
This paper proposes a new type of cylindrical coaxial dual-rotor aircraft to address the complexity of accurately modeling and designing controllers for the complex control mechanism of coaxial dualrotor aircraft based on periodic pitch variation.This aircraft changes its flight attitude by adjusting the direction of lift from the coaxial dual rotors through the vector motor seat.A position and attitude controller based on the neural network and adaptive cascaded PID control is designed.Through Matlab/Simulink simulation and flight tests, it has been confirmed that the designed controller has good control effects.

Principles of aircraft manipulation
The small coaxial dual-rotor aircraft designed in this article consists of five parts: the rotor system, vector motor seat, fuselage, battery compartment, and payload.The overall structure is shown in Figures 1 and 2.  As can be seen from the figure, both the upper and lower rotors can be folded, which makes it convenient for carrying and transportation when they are folded against the fuselage.The battery compartment and payload are rigidly connected to the fuselage and can both be regarded as payloads of IOP Publishing doi:10.1088/1742-6596/2764/1/0120143 the aircraft.The vector motor seat, connecting the contra-rotating motor and the fuselage, is responsible for controlling the direction of the dual rotors' lift.Among them, the vector motor seat controls the deflection direction through two servo linkages, as shown in Figure 3. 3 Controller design

Overall control structure
The overall control system framework designed for the coaxial dual-rotor aircraft in this paper is shown in Figure 4.The entire control system can be divided into a position controller and an attitude controller.
Figure 4.The overall control system of the coaxial dual-rotor aircraft.Grounded on the outlined flight control system structure, the operational principle of this system is explained as follows.The user feeds in the desired position and yaw angle data via the ground station.After processing by the aircraft, this information transforms into instructions directly influencing the position and yaw angle.The position command enters the position controller, leading to computed expected outcomes for the aircraft's roll angle, pitch angle, and tri-axial thrust.Likewise, the desired attitude angle goes into the attitude controller, generating the aircraft's anticipated tri-axial torque.Control allocation eventually delivers the required inputs, including both rotors' rotation speed and the two servos' deflection angles.These four input variables activate the dynamic model as control inputs, leading to 12 output quantities.Here, six position feedbacks and six attitude feedbacks go back to the position and attitude controllers respectively, constituting a closed-loop circuit to finalize the control procedure.

Position controller
The position control system controls the x, y, and z channels of the aircraft, forming the outer loop of the entire flight control system.For systems like coaxial dual-rotor aircraft, which are significantly linearized and have large changes in flight state over time, classical PID controllers cannot reflect the IOP Publishing doi:10.1088/1742-6596/2764/1/0120144 changes in the system model caused by flight states [10,11] .Therefore, to achieve better control effects without excessively complicating the model, a neural network is used to adjust the parameters of the PID controller in real-time.This maintains the control effect of the PID controller while adapting to the uncertainties of the control system, as shown in Figure 5.

Attitude controller
Regardless of the flight state of the aircraft, when changing the state to perform tasks, the first thing that changes is the attitude angle, then the lift and torque of the aircraft will change accordingly.Therefore, the attitude control system is the key to the design of the entire flight control system.However, for the coaxial propeller aircraft studied in this paper, its nonlinearity is severe, it is unstable in the hover state, and during flight, interference from the magnetic field can affect sensor data collection, resulting in errors in the calculated attitude angle.If only a classical PID controller is used, it is difficult to maintain stable flight of the coaxial propeller aircraft.Therefore, this paper adopts a cascade PID controller to complete the design of the attitude controller, and adds an integral self-adaptive factor, which solves the overshoot and saturation phenomena that are likely to be caused by the integral term in PID.This is shown in Figure 6.In order to avoid overshooting and saturation [12,13] , an integral adaptive factor is introduced.This factor adjusts according to the size of the error.When the error is large, reducing this factor (even down to zero) can prevent the integral from increasing too quickly due to a large error, thereby avoiding saturation of control output.Conversely, when the error is small, increasing this factor can make the system eliminate static errors more quickly.Therefore, the expression for the integral term can be written as follows: 0 ( ) ( ) Where Ai is the integral self-adaptive factor, and its expression is as follows: IOP Publishing doi:10.1088/1742-6596/2764/1/012014 Where  max and  min are the maximum and minimum values of the error between the actual value and the expected value, respectively.
According to Formula (2), when the error value is greater than the set maximum value  max , the integral self-adaptive factor takes 0. At this time, the integral term does not play a role, and the controller turns into PD control; when the error value is less than the set minimum value  min , the integral selfadaptive factor takes 1, which is equivalent to the self-adaptive factor does not play any role; when the error value is between the maximum value  max and the minimum value  min , Ai size is adjusted adaptively according to the size of the error value.
This can be implemented in Simulink through the S function, as shown in Figure 7.
The main controlled variables in the centripetal return flight experiment are lateral speed v and yaw angle , which satisfy the following relationship: Where R is the return radius.
Taking the return period as 20 s, we can get rad / s  10 . Taking the return radius as 10 m, we can get the lateral speed m / s v  . Setting the flight height of the aircraft to be 5 m, then the input command for the centripetal rotation simulation experiment can be expressed as: (c), it can be seen that the maximum errors occur near the maximum amplitude, and the tracking effect of the controller designed in this paper is significantly better than the classic PID controller.Compared with the classic PID controller, the control effect of the controller designed in this paper has improved by 36.3%~54.6%.For different input signals, the controller designed in this paper can track well and has stronger adaptability, indicating that the neural network plays a good role in the controller.

Centripetal rotation simulation experiment
Through MATLAB/Simulink simulation, the simulation results of each output quantity when the aircraft performs centripetal rotation are shown in Figure 9.    (d), 9(e), and 9(f) show larger fluctuations in velocity response within the initial 2 s of simulation, particularly a significant error at 1.5 s for longitudinal velocity v, though this falls within acceptable limits.Over time, the velocity response gradually approaches the reference response and ultimately aligns closely with the reference response curve.This demonstrates the effectiveness of introducing neural network parameter tuning in the displacement controller.Overall, the designed trajectory controller meets the design requirements.
From Figures 9(g), 9(h) and 9(i), it can be seen that there is some fluctuation in the pitch angle channel at the beginning of the simulation.This is due to the strong coupling between the pitch angle and roll angle of the coaxial dual-propeller aircraft, which is consistent with the general situation of axisymmetric coupling in aircraft.In addition, the attitude angles track the reference response curve well, and there are no obvious overshoot or saturation phenomena during the whole process.This indicates that the designed integral limit strategy and integral adaptive factor have played a good role.The design of the attitude controller for the coaxial dual-propeller aircraft satisfies the design requirements.
Overall, at the initial stage of the simulation, there is a large error between the model response and the reference curve due to the coupling of its own state variables and the sudden change of the body state.However, after 2~4 s, the flight state gradually stabilizes, and the model response and reference curve basically coincide.The displacement error does not exceed 0.2 m, the speed error does not exceed 0.05 m/s, and the attitude angle error does not exceed 0.01 rad, which verifies the effectiveness and superiority of the designed controller.

Flight experiment verification
To confirm the real flight performance of the coaxial dual-propeller aircraft, we assembled a prototype and carried out a flight test, as shown in Figure 10.

Conclusion
This paper designed a coaxial dual-rotor aircraft based on a vector motor seat and introduced its structure and working principle.The position controller and attitude controller were designed based on the neural network and integral adaptive factor respectively, and a centripetal rotation flight simulation of the aircraft was conducted using MATLAB/Simulink.The results showed that: 1. Compared with the classic PID controller, the controller designed in this paper improved control performance by 36.3%~54.6%,demonstrating stronger adaptability and accuracy.
2. Through the centripetal rotation simulation experiment, the displacement error of the controller designed in this paper did not exceed 0.2 m, the speed error did not exceed 0.05 m/s, and the attitude angle error did not exceed 0.01 rad, showing a fast response speed and small error.
3. The flight experiment verified that the coaxial dual-rotor aircraft flew smoothly with rapid attitude responses.The controller we designed can ensure stable flight of the coaxial dual-rotor aircraft, guaranteeing flight reliability.

Figure 2 .
Figure 2. The overall structure of the aircraft.As can be seen from the figure, both the upper and lower rotors can be folded, which makes it convenient for carrying and transportation when they are folded against the fuselage.The battery compartment and payload are rigidly connected to the fuselage and can both be regarded as payloads of

Figure 5 .
Figure 5.The structure diagram of the PID control system based on the improved BPNN.

Figure 6 .
Figure 6.Cascade PID controller with integral self-adaptive factor.In order to avoid overshooting and saturation[12,13] , an integral adaptive factor is introduced.This factor adjusts according to the size of the error.When the error is large, reducing this factor (even down to zero) can prevent the integral from increasing too quickly due to a large error, thereby avoiding saturation of control output.Conversely, when the error is small, increasing this factor can make the system eliminate static errors more quickly.Therefore, the expression for the integral term can be written as follows:

5 ( 5 ) 5 Figure 8 .
Figure 8.Comparison of simulation results.(a.Amplitude equals 5; b.Amplitude equals 2; c.Amplitude equals 0.5.)From Figures8(a), 8(b) and 8(c), it can be seen that the maximum errors occur near the maximum amplitude, and the tracking effect of the controller designed in this paper is significantly better than the classic PID controller.Compared with the classic PID controller, the control effect of the controller designed in this paper has improved by 36.3%~54.6%.For different input signals, the controller designed in this paper can track well and has stronger adaptability, indicating that the neural network plays a good role in the controller.

Figure 9 .
Figure 9. Centripetal turn simulation curve diagram.(a.displacement in the x direction; b.Displacement in the y direction; c.Displacement in the z direction; d.Velocity in the x direction; e. Velocity in the y direction; f.Velocity in the z direction; g.Roll angle; h.Pitch angle; i. Yaw angle.)From Figures 9(a), 9(b) and 9(c), it can be seen that the model response of the co-axial twin-propeller aircraft closely follows the reference response, indicating accurate tracking of control signals.Figures 9(d), 9(e), and 9(f) show larger fluctuations in velocity response within the initial 2 s of simulation, particularly a significant error at 1.5 s for longitudinal velocity v, though this falls within acceptable limits.Over time, the velocity response gradually approaches the reference response and ultimately aligns closely with the reference response curve.This demonstrates the effectiveness of introducing neural network parameter tuning in the displacement controller.Overall, the designed trajectory controller meets the design requirements.From Figures 9(g), 9(h) and 9(i), it can be seen that there is some fluctuation in the pitch angle channel at the beginning of the simulation.This is due to the strong coupling between the pitch angle and roll angle of the coaxial dual-propeller aircraft, which is consistent with the general situation of axisymmetric coupling in aircraft.In addition, the attitude angles track the reference response curve well, and there are no obvious overshoot or saturation phenomena during the whole process.This indicates that the designed integral limit strategy and integral adaptive factor have played a good role.The design of the attitude controller for the coaxial dual-propeller aircraft satisfies the design requirements.Overall, at the initial stage of the simulation, there is a large error between the model response and

Figure 10 .
Figure 10.Coaxial twin-propeller aircraft test effect diagram.(a.Prototype of the coaxial twinpropeller aircraft; b.Flight experiment of the coaxial twin-propeller aircraft.)Figure 10(b) shows the in-flight test.After the folding propeller blades are unfolded by inertia, the aircraft takes off vertically and flies between the sent trajectory commands, finally returning to the starting point to retrieve the aircraft.The results of the physical flight test show that the coaxial twinpropeller aircraft can complete tasks such as smooth take-off, aerial hover, flight turning and stable landing well through the designed controllers.The designed controllers meet the task requirements.At the same time, it has a certain wind resistance capability, and the endurance time can reach 20 minutes.