Virtual Electric Dipole Field Applied to Autonomous Formation Flight Control of Unmanned Aerial Vehicles

The following paper presents a method for the use of a virtual electric dipole potential field to control a leader-follower formation of autonomous Unmanned Aerial Vehicles (UAVs). The proposed control algorithm uses a virtual electric dipole potential field to determine the desired heading for a UAV follower. This method’s greatest advantage is the ability to rapidly change the potential field function depending on the position of the independent leader. Another advantage is that it ensures formation flight safety regardless of the positions of the initial leader or follower. Moreover, it is also possible to generate additional potential fields which guarantee obstacle and vehicle collision avoidance. The considered control system can easily be adapted to vehicles with different dynamics without the need to retune heading control channel gains and parameters. The paper closely describes and presents in detail the synthesis of the control algorithm based on vector fields obtained using scalar virtual electric dipole potential fields. The proposed control system was tested and its operation was verified through simulations. Generated potential fields as well as leader-follower flight parameters have been presented and thoroughly discussed within the paper. The obtained research results validate the effectiveness of this formation flight control method as well as prove that the described algorithm improves flight formation organization and helps ensure collision-free conditions.

and provide reliable operation which, in turn, makes their design challenging. The problem of formation flight control has been well documented and widely considered in literature.
Formation flight control systems can be classified according to a number of criteria with the most important being the type of information they use and the way this information is exchanged. Examples include (i) systems based on a radio data exchange (most often concerning positions and velocities of objects within a group), (ii) those relying on video information that is obtained from cameras and computer vision systems [31,32], and (iii) systems based on specialized sensors -such as seekers [33]. Another manner of classifying formation control systems is through the structure of their control system and dependencies related to communication and data exchange. Three of the most commonly used structures are (i) leader-follower [34,35], (ii) virtual structure [36] and (iii) behavioral approach [37]. Flight formation control methods can also be categorized on the basis of the control system's organizational arrangement (according to the place where decision making and control occurs), with examples including (i) centralized, (ii) decentralized, and (iii) hybrid. We can also divide the methods with regard to the type of control object and its kinematic properties. Methods can also be classified with respect to their control object, such as (i) nonholonomic [38,39] and (ii) holonomic, and its kinematic properties. There are also formations of homogeneous and heterogeneous objects [40].
In considering solely the technique used for formation flight control, it is possible to mention methods utilizing proportional-integral controllers [41][42][43], nonlinear [44,45] or with switching controllers [46]. Other types of controllers like optimal [47,48], adaptive [49,50], predictive [51] or robust [52] have also been analyzed and evaluated. In [53] and [54], for example, trajectory optimization methods for multiple agents of formation flight were presented and carefully discussed. An efficient and optimal path smoothing technique for UAV formation path planning that accounts for moving obstacles is proposed in [55] and for guiding a UAV to a desired position. However, artificial potential field derivation, their handling, and usage are carried out in various ways. Works [56][57][58][59], for example, utilized bifurcating potential fields to determine the desired airspeed and heading of a fixed-wing UAV and focused on keeping the aircraft on the desired trajectory defined as a constant radius circle or as a straight line. The authors of these works consider a decentralized control methodology without a leader. The [60], on the other hand, presents a virtual leader approach combined with an extended local potential field. This method was applied only with respect to small unmanned helicopters and is only suitable for holonomic mobile objects, greatly limiting its uses. The most frequently used methods of formation control represent the position or displacement-based approaches where objects measure their position or relative position within a global coordinate system. [61] proposes a formation control system that uses information concerning the line of sight angles but only with respect to nearby agents. Furthermore, it is important that the proposed algorithm does not require a communication link for data exchange between vehicles. A similar idea for controlling the formation of flying robots without relative position determination of each vehicle was proposed in [62] where the detective deviated pursuit rule regulates the distances between vehicles.
The present work also addresses the problem of UAV formation flight control. The algorithm proposed within the work uses a potential field to determine the desired heading for the follower UAV. A great advantage of this method is the ability to rapidly change this potential field function depending on the position of an independent leader. What is more, the potential field is generated in a manner that provides collision avoidance during formation flight. The system is decentralized and based on a leader-follower configuration and could be easily adapted to vehicles with different dynamics without having to retune heading control channel gains and parameters. One of the paper's main goals was to conduct simulation tests of the proposed formation flight control system. The leader-follower simulation onboard control system was designed in a manner that corresponds to commercial autopilots and was carefully described in the paper. The synthesis of the potential field control algorithm is also closely described and presented in detail. The proposed control system was thoroughly tested and verified during simulations. Longitudinal and lateral positions of the UAVs (leader and follower) obtained during the tests were recorded and then presented on plots. Furthermore, waveforms of position errors were introduced to show control system quality. Generated vector fields, as well as the logged leader and follower flight parameters, were subjected to careful consideration. The Obtained results validate the effectiveness of the vector field-based formation flight control method and the developed control algorithm improves formation flight organization, provides a simple and computationally efficient method for controlling, and helps to ensure collision-free flight of multiple UAVs.
The remainder of the paper is organized in the following manner: Section 2 includes a thorough description of the research object, its mathematical model, and simulation system while the main definitions of the virtual electric dipole field and formation flight problem are formulated in Section 3. Section 4 presents the validation of the proposed navigation strategy conducted using computer simulations and illustrative examples. Comprehensive conclusions are presented in Section 5.

