Skip to main content

ORIGINAL RESEARCH article

Front. Neurorobot., 30 May 2024
This article is part of the Research Topic Biomedical signals and Artificial Intelligence Towards Smart Robots Control Strategies View all 3 articles

On designing a configurable UAV autopilot for unmanned quadrotors

Ali Bhar\r\n,\r\n\r\n
\r\nAli Bhar1 ,2 * Mounir Sayadi\r\nMounir Sayadi1
  • 1University of Tunis, ENSIT, Labo SIME, Tunis, Tunisia
  • 2Military Academy of Fondouk Jedid, Nabeul, Tunisia

Unmanned Aerial Vehicles (UAVs) and quadrotors are being used in an increasing number of applications. The detection and management of forest fires is continually improved by the incorporation of new economical technologies in order to prevent ecological degradation and disasters. Using an inner-outer loop design, this paper discusses an attitude and altitude controller for a quadrotor. As a highly nonlinear system, quadrotor dynamics can be simplified by assuming several assumptions. Quadrotor autopilot is developed using nonlinear feedback linearization technique, LQR, SMC, PD, and PID controllers. Often, these approaches are used to improve control and to reject disturbances. PD-PID controllers are also deployed in the tracking and surveillance of smoke or fire by intelligent algorithms. In this paper, the efficiency using a combined PD-PID controllers with adjustable parameters have been studied. The performance was assessed by simulation using matlab Simulink. The computational study conducted to assess the proposed approach showed that the PD-PID combination presented in this paper yields promising outcomes.

1 Introduction

Recently, there is increasing interest in unmanned aerial vehicles (UAVs) in a wide variety of fields. Recent investigations and researches are published (Akhloufi et al., 2021) regularly since many years. Using UAVs to detect and monitor fire hazards demonstrates an effective contribution, whether they are controlled remotely or incorporated with intelligent computer vision software (Zhang et al., 2014). Indeed, the autonomous drones are becoming an essential tool in fire and rescue management (Moumgiakmas et al., 2021). Even though many technology advances have been made in relevant designing technologies looking for the maximum of efficiency with popular items still challenging. In fact, a huge advancement is continuously made in (MEMS) Micro-Electro-Mechanical Systems and (NEMS) Nano-Electro-Mechanical Systems technologies allowing manufacturing miniature sensors, actuators and controllers (Burggräf et al., 2019). Autonomous applications have to be built for specific missions. Quadrotors are one of the most popular (Manoj Kumar et al., 2021) and their advantages of hovering capabilities, vertical taking off and landing (VTOL) are applied to fixed wing.

The flight behavior of a quadrotor is impacted by several factors such as the wind, the weight variation, the speed, the trajectory to follow and the evolution of its own internal parameters (e.g., Wei et al., 2023). Due to sophisticated nonlinearity and strong coupling parameters under-actuating an absolutely unstable dynamic model, these phenomena are augmented. Indeed, to control a quadcopter we have four fixed rotors to control its six degrees of freedom in space. Any control strategy for manual, or autonomous missions depends on the reliability of the mathematical model. A valid and accurate mathematical model can be extracted from a commercial or self-designed Quadrotor using identification and laboratory experiments (Tahir et al., 2023).

Research has been conducted on the altitude and attitude control methods for quadrotors in the literature. The control strategy including Sliding Mode Control (SMC) is often used (Rinaldi et al., 2023). It presents good robustness results for nonlinear systems in presence of parameter uncertainties and external disturbances (Manoj Kumar et al., 2021). It has been shown that this technique can be applied in model-free control (Wang et al., 2016) or associated with LQR optimization, adaptive or back-stepping modes (e.g., Bouabdallah and Siegwart, 2005; Li et al., 2014; Ghamry et al., 2016) for indoor and outdoor operations. The augmented SMC controller reduces the disadvantage of the chattering problem. There may be undesirable oscillations in practice, called chattering problems, of finite frequency and amplitude.

For general application, Proportional Derivatives (PD) and Proportional Integrator Derivatives (PID) control techniques continue to be widely used due to their simplicity, real-time implementation and no mathematical model requirement (e.g., He and Zhao, 2014; Nguyen and Hong, 2018). Recently, has proposed a PID approach control for enhancement of a DJI-F450 drone model. They are also associated with other control techniques to improve their efficiency and reduce their disadvantages. To compensate disturbances in attitude and altitude control, a PID and fuzzy – PID controls combination was proposed by Kuantama et al. (2017). Using predictive models and linear quadratic optimisation techniques, PID controllers in discrete version have also been investigated by Khan and Kadri (2015) and Reizenstein (2017). In fact, a PID controller cannot cover all fluctuations in the dynamics of a system. However, it can cover a significant amount of uncertainty and ensure fast control response. This is crucial for aerial quadrotors controlling attitude to avoid obstacles and perform demanding maneuvers in urban or forest areas. PID control has been combined with a variety of tuning approaches in several studies in order to improve its efficiency. Auto-tuning algorithms using metaheuristics deep reinforcement learning, neural network or fuzzy rules are recently explored (e.g., Doukhi et al., 2017; Sheta et al., 2021). Basically, the PD-PID controllers present the advantage of having only two effects (for the PD controller) and three effects (for the PID controller) adjusted with the corresponding parameters. The system behavior could be modified with the forementioned parameters. In the existing literature, many works have been conducted for the evaluation of these parameters without necessarily appealing a mathematical model of the system. The effectiveness of controllers has long been established in the industry. Their utilization in more advanced systems such as robots and drones has also been demonstrated. In fact, their flexibility and simplicity made the PD-PID controllers gain popularity among researchers and practitioners.

