Neural Network-PSO-based Velocity Control Algorithm for Landing UAVs on
  a Boat
Precise landing of Unmanned Aerial Vehicles (UAVs) onto moving platforms like
Autonomous Surface Vehicles (ASVs) is both important and challenging,
especially in GPS-denied environments, for collaborative navigation of
heterogeneous vehicles. UAVs need to land within a confined space onboard ASV
to get energy replenishment, while ASV is subject to translational and
rotational disturbances due to wind and water flow. Current solutions either
rely on high-level waypoint navigation, which struggles to robustly land on
varied-speed targets, or necessitate laborious manual tuning of controller
parameters, and expensive sensors for target localization. Therefore, we
propose an adaptive velocity control algorithm that leverages Particle Swarm
Optimization (PSO) and Neural Network (NN) to optimize PID parameters across
varying flight altitudes and distinct speeds of a moving boat. The cost
function of PSO includes the status change rates of UAV and proximity to the
target. The NN further interpolates the PSO-founded PID parameters. The
proposed method implemented on a water strider hexacopter design, not only
ensures accuracy but also increases robustness. Moreover, this NN-PSO can be
readily adapted to suit various mission requirements. Its ability to achieve
precise landings extends its applicability to scenarios, including but not
limited to rescue missions, package deliveries, and workspace inspections.
Li-Fan Wu, Zihan Wang, Mo Rastgaar, Nina Mahmoudian
# Neural Network-PSO-based Velocity Control Algorithm

###### Abstract

Precise landing of Unmanned Aerial Vehicles (UAVs) onto moving platforms like Autonomous Surface Vehicles (ASVs) is both important and challenging, especially in GPS-denied environments, for collaborative navigation of heterogeneous vehicles. UAVs need to land within a confined space onboard ASV to get energy replenishment, while ASV is subject to translational and rotational disturbances due to wind and water flow. Current solutions either rely on high-level waypoint navigation, which struggles to robustly land on varied-speed targets, or necessitate laborious manual tuning of controller parameters, and expensive sensors for target localization. Therefore, we propose an adaptive velocity control algorithm that leverages Particle Swarm Optimization (PSO) and Neural Network (NN) to optimize PID parameters across varying flight altitudes and distinct speeds of a moving boat. The cost function of PSO includes the status change rates of UAV and proximity to the target. The NN further interpolates the PSO-founded PID parameters. The proposed method implemented on a water strider hexacopter design, not only ensures accuracy but also increases robustness. Moreover, this NN-PSO can be readily adapted to suit various mission requirements. Its ability to achieve precise landings extends its applicability to scenarios, including but not limited to rescue missions, package deliveries, and workspace inspections. [Video]

 Aerial Systems: Perception and Autonomy; Machine Learning for Robot Control.

## I Introduction

Many researchers equip drones with expensive sensors like depth cameras, dual cameras [1, 2], LiDAR [3], or even high-cost IR-Lock sensors to deal with the difficulties of precise landing. Although these added sensors bring benefits to a more precise landing, their weight and power consumption can not be ignored due to the limited battery life of drones. In this work, the landing process only depends on a low-cost RGB camera to detect fiducial markers and estimate the landing target location, plus a distance sensor to detect the height of the target plane.

In addition, software algorithms have been developed for the precise landing of drones. Advances in drone state estimator and visual inertia odometry [4, 5, 6, 7] have significantly improved trajectory following accuracy and stability in waypoint navigation tasks. However, for safe and soft drone landing, regular aerial waypoint navigation may not be directly adapted due to the ground effect when the drone touches the landing platform. Besides, waypoint navigation dependency on drone odometry brings another source of error in localizing dynamic landing targets, compared to direct vision-driven velocity controller which does not focus on following certain trajectories when landing on a dynamic target. For example, when landing on a moving boat, forest canopies decrease the GPS accuracy. The sunlight reflection, shadow, and uneven and low-textured lake surface disturb the visual odometry positioning [8]. To ensure the robustness of landing in GPS-denied river environments, our work adopts an intermediate-level velocity controller.

