Quadcopter Vehicle Proportional-Integral-Derivative Controller (PIDC) Tuning by Particle-Swarm-Optimization (PSO)

Inspection of the faults and damages in high voltage transmission lines is not only unsafe and costly but also a very time-consuming process. In addition, it demands highly skilled manpower for the operation at tens of meters above the ground on cables carrying thousands of Volts. Meanwhile, the Quadcopter Aerial Vehicle (QAV) system became a popular alternative for aerial photography applications due to its low cost, ease of usage, and fast response wherein the proportional-integral-derivative controller (PIDC) is used. The PID controller compares the expected location of the drone with the actual measured position thereby can accurately detect the faults in the transmission lines. Based on these factors, in this study, the flight simulation is done according to the desired flight path, and drone imagery is used for (insulator, power line, and porcelain) flaw identification. Furthermore, three movements (roll, pitch, and yaw) of the quadcopter were controlled by different PIDC that were optimized using the particle swarm optimization (PSO). The MATLAB/Simulink application was used to develop the system and simulate the results (R2021b). This clearly suggested that the quadcopter continues to fly on a trajectory with minimum inaccuracy, wherein the PIDC operated as a closed-loop adaptive controller. Finally, the PSO-PIDC outperformed the PIDC due to the critical nature of manual gain modification for quadcopter flight stability.


Introduction
Quadrotor is a type of helicopter that can be skillful by variable the rotor hurries. It is an under-actuated, lively vehicle with four input militaries and six output organizes. Quadrotor, calm of four rotors with proportionally preparation where two slanting motors (1 and 2) are consecutively in the same way while the others (3 and 4) in the other way to remove the anti-torque [1][2][3][4][5].The technique used in the quadcopter system, controller design, implementation of PSO algorithm [5][6][7], and procedure for achieving the best tuning. Also, the mathematical model and analysis of PSO algorithms are explained. These algorithms are used to improve the control of the quadcopter by applying them to tune the parameters of PIDC. Many factors are needed to operate a UAV [8]. The control is defined as the capacity to determine, maintain, or modify an airplane's attitude with respect to its intended flight path. A quadcopter with 6-DOF has fewer autonomous control inputs, making it difficult to retain control over all six. The axes, as well as yaw, pitch, and roll can now be controlled using the newly proposed design [9].
The trajectory planning is used to move the quadrotor from its initial location to the target position by determining the quadrotor's rotor velocities. Design and analysis of optimization process was performed to evaluate the vehicle's ideal path. The lodge of a system is necessary to specify the movement of the system, forces involved, and its response to the inputs [10], [11,12].
The goal is to demonstrate the simulation process of the quadcopter and introduce the control trajectory design used for the simulated flight path for this paper. The basic working principle of PIDC (Proportional, Integral, and Derivative) algorithm for quadcopter linear control systems are discussed in depth. The feedback linearization method for quadcopter attitude control was used because of its advantages and we then the outcomes were analyzed.

Simulation of The Quadcopter System
Simulink contained many points' path references of the simulation model wherein the waypoint follower block of Simulink's was utilized as the model. When input in MATLAB program it created a subdirectory in the project directory that contained the primary parameters and models required to simulate a flight route. This application may either simulate the intended flying route for the quadcopter using its 3D visualizer or it can begin flying and follow a pre-configured set of waypoints. Figure 1 illustrates the Simulink the quadcopter's initial flight model including the subsystem component blocks for waypoint commands, control system, plant model, and 3D flight display [13]. Figure 1 illustrates the Simulink the quadcopter's initial flight model including the subsystem blocks for waypoint commands, control system, plant model, and 3D flight display.