There is no doubt that forest fire detection and surveillance are becoming increasingly important issues all over the world. The degradation of the ecosystem due to climate change is more and more visible. Several monitoring and management strategies involve the use of cooperative UAVs and Unmanned Ground Vehicles (UGVs) (e.g., Ghamry and Zhang, 2015; Bhar et al., 2017). Wild expanses to be explored require UAVs that are economical, have the capability of generating a trajectory, tracking, and avoiding obstacles (e.g., Ait El Cadi, 2010; Bhar et al., 2018).

The main contribution of this study is using simple PD with adjustable parameter controller associated with PID controller to make the quadrotor more stable when dealing with changes in weight and compensating for wind gusts. Our work involves designing a quadrotor UAV autopilot that will be used later in collaboration with intelligent navigation algorithms for surveillance and detection. By combining PD and PID controllers, the quadrotor autopilot offers a configurable architecture and a significant advantage over other autopilots. Through simulations under multiple disturbances, its performance were assessed.

The remainder of this article is organized as follows. Section 2 reports the motion mechanism and the dynamic model. Section 3 describes the design of the controller architecture. Section 4 details the Simulink parameters and reports the main numerical results. Conclusions and avenues for future work are drawn in Section 5.

2 Dynamic model

2.1 Quadrotor configuration

A Quadrotor includes 4 rotors arranged in a cross-like shape as displayed in Figure 1. Rotor blades are equipped with propellers powered by one-by-one DC motors. Rotors 1 and 3 rotate within side the equal route at the same time as rotors 2 and 4 rotate in a contrary route in order to balance the whole machine torque and cancel the gyroscopic and aerodynamics torques.

Figure 1
www.frontiersin.org

Figure 1. Quadrotor model.

2.2 Flight mechanisms

The motion of quadcopters can be achieved through six distinct maneuvers, which involve a combination of translational and rotational motion as illustrated in Figure 2. There are four inputs on the quadcopter:

• Thrust (z): This input generates a vertical force that enables the quadcopter to hover or move up and down through the air. Increased or decreased speed of all four rotors by a similar amount, greater or lesser than gravitational force, creates the force.

• Roll angle (ϕ): It denotes the quadcopter rotation around the x-axis. In order to create the roll motion, the second rotor’s speed is decreased and the fourth rotor’s speed is increased. These “rolls” move the quadcopter sideways along the y + and y- axis, while maintaining its altitude position.

• Pitch (θ): It corresponds to the quadcopter rotation around the y-axis. By decreasing the first rotor’s speed and increasing the third rotor’s speed, pitch motion can be created. Depending on the quadcopter’s orientation and the position of its nose, the pitch action causes it to tilt upwards or downwards. An upward tilt moves the quadcopter in a backward motion (x-), while a downward tilt moves it forward (x+).

• Yaw (ψ): It refers to the quadcopter rotation around the z-axis. Angular velocities are increased of two opposite rotors while angular velocities of the other two are decreased. Thus, the Yaw motion is generated. Precisely, In both clockwise and counterclockwise rotations, the quadcopter’s front faces the same direction.

Figure 2
www.frontiersin.org

Figure 2. Quadrotor flight mechanisms.

2.3 System coordinates

First, let us begin by precising the reference coordinate frame and the coordinate frame of the vehicle body, in order to construct the quadrotor’s mathematical model. Let us denote by B = [Bx, By, Bz]T the body-fixed frame (BFF) and (EFF) E = [Ex, Ey, Ez]T the ground fixed reference coordinate frame also called inertial frame. The center of the BFF origin is aligned with the center of mass of the quadcopter, and its origin is connected to the body of the vehicle.

In the 3-dimensional Euclidean space, we denote B = (x,y,z)T. The coordinate vector I B describes the distance between the Inertia frame and the body frame. The three Euler angles 𝜙, 𝜃 and 𝜓 (so called: roll, pitch, and yaw) describing the quadrotor orientation are represented by the vector Γ = [𝜙,𝜓]𝑇.

The vehicle body frame BFF is considered the base for reference frame analysis. To catch the 3D space’s movements and create our mathematical references, Equations 1–5 are considered:

R B I z ψ = cos ψ sin ψ 0 sin ψ cos ψ 0 0 0 1     (1)
R B I x ϕ = 1 0 0 0 cos ϕ sin ϕ 0 sin ϕ cos ϕ     (2)
R B I y θ = cos θ 0 sin θ 0 1 0 sin θ 0 cos θ     (3)

- Body frame rotated in 𝜓+:

- Body frame rotated in 𝜙 +:

- Body frame rotated in 𝜃 +:

The movement from one frame to another in this case is defined by Equation 4:

R B I ψ θ ϕ = R B I z ψ R B I y θ R B I x ϕ     (4)

The rotational matrix is then derived as