To achieve a velocity controller for fast, stable, and accurate horizontal alignment with the landing target, many researchers investigate the fuzzy logic [9], interaction matrix [10, 11, 12], model prediction [13, 14] or the cascade method [15]. However, many of these approaches require either manual parameter tuning before deployment (For example, fine-tuning multi PID parameters for different heights [16]) or have requirements about the differentiability of the optimization function (such as adjusting PID values with exponential functions based on heuristic rules [17, 18, 19]).

To take into account both the accuracy and smoothness of drone landing with minimum human intervention and localization requirement, an adaptive velocity controller is proposed and optimized by NN-PSO algorithm. The controller includes variable PID parameters for different altitudes and boat speeds. Besides, an exponentially decaying function (_tanh_ in this work) is adopted to regulate z-direction velocity control for stable landing with braking effects [20, 21]. By taking advantage of PSO's exploration [22] and NN's expansion [23, 24], the method can keep the accuracy and greatly increase the training efficiency. Lastly, field experiments were conducted to test the sim-to-real transferability of the velocity controller that lands a hexacopter on a boat. The qualitative result verifies the precision and stability, even in windy conditions, of the NN-PSO-based velocity control algorithm. Low-cost dependent sensors and negligible parameter tuning effort from simulation training to real-world deployment reveal the wide range of applicability and simplicity of the proposed drone landing approach.

This paper is organized in the following way: Sec. II elaborates on the NN-PSO inputs, the cost function design, the adaptive velocity controller, target state estimation, and state machine. Sec. III presents the water strider drone design, the training process of PSO particles, the comparison of the constant PID and the adaptive PID controllers, the velocity ramp function effectiveness, the comparison of single and dual marker design, and the landing accuracy in different environments. The conclusions are given in Sec. IV.
## II Algorithm and Controller

This section first elaborates on the inputs, cost function design, and particle moving rule of the PSO algorithm. Second, the adaptive PID controller, the ramp function and _tanh_ function are adopted for three-dimensional speed control. Third, the inputs and outputs of the Neural Network are explained. Fourth, the state estimation error of the landing target is reduced by filtering. Fifth, the landing strategy, including three stages: Explore, Align, and Land, is depicted.

### _Particle Swarm Optimization_

PSO algorithm is a population-based optimization algorithm that is inspired by the behavior of social animals, such as birds and fish. With each particle being a set of parameters that needs to be optimized, PSO iteratively updates the velocity and position of the particles in the parameter search space to find the optimal solution. In this work, PSO helps optimize the parameters of the velocity controllers to ensure the accurate and stable landing of drones on the targets.

The proposed velocity controller includes proportional, integral, and derivative parameters for the horizontal alignment, and the scaled _tanh_ function for stable descending with brake. Thus, each particle includes five parameters.

\[X^{i}(t)=(K_{P}^{i}(t),K_{I}^{i}(t),K_{D}^{i}(t),\alpha^{i}(t),\beta^{i}(t)) \tag{1}\]

where the position of particle \(i\) at iteration \(t\) is denoted as \(X^{i}(t)\). \(K_{P}\), \(K_{I}\), and \(K_{D}\) represent the PID parameters of the drone's horizontal velocity controller. \(\alpha\) is the scale rate of the vertical velocity controller, and \(\beta\) is the ramp function time, which will be elaborated in Sec. II-B.

First, the basic optimization function is the horizontal distance between the target location and the final landing spot of the drone.

\[d=\sqrt{(x_{d}-x_{t})^{2}+(y_{d}-y_{t})^{2}} \tag{2}\]

\(x_{d}\) and \(y_{d}\) are the final position where the drone actually land, \(x_{t}\) and \(y_{t}\) are the position where the target is. Therefore, if \(d\) is very close to 0, it represents that the input, PID parameters, are suitable and help the drone land precisely.

