Adaptive algorithm for mobile robot movement control

The paper reviews the goal of controlling mobile robot movement along the planned path. It proposes an adaptive robot movement control algorithm, allowing to increase the precision of holding the robot within the prescribed path under the conditions of unstable navigation field. The adaptation of the algorithm to jamming environment is in redistributing weights of the weighted sum of estimates given by the ultrasound navigation system (USNS) and wheel pulse transducers (WPT). When precision of the USNS reduces affect of the WPT on the final estimate increases while affect of the USNS decreases. Such a redistribution is carried out when the system is operating due to changing elements of a measurement noise matrix in Kalman filter [1] with use of which a mobile robot heading angle is estimated. Corresponding elements of the measurement noise matrix increase along with increase of deviation of the mobile robot trajectory from a straight line. The extent of deviation calculated as the standard error of a regression is defined by means of the statistical analyses involving the last n measurements contained in buffer store of the USNS. The obtained results demonstrate significant benefit of the developed mobile robot heading estimation algorithm in comparison with the conventional filtering algorithm basing on using the classical Kalman filter with the measurement noise matrix whose elements are fixed.

Introduction
One of the crucial directions for enhancing social robotic technologies is the development of autonomous robots, serving as human assistants. Autonomous robots shall plan the route and independently follow the preplanned route in accordance with their tasks to be fulfilled [2,3]. As a rule, a preplanned route is composed of direct line segments. Therefore, the primary task of a mobile robot (MR) control algorithm is to ensure MR movement from one route point to another with the prescribed speed and minimum deviation from the direct line, connecting such points.

Mobile robot control algorithm
By now time a great variety of algorithms based on self-training has been developed [4][5][6][7][8].
However most of such algorithms require to use substantial computational resources. The algorithm proposed below is simple enough and undemanding to controller characteristics but at the same time it permits to control a mobile platform with high quality in conditions of an unstable navigation field.
For guiding the mobile robot (MR) to the assigned point (target), the angular misalignment value dΨ is used (refer to figure 1) The direction to the target is defined as follows: where is the distance to the target. The MR coordinates (X(t) and Y (t)) are measured by the ultrasound navigation system (USNS) with sufficient precision (the average error equals to 2-3 cm) provided there are no severe interferences. When the distances to the target are relatively large (several meters), the error in determining the direction towards the target does not exceed 0.01 rad; however, it increases with the MR approaching the target. MR heading angle is defined based on the data, containing MR coordinates in two points (points 1 and 2 in figure 1) where S is linear distance between the coordinates, used for heading calculation The precision of heading calculation significantly depends on the length of S segment. The issue is further aggravated by the fact that within T v time interval, the robot does not follow a straight line (refer to figure 1). In this case, the actual MR heading can substantially differ from the one, determined using equation (4). Therefore, the error in defining heading Ψ constitutes the primary factor, determining the dΨ (1) calculation error.
To increase the precision of MR heading determination, it is necessary to use additional navigational data, which can be obtained, for example, from wheel pulse transducers (WPT), measuring the angular velocity of MR wheels. The measured angular velocity is used for identifying variations in MR heading. The final heading estimate shall be the weighted total of The adjustment based on the interference level is performed be redistributing the weighting coefficients within the weighted total. When the USNS precision drops, the impact of WPTs on the final weighted estimate shall increase, and the impact of USNS shall decrease. The most common algorithm, allowing to fulfill this task, is the Kalman filter [1].

Adaptive algorithm for mobile robot heading estimation
The diagram of the developed mobile robot heading estimation algorithm is provided in figure 2. The estimation of speed vector direction (MR heading) is performed using the linear Kalman filter (KF) [1]. For defining the heading variation dynamics, the following simplest model is used: where Ψ-is heading; ω-angular mobile platform (MP) rotation rate relative to the vertical axis; w-flat noise with prescribed intensity and zero expected value. Z measurement vector contains two items: where v are flat noises with prescribed intensity and zero expected value. Heading Ψ is not measured directly. USNS is used to measure MP coordinates at a certain time point t: X(t) and Y (t). The measured coordinates are stored in FIFO type buffer memory. The memory size allows keeping the measurements, obtained during a certain preceding period (approximately 1 sec). With the measurement cycle of 0.2 sec, the latest five measured coordinate values are stored. Then, two coordinate pairs are taken: X(t), Y (t), which are the latest measured coordinates (the 1 st pair), and X(t − T v ), Y (t − T v ), which are the coordinates, preceding the current ones by a certain period T v (the 2 nd pair).
The "measured" heading value z 1 is determined as follows: where S is linear distance between the coordinates, used for heading calculation (11) z 2 is the "measured" MP angular velocity relative to the vertical axis, which is also not measured directly, but determined as follows: where V 1 = W 1 /R is linear velocity of the left wheel rim; V 2 = W 2 /R is linear velocity of the right wheel rim; W 1 , W 2 are MP wheel rotation rates (measured using wheel pulse transducers); R is wheel radius; L is distance between MP wheels. The algorithm adaptivity is achieved by modifying the R(1, 1) factor of the measurement noise covariation matrix, included into the Kalman filter algorithm [1]. An increase in this factor results in a decreased weight of the USNS measurements in the total heading estimate. A decrease in R(1, 1) value leads to a reduction in the weight of measurements, obtained from the pulse transducers R(1, 1) = K r · E L ; (13) K r coefficient is selected empirically. E L is an estimate of the mobile platform deviation from a straight line. E L value can be determined by statistically processing the last n measurements, stored in the USNS measurement buffer memory, as the standard error of the following linear regression equation: where is the coordinate, calculated by the regression equation.
In another alternative, which is easier for implementation, the MP path deviation from a straight line is found as the modulus of MP measured angular velocity relative to the vertical axis (13):