R B I = cos ψ cos θ sin θ sin ϕ cos ψ cos θ sin ψ sin θ cos ϕ cos ψ + sin ϕ sin ψ sin ψ cos θ sin θ sin ϕ sin ψ + cos ϕ cos ψ sin θ cos ϕ sin ψ sin ϕ cos ψ sin θ sin ϕ cos θ cos ϕ cos θ     (5)

2.4 Actuator dynamics

The actuator dynamic refers to the correlation between the voltage applied to the actuator, which serves as the real control input, and the speed of the rotor. Designers are particularly interested in the speed of the actuator’s response, as it plays a crucial role in the performance of the system. Based on Kirchhoff laws and the law of rotation, we derive the following simplified actuator dynamic model described by Equation 6:

d w i d t = 1 τ w i + K w τ u i , i = 1 , .. , 4     (6)
where 𝜏 and K w denotes the delay and gain coefficient, respectively (Bouabdallah et al., 2004). Furthermore, d w i d t and u i represent the speed and the input voltage of actuator 𝑖, = 1 , .. , 4 . Actuator delay assumes a critical role, especially in cases where the attitude control loop is functioning at a low frequency.

2.5 Kinematics

Let us move on to the kinematics side of the conducted study. Herein, the rigid “+” symmetric quadrotor is shown in Figure 1 with four rotors producing (Th1, Th2, Th3, Th4) forces. Quadrotor structure center of mass and origin of body coordinate system are the same. The center of gravity of the system coincides with the origin of the body-fixed frame (BFF). It is assumed that propellers are rigid and that thrust and drag are proportional to the square of the propeller’s rotational speed. The difference between the body rates p, q, r in BFF and the angle rates expressed in EFF should be calculated following Equations 7, 8.

p q r = 1 0 sin θ 0 cos θ sin ϕ cos θ 0 sin θ cos ϕ cos θ ϕ ˙ θ ˙ ψ ˙     (7)
v = M Γ ˙     (8)

Where v and Γ ˙ represent the angular velocity vectors in both frames the B-frame and E-frame, respectively. Furthermore, the inverse of the matrix M is expressed in Equation 9 as

M 1 = 1 tan θ sin ϕ tan θ cos ϕ 0 cos ϕ sin ϕ 0 sin ϕ cos θ cos ϕ cos θ     (9)

During position control, the quadrotor’s body must be compensated for rotation. Compensation is obtained by transposing the rotation matrix.

2.5.1 Translation dynamics

Based on the works of Barzegar and Lee (2022) and Quan (2017), the system under study was subjected to the following forces:

The vehicle’s total weight:

P = 0 0 mg     (10)

The rotors’ generated thrust:

F t h = R B I i = 1 4 T h i = b i = 1 4 ω i 2 sin ϕ sin ψ + sin θ cos ψ cos ϕ sin ϕ cos ψ + sin ψ cos ϕ sin θ cos θ cos ϕ     (11)

The drag force and air friction:

F d r = C d B ˙ = C d x 0 0 0 C dy 0 0 0 C d z x ˙ y ˙ z ˙ = C d x x ˙ C dy y ˙ C d z z ˙     (12)
F = m B ¨ = P + F t h + F d r     (13)

The mass of the quadrotor is represented by m and the acceleration due to gravity is represented by g in Equation 10. Equation 11 expresses that the angular velocity and thrust constant of the ith propeller are represented by ω i and b , respectively. Equation 12 contains the translational drag coefficient matrix denoted by C d . The position of the center of mass in the coordinates of the Flat Earth, as given in Equation 10, is a vector of the dimensions 3 times 1. Then, the total force is expressed by Equation 13. The equation of motion describing the translational motion of the quadcopter is expressed using Newton’s second law and reads are Equations 14–16:

x ¨ = 1 m b i = 1 4 ω i 2 sin ϕ sin ψ + cos ϕ sin θ cos ψ C d x x ˙     (14)
y ¨ = 1 m b i = 1 4 ω i 2 sin ϕ cos ψ + sin ψ cos ϕ sin θ C dy y ˙     (15)
z ¨ = 1 m b i = 1 4 ω i 2 cos θ cos ϕ C d z z ˙ mg     (16)

2.5.2 Rotation dynamics

The motion of a quadrotor is clearly attributed to an array of forces and moments resulting from various physical phenomena. A quadrotor experiences torques in roll, pitch, and yaw, as well as aerodynamic friction torque and gyroscopic effects caused by the propellers. To calculate angular acceleration on the body frame, the second law of Newton for rotational motion must be applied, and the Coriolis effect should be taken into account. We can consider for this model the torques detailed in Table 1.

Table 1
www.frontiersin.org

Table 1. Torques details.

Accordingly, the torques can be derived as follows:

τ x = 0 l 0 0 0 T h 2 + 0 l 0 0 0 T h 4 = lb ω 4 2 ω 2 2 0 0     (17)
τ y = l 0 0 0 0 T h 1 + l 0 0 0 0 T h 3 = 0 lb ω 3 2 ω 1 2 0     (18)
τ z = 0 0 d i = 1 4 ω i 2     (19)
τ a = C a ψ ˙ 2 ϕ ˙ 2 θ ˙ 2 = C a z ψ ˙ 2 C ax ϕ ˙ 2 C a y θ ˙ 2     (20)
τ g p = J r Ω r 0 θ ˙ ϕ ˙     (21)