Second, to optimize the vertical landing speed and ensure stability, the optimization function further includes time, velocity, acceleration, and the roll and pitch rate. The goal of the PSO is to find the minimum of the function.

\[F(X)=d+T+|\nu|+|a_{z}|+\sum\left|\dot{\phi}\right|+\sum\left|\dot{\theta}\right| \tag{3}\]

where \(T\) is the duration from when the drone hovers vertically over the target, to the drone landing on the surface. \(\nu\) and \(a_{z}\) are the z-directional velocity and acceleration at the moment when the drone reaches the surface. \(\dot{\phi}\) and \(\dot{\theta}\) are the x-axis and y-axis angular velocity, which represent the roll and pitch rate of the UAV.

Third, each particle \(i\) will update its own velocity vector \(V\) in every iteration \(t\). The velocity vector of particle \(i\) updates towards not only this particle's best parameter position but also the best global parameter position among all spread particles.

\[X^{i}(t+1)=X^{i}(t)+V^{i}(t+1) \tag{4}\]

\[V^{i}(t+1)=wV^{i}(t)+c_{1}r_{1}(bbest^{i}-X^{i}(t)) \tag{5}\] \[+c_{2}r_{2}(gbest-X^{i}(t))\]

where velocity vector at next iteration \(V^{i}(t+1)\) is the weighted sum of the current velocity vector \(V^{i}(t)\), vector to current particle's best parameter \(pbest^{i}\) and vector to the best parameter among all particles \(gbest\), with weights being \(w\), \(c_{1}\), and \(c_{2}\) respectively. Weight \(w\) acts as an inertia force to particles to avoid sudden parameter jump that jeopardizes convergence, weights \(c_{1}\), and \(c_{2}\) improve the chance of finding the global sub-optimal solution without being stuck in the local optimal region. \(r_{1}\) and \(r_{2}\) are random scalars ranging [0, 1). They add noise to the velocity vector magnitude to further increase the convergence rate [25].

Last, the PSO algorithm can efficiently explore the sub-optimal global solution. Every particle represents a set of PID parameters that govern the horizontal movements of a drone during a complete landing process. In each iteration, particles share information on costs according to Eqn. 3 and update their velocity vectors based on this collective knowledge. This approach makes the discovery of near-optimal velocity controller parameters possible with less than a hundred iterations in simulation. Besides, the hyper-parameters in Eqn. 5 can adopt task-independent empirical values with little manual tuning. Moreover, the optimization of the cost function can be easily customized without the need to consider its differentiability with respect to the parameter variables. This enables researchers to mainly focus on the parameter design of velocity controllers and task-dependent cost functions.

### _Adaptive Velocity Controller_

The PID controller is adopted for horizontal control, as the below equation:

\[v_{xy}=K_{P}*e+K_{I}*(I_{e}+e*T)+K_{D}*\frac{e-e^{\prime}}{T} \tag{6}\]

where \(K_{P}\) is the proportional term, \(K_{I}\) is the integral term, \(I_{e}\) is the accumulated error, \(K_{D}\) is the derivative term, \(e\) is the current error, \(e^{\prime}\) is the last error, and \(T\) is the sampling period, which is 0.05 sec in this experiment.

To optimize the landing stability and time spent, the vertical velocity controller adopts the _tanh_ function, which can make the drone descend fast at high altitudes and slow down at low altitudes.

\[v_{z}=\frac{v_{max}}{2}(\tanh{(\alpha h-3)}+1)+v_{min} \tag{7}\]