Waypoint System
To start, the Simulink model mission requires the drone to reach the path points, while using a constant block to enter the desired path points (wps) into a waypoint follower block. matrix's waypoints show below in Figure  2. The waypoint (WP) follower, from the Simulink system UAV toolbox, calculates the target yaw, heading, and look-ahead point based on the quadcopter's position, WPs, and look-ahead distance. The desired WPs created for this study are entered into the WP box given by [14]: (1)   The suggested control technique involved the combination of a position, velocity and an attitude controller. Due to the unreliability of open-loop control methods, a PIDC is used to regulate the quadrotor's closed-loop altitude. IAE is used in conjunction with the PSO method to avoid selecting gains that cause early mistakes high enough to make the job impossible. Additionally, disregard scenarios in which the UAV fails to reach the point, is too slow to reach the point, or reaches the target location but oscillates with an undesired amplitude. Gain difference intervals were determined based on the investigated system's behavior and, more specifically, the controller's responses in order to minimize saturation of the control signals [15].
As a result, a PID with chose PSO-gain is used to adjust the quadrotor's closed-loop fast controls to reach the desired point. PIDC is beneficial due to its simplicity and ease of implementation and takes the general mathematical form as in Equation 2,3 [15,16] (2) (3) where u (t) is the control input, e(t) is the difference between the intended state x d(t) and current state x(t); KP, KI, and KD are the proportional, integral, and derivative components of PIDC, respectively. A quadrotor has three main subsystem blocks constituting the flight control system wherein the position controller is responsible for the variables x, y, z as shown in Figure  5 [16].

Position And Velocity Controllers
The position control is a method for keeping track of moving vehicles using their current locations. In the position and velocity controls, there are three PID blocks that drive the distance to velocity translation as displayed in Figure 7. The derivation of the vehicle speed gives the acceleration of the vehicle Figure

The attitude controller
PIDCs are essential to tackle the problem and differences between their usages as seen clearly from the output. The tuning of the PIDC parameters for both roll angle, pitch angle and yaw angle loops can be accomplished by adjusting the PID coefficients. The proportional gain coefficient is used to manage acceleration and stability, while the integral coefficient is used to reduce permanent fault, and lastly, the derivative coefficient is used to reduce oscillation range and increase stability. The altitude controller was developed to follow a trajectory path using the Simulink block diagram as shown in Figure 9. [17,18].
By applying the force and moment balance laws, the Quadcopter motion equation are given in Equation (8) (11) Figure 9. Altitude control design strategy

Quadcopter Plant
The quadrotor's governing equations were used to develop the system's dynamic and kinematics model. First, the blocks of the system received the required trajectory and passed the model's ideal state to the state estimation output vectors. Next, the state estimation function determined the current state of the model by comparing it to the model's state. The plant determines the current state in the body frame of the model by comparing it to the desired path. The controller will at first receive a large error, and the control signal should be high. As the robot gets closer to the desired point, the control signal will get smaller, tending toward zero, wherein the quadrotor should stabilize until the position and velocity errors are zero. Figure 10 shows the basic architecture of Simulink and simulation of quadcopter plant. Figure 11 displays the parameters of quadcopter plant. The quadcopter will start from its initial position (0, 0, 0) [m] and thrust value 1 N as see in Fig. 12.   In rotations port, using the coordinate transformation, the conversion block makes a coordinate transformation from the input representation to a specified output representation, displaying the visual mesh for multi-rotor at the given position and orientation. By clicking the show animation button in the block mask, it is possible to bring up the figure after simulating. The final view is the QAV view that allows for a top-down tracking while the drone is in flight show in Figure 13. Figure 14 illustrates the parameters of UAV animation block.

Particle Swarm Optimization
Following the swarm intelligence technology introduced by Eberhart and Kennedy, the optimization problems can be solved using PSO. PSO takes its cues from animal groups such as birds, fish, and herds of animals are all examples of flocks. All of which have evolved an evolutionary advantage through the use of "information sharing" systems. There are several iterations of propagation in which a randomly produced population of particles (called an "initial swarm") populates the PSO and a random velocity is assigned to all of those particles. A particle's "personal best position" is a memory of the highest position it has ever achieved (Post). It is the particle with the highest P best that is referred to as the "global best particle" [20,21].
Let us consider that the search space is D-dimensional wherein a D-dimensional vector represents the ith member of the population. These moves at a higher speed and the velocity represent another particle in the D-dimensional space through another vector . Pi denotes the particle's previous best position, while the best particle is denoted by Pi and Pg denotes the presence of the swarm. The following two equations are used to update the particle's position. After calculating the previous velocity, Eq. (12) updates each particle's position in the search space by computing a new velocity for each particle Next, Eq. (13) updates each particle's position in search space [22,23].
where k¼ is the iteration number; d¼ can take values 1,2,3, …, D; i¼ can take values 1,2,3, …, N; N¼ is the swarm size; w¼ is the inertia weight that controls the momentum of particle by weighing the contribution of previous velocity; c1 and c2 are the positive constants called acceleration coefficients; r1 and r2 are the random numbers uniformly distributed between [0,1] [24,25].