Equations 17–21 denote that the parameter l indicates the distance of the motor axis from the center of gravity of the quadcopter, while d represents the drag coefficient. Equation 20 depicts C a as the 3×3 matrix of aerodynamic friction coefficients. In Equation 21, J r and Ω r represent the rotor’s inertia and rotation velocity, respectively. The rotational motion of the quadrotor is governed by the equations of motion, expressed by Equations 22–24, obtained by using Euler’s rotation equations. In Equations 22–24, moments of inertia along x , y and z directions are represented by I x , I y and I z respectively:

ϕ ¨ = 1 I x C ax ϕ ˙ 2 J r Ω r θ ˙ I z I y θ ˙ ψ ˙ + lb ω 4 2 ω 2 2     (22)
θ ¨ = 1 I y C a y θ ˙ 2 J r Ω r ϕ ˙ I x I z ϕ ˙ ψ ˙ + lb ω 3 2 ω 1 2     (23)
ψ ¨ = 1 I z C a y θ ˙ 2 J r Ω r ϕ ˙ I x I z ϕ ˙ ψ ˙ + i = 1 4 1 i + 1 ω i 2     (24)

2.5.3 Mathematical model

Considering both the translational and rotational dynamics, the entire dynamic model of the quadcopter is expressed as follows:

x ¨ = 1 m u z u x C d x x ˙     (25)
y ¨ = 1 m u z u y C dy y ˙     (26)
z ¨ = 1 m u z cos θ cos ϕ C d z z ˙ mg     (27)
ϕ ¨ = 1 I x C ax ϕ ˙ 2 J r Ω r θ ˙ I z I y θ ˙ ψ ˙ + u ϕ     (28)
θ ¨ = 1 I y C a y θ ˙ 2 J r Ω r ϕ ˙ I x I z ϕ ˙ ψ ˙ + u θ     (29)
ψ ¨ = 1 I z C a y θ ˙ 2 J r Ω r ϕ ˙ I x I z ϕ ˙ ψ ˙ + u ψ     (30)
where u = u x u y u z u ϕ u θ u ψ is a vector expressed by Equations 31–33 with d as the drag coefficient:
u x = sin ϕ sin ψ + cos ϕ sin θ cos ψ     (31)
u y = sin ϕ cos ψ + sin ψ cos ϕ sin θ     (32)
u z u ϕ u θ u ψ = b b b b 0 lb 0 lb lb 0 lb 0 d d d d ω 1 2 ω 2 2 ω 3 2 ω 4 2     (33)

Equations 25–30 exhibit the complete nonlinear model of a quadrotor, revealing its complex dynamics. The strong nonlinearity, including inter-state multiplication, intensive variable coupling, and the presence of multivariable features, poses challenges in designing controllers, while simultaneously eliciting significant researchers’ attention.

2.5.4 Simplified system

The purpose of the mathematical model is to facilitate the construction of a control system. Nevertheless, if the mathematical model is overly sophisticated, the design of the control system will also be complex. A state space model could be adapted for the control system X ˙ = f X U where X and U are the state and input vectors, respectively. The state vector X reads as:

X = x , y , z , x ˙ , y ˙ , z , ̇ ϕ , θ , ψ , ϕ ˙ , θ ˙ , ψ ˙     (34)

Let us begin by assuming that