where the scaling parameter \(\alpha\) can be optimized to change the slope of \(v_{z}\) to exponentially regulate drone descending velocity at various altitudes in Fig. 1. \(h\) is the real-time height in meters measured by the range sensor. \(v_{max}\) and \(v_{min}\) are the maximum and minimum vertical velocity. The constants in the equation is for shifting the tanh function
towards within the bounds of positive \(v_{max}\) and \(v_{min}\) values. To track a moving boat effectively, a ramp velocity function is implemented to work in tandem with the PID controller during the Align stage. This harmonious integration enables the drone to gradually increase its velocity in a smooth manner. Maintaining a stable acceleration profile allows to reduce oscillations and maintain steady roll and pitch angles, which are instrumental in enhancing the accuracy of boat tracking by keeping it within the camera field of view.

\[\begin{split} v_{r}=f(v_{xy},\beta)=\\ \begin{cases}v_{r}+\lambda&\text{if $v_{xy}>v_{r}+\delta$ and $t< \beta$}\\ v_{r}-\lambda&\text{if $v_{xy}<v_{r}+\delta$ and $t<\beta$}\\ v_{xy}&\text{else}\end{cases}\end{split} \tag{8}\]

where \(v_{r}\) is the output velocity of the ramp function. \(\lambda\) is the desired acceleration. The velocity threshold \(\delta\) and the time threshold \(\beta\) decide whether to directly use the PID controller output \(v_{xy}\). When tracking a fast-moving target, the integrator requires more time (higher \(\beta\)) to eliminate steady-state error.

### _Neural Network_

As a drone transitions from higher to lower altitudes, its field of vision narrows, prompting the need for increased \(K_{p}\) values to enhance horizontal agility and target tracking. Moreover, the varying speed of a moving boat also requires different PID parameters for velocity compensation. The studies referenced in [16, 17, 18] underscore the critical relationship between flight altitudes and specific PID parameter adjustments. The application of a Neural Network serves to provide a more comprehensive solution for adapting PID parameters across various scenarios, effectively reducing the reliance on an extensive number of PSO training cases.

The initial phase involves training the neural network using a flexible dataset of 25 data points, which can be tailored to user requirements. This dataset includes flight height and boat velocity as inputs, while PID parameters and the ramp function time \(\beta\) serve as the corresponding outputs.

These 25 training data points represent the outcomes produced by PSO, covering a range of five distinct flight altitudes and five different boat speeds. To provide context, the maximum observable height of the drone is limited to 5 m and the altitude of the landing platform on the boat is about 1.25 m. The maximum speed of the boat is 2.9 m/s. Accordingly, the five flight altitudes are set between 1.3 and 5 m, while boat speeds span from 0 to 2.9 m/s.

Leveraging the interpolation capabilities of the Neural Network, we can construct a dynamic PID controller that adapts seamlessly to varying heights and boat speeds. During field tests, the drone can readily utilize this Neural Network by inputting observed boat velocities, allowing it to adjust PID parameters in real-time according to its current altitude. This process is visualized in Fig. 2.

### _Target State Estimation_

Drones typically utilize pitch or roll angles to adjust flight direction, which in turn affects the camera orientation on the drone. To correct for this observational error, transformation matrices are employed to rotate coordinates.

\[P_{\text{body}}=T_{\text{body\_world}}T_{\text{world\_cam}}P_{\text{cam}}=T_{ \text{body\_cam}}P_{\text{cam}} \tag{9}\]

where real-time roll (\(\phi\)) and pitch (\(\theta\)) angles of the drone can be directly obtained from the IMU sensor. When projecting the target position onto the camera frame, only \(R_{x}\) and \(R_{y}\) are needed, so the yaw (\(\psi\)) angle is set as 0. Last, the movement of the target in the drone body frame, divided by the time can derive the velocity estimation:

\[\overrightarrow{x(t)}=(\sum_{k=t-n}^{t}\frac{\Delta x(k)}{T_{s}})/n \tag{10}\]

where a filter samples and averages \(n\) velocities to reduce errors, with \(x\) representing the position of the boat in the drone body frame and \(T_{s}\) denoting the sampling time, which dynamically adjusts while adhering to an outlier threshold, because, during field tests, variations in the on-board computer computational load impact the camera sampling rate.