Objective Function for tuning PID control
The importance of optimization parameters or the results of an operation used as input to the optimization algorithm is described mathematically as the objective function. Figure 15 shows the fitness function for tuning PID controls. The PID controller is employed with all optimization techniques to obtain the lowest feasible error and to offer the PID controller's overall magnitude as a preferred alternative [53] The PID tuning values were mentioned in Appendix A. Objective function calculate from the following Integral absolute error Equation in (14)- ( 15) [26].
The objective function can be calculated in terms of the integral absolute error (IAE) or performance index via: Objective function= (14) performance index= (15) IAE: Integral absolute error u= The desired angle -The actual angle u= error

Simulation Results
The QAV is flown in a detailed order to six chosen WP. The three-dimensional image demonstrates that the gain values have been set appropriately; The grid spacing represents one meter. Throughout the scenario, the QAV

EAI Endorsed Transactions on
Creative Technologies 03 2022 -07 2022 | Volume 9 | Issue 31 | e5 begins at a distance of one meter. This is a setting within the plant model that moves vertically first and then angularly to accomplish the first WP. This arises as a result of the plant's basic settings. The following WPs are accomplished by establishing the appropriate heading and yaw and then proceeding at a determined speed to a specified distance [1,2,[27][28][29][30]. Figure 16 displays the 3d view of the simulated flight trajectory of the QAV wherein it is flown in a detailed order to six chosen WP. The obtained 3D image demonstrates that the gain values have been set appropriately. The grid spacing represents one meter and throughout the scenario, the QAV began at a distance of one meter. This is a setting within the plant model that moves vertically first and then angularly to accomplish the first WP. This arises as a result of the plant's basic settings. The following WPs are accomplished by establishing the appropriate heading and yaw and then proceeding at a determined speed to a specified distance. Figure 17 shows the 2D view of Simulink flight path of the QAV display like simulation waypoint. Thus, the flight path confirmed that the QAV made the most efficient route to the targeted WP. The results simulated flight trajectory of the QAV is presented from Were P: position in earth frame, V: velocity in earth frame, :angles of axis in earth frame, : angular velocity in body frame the quadcopter's output state vector in Equation 17 continues to track the six degrees of freedom with extremely minimal errors. When the x, y, and z reference distance values are tracked, a significant overshoot is noted at the start of the test period. This is because the quadcopter begins its journey from a point much outside the trajectory. However, once it reaches the desired route, the quadcopter's velocities stabilize and track the reference values quite smoothly.     Figure 32 illustrates the 3D view of Simulink Flight path without attitude controller. Figures 33-36 show the plot of various output state vectors of the quadcopter as equation 17 continued to track the six degrees of freedom with lowest possible errors. A significant overshoot was noted at the start of the test period when x, y, and z reference distances were tracked. This observation was ascribed to the starting journey of the quadcopter from a point far away from the trajectory. However, the velocities of the quadcopter were stabilized and the reference values were tracked quite smoothly once it reached the desired route. It was asserted that the Newton-Euler kinematic model can be used to simulate the quadcopter's altitude during a trajectory flight. In addition, the quadcopter must have a control system for continuous movement in order to remain stable during the motions with constantly varying yaw, pitch, and roll angles. The simulation results showed a significant overshoot without any control mechanism in place.

Conclusion
This chapter demonstrated that the quadcopter's altitude movement on a trajectory flight can be modelled using the Newton-Euler kinematic model. A continuous movement control system is required to ensure the stability of the quadcopter while navigating that involves continuous changes in the yaw, pitch, and roll angles. Without a control system, significant amounts of overshoot can readily be produced in the horizontal plane of altitude movement and the simulated results show the aircraft moving in an unstable manner, deviating from the needed course, and failing to return to the original point. Thus, to reduce the inaccuracy of flight, PIDC can be added to the quadcopter movement model. Only proportional and derivative components are required to guarantee the quadcopter flying position stability in the case of the PID control system. This clearly suggested that the quadcopter continues to fly on a trajectory with minimum inaccuracy, wherein the PIDC operated as a closed-loop adaptive controller. Finally, the PSO-PIDC outperformed the PIDC due to the critical nature of manual gain modification for quadcopter flight stability.