Simulation results
The modeling of the proposed adaptive algorithm for estimating MP coordinates was carried out using "MatLab-Simulink" system. The generalized simulation results are presented in figures 3 and 4. Figure 3 shows the dependency of the MP heading angle estimation accuracy on the value of its path deviation from a straight line. The angular MP velocity relative to its degrees) vertical axis is used as a parameter, indicating the deviation value.   The provided results evidently demonstrate that the adaptive algorithm has a significant advantage over the traditional one. The reason is that to prevent the divergence of the Kalman filter in case of a significant curvature of the MP path, the traditional algorithm requires setting relatively large values of the measurement noise intensity R(1, 1). On the other hand, the use of the adaptive algorithm allows keeping the R(1, 1) value relatively small for small path curvature levels, which significantly increases the accuracy of the heading angle estimation.

Conclusions
The implementation of the defined algorithm resulted in the development of a concise software code, occupying approximately 5 KB of the controller memory and having the processing speed of 0.01 sec per 1 filtering cycle (for Arduino UNO controller).
The algorithm testing demonstrated that with the root-mean-square deviation of the calculated heading equal to 10 angular degrees, root-mean-square deviation of MP angular rotation rate equal to 1 deg/sec, and MP turning rate of 20 deg/sec, the heading estimate error is reduced to a value below one angular degree within a few seconds of filtering.


extfieldsofstudy:
Computer Science
Mathematics

text:
RISe of Flight: RIS-Empowered UAV Communications for Robust and Reliable Air-to-Ground Networks

Next generation mobile networks need to expand towards uncharted territories in order to enable the digital transformation of society. In this context, aerial devices such as unmanned aerial vehicles (UAVs) are expected to address this gap in hard-to-reach locations. However, limited battery-life is an obstacle for the successful spread of such solutions. Reconfigurable intelligent surfaces (RISs) represent a promising solution addressing this challenge since on-board passive and lightweight controllable devices can efficiently reflect the signal propagation from the ground BSs towards specific target areas. In this paper, we focus on air-to-ground networks where UAVs equipped with RIS can fly over selected areas to provide connectivity. In particular, we study how to optimally compensate flight effects and propose RiFe as well as its practical implementation Fair-RiFe that automatically configure RIS parameters accounting for undesired UAV oscillations due to adverse atmospheric conditions. Our results show that both algorithms provide robustness and reliability while outperforming state-of-the-art solutions in the multiple conditions studied.

I. INTRODUCTION
Unmanned aerial vehicles (UAVs) 1 are increasingly becoming part of our lives by enhancing how we work, e.g., package delivery, how we entertain ourselves and how we extend the safety and security of our society. Li-ion batteries have already reached a mature state thereby allowing limited-size devices to fly towards hard-to-reach locations in very short time [1], [2]. Recently, the telecom industry and academia made a big effort in bringing flexibility and agility to advanced wireless networks that rely on flying access points [3], namely airto-ground networks. UAVs have demonstrated to be suitable for readily establishing a line-of-sight (LoS) link towards ground users thereby avoiding obstacles that impair the overall communication quality [4], [5]. Dense-urban scenarios further exacerbate the obstruction issues making UAVs a viable solution for building reliable networks on-demand.
Due to their fast-deployment property, UAVs have been identified as a key technology to deal with emergency situations so as to expedite rescue operations, e.g., assisting first-responder teams, in areas where there might not be connectivity or when the network infrastructure is temporarily damaged or unavailable [6]. Interestingly, UAVs are proposed to bring back-up connectivity in such areas and/or leverage on advanced sensing and localization techniques exploiting the cellular protocol stack to find missing people [7]. However, since they are envisioned as flying mobile base stations (BSs) carrying one or more active antennas, a significant increase of the total power consumption and, in turn, battery drain issues are expected due to i) the weight of active elements, ii) the Manuscript received xxx XX, xxx; revised XXX xx, xx; accepted XXX x, xxx.
X. Costa-Perez is with NEC Laboratories Europe GmbH, Heidelberg, Germany, and i2CAT Foundation and ICREA, Barcelona, Spain (e-mail: xavier.costa@neclab.eu). 1 The terms UAV and drone are used interchangeably throughout the paper. power irradiated to reach ground targets and iii) the additional power burden required to establish a backhaul link and process incoming packets. To overcome the above-mentioned issues, lightweight and low-energy equipment is needed on board. In this context, reconfigurable intelligent surfaces (RISs) are currently gaining much attention owing to their ability to control the propagation environment by altering reflection, absorption and amplitude properties of the material where the signal bounces off [8]- [11]. This introduces a new powerful tool that allows to efficiently redirect the signal propagation at very limited power expense: varactor diodes can apply a phase shift and/or absorb the incoming signal in a real-time reconfigurable way. Passive, flexible and configurable elements match a variety of envisioned applications spanning among electromagnetic field exposure efficiency (EMFEE)-boosted communications, extreme-accurate localization mechanisms and user-centric quality-of-service-enhanced connections [12].
As depicted in Fig. 1, conventional UAV-based systems may be combined with comfortably sized RISs to effectively reflect incoming signal towards hard-to-reach locations while keeping the power consumption very low [13], [14]. While appropriate RIS modeling assumes the location of transmitters, receivers and RIS to be known, the high mobility property of UAVs introduces unprecedented random variables in such a complex analysis. Interestingly, [15] discusses design challenges of UAV-mounted RIS-assisted terrestrial communication. Indeed, the overall communication performance may be negatively affected when small variations of the orientation of the RIS and/or its position occur. Sophisticated sensors system and GPS antennas are built to keep the drone stable and its location fixed while hovering on selected areas: when adverse meteorological conditions strike, drone movement counteractions are automatically taken but still orientation oscillations or location perturbation may result in an instantaneously-wrong RIS configuration.
In this paper, we focus on the above-mentioned scenario where UAVs are provided with passive RISs to support first responder teams in selected target areas. Our solution, namely RiFe, takes into account the statistical properties of unwanted UAV oscillations due to meteorological phenomena while optimizing RIS parameters such as phase shift and reflection coefficient. To the best of our knowledge, RiFe is the first of its kind tackling such undesired oscillations while steering signal reflections to build a robust and reliable air-to-ground network solution.