The Bullit 60
The study utilized the Bullit 60, a micro air vehicle (MAV) [63] (Figure 1), which is a fixed-wing aircraft of the flying wing configuration. The control surfaces in a flying wing are commonly called elevons. The angular deflections of the right and left elevons are labeled as δ e r and δ e l , respectively. Using the following formulas, we can convert elevon singnals into a standard aileron-elevator (δ a and δ e ) signals [64][65][66]: Therefore, the mathematical model of the MAV presented in the next paragraph will be expressed in terms of standard aileron-elevator notation. The Bullit 60 is made of balsa wood covered with plastic skin and is powered by a front-mounted electric motor. Its propulsion system is composed of a two-blade, 14 × 8 propeller that has an area (S p ) of 0.0031 m 2 . The MAV's wing is configured as a single-delta and has a symmetrical, bi-convex BELL 540 (modification of NACA0012) profile. The wing span (b) of the Bullit 60 is 1.095 m, whereas the wing area (S) is 49.7 dm 2 . The other important aerodynamic wing parameters are the mean chord (c) and the tip chord that are 0.660 m and 0.170 respectively. The total length (l) of the UAV is 0.770 m and its total ready-to-fly mass (m) is 1.8 kg. The vehicle's maximum airspeed (V max ) is 34 m/s and and its minimum velocity (V min ) is 11 m/s.

Mathematical Model
To characterize the spatial motion of a UAV it is crucial to consider the action of forces and moments on the vehicle. To complete the mathematical model, it is also important to account for kinematic relations.
The considered UAV is symmetrical within the x-z plane. Consequently, the inertia matrix (please refer to Table 1) can be expressed as: (1) The six-degree-of-freedom, 12-state model with externally applied forces and moments due to gravity, aerodynamics, and propulsion system can be presented through Equations (2)- (5). Aerodynamic parameters (lateral and longitudinal) of the Bullit 60 were calculated using Advanced Aircraft Analysis (AAA) computer software developed by the DAR Corp.
[67] and the Tornado VLM software [68] and were compared with wind tunnel experiments [69]. The Bullit equations of motion that have been applied in the present study are as follows:  ṗ q r where: Figure 2); y-inertial East UAV position in the O g X g Y g Z g ( Figure 2); z-inertial Down position in O g X g Y g Z g ( Figure 2); φ, θ, ψ-roll angle, pitch angle, yaw angle respectively; u, v, w-body frame velocities measured in OX b Y b Z b ( Figure 2); p, q, r-angular rates measured in OX b Y b Z b (roll rate, pitch rate, yaw rate respectively); OX v Y v Z v -MAV vehicle frame with origin in the MAV center of mass, axes are aligned with O g X g Y g Z g axis; C * -aerodynamic coefficients (values in a Tables 2 and 3); δ a , δ e , δ t -aileron, elevator, throttle commands; V * -airspeed; β-sideslip angle.   Table 3. The Bullit lateral aerodynamic coefficients.