{ x 1 = x x 2 = y x 3 = z x 4 = x ˙ = x ˙ 1 x 5 = y ˙ = x ˙ 2 x 6 = z ˙ = x ˙ 3 x 7 = ϕ x 8 = θ x 9 = ψ x 10 = ϕ ˙ = x ˙ 7 x 11 = θ ˙ = x ˙ 8 x 12 = ψ ˙ = x ˙ 9     (35)

Then, Equations 25–40 leads to

X ˙ = x 4 x 5 x 6 1 m u z u x C d x x ˙ 1 m u z u y C dy y ˙ 1 m u z cos θ cos ϕ C d z z ˙ mg x 10 x 11 x 12 1 1 x C ax ϕ ˙ 2 J r Ω r θ ˙ I z I y θ ˙ ψ ˙ + u ϕ 1 1 y C a y θ ˙ 2 J r Ω r ϕ ˙ I x I z ϕ ˙ ψ ˙ + u θ 1 1 z C a y θ ˙ 2 J r Ω r ϕ ˙ I x I z ϕ ˙ ψ ˙ + u ψ     (36)

Equation 36 indicates that rotational movements are functionally independent of translational movements and are entirely actuated. However, translational movements are under actuated and highly dependent on rotational movements. A control loop structure comprising both an inner and outer loop has been devised. The inner control loop guarantees asymptotic tracking of the desired attitude and altitude, ensuring precise control. On the other hand, the outer loop is responsible for conducting navigation, overseeing the path planning and overall trajectory of the system.

It is possible to make certain simplifying assumptions for the previous model, without compromising the precision of the motion behavior to a significant extent. To minimize the complexity of calculations, it is presumed that the quadrotor is near a hovering position, with very little changes in angles and angular acceleration contribution. Resulting in a null attitude angular rates ( ϕ ˙ = 0 , θ ˙ = 0 , ψ ˙ = 0 ), this enables neglecting of the gyroscopic effects and moments of inertia terms. Additionally, assuming that the angles ϕ and θ are small and the Coriolis terms can be neglected, we can consider that the Coriolis effect terms do not exert a significant influence on linear acceleration. Additionally, considering the quadcopter’s movement near a hovering state allows the approximation of the velocities transformation matrix M between the BFF and EFF frames to be close to identity.

Thereby, the motion Equation 36 becomes

X ˙ = x 4 x 5 x 6 1 m u z u x 1 m u z u y 1 m u z cos θ cos ϕ mg x 10 x 11 x 12 u ϕ I x u θ I y u ψ I z .     (37)

3 Controller design

In this section, the control strategy and design of the attitude and elevation controller are described in detail.

3.1 Control strategy

Achieving seamless tracking performance utilizing traditional gains is the primary goal of the proposed PD-PID controller, while simultaneously ensuring satisfactory performance in position hold mode through gain adjustment aimed at mitigating the effects of wind disturbances. A schematic representation of the proposed PD-PID technique is depicted in Figure 3. The proportional, integral, and derivative gains are optimized utilizing gain scheduling, which is determined by variations in natural frequency and the Ziegler-Nichols methods.

Figure 3
www.frontiersin.org

Figure 3. The full quadrotor control scheme.

3.2 Attitude control

The primary control loop, as proposed, governs four Degrees of Freedom (DOF) in the quadrotor system, namely the altitude z , roll angle ϕ , pitch angle θ , and yaw angle ψ . Given that the quadrotor dynamic system is under-actuated, an outer loop is employed to derive the desired control inputs for roll and pitch, denoted as ϕ d and θ d , respectively, based on the desired positions in the earth frame x e y e . For the linear acceleration, very small angles ϕ and θ are assumed. Inspired from the work of Kotarski et al. (2016), the following desired angles are derived:

ϕ d θ d = 1 g sin ψ cos ψ cos ψ sin ψ T x T y     (38)

A configurable PD controller is also envisaged, following the work of Nguyen and Hong (2018). the controller produces virtual accelerations T x and T y along the X and Y axes, respectively, such as

T x = k 1 x k 2 x x d x x ˙     (39)
T y = k 1 y k 2 y y d y y ˙     (40)
where the coordinates ( x d , y d ) refer to the desired position in the X Y plane, whereas ( k 1 x , k 2 x ) and ( k 1 y , k 2 y ) represent the controller gains along the X and Y axes, respectively.

To summarize, the block diagram shown in Figure 4 represents the roll controller for the X-axis. It is evident that the structure of the roll controller for the Y direction is highly similar.

Figure 4
www.frontiersin.org

Figure 4. X-direction PD roll controller.

Now, let ξ and w n denote and the controller’s damping ratio and the natural frequency, respectively. Accordingly, Equation 41 was derived as a transfer function of second order that leads to the controller gains k 1 x and k 2 x , expressed by Equations 42, 43, respectively:

T x p X d p = k 1 x k 2 x p 2 + k 1 x p + k 1 x k 2 x     (41)
k 1 x = 2 ξ w n     (42)
k 2 x = w n 2 ξ     (43)

3.3 Roll control

To facilitate roll control and achieve motion along the Y-axis, the PID controller is utilized to generate small variations in forces which are then applied to rotors 3 and 4. If we assume that the roll parameters of the PID controller are represented by K P ϕ , K I ϕ , and K D ϕ , and that the actual roll angle is ϕ m , then the roll angle error e ϕ can be expressed as ϕ d ϕ m . Accordingly, Δ T h ϕ can be represented by Equation 44:

Δ T h ϕ = K P ϕ e ϕ + K I ϕ e ϕ + K D ϕ e ˙ ϕ     (44)

3.4 Pitch control

In order to generate motion along the X-axis, a PID controller is employed to generate a small variation in forces, denoted as Δ T h θ , which is then applied to rotors 1 and 2. If the quadrotor needs to move backwards, the speed of rotor 2 is decreased while the speed of rotor 1 is increased. This differential change in rotational speeds causes the quadrotor to move in a backward direction along the X-axis. This speed variation is controlled by PID which pitch angle parameters are K P θ , K I θ , and K D θ so that Δ T h ϕ is expressed according to Equation 45:

Δ T h θ = K P θ e θ + K I θ e + K D θ e ˙ θ     (45)
and e θ = θ d θ m , such that the pitch angle error e θ is associated with the measured pitch angle θ m .

3.5 Yaw control

The quadrotor’s counter clockwise and clockwise movements can be controlled by altering the yaw angle. The yaw angle parameters of the considered PD or PID controller are K P ψ , K I ψ , and K D ψ . Additionally, ψ m represents the sensor measured yaw angle, and e ψ represents the yaw angle error. Thus, as with the roll and pitch control, e ψ equals ψ d ψ m . Equations 46, 47 represent the yaw control equations for the PID and PD controllers, respectively:

Δ T h ψ = K P ψ e ψ + K I ψ e ψ + K D ψ e ˙ ψ     (46)
Δ T h ψ = K P ψ e ψ + K D ψ e ˙ ψ     (47)

3.6 Altitude control

A thrust force is created to compensate for the gravitational force. Altering the angular velocities of all rotors at equal speed is the way to achieve the desired altitude of the quadrotor. Let K P z , K I z , and K D z denote the altitude parameters of the PID controller, z m be the sensor measured altitude, and e z be the altitude error. Obviously, e z equals z d z m . According to these notations, the thrust forces for the PID and PD controllers, respectively, could be expressed by Equations 48, 49 as

Δ T h z = K P z e z + K I z e z + K D z e ˙ z     (48)
Δ T h z = K P z e z + K D z e ˙ z     (49)

4 Simulation and experiments

Using Matlab Simulink, we implemented the simulation study, the experiments, and the parameter tuning for the PD and PID controllers (Figure 3). The control scheme can be generally characterized as being comprised of a waypoint input, which in turn is divided into a position component and a yaw angle orientation component. In the upcoming subsections, we will provide concise descriptions of the primary controllers and quadrotor parameters. Subsequently, we will present simulation results pertaining to main movements and trajectory tracking. Finally, we will evaluate control robustness by examining the quadrotor’s response to wind disturbances across various trajectories.

4.1 Controllers and quadrotor parameters setting

For the simulation study, we have adopted a quadrotor which main parameters are displayed in Table 2.

Table 2
www.frontiersin.org

Table 2. Main quadrotor parameters.

For the design of the quadrotor autopilot, a PD/PID controller is implemented as presented in Section 3. As a result of Ziegler-Nichols PID parameters setting rules, the proportion and derivative coefficients of the controller are adjusted. According to this parameter-setting method, parameters are set according to stability analysis. Therefore, K p the proportion coefficient is set such that K D and K I are fixed to 0. Then, an iterative increase in K p is made until the closed-loop system begins to shock, i.e., as soon as the poles of the closed-loop system cross the 𝑗𝑤 axis. Equations 50–52 express the final K p , K D , and K I values as

K p = 0.6 K m     (50)
K D = K P π 4 w m     (51)
K I = K P w m π     (52)
where the value of K p at which the system experiences shock is represented by K m , while w m denotes the frequency of oscillation. The root locus method is applied to determine K m and w m . The root locus of the controlled object’s transfer function can be obtained for a given system. K m corresponds to the gain traversing the 𝑗𝑤 axis, with the oscillation frequency of the point corresponding to w m .

4.2 Main movements

In order to assess and validate the PD and PID controller simulator, several numerical experiments were conducted.

The time evolution of the X, Y, Z, and Yaw angle positions of the tuned PD/PID controllers are reported in Figures 58. The PD and PID controllers have similar performance in terms of X and Y-axis motion, as shown in Figures 5, 6. It should also be noted that the Z position controller does not affect movement along the X and Y axes. The PID controller proves to be more efficient in reducing altitude position errors (Figure 7), whereas the PD controller only manages to keep a minor, permanent error. Additionally, the PD controller exhibits a marginally quicker rise time compared to its counterpart, the PID controller. The dynamics of the response of both PD/PID yaw controllers to the input reference show comparative behavior, as displayed in Figure 8.

Figure 5
www.frontiersin.org

Figure 5. Time history of the X-position.

Figure 6
www.frontiersin.org

Figure 6. Time history of the Y-position.

Figure 7
www.frontiersin.org

Figure 7. Time history of the Z-position.

Figure 8
www.frontiersin.org

Figure 8. Quadrotor’s yaw angle.

Based on the information presented in Figures 9, 10, we can infer that the PID controlled inner loop has a quick response time as well as high degree of accuracy. The overshoot is well-damped, and the system stabilizes the roll and pitch input angles of the quadrotor. It succeeds to maintain these angles as minimal as possible, assuming negligible values for the ϕ and θ angles. In general, higher roll and pitch angles correlate with greater speeds along the X and Y directions.

Figure 9
www.frontiersin.org

Figure 9. Quadrotor’s roll angle.

Figure 10
www.frontiersin.org

Figure 10. Quadrotor’s pitch angle.

4.3 Main results of the trajectory trucking

A wide range of signal shapes, such as square, circular, and sinusoidal trajectories, have been tested for trajectory trucking. In order to evaluate the performance of the proposed control architecture, a number of time-varying input references were examined and implemented.

Figure 11 illustrates the time history of helical paths. When the quadrotor is being controlled by a PD command, the PD controller produces a small permanent position error. However, the PID controller operates dynamically to ensure precise control. Besides, Figure 12 highlights that the pitch and roll controllers ensure that the quadrotor remains very stable. It can be observed that the trajectory tracking performance is satisfactory with both PD and PIC controllers, particularly when considering the application of the designed autopilot.

Figure 11
www.frontiersin.org

Figure 11. Quadrotor’s trajectory tracking.

Figure 12
www.frontiersin.org

Figure 12. The roll and pitch angles time evolution.

4.4 Assessment of the control robustness

As an input signal to the quadrotor model, a wind force model was added to test whether the control response of the quadrotor was affected by wind disturbances. We have implement the wind force inspired from the work of Alexis et al. (2012). We begin by assessing the impact of disturbances along X and Y axes. The corresponding simulation results are reported in Figure 13.

Figure 13
www.frontiersin.org

Figure 13. Simulation of disturbances along X and Y axes.

It is worth mentioning that the quadrotor is capable of following any rectangular trajectory accurately in the absence of disturbances. Now, when adding the wind gusts scenario, the controller shows very good robustness. Indeed, by properly compensating for wind gusts, the controller corrects any deviation caused by the wind as displayed by Figure 14.

Figure 14
www.frontiersin.org

Figure 14. Wind gusts response for a square trajectory tracking.

Furthermore, controlling a circular trajectory yields the same promising results. As can be clearly observed in Figure 15, the controller succeeds to keep the quadrotor’s trajectory around the input reference in a highly accurate and dynamic manner. For both circular and rectangular trajectories, the simulation results confirm that the quadrotor, utilizing the designed autopilot, can deal with disturbances equivalent to more than 30% of its weight without experiencing any significant deviation from its reference trajectory.

Figure 15
www.frontiersin.org

Figure 15. Wind gusts response for a circular trajectory tracking.

At this stage, it is noteworthy that as the parameters of the controllers are adjustable, their determination could be calculated in several ways and using multiple methods. The mathematical approach used in this paper consists of calculating the parameters according to a second order model that corresponds to the system response. In future work, another approach to be considered involves implementing a more intelligent strategy. This entails using machine learning algorithms trained with historical data. In fact, additional IoT sensors could be deployed for example to continuously update the parameters according to weight variation, flight behavior, environment/landscape nature, and weather information.

5 Conclusion

This study explores the design of an autopilot for a quadrotor unmanned aerial vehicle to analyze intelligent navigation algorithms for surveillance and detection purposes. Its purpose is to serve as a tool for simulating intelligent trajectory tracking algorithms, aiding in the enhancement and refinement of detection and surveillance tasks. Toward this goal, a configurable PD/PID controller is introduced. Simulation study of the controllers were conducted using Matlab Simulink. The simulation results, concerning main movements and trajectory tracking, were presented to demonstrate the controllers’ good performance. With the introduction of wind gusts, the proposed controllers effectively maintained the quadrotor’s trajectory close to multiple provided input references in an accurate manner. While the PID-controlled autopilot exhibited slightly superior performance, the hybrid version emerged as an enticing alternative, capitalizing on the simplicity of the PD control approach.

Future research could delve deeper into exploring controllers with improved efficiency, given the established understanding that the PID controller falls short of optimality and fails to meet all stability requirements for flight. In addition to studying the performance of the proposed control scheme with respect to other disturbances types, it would also be possible to investigate the accuracy of the quadrotor parameters as well.

Data availability statement

The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author.

Author contributions

AB: Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Software, Validation, Writing – original draft. MS: Supervision, Validation, Writing – review & editing.

Funding

The author(s) declare that no financial support was received for the research, authorship, and/or publication of this article.

Conflict of interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

The reviewer KK declared a shared affiliation with the authors to the handling editor at the time of review.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

References

Ait El Cadi, A. (2010). Planification de trajectoires pour une flotte d'UAVs. Doctoral dissertation École Polytechnique de Montréal.

Google Scholar

Akhloufi, M. A., Couturier, A., and Castro, N. A. (2021). Unmanned aerial vehicles for wildland fires: sensing, perception, cooperation and assistance. Drones 5:15. doi: 10.3390/drones5010015

Crossref Full Text | Google Scholar

Alexis, K., Nikolakopoulos, G., and Tzes, A. (2012). Model predictive quadrotor control: attitude, altitude and position experimental studies. IET Control Theory Appl. 6, 1812–1827. doi: 10.1049/iet-cta.2011.0348

Crossref Full Text | Google Scholar

Barzegar, A., and Lee, D. J. (2022). Deep reinforcement learning-based adaptive controller for trajectory tracking and altitude control of an aerial robot. Appl. Sci. 12:4764. doi: 10.3390/app12094764

Crossref Full Text | Google Scholar

Bhar, A., Sayadi, M., and Fnaiech, F. (2017). “Improved modular UAV autopilot simulator for Pinguin BE aircraft” in In 2017 international conference on control, automation and diagnosis (ICCAD) (IEEE), 125–129.

Google Scholar

Bhar, A., Sayadi, M., and Fnaiech, F. (2018). “Modular navigation strategy for autonomous robot” in In 2018 15th international multi-conference on systems, signals & devices (SSD) (IEEE), 396–401.

Google Scholar

Bouabdallah, S., Noth, A., and Siegwart, R. (2004). “PID vs LQ control techniques applied to an indoor micro quadrotor” in 2004 IEEE/RSJ international conference on intelligent robots and systems (IROS) (IEEE Cat. No. 04CH37566), vol. 3 (IEEE), 2451–2456.

Google Scholar

Bouabdallah, S., and Siegwart, R. (2005). “Backstepping and sliding-mode techniques applied to an indoor micro quadrotor” in Proceedings of the 2005 IEEE international conference on robotics and automation (IEEE), 2247–2252.

Google Scholar

Burggräf, P., Pérez Martínez, A. R., Roth, H., and Wagner, J. (2019). Quadrotors in factory applications: design and implementation of the quadrotor’s P-PID cascade control system: modeling and implementation. SN Appl. Sci. 1:722. doi: 10.1007/s42452-019-0698-7

Crossref Full Text | Google Scholar

Doukhi, O., Fayjie, A. R., and Lee, D. J. (2017). Intelligent controller design for quad-rotor stabilization in presence of parameter variations. J. Adv. Transp. 2017, 1–10. doi: 10.1155/2017/4683912

Crossref Full Text | Google Scholar

Ghamry, K. A., Kamel, M. A., and Zhang, Y. (2016). “Cooperative forest monitoring and fire detection using a team of UAVs-UGVs” in In 2016 international conference on unmanned aircraft systems (ICUAS) (IEEE), 1206–1211.

Google Scholar

Ghamry, K. A., and Zhang, Y. (2015). “Formation control of multiple quadrotors based on leader-follower method” in In 2015 international conference on unmanned aircraft systems (ICUAS) (IEEE), 1037–1042.

Google Scholar

He, Z., and Zhao, L. (2014). A simple attitude control of quadrotor helicopter based on Ziegler-Nichols rules for tuning PD parameters. Sci. World J. 2014, 1–13. doi: 10.1155/2014/280180

Crossref Full Text | Google Scholar

Khan, H. S., and Kadri, M. B. (2015). “Attitude and altitude control of quadrotor by discrete PID control and non-linear model predictive control” in In 2015 international conference on information and communication technologies (ICICT) (IEEE), 1–11.

Google Scholar

Kotarski, D., Benić, Z., and Krznar, M. (2016). Control design for unmanned aerial vehicles with four rotors. Interdiscip. Descrip. Complex Syst. 14, 236–245. doi: 10.7906/indecs.14.2.12

Crossref Full Text | Google Scholar

Kuantama, E., Vesselenyi, T., Dzitac, S., and Tarca, R. (2017). PID and fuzzy-PID control model for quadcopter attitude with disturbance parameter. Int. J. Comput. Commun. Control 12, 519–532. doi: 10.15837/ijccc.2017.4.2962

Crossref Full Text | Google Scholar

Li, S., Li, B., and Geng, Q. (2014). “Adaptive sliding mode control for quadrotor helicopters” in Proceedings of the 33rd Chinese control conference (IEEE), 71–76.

Google Scholar

Manoj Kumar, M., Arun Sankar, M., Jeeva, M., and Sasi, G. (2021). Autonomous drone using Pixhawk flight controller with live stream and mask detection features. Int. J. Eng. Res. Technol. 10, 104–107.

Google Scholar

Moumgiakmas, S. S., Samatas, G. G., and Papakostas, G. A. (2021). Computer vision for fire detection on UAVs—from software to hardware. Future Internet 13, 1–17. doi: 10.3390/fi13080200

Crossref Full Text | Google Scholar

Nguyen, N. P., and Hong, S. K. (2018). Position control of a hummingbird quadcopter augmented by gain scheduling. Int. J. Eng. Res. Technol. 11, 1485–1498.

Google Scholar

Quan, Q. (2017). Introduction to multicopter design and control (pp. 150–160). Singapore: Springer.

Google Scholar

Reizenstein, A. (2017). Position and trajectory control of a quadcopter using PID and LQ controllers. Doctoral dissertation. Linköping: Linköping University).