### _Landing Strategy_

To ensure comprehensive coverage of various scenarios, such as missing targets and targets with varying speeds, multiple events have been integrated into the system to enhance its robustness. The mission consists of three main stages: exploration, alignment, and landing. Fig. 3 illustrates these stages along with their corresponding trigger conditions.

Fig. 1: From Align to Land stage, velocity controllers change

Fig. 2: The system overview: Yellow blocks are the controllers; Green blocks are sensor modules; and the blue blocks represent software design. The communication between modules is through ROS.
## III Results and Analysis

This section details the training and validation processes of the velocity controller for drone landing in simulation, the real-world tests of the trained controller, as well as the results and their analysis.

### _Water Strider Design_

The hexacopter is inspired by water striders, featuring four legs to handle challenging scenarios like landing on a moving boat and emergency lake landings. Fig. 4 provides an overview of the autonomous drone equipped with (a) Pixhawk4 FMUv5, (b) Jetson TX1 running Ubuntu 18.04 with ROS Melodic, (c) GPS, (d) AWC201-B RGB webcam, and (e) LiDAR-Lite v3 distance sensor. Separate batteries (11.1V Li-Po) power Pixhawk4 and six 960 KV motors. To ensure smooth operations, the distance sensor is wired with a capacitor to prevent voltage fluctuations and communicates with Pixhawk through the I2C protocol. Additionally, (f) 2.4GHz and 5GHz WiFi antennas are integrated into Jetson TX1 for wireless SSH access and off-board control. Other components include (g) Holybro Radio Telemetry and FrSky X8R Telemetry systems facilitate communication with QGroundcontrol and an RC transmitter, allowing manual flight mode. Three ABS elastic ribs, shown in (h) side view and (i) front view, are strategically positioned to safeguard the computer and controllers. Each water strider-inspired leg, composed of (j) the upper part connecting to the base and (k) the lower part outfitted with two 330 ml bottles for added buoyancy, ensures stability during landings. The total weight is approximately 2.4 kg.

### _Training and Validation of the NN-PSO_

To train the velocity controller using the PSO algorithm, a five-particle configuration is utilized to strike a balance between training efficiency and optimal solution attainment. In the initialization phase of the velocity controller parameters, namely \(K_{P}\), \(K_{I}\), \(K_{D}\), \(\alpha\), and \(\beta\) in Eqn. 1, we employed randomization within predefined ranges: [0, 2) for \(K_{P}\), [0, 1) for \(K_{I}\), [0, 1) for \(K_{D}\), and [0, 3) for both \(\alpha\) and \(\beta\). For the validation of the controller performance of UAV landing on a moving ASV in the same simulated environment, Gazebo is adopted and includes the river environment with a differential-driven WAM-V boat from [26], a simulated hex-rotor firefly [27], and a Iris drone to take off and land on the boat. To achieve robust controller parameters, the training sessions are separately conducted for descending and horizontal tracking. The descending motion, potentially conflicting with tracking during PSO training, allows the drone to land quickly for higher rewards instead of stable, extended tracking.

In the left Fig. 5, the trajectories of the five particles converge towards optimal descending parameters. These trajectories document the adjustments made to \(K_{P}\), \(K_{I}\), \(K_{D}\), and \(\alpha\). Notably, the cost of the best particle drops rapidly within the initial 20 iterations, indicating the swift convergence of the PSO algorithm towards optimal values. Subsequently, by sharing costs, all particles gradually converge towards a global sub-optimal solution, resulting in closely aligned optimized parameters among all particles.