A. Contributions
The main novelty of this paper stems from the design of an optimization framework that addresses undesired UAV oscillations-caused by meteorological phenomena-which exacerbates when high altitudes are considered. This is in marked contrast with prior works that usually assume a perfectly stable flight. Since UAV flight perturbations are always present and inevitable in real-life situations, our solution RiFe, aims at maximizing the worst SNR averaged over the unwanted perturbations on the UAV in a target area wherein a number of receivers is present. RiFe is based solely on second-order statistics of said perturbations and of the position of the receivers. Thus, an advantage of such approach is the reduction in the overhead necessary to acquire instantaneous channel information.
In addition to the optimization framework, we extend RiFe to account for practical considerations such as the need to update the RIS parameters due to rapidly-changing channel statistics, the mobility of the UAV as well as complexity issues and rename it as Fair-RiFe. Our numerical results show, as expected, that our approach outperforms state-of-the-art solutions which assume perfectly stable flights. Indeed, our solution results in a considerably higher received SNR at target locations due to more robust passive beamforming at the RIS. The main four contributions of this paper are thus summarized in the following. C1: A novel mathematical framework to maximize the worst SNR within a given target area by taking into account unwanted rotations on the position of the surface of the RIS due to flight perturbations.
C2: A low-complexity approach RiFe that tackles the solution of the aforementioned problem by designing both the precoding vector at the BS and the adequate RIS configuration. C3: An easy-to-develop solution Fair-RiFe that accounts for practical considerations such as time and/or complexity constraints on the optimization routine and reconfiguration of the RIS. C4: Exhaustive numerical results that show substantial gains in terms of received average SNR at the target locations with respect to state-of-the-art solutions. The remainder of this paper is structured as follows. In Section II we review the state of the art when integrating RISs in UAV-based communications and highlight the differences with respect to our proposed approach. Section III introduces the system model and defines the key physical quantities of interest. In Section IV we give the problem formulation to optimize the considered metric and propose RiFe to tackle its solution. In Section V we propose Fair-RiFe, which takes into account practical considerations such as timing constraints and UAV mobility. Section VI presents numerical results to evaluate the performance of the proposed algorithms. Lastly, Section VII concludes the paper.

B. Notation
We use italic letters to denote scalars, whereas vectors and matrices are denoted by bold-face lower-case and upper-case letters, respectively. We let C and R denote the set of complex and real numbers, respectively. We use C N and C N ×M to represent the sets of N -dimensional complex vectors and N × M complex matrices, respectively. I N stands for the identity matrix of size N while j represents the imaginary index. Vectors are denoted by default as column vectors while subscripts represent an element in a vector. For instance, x = [x 1 , . . . , x n ] T is a vector from C N and x i is its ith component. The symbols (·) T , E[·], (·) * , tr(·) and (·) H represent the transpose, expectation, complex conjugate, trace, and Hermitian transpose operator, respectively. · denotes the L2-norm of a vector. Lastly, |·| and ∠· denote the absolute value and angle of a complex number, respectively.