Google Scholar

Rinaldi, M., Primatesta, S., and Guglieri, G. (2023). A comparative study for control of quadrotor uavs. Appl. Sci. 13:3464. doi: 10.3390/app13063464

Crossref Full Text | Google Scholar

Sheta, A., Braik, M., Maddi, D. R., Mahdy, A., Aljahdali, S., and Turabieh, H. (2021). Optimization of pid controller to stabilize quadcopter movements using meta-heuristic search algorithms. Appl. Sci. 11:6492. doi: 10.3390/app11146492

Crossref Full Text | Google Scholar

Tahir, M. A., Mir, I., and Islam, T. U. (2023). Control algorithms, Kalman estimation and near actual simulation for UAVs: state of art perspective. Drones 7:339. doi: 10.3390/drones7060339

Crossref Full Text | Google Scholar

Wang, H., Ye, X., Tian, Y., Zheng, G., and Christov, N. (2016). Model-free–based terminal SMC of quadrotor attitude and position. IEEE Trans. Aerosp. Electron. Syst. 52, 2519–2528. doi: 10.1109/TAES.2016.150303

Crossref Full Text | Google Scholar

Wei, X., XianYu, W., Jiazhen, L., and Yasheng, Y. (2023). Design of anti-load perturbation flight trajectory stability controller for agricultural UAV. Front. Plant Sci. 14:1030203. doi: 10.3389/fpls.2023.1030203

PubMed Abstract | Crossref Full Text | Google Scholar

Zhang, X., Li, X., Wang, K., and Lu, Y. (2014). “A survey of modelling and identification of quadrotor robot” in Abstract and applied analysis, vol. 2014 (Hindawi)

Google Scholar

Keywords: unmanned aerial vehicles, autopilot, design, PD/PID control, quadrotor

Citation: Bhar A and Sayadi M (2024) On designing a configurable UAV autopilot for unmanned quadrotors. Front. Neurorobot. 18:1363366. doi: 10.3389/fnbot.2024.1363366

Received: 30 December 2023; Accepted: 15 March 2024;
Published: 30 May 2024.

Edited by:

Hassene Seddik, University of Tunis, Tunisia

Reviewed by:

Khaled Nouri, ENICarthage, Tunisia
Balti Ala, Carthage University, Tunisia
Wassim Arfa, Carthage University, Tunisia
Khaled Khnissi, Higher National Engineering School of Tunis, Tunisia

Copyright © 2024 Bhar and Sayadi. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

*Correspondence: Ali Bhar, bhar.ali@topnet.tn

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.