After 100 iterations of PSO training, utilizing the best PID parameters (\(K_{P}=1.565\), \(K_{I}=0.121\), and \(K_{D}=0.245\)) at that moment, the horizontal distance error between the landed drone and the target spot is reduced to a mere 0.0026 meters within the training simulation environment. In comparison to the default Pixhawk AutoLand Mode, descending from the same height results in a significant reduction in landing time, from 18.62 to 3.21 seconds, while the vertical velocity \(\nu\) decreases from -0.3041 to 0.002 m/s. Additionally, the vertical acceleration \(a_{z}\) experiences a negligible increase, from 9.817 to 9.821 \(\mathrm{m/s^{2}}\) (including gravitational acceleration). This indicates that the drone can land quickly without bouncing upon contact with the surface of a boat.

The right Fig. 5 shows the trajectories of the five particles moving close to the optimized horizontal tracking parame

Fig. 4: The hexacopter schematics, water strider design, and the boat in the experiments.

Fig. 3: The flowchart of the landing strategy
ters. These trajectories document the adjustments made to \(K_{P}\), \(K_{I}\), \(K_{D}\), and \(\beta\). The PSO algorithm separately optimized these parameters at five different heights and positions, which are marked in yellow in Tab. I. Subsequently, the trained neural network model predicts continuous parameters for altitudes from 1.5 to 5 m and velocity from 0.6 to 2.3 m/s.

### _Adaptive PID controller_

The Adaptive PID controller exhibits an impressive maximum tracking speed of 8.9 m/s (target speed) when deployed on the Iris drone, which itself can reach a top speed of 11 m/s. Thus, the maximum landing speed achieved with this controller reaches 80.9% of the drone maximum flight speed (the target size in the experiment is 1x1 m).

In Fig. 6, the 3D and 2D trajectories of the flight, along with target velocity estimation, are depicted. At the 9-second mark in the velocity plot, the drone velocity measurement is sufficiently accurate, serving as input for the neural network in the proposed landing strategy.

In comparison, the Visual Odometry Tracking [1] exhibits a maximum tracking speed of 4.2 m/s in simulation scenarios. When deployed on the DJI F450 drone, which itself can reach a top speed of 36.1 m/s, its controllers' tracking capability is far from the hardware limit. The target landing platform size in their experiment is 1.5x1.5 m. The maximum landing speed is about 11.6% of the drone's maximum flying speed. Hence, the utilization of the NN-PSO algorithm in conjunction with the adaptive PID controller streamlines testing and exploration, allowing us to approach the landing speed near the maximum flight speed more efficiently.

Many studies [16, 17] have demonstrated that the height-adaptive PID controller outperforms its constant counterpart. To further substantiate this theory and validate the superior performance of our Adaptive PID controller, a comparative analysis involving two constant PID controllers is executed. These two PID controllers were fine-tuned using PSO at both low and high altitudes, serving as benchmarks. The descent speed remained constant, allowing ample time for observing the controllers' performance. Furthermore, the boat's variable speed, as opposed to a constant speed, enabled a comprehensive evaluation of the PID controllers' tracking capabilities. In Fig. 7, the fourth column illustrates that the adaptive PID controller excels in both tracking ability and boat velocity estimation, attributed to its stable flight performance.

### _Ramp Function Effectiveness Assessment_

The ramp function can gradually increase the drone's speed, maintains camera stability, ensures the target remains in view, and allows the integrator to proactively contribute. Once the ramp function phase concludes, the PID controller takes over, with its integrator finalizing velocity compensation. The accompanying Fig. 8 illustrates the impact of varying ramp function duration. If the duration is too brief or omitted altogether, the drone may exhibit an initial over-reaction and miss the target. Especially when the marker initially appears at the edge of the drone camera's field of view, large estimated distance typically generates substantial rush. Conversely, if the duration is excessively prolonged, the drone may struggle to land accurately during descent. By employing an appropriately timed ramp function, the drone can effectively track and execute a successful landing.

### _Dual Marker Performance Evaluation_