II. RELATED WORK
Air-to-ground (A2G) communication has been recently promoted as an upcoming technology to deliver advanced and sophisticated services. In [16], the authors introduce effective A2G channel models while empirically validating them via realistic measurements. In particular, A2G can be implemented to support vehicular-based use-cases [17] or to assist emergency communication [18]. In both, the authors propose an optimization-based approach to maximize the enduser coverage during the UAV flight.
Recently, an integration of RIS in UAV-based communications has been proposed as a means to enhance the performance of air-to-ground networks (see, e.g., [19], [20] and references therein). In [21], the authors propose to use a RIS to increase the power of the received signal at the UAV. However, this approach has the limitation of requiring both the UAV and the user to lie on the same side with respect to the RIS [22].
Hence, a more feasible solution is to install a lightweight RIS on board the UAV. In this regard, several works have investigated the joint UAV trajectory and RIS parameters optimization problem [23]- [27]. In [23] the authors propose to employ a reinforcement learning approach based on Qlearning and neural networks to optimize both the trajectory of the UAV so as to maintain a LoS link with the ground user, and the RIS parameters to maximize the downlink transmission capacity. In [24] the authors tackle the maximization of the secure energy efficiency of the system via joint optimization of the trajectory of the UAV, the phase shifts at the RIS, the user association and transmit power by means of successive convex approximation.
A similar technique is also used in [25] to maximize the achievable rate of a single ground user. In [26], [27] the authors consider the problem of maximizing the worst SNR in a given target area to be covered by the BS by proper choice of the RIS configuration and placement of the aerial platform. The resulting non-convex problem is solved by decoupling the optimization in maximizing the worst-case array gain to find the RIS configuration, and balancing the resulting angular span and path loss of the equivalent downlink channel to find the placement of the aerial platform.
However, existing works assume for simplicity that aerial platforms (e.g., UAV or HAP) has a perfectly stable flight. Inspired by real-life scenarios, in this paper we consider the case where the UAV is subject to perturbations due to meteorological phenomena. Specifically, we pioneer a mathematical framework that takes into account undesired perturbations while continuously configuring the on-board RIS to pursue the overall performance maximization in terms of fairness within a target area and minimum experienced SNR.

III. SYSTEM MODEL
We describe hereafter the adopted system model whose geometrical representation is depicted in Fig. 2. We consider a base station (BS), or general transmitter, located at the origin and equipped with M antennas whose signal shall cover a target area A wherein first responders and/or victims are present. Moreover, we consider a RIS mounted on a UAV, composed of N reflecting elements and reflecting the signal coming from the BS towards the target area. Specifically, each aforementioned receiver shall be reached by a signal experiencing a minimum SNR to successfully decode the upcoming packets. We assume that the position of the first responder team is known with some uncertainty, whereas only a probability distribution function (pdf) of the spatial position of the victims is known.
Considering that the UAV is hovering, it might be subject to perturbations due to the wind or other meteorological phenomena, which result in undesired roll, yaw and pitch of the surface of the RIS. Let q = [q x , q y , q z ] T denote the position of the center of the RIS and φ R and θ R denote the azimuth and elevation angles of the geographical path connecting the BS to the RIS, respectively. Hence, the coordinates of q can be expressed as q q y = q cos(θ R ) sin(φ R ), and q z = q sin(θ R ), respectively. Furthermore, let r = [ψ x , ψ y , ψ z ] T , which takes into account the possible perturbations on the orientation of the surface of the RIS, where the random variables (RVs) ψ x , ψ y , and ψ z represent the rotations on the x, y, and z axes, respectively.
We assume that such rotations are mutually independent and normally distributed with zero mean and variance σ 2 ψ,x , σ 2 ψ,y , and σ 2 ψ,z , respectively. We further assume that the BS has the perfect knowledge of the statistics of r. Let w = [w x , w y , w z ] T ∈ A-distributed according to a given probability density function expressed as per f (w)-be a point in the target area to be covered and let φ T and θ T denote the corresponding azimuth and elevation angles with respect to the RIS, respectively. The coordinates of w can thus be expressed as w x = w cos(θ T ) cos(φ T ), w y = w cos(θ T ) sin(φ T ), and w z = w sin(θ T ), respectively. Note that in the case of first responder team, we model f w (w) as the union of twodimensional Gaussian distributions whose means correspond to the nominal positions of each first responder member and with given variances along each direction. Conversely, when considering victims f w (w) can be modeled again as a twodimensional Gaussian distribution with mean equal to the center of the target area and with given variances along the two directions in space. If both first responder team and victims are present then f w (w) is modeled as the union of the two aforementioned cases.
The distance between the source node and the RIS is defined as the following whereas the distance between the RIS and the target position w is defined as the following Hence, the overall length of the communication path is equal to d(q, w) = d 1 (q) + d 2 (q, w). Given the position of the RIS with respect to the BS and the target area A and the fact that we assume the drone to be maneuvered by first responder teams, the communication link between the BS and the RIS is assumed to be in line-of-sight (LoS) condition with a very high probability (see, e.g., [14], [25], [28]). Therefore, the channel power gain from the source to the RIS is defined as per where β 0 is the channel power gain at a reference distance. In a similar way, by adopting the one-ring channel model (see, e.g., [29]) we define the channel power gain between the RIS and the target point w as the following We consider a relative reference system Ω with origin in the right bottom corner of the RIS and with the (x, y)-plane lying on the RIS surface as shown in Fig. 2. The position of the i-th element of the RIS with respect to Ω is defined by the vector c The position of the i-th element of the RIS in the absolute coordinate system, which has the origin located at the BS, is thus expressed as where the rotation matrix R(r) ∈ R 3×3 takes into account the possible aforementioned rotations of the RIS with respect to the absolute reference system and it is defined as the following with the rotation matrices on the x, y, and z axes defined as and respectively. We assume that the drone is flying at an altitude such that the incoming signal can be considered as a plane wave 2 with propagation direction identified by k = q q . Hence, the phase 2 We consider the far-field beamforming case from the UAV equipped with a RIS and the ground. We refer the reader to [30] for more details.
shift on the i-th element of the RIS related to the incoming signal from the BS is defined as the following 3 where λ represents the signal wavelength, 0 is the zerovector of size 2 × 1, and where we have defined c (Ω) i , which is equal to the first two elements of c (Ω) i and the vector v R (q, r) that describes the spatial frequency on the surface of the RIS corresponding to the incoming signal from the BS. As expected, the phase shifts on the elements of the RIS depend on the undesired changes of the orientation of the UAV r. The elements of the receiving array response vector a R (q, r) ∈ C N ×1 at the RIS are thus expressed as In a similar way, the phase shift on the i-th element of the RIS and the corresponding value of the antenna array response when reflecting the signal towards the target point w are defined as the following and respectively, where we define the vector v T (q, r) that describes the spatial frequency on the surface of the RIS when reflecting the signal towards the target area. The random phase shifts φ R i and φ T i refer respectively to the incoming and departing wave with respect to the RIS surface. Interestingly, they need to be properly aligned by suitably adjusting the RIS parameters: the role of the RIS is to maximize the network performance while statistically counteracting the undesired rotations of the RIS surface r caused by perturbations.
We further define the channel between the BS and the RIS as the following where a BS is the antenna array response at the BS. The obtained channel between the RIS and the target position w is given by From Eqs. (17) and (18), we can write the receive signal at the intended location w as the following where v ∈ C M is the precoding vector at the BS, Θ = diag(α 1 e jθ1 , . . . , α N e jθ N ) represents the phase shifts (to be optimized) at the RIS with |α | 2 ≤ 1 and θ ∈ (0, 2π], ∀ . Furthermore, s ∈ C is the transmitted symbol with E[|s| 2 ] = 1 and n ∼ CN (0, σ 2 n ) is the noise term which is assumed to be independent from s. Note that in the following we propose a method to optimize directly the RIS configuration in matrix Θ and not the absorption coefficients {α } N =1 and the phase shifts {θ } N =1 . However, the latter can be recovered by simply setting and respectively.