MAV Simulation System
The 12 nonlinear, coupled, first-order, ordinary differential Equations (2)-(5) represent the mathematical model of the MAV. Based on these equations, a simulation model was constructed in Matlab/Simulink software using specialized toolboxes like Control System [70], Flight Dynamics and Control [71], and Aerospace [72]. Presented Equations (2)-(5) create the MAV's kinematics and dynamics block ( Figure 3). Additionally, an autopilot model whose primary goal is to control the MAV's inertial position and attitude was also developed. Apart from stabilization and navigation control loops, the developed simulation model of the Bullit 60 includes formation flight control loops, path following and path planning functions as well as a trajectory generator block ( Figure 3). Path-following functions generate commands to low-level control loops (stabilization and navigation control loops). The path planning block produces a sequence of straight-line paths that maneuver the MAV. The block labeled as the trajectory generator is responsible for switching between orbit and straight-line path following to maneuver the MAV along defined waypoints on the terrain map. The prepared simulation model provides a full flight MAV control system during various phases of flight and emulates commercial autopilots like MicroPilot [73] or Kestrel [74]. Simulation systems utilized during the MAV formation flight control tests were composed of two separate MAV blocks with autopilots (a full flight control system like the one presented in Figure 3): communication block which is responsible for data exchange between UAVs and a formation flight control block implementing a potential field leader following algorithm. The simulation model also takes into account positioning errors and noise in this process (not only the size of the GPS error but also the dynamic characteristics of the error. The GPS error model (both altitude and x-y plane) includes a slowly varying, zero-mean bias (4.7 m for x and y direction, 9.2 m for altitude) and a random noise component (0.4 m for x and y direction, 0.7 m for altitude). The model of the transient behavior of the error was approximated using the Gauss-Markov process based on [75] with a standard deviation of 0.21 m in x and y directions and of 0.4 m in altitude. Moreover, the simulation model also took into account atmospheric disturbances. The total wind vector was represented as a constant vector (steady ambient wind) and stochastic process (wind gusts and atmospheric disturbances). A suitable approximation of the nonsteady gusts was given by Dryden transfer functions with turbulence intensities along vehicle frames x, y, z on level 2.12 m, 2.12 m and 1.4 m respectively for each direction [75]. A schematic of the entire system used within the study has been presented in Figure 4.

Formation Flight Geometry
The formation flight control system is based on the leader-follower control strategy. The cosidered example concerns the case of two UAVs-one leader and one follower. This is due to the fact that future in-flight tests of the proposed formation flight algorithm will be carried out with a single leader-follower scheme on account of consideration for available hardware resources (autopilots, airframes, base stations, etc.). A simple formation geometry of two UAVs is presented in Figure 5. Leader and follower positions can be denoted with the following formulas: The length of R (defined on the scheme in Figure 5) is defined as: The Follower UAV's commanded trajectory can be defined as: where V c F , ψ c F , A c F -is the follower's desired airspeed, heading and altitude respectively.

Virtual Electric Dipole Field in Leader-Follower Control Structure
The aim of the leader-follower formation control is to keep the follower in the desired position relative to the leader's position. Additionally, when the follower reaches the desired position, its heading should be parallel to the leader's heading. Therefore, the aim of formation flight control is to determine the heading and the velocity of the follower based on the leader's position and velocity. For the purposes of this paper, the potential field method, utilized first by Khatib [76] to help mobile robots to avoid obstacles, was used to determine the follower's heading angle. In later studies, the potential field method was used to plan the robot's paths, see e.g., [77][78][79][80]. The main idea of the potential field method is to find a scalar field whose gradient will produce the desired vector field in space. This virtual vector field is then used in the control process. The vector field used to control the follower's heading must have the following properties: lines of this field must meet at one point and reach this point in a manner that allows them to parallel the leader's velocity. The electric dipole whose dipole moment vector forms angle ψ L (leader heading) with the x-axis and is, therefore, parallel to the longitudinal leader's velocity V L , is a good candidate for the generation of such a field. The electric vector field generated by the electric dipole is shown in Figure 6. The dipole electric field has the following features: the direction of the electric field is tangent to the field line at any point in space, the field lines begin on positive charge q + and terminate on negative charge q − , the field lines can never cross. When the direction of such an electric vector field defines the desired follower's heading, the path of the follower's UAV coincides with the field lines (the direction of the follower's velocity is determined by its heading, and by definition, the velocity is always tangent to the path). It can therefore be said that the position of charge q − is an attractor for the follower, which ensures the stability of the system control. As can be seen in Figure 6, from almost any point within the space, the electric field lines reach point q − circling the dipole. There is an exception, however, the part of space between dipole charges. In the case when the point q − is the desired follower's position and the direction of the electric vector field defines the desired follower's heading, the follower reaches point q − circling it. This behavior is consistent with intuition: if the electric dipole is placed in the leader position and q − is the desired follower's position, the follower should just go around the leader and position behind him.
The follower's desired position relative to the leader's position can be arbitrary (the follower on the leader's right side, for example) and the virtual electric dipole position can also be arbitrary. The potential field of an exemplary leader-dipole configuration is shown in Figure 7.

Potential Field Generation and Desired Heading Definition in Formation Flight
Let the leader's position in the global frame in the plane YX be described by vector: and the desired follower's position relative to the leader in the global frame by vector: where (y d , x d )-follower's desired position relative to the leader in the leader's body frame (please see Figure 5). The follower's desired position in the global frame is described by vector: The electric field of the dipole has two singular points-these are points where electrical charges are placed. These are critical because within their proximity the vector field can rapidly change direction by as much as 180 degrees, changing the desired heading just as rapidly. The follower's desired position must not be placed at these critical points. The position of the negative charge of the electric dipole in the global frame is therefore described by the vector: As can be seen in Equation (12), the position of the dipole's negative charge does not correspond to the follower's desired position (Equation (11)). Rather, the dipole's negative charge position is shifted in the direction of the leader's ψ L heading by a value of a (see Figure 8). Position of the positive charge of the electric dipole in the global frame is described by a vector: R + = R dF + (d + a)(sin(ψ L ), cos(ψ L )). (13) Based on the positions of the virtual electric charges (Equations (12) and (13)), it becomes possible to determine the potential field. A potential field generated by a positive charge at (y, x) position is presented below: where: R R+ = (y, x) − R + , q c -is the electric charge value. A negative charge generates the following potential field: where R R− = (y, x) − R − . A potential field protecting the leader against a collision with the follower is expressed as: where R RC = (y, x) − R L , R C is the collision's radius, C RC is the collision's coefficient. When R RC > R C , this protection field should disappear. It can be assumed that this happens in situations where V C is equal to 0.01 of its maximum value (equal to q c ). Under this assumption the collision's coefficient C RC is equal to 0.217.
According to Equations (16) and (17) the total potential field at point (y, x) takes the form of: Taking into account Equations (9)-(16), Equation (17) can be written as: The next step is to determine the vector field based on the scalar potential field (18). The vector field for controlling follower's heading is determined using the following formula: Taking into account Equations (18) and (19), components of the vector field take the form of: The vector field E T has been used to control the follower's heading. Finally, the angle between vector E T and the positive X,N-axis in the follower's position define the follower's desired heading: An exemplary vector field setting out the follower's heading is shown in Figure 8. In conclusion, it should be emphasized that the proposed vector field has one big advantage: a lack of local minima and only one global minimum in the position of the negative charge (minus infinity). The absence of additional minima makes control processes using such potential fields reliable because such control systems have only one attractor.

Velocity Control in Formation Flight
Realization of effective formation flights also requires precise control over the follower UAV's velocity. In the approach presented within this work, velocity control is based on position errors between the leader and the follower. These position errors can be defined as follows: Errors defined in Equation (22) need to be expressed in the formation frame. In the formation frame they can be written as follows: Position errors expressed in the formation frame in x and y directions are defined as R v (23) and R ψ (24). To control the follower's velocity during formation flight only the R v component of the vector R is used. The position error R v expressed in the formation frame defined with Equation (23) should contain the desired distance in direction x designated as x d . This can be expressed in the following manner: Parameter e v is the input signal to the velocity controller (please refer to scheme in Figure 9). Discrete time forms of the controller for producing airspeed corrections are presented below: where k p , k d are controller gains, T s is sampling time, N is the filter coefficient, Z is a discrete time operator from Z transform. During formation flight control the desired altitude signal for the follower UAV is produced in accordance with the following equation: where z d is the desired separation distance in direction z.

Results
Simulation tests of the proposed formation flight control algorithm were performed with one leader and one follower. The leader had information about the desired trajectory. The follower's task was to follow the leader using the potential field algorithm. Performed tests were done using straight-line path following as well as the loiter function (following a circular path with a specified radius). Initial parameters (positions, headings) of the leader and the follower were different and were changed during the tests (please refer to Tables 4 and 5). Other parameters utilized in the Equation (20) were: R C = 20 m, C RC = 0.217, a = 20 m, d = 20 m, q c = 1. During simulation tests MAVs dynamics were influenced by atmospheric disturbances V wind = V w const + V w dyn modeled as constant wind field V w const = w x w y w z T (where w x = 1 m/s, w y = 3 m/s, w z = 0 m/s ) expressed in the inertial frame with added turbulences V w dyn (non-steady gusts). The turbulences V w dyn were generated by passing white noise signal through Dryden transfer functions. Dryden gust model parameters were taken for low altitudes and moderate turbulences in accordance to [64]. Simulation studies include seven test flights (four tests for straight-line and three for circle path).

Straight Line Path Following Tests
During straight-line path following tests, the follower had to fly 30 m behind the leader and 15 m to its left side. The first trial concerned the situation when the follower's initial position was placed 100 m behind the leader ( Figure 10). During trials, two and three, the follower's initial position was set 200 m to the left of and to the right of the leader (Figures 11 and 12). The fourth test concerned the situation when the follower's initial position was in front of the leader with the two given opposite headings to provoke a potential collision (Figures 13 and 14). During all tests vector R was measured and presented to confirm the quality of the formation flight control system.

Circle Path Following Tests
The second portion of simulation tests was associated with following a circular path. The first loitering trial concerned a situation where the follower had to fly behind the leader at a distance of 30 m as well as 15 m to its left. Initial headings of the leader and the follower were the same and were equal to 0 rad. The leader's initial position was in front of the follower. Figure 15 shows the paths of the leader and the follower during trial 5. To show the quality of formation flight control, the length of vector R has also been presented. Test 5 concerned a case when the follower's initial position was behind the leader (with both having the same initial headings). The follower's behavior could easily be predicted-the follower caught up with the leader and then fell into the desired position.
Test number 6 concerned a situation when the leader's initial position was behind the follower (with both having the same desired separation distance). Results of this attempt are shown in Figure 16. The follower's heading is determined by an electric vector field generated by a virtual electric dipole (see Figure 8), so at the beginning, the follower turned left, next it made a circle and settled behind the leader in the desired position. This behavior is consistent with one's intuition. Test number 7 presented a case where the leader's and follower's initial headings were opposite. Figures 17 and 18 show the results of this test. In this case, the follower's behavior is similar to test 6-the follower first turned left and next made a circle. For the circle trajectory following, an additional test (number 8) was performed in which the desired altitude of the leader and follower were different, while the follower follows the leader without position shifting respect the leader on the x-y plane. The results are presented in the form of a 3D trajectory and its projection on the x-y plane (Figure 19 as well as a time course of the R parameter ( Figure 20).     Simulation tests also verified the collision avoidance efficiency of the proposed algorithm. In Equation (17) the part related to the formation flight was turned off (V + = V − = 0). Only the component responsible for collision avoidance was left active. The leader and the follower were installed 100 m apart and given opposite headings (0 rad and π rad). Both UAVs had to follow the same straight line to create a likelihood of a collision situation. The results of this test have been presented in the Figures 13, 17 and 18. An analysis of the follower's trajectory shows no collision occurred. The follower deviated from its established path and avoided a collision with the second UAV. During the test, the R parameter value decreased to about 20 m indicating that distance as the closest proximity of the UAVs. Furthermore, this distance can be modified through parameter R C . The most convenient way to check the quality of the proposed algorithm is to determine some statistical parameters. For flight tests 1-7, the root mean square error (RMSE) and relative root mean square error (RRMSE ) between the desired and the real follower's position were determined. These indicators were calculated for the R parameter logged during 100 sec long simulations. For RMSE and RRMSE calculations, only the last 30sec of data were used to ensure that the transient process expired and both UAVs positions were set properly. Established indicators have been presented in Table 6. Concerning the existence of random wind, the accuracy of the MAV model, quality of the composed simulation system, and the leader's nonlinear motion (circular path following) an error of approximately 30 cm can be considered to be a satisfactory result. The influence of random wind and inaccuracies of GNSS measurements can also be observed in figures labeled as "parameter R during flight" where the parameter R performs small oscillations. Additionally, during the simulation tests, the impact of the communication delay between leader and follower was checked. During the straight-line path following the communication delay was changed from 0.1 s to 2.0 s and the RMSE and RRMSE were calculated from the last 30 s of 100 s long simulations (Table 7). It can be easily noticed that the RMSE and RRMSE parameters grow along with a rise in the time delay. In the case of the circle path following the communication delay over 2 s was a critical value and caused the follower not to reach its desired position behind the leader.

Conclusions
The paper presents a new method for controlling the formation flight of Unmanned Aerial Vehicles (UAVs). The control algorithm proposed within the work uses a virtual electric dipole field to determine a desired heading for the follower UAV. Furthermore, the manner of potential field generation provides protection from collisions during operations employing multiple UAVs. Simulation results presented in Chapter 4 are promising. A major advantage of using an electric field generated by a virtual electric dipole is its universality, reliability, and the fact that the follower's heading is determined directly and not as corrections from the controller. This new method eliminates the need for a mixed control strategy since it works correctly within the entire phase space of the leader-follower system. One disadvantage of the presented method might be the computational complexity of the control algorithm. However, it should be noted that the computational resources of UAVs are constantly growing, and small, lightweight, high-performance on-module computers with low power consumption are available. Yet another disadvantage of the proposed system is that the follower's velocity control strategy is different from its heading control. Achievement of a unified system for the control of the follower's heading and velocity will be the subject of further research. The authors also plan to expand research into systems with more than one follower. Possibilities for changing formation flight hierarchy (where the leader becomes the follower and the follower becomes the leader) may also become the focus of future studies. It is worth mentioning that the described algorithm was successfully verified during in-flight tests, the results of which will be presented in the following article.