In the context of tracking landing targets, ARTag [28, 29, 30] markers, known for their binary square fiducial properties, offer a swift and robust solution for 3D camera pose estimation. In our experimental setups, the Dual Marker is designed and attached on the boat to facilitate low-altitude target tracking and delicate flight maneuvers. The Dual Marker comprises two ARTags, one measuring 5.5x5.5 cm and the other 16x16 cm, positioned 1 cm apart. To further validate the effectiveness of the Dual Marker, we conducted tests using a circularly moving boat scenario in Fig. 9, and the data is recorded in Tab. II. Under identical conditions, including the same PID settings and velocity limitations, the Dual Marker design significantly improves the drone's landing precision during simultaneous forward movement and descent, thereby reducing landing position errors compared to using a single marker. In summary, transitioning to the smaller marker when descending proves instrumental in helping the drone overcome the limited field of vision at low altitudes.

### _Field Test_

The field tests demonstrate precise landing capabilities in both static and dynamic scenarios, as visualized in Fig. 10.

## IV Conclusions

The Neural Network-PSO-based velocity control algorithm enables autonomous landing of the drone on a moving boat, using only onboard sensing and computing, eliminating

\begin{table}
\begin{tabular}{l|c|c|c|c|c} \hline (**Nip, K, K, K, \(\beta\))** & **Vinberg-0.6 (\(\alpha\))** & **Vinberg-1.0 (\(\beta\))** & **Vinberg-1.5 (\(\beta\))** & **Vinberg-2.0 (\(\alpha\))** & **Vinberg-2.0 (\(\beta\))** \\ \hline \hline
**Robag 1.5 (\(\beta\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** \\ \hline \hline
**Robag 2.0 (\(\beta\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** \\ \hline \hline
**Robag 3.0 (\(\beta\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** \\ \hline
**Robag 4.0 (\(\beta\))** & **0.5000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** \\ \hline \hline
**Robag 5.0 (\(\beta\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** & **0.50000** (\(\alpha\))** \\ \hline \hline \end{tabular}
\end{table} TABLE I: The yellow blocks are the outputs of the PSO, and the other blocks are the result of the Neural Network.

Fig. 5: PID gains, \(\alpha\) and \(\beta\) value of the five particles. The cost function trajectory of the best particle across all iterations during PSO training.
the need for external infrastructure like visual odometry or GPS. The approach doesn't require prior information about the boat's location. To further increase robustness, the adaptive PID controller is designed and NN-PSO trained for variable speeds and altitudes. This algorithm includes features like a ramp function for keeping targets in vision, a tanh function for landing softly, multi-sensor fusion for relative UAV localization and boat velocity estimation. By achieving more stable flight velocity, the drone can autonomously track and land on a boat. This framework is validated through both simulation and real-world experiments.

\begin{table}
\begin{tabular}{c|c|c} \hline Error (m) & Single Marker & Dual Marker \\ \hline
**Static** & 0.113 & 0.012 \\ \hline
**Linear movement** & speed 0.1 m/s & 0.0929 & 0.0558 \\ speed 0.2 m/s & 0.0881 & 0.0117 \\ speed 0.4 m/s & fail & 0.2497 \\ \hline
**Circular movement** & & \\
**with x-speed 0.1 m/s** & & \\
**speed 0.1 rad/s** & 0.1539 & 0.0781 \\ speed 0.2 rad/s & 0.1708 & 0.1162 \\ speed 0.3 rad/s & 0.3268 & 0.2082 \\ speed 0.4 rad/s & fail & 0.2130 \\ \hline \end{tabular}
\end{table} TABLE II: The distance error of the drone landing on the boat with different moving patterns

Fig. 8: The results of ramp function duration comparison experiments. The appropriate 2.15 sec ramp function in 4th column, can help the drone effectively decrease oscillation and successfully track the target.

Fig. 10: Visual-based Drone Landing with Neural Network-PSO-based Velocity Control Algorithm

Fig. 6: The simulation result: Iris drone can land on a boat that moves at a speed of 8.9 m/s.

Fig. 7: The results of constant and Adaptive PID comparison experiments.

Fig. 9: The circularly moving boat and the real dual marker.