IV. RIS TO COMPENSATE FLIGHT EFFECTS
Our objective is to guarantee coverage over a given target area A, i.e., ensuring that each receiver obtains a sufficiently high SNR, by taking into account the undesired rotations of the surface of the RIS caused by perturbations on the UAV. In this regard, in the following we define the received SNR at a given target location w and formulate an effective optimization problem that pursues the worst SNR maximization among all possible target locations, accounting for possible perturbations. We therefore provide a solution to such problem based on semidefinite relaxation (SDR) and Monte Carlo sampling denoted as RIS to compensate flight effects (RiFe).

A. Problem Formulation
Let us consider the received SNR at position w, which is given by the following Our objective is to maximize the worst-case SNR within the target region via the proper choice of both beamforming vector at the BS and the RIS configuration while accounting for the perturbations, which are identified by means of r, i.e., Problem 1 (P 1): where P is the power budget available at the BS and the expectation is calculated over the RV r. Note that the constraints on the matrix Θ ensure that the RIS remains a passive structure without amplifying the incoming signal. Problem 1 is highly complex to tackle due to its non-convex nature and the difficulty in treating any generic form of the pdf f (w).
In the following, we propose a simple and efficient solution based on Monte Carlo sampling and SDR.

B. Proposed canonical solution (RiFe)
Let a BS (v) = a H BS (q)v such that we can simplify the numerator of the objective function of Problem 1 as follows where we have dropped the dependency on q, w, and r to ease the notation. The term a * where the elements of the matrix A(q, w) are defined as . We assume that the matrix A(q, w) is approximated (we refer the reader to Appendix A for more details) or estimated at the BS-side via a separate control channel. The phases {φ i −φ } N i, =1 corresponding to the element in position (i, ) of matrix A(q, w) can be expressed as a function of r as the following with and We then reformulate Problem 1 as the following Note that in the above the optimal value of the precoder v adopted at the BS does not depend on w and, when the vector of the RIS parameters θ is kept constant, can be optimized by aligning it to the direction of departure of the link between the BS and the RIS. Hence, by noting that a BS (q) 2 = M and by using maximum ratio transmission (MRT) we set We are thus left with the following optimization problem on RIS parameters Problem 2 (P FD): Problem 2 is still non-convex due to the maximization of a quadratic function in θ. An efficient solution can be found by employing SDR as detailed in the following. Let Θ θθ H , which allows us to reformulate Problem 2 as the following In order to cope with any given general probability density function of the distribution of the receivers f w (w), we propose to apply a Monte Carlo sampling approach whereby we drop a number of sample points N w within the target area A and according to a-priori statistics f w (w). If N w is sufficiently high, we obtain a correct sampling of the pdf of the receivers in the target area. Note that N w is expressed as a trade-off between complexity and accuracy of the proposed approach. Let A be the set of such points such that the above problem can be solved by standard semidefinite programming (SDP) (e.g., CVX) in its relaxed convex form, i.e., by ignoring the nonconvex rank constraint. The solution obtained by SDP can be projected onto a rank-one space by Gaussian randomization or eigenvalue decomposition [31]. We thus find an approximate solution to Problem 2 by solving the following Problem 3 (P FD SDR): The proposed procedure is formally described in Algorithm 1. The complexity of RiFe is essentially dictated by step 3, i.e., the solution of Problem 3. The latter is typically implemented via standard SDP such as the bisection method, Algorithm 1 RiFe 1: Initialize N w 2: Form set A by dropping N w points {w i } Nw i=1 according to f w (w) 3: Solve Problem 3 and obtain Θ 4: Extract θ from Θ via Gaussian randomization whose convergence is guaranteed thanks to the convex nature of Problem 3. Such method typically requires 10 to 12 iterations each one having a complexity of O( √ N (N 6 +N 3 )). Moreover, the complexity of the Gaussian randomization in step 4 is negligible compared to the previous step [32].

V. PRACTICAL CONSIDERATIONS
We further propose a more practical solution aiming at simplifying the optimization procedure described in Algorithm 1. Specifically, Problem 3 requires to be solved every time the statistics of r are no longer valid which, given the need to use SDP, can be excessively time-consuming when the statistics change rapidly. This motivates us to propose a suboptimal yet simple closed-form solution to Problem 3.
Given a total number of sampling points N w , the objective is to maximize the worst SNR among the associated ones in set A. Hence, we fix the matrix Θ to a weighted combination of the A * (q, w) matrices as The weights λ i need to be chosen such that more power is allocated along the propagation directions corresponding to the point exhibiting the worst SNR w.r.t. the others in set A and such that the resulting matrix Θ is a positive semi-definite matrix whose diagonal elements are less than or equal to 1.
Since the received SNR depends largely on the distance from the target point to the UAV location, we set where the constant factor λ is properly chosen to guarantee the aforementioned constraints on the matrix Θ. In this regard, note that A * (q, w i ) is a positive semi-definite matrix and λ i > 0, ∀i thus ensuring that Θ is a positive semi-definite matrix as well. Moreover, the value of λ is found by constraining the diagonal of Θ to 1 as which ensures that the RIS is a passive structure overall. Finally, we set By substituting Eqs. (47) and (49) into Eq. (46) we obtain The RIS parameters in the vector θ can be obtained from Eq. (50) by Gaussian randomization or eigenvalue decomposition. The proposed procedure is formalized in Algorithm 2 and is denoted as Fair-RiFe. In Fig. 3 we compare the radiation pattern at the RIS along the azimuth and elevation directions obtained with RiFe, Fair-RiFe and with an agnostic solution that does not take into account the UAV perturbations. As expected, the agnostic solution points towards the center of the target area, regardless of the entity of the drone perturbations. Whereas, both RiFe and Fair-RiFe tend to spread the energy over a wider angular span as the perturbations increase.

A. Special case: deterministic UAV movements
Let us consider a special case of the above-described scenario, wherein the UAV is moving with given direction and velocity. In this case the statistics of r changes rapidly together with drone movements, which requires an updated matrix A(q, w) and the solution of Problem 1. As a result of the movement of the UAV, the surface of the RIS exhibits an (expected) inclination ofψ x ,ψ y , andψ z along the x, y, and z axes, respectively. 4 In this case, our proposed approach is readily applicable by simply substituting the coefficients in Eqs. (36)-(37) with and respectively. Moreover, in this case the phase term in position (i, ) of matrix A(q, w) is expressed as Hence, both Algorithms 1 and 2 can be alternatively applied without any further modification. 4 Note that such expected inclination of the surface based on the UAV speed can be readily calculated via flight controller. We refer the reader to [33] for more details.   Table I.

VI. PERFORMANCE EVALUATION
We present numerical results to assess the performance of our proposals by means of ad-hoc MATLAB® simulations. We place one BS with M = 16 antenna elements at coordinates (0, 0, 10) m, while the RIS is installed on a drone that is located at coordinates (25, 25, h d ) m, where the altitude of the drone is set to h d = 50 m, unless otherwise stated. The RIS is equipped with N x × N y antenna elements, with N x = N y = 10, unless otherwise stated. Hence, the total number of RIS elements is N = N x N y = 100 with an interdistance of d = λ 2 . 5 The target area wherein first responder teams and/or victims are located is centered at coordinates (50, 20, 0) m. The BS transmit power is set to P = 24 dBm and the average noise power to σ 2 n = −80 dBm. We assume that the variances of the perturbations of the drone orientation along the x, y, and z axes are equal to σ ψx = σ ψy = σ ψz = σ, with σ ranging from 0 • to 20 • . Lastly, the working frequency is set to f = 30 GHz and the channel gain at a reference distance of 1 m is assumed to be equal to β 0 = 1. All simulation settings are listed in Table I, unless otherwise stated. The numerical results for each simulation instance are averaged over 5000 realizations of the drone perturbations, i.e., of the vector r, and the number of sample points necessary for Monte Carlo sampling of the distribution of the receivers is set to N w = 200. Lastly, we average the obtained results over 10 instances of random locations of the receivers in the target area. Numerical simulations are carried out on an Intel i7-8665U CPU @ 1.90 GHz and 32 GB RAM 8-core machine.

A. Robustness to perturbations
We first consider the case where the location of the first responder team in the area is perfectly known and the drone  is affected by orientation perturbation: we highlight the robustness of our method against the uncertainty on the drone orientation. We compare RiFe against an agnostic procedure that optimizes the RIS parameters by neglecting such perturbations and assuming a perfectly-stable flight, denoted as agnostic. We consider 10 users uniformly dropped in a circular target area of radius R = {20, 35} m. Fig. 4 compares the performances of RiFe against the agnostic scheme in terms of the minimum SNR received by the first responder team in the target area. It is worth noting that drone oscillations results in a reduction of the received SNR, which is mainly caused by the misalignment of the reflected beams (on the RIS) with respect to the users to be covered in the target area. Notably, RiFe mitigates such misalignment effects by optimizing the RIS parameters as a function of the statistics of such oscillations. Indeed, our proposed approach tends to generate wider beams compared to the agnostic solution, i.e., it better spreads the radiated power over the target area thus compensating an undesired misalignment.
Interestingly, RiFe performance gains are less evident as the dimension of the target area increases. When points to be covered are well separated, reflected beams on the RIS focus on each target point. Vice versa, if the receivers are in close  proximity then RiFe tends to cover all the target points with a single wide beam. This results in a similar RIS configuration compared to the agnostic solution, thus reducing the overall performance gain in terms of received SNR. Additionally, we observe a trade-off between the effectiveness of the oscillation compensation mechanism of RiFe and the magnitude of such oscillations. Indeed, the two considered methods produce similar gains in the two extreme cases when the magnitude of the perturbations is low because of a relatively low drone altitude or small values of σ ψ , and when the size of perturbations is large because of high altitude of the drone or a large value of σ ψ . The rationale behind this behavior is the following: when perturbations are limited, their corresponding effect is negligible, thus the improvement of the proposed compensation mechanism is negligible. Conversely, when the altitude is high, small oscillations may result in large deviations of the corresponding beams with respect to the desired pointing direction. In this case, RiFe will generate wide beams to spread the irradiated power over a larger angular span thereby resulting in an inevitable reduction of the received signal power. Such a behavior is highlighted in Fig. 5, which shows the cumulative density functions (CDF) of the received SNR.
We perform additional tests to take into account the effect of the RIS size by varying the number of elements N . Fig. 6 compares the performances of RiFe against the agnostic scheme in terms of minimum SNR. It is worth noticing the overall increasing trend of the achieved minimum SNR according to the number of elements. This due to the ability to focus-which is proportional to its dimension-that reflects on the directionality of the reflected beams. However, the more the energy is focused towards the target points, the higher the effect of misalignment due to the drone orientation perturbation. This results, in turn, in the gap between the performances of RiFe and agnostic optimization schemes, which increases according to the available number of elements, thus highlighting the importance of a robust RIS configuration to combat drone perturbations.
Lastly, as a means to further assess the performance of the proposed RiFe algorithm and the agnostic scheme in terms of worst-case SNR within the target region, we consider the multicast rate, i.e., the rate given by the UE with the worst effective channel condition. This is given by the following where the instantaneous SNR for a given drone position q and perturbation r is given by Eq. (23), Θ is given by the proposed RiFe algorithm, and v is set as per Eq. (40). The multicast rate in Eq. (54) is an important key performance indicator in emergency scenarios, considering the need to propagate useful information to the overall first responder team in the shortest time. We report the obtained comparison results in Table II to emphasize the benefits of robust optimization strategies to improve the overall system performance and effectiveness.

B. Analysis of location-unaware solutions
When the BS aims at serving a number of victims whose position is unknown, our objective is to provide a minimum SNR within the target area to ensure an adequate signal coverage. We assume that the distribution of the victims in the target area is known and follows a symmetric and independent bivariate normal distribution centered in a given  point C and with associated standard deviations along the x and y axes equal to σ w,x = σ w,y = σ w . The value of σ w is set to {2.5, 10} m, which represent two possible situations, namely victims located in a predefined collection point, and a more sparse distribution around the disaster location. Note that the values of σ w correspond to an area of 80 m 2 and 1200 m 2 , respectively wherein the 95% of the victims are located. Additionally, we compare our solution against 3D beam flattening, which is described in [26]. Fig. 7 shows the achieved minimum SNR over the victims dropped in the area with different values of the drone perturbation, altitude of the drone and spread of the victims in the target area. After comparing the curves with low and high spread of victims in the area, we note that the minimum received SNR has a decreasing trend as the drone perturbation increases. On the other hand, if the victims are more spread, the performance exhibits an increasing trend in the low perturbation regime. This behavior is due to the limited number of samples adopted for the Monte Carlo sampling of the distribution of the victims. Indeed, in the case of low spread of the location of the victims, the proposed method accurately represents the underlying distribution, which in turn results in an effective coverage of the area. Conversely, in the case of large spread of the locations of the victims, the limited number of samples results in a more sparse sampling of the distribution. As a result, the RIS configuration tends to focus the reflected energy towards the available samples instead of following the actual input distribution.
We also note when the victims are widely spread, the beam patterns generated by RiFe result in a considerable SNR improvement since they are sufficiently spread to effectively cover the target area. On the other hand, when the victims are more concentrated, all considered algorithms produce beams that properly cover the target area. However, we can observe an overall increase of the SNR obtained with RiFe. To dig deeper into this behavior, we report in Fig. 8 the CDF experienced by the victims in the target area considering different considered scenarios. As expected, the CDFs obtained with RiFe have a more pronounced slope with respect to the ones obtained with the agnostic solution because of larger beam patterns.

C. Practical evaluation
In the previous numerical evaluation, we demonstrated the effectiveness of RiFe to obtain a robust RIS configuration, which is able to mitigate the effect of the inherent instability of the drone in flight. We conclude our analysis by considering the practical implications of the proposed method. To this end, we compare the performance of RiFe algorithm with the Fair RiFe solution described in Section V, in terms of target area coverage quality as well as computational cost of the optimization process. For the stake of completeness, we include an agnostic version of Fair RiFe in our numerical evaluation, namely Fair-agnostic, where Algorithm 2 is solved neglecting the drone perturbation statistic. We consider the same scenario as per Section VI-B. Fig. 9 compares the CDF of the victims SNR experienced over a target area considering different proposed solutions. From the results, we can notice that the CDFs obtained with the Fair RiFe and Fair agnostic algorithms exhibit a less-marked slope than their optimal counterpart. Thus, they produce a less-homogeneous distribution of the radiated power over the area than their optimal counterpart due to the suboptimal RIS configuration. Upon comparing the Fair RiFe and the Fair agnostic performance, we can notice that, for relatively low SNR values, distributions are very similar to each other, thus leading to similar performances in terms of minimum SNR provided. Vice versa, considering relatively high value of SNR, we can notice that the overall delivered SNR is higher with the Fair RiFe solution. Therefore, while it delivers a sub-optimal solution, it still provides a performance improvement by considering the drone perturbation statistics in the optimization process. Finally, we assess the computational time in Fig. 10. In particular, we compare the overall optimization time needed by RiFe and Fair RiFe solution while varying the number of points within the target area N w as well as the size of the onboard RIS N . In Fig.10a we can notice a dramatic reduction of the optimization time when considering Fair RiFe against RiFe solution. The reason behind such an improvement relies on the fact that Fair RiFe does not involve an optimization process to obtain the solution. We can also see that the Fair RiFe optimization time shows a limited growth w.r.t. the number of points N w against RiFe solution. Therefore, in the case it is required to sample the target area (i.e., unknown position of the victims) it is suitable for a finegrained sampling of the victim distribution. Fig. 10b provides the optimization time against the number of RIS elements N . Fair RiFe, which keeps the optimization time almost constant, outperforms RiFe, whose optimization time has an exponential growth w.r.t. the number of RIS elements. Thus, Fair RiFe allows for a quick configuration of the RIS thereby allowing to exploit the large-sized RIS in real scenario.

VII. CONCLUSION
Agile and flexible air-to-ground networks represent the new frontier for reliable communications. In this paper, we envision UAVs equipped with passive devices, namely Reconfigurable Intelligent Surfaces (RISs), able to control the propagation properties of incoming signals to deliver connectivity in emergency scenarios while keeping the energy burden within affordable bounds. The main novelty of our RiFe solution is the robustness and reliability of the UAV communication channel by properly combating undesired flight effects, e.g., position perturbations and UAV orientation fluctuations. In addition to the optimization framework, a practical implementation has been designed, Fair-RiFe, which in turn reduces the complexity of the optimal solution. Finally, an exhaustive simulation campaign has been conducted to validate our framework where state-of-the-art solutions are significantly outperformed (e.g., 25 dB).  In the following we describe a possible way to estimate matrix A(q, w) by assuming that the oscillations of the UAV are small, i.e., that ψ x , ψ y , ψ z ≈ 0 and using a Taylor expansion such that cos(ψ) ≈ 1 − ψ 2 /2 and sin(ψ) ≈ ψ. Let ∆x i = x i − x and ∆y i = y i − y denote the difference in position between the i-th and -th element of the RIS along the x and y axis, respectively and let us approximate Eq. (35) as the following where we have neglected the terms that are O(ψ 3 ). Let f ψx (ψ x ), f ψy (ψ y ), and f ψz (ψ z ) denote the pdf of ψ x , ψ y , and ψ z , respectively. Hence, we have that The integral in Eq. (58) can be seen as the product of three integrals in the form respectively. Let c i, = Lastly, by noting that Re(c i, ) > 0 and by operating the following change of variable we have that where Eq. (76) is found by solving the Gaussian integral in Eq. (75). Hence, we have that each element of the matrix