Optimal Tuning of the Lateral-Dynamics Parameters for Aerial Vehicles With Bounded Lateral Force

This letter shows for the first time why it is important and how to optimize the gains of a position controller on board of a fully-actuated aerial vehicle with bounded lateral force, via an auto-tuning approach. In such vehicles, most of the control authority is expressed along a principal thrust direction, while along lateral directions smaller forces can be exploited to achieve full-pose tracking. The nonlinear and hard to model interplay between the constraint imposed on the lateral force and the gains of the position controller is overcome by employing the OPTIM-tune calibration method. Several experimental tests, performed fully autonomously during flight, clearly show the practicability and benefits of the approach.

the above-mentioned fields, these platforms lack the ability of applying lateral forces and thus need to tilt to move laterally.
Different designs from the literature overcome this limitation by adding additional propellers that can apply lateral forces. Romero et al. [5] add four propellers to a quadrotor along the major lateral directions to move sideways. Similarly, Albers et al. [6] add an extra propeller that produces thrust perpendicular to the four main propellers. Conversely, Ryll et al. [7] apply lateral motion by tilting each of the propellers of a quadrotor independently.
Recently, all the platforms that can apply lateral forces in body frame have been grouped in the abstract class of Bounded Lateral Force (BLF) UAVs, firstly introduced in [8]. Unlike the more popular quadrotors, these platforms can apply a lateral force in their body frame thanks to tilted propellers, similar to the example platform shown in Fig. 1. For such platforms position and orientation dynamics are decoupled, and as such they can move laterally without the need of tilting, tilt without the need of moving laterally, and interact with the environment while maintaining an independent desired orientation. In its simplest and more effective representation, among the ones introduced in [8], a BLF platform's feasible force set is modeled as a cylinder which radius, summarized by the parameter f xy representing the maximum allowable lateral force in any horizontal direction, in body frame.
The geometric controller presented in [8] requires the inertial parameters of the platform, and tuned gains of its attitude and position controllers; similar controllers have also been proposed in the literature, such as the controller presented in [9]. The inertial parameters of the platform can be easily estimated from the platform's geometry, and do not depend on the controller gains. Similarly, the attitude controller has a larger authority than the position controller, and thus can be tuned using standard be seen from Fig. 2, the lateral force limits are coupled with the applied lift force. Therefore a single parameter f xy is an estimate of the actual maximum lateral force allowed by the platform for the current lift, it is difficult to chose the best value for this parameter a priori.
Furthermore, the choice of f xy can substantially affect the platform's performance, where if chosen to be near zero, the platform acts as an underactuated one, with a strong coupling between the position and attitude dynamics. If f xy is chosen to be large enough, the platform behaves as a fully-actuated one, and the position and attitude dynamics become decoupled; special consideration has to be given as not to exceed platform's physical limits at the applied lift.
In this letter, we aim to study experimentally the abovementioned interplay between the chosen maximum lateral force and the position dynamics. To be able to systematically tune the controller gains for each chosen f xy value, we use the recently introduced OPTIM-tune algorithm [10]. The method described in [10] performs auto-tuning of controllers, where the tuning is done in cycles, composed of stages where a particular gain is tuned, and the remaining held fixed [10]. The method finds the optimal gains that maximize a designed performance index, and as such can be scaled to tune any of the controller gains affecting the desired performance.
The rest of this letter is structured as follows: Sec. II presents the UAV model and the BLF controller. Sec. III analyzes carefully the parameters of the BLF controller, and discusses the corresponding interdependency. Sec. IV summarizes the tuning algorithm and its use for the tuning of the BLF controller. Finally, Sec. V shows the experimental analysis of the proposed method, and Sec. VI concludes the letter.

II. MODELING AND CONTROL OF FULLY ACTUATED UAVS WITH BOUNDED LATERAL FORCE
In this section, we briefly describe the modeling and control of fully-actuated aerial vehicles with Bounded Lateral Force, in order to introduce the parameters whose automatic tuning represents the goal of the proposed method. A BLF model is a powerful and simple abstraction of several different multi-rotor designs, including, e.g., underactuated, fully-actuated, multidirectional thrust, and thrust vectored designs. For a detailed description of the BLF model and its relation with real multirotor designs, we refer the reader to [8], where all these concepts have been introduced.
We define an inertial world frame F W with origin O W and axes {x W , y W , z W }, and a robot frame F R , attached to the vehicle, with origin O R and axes {x R , y R , z R }, where O R coincides with the Center of Mass (CoM) of the vehicle. We denote by p R ∈ R 3 and R R ∈ SO(3) the position of O R in F W and the rotation matrix describing the orientation of F R with respect to (w.r.t.) F W , respectively. The linear velocity of O R in F W is denoted by v R ∈ R 3 and the angular velocity of F R w.r.t.
>0 denote the vehicle mass and moment of inertia w.r.t. to O R in F R , respectively.
Following the Newton-Euler formalism, we can write the equations of motion of this rigid body aṡ where [•] × is the skew-symmetric operator, e 3 is a unit vector along z W , g is the gravitational constant, f R = [u x , u y , u z ] ∈ U f ⊂ R 3 and τ R ∈ R 3 are the total control force and moment applied on O R in F R , respectively, and U f represents the set of feasible forces in the robot's frame. A BLF vehicle is characterized by the particular structure of the set U f , namely, where U xy is the set of feasible lateral forces defined as The distinguishing feature of the BLF model is the presence of the parameter f xy > 0, which represents the maximum magnitude of lateral (horizontal) force that the BLF vehicle can produce in F R . As such, and following the allocation strategy from [8], if the required lateral force / ∈ U xy , the controller prioritizes the position controller and tilts the platform differently from the reference attitude trajectory so as to include the lateral force ∈ U xy . The smaller f xy , the closer the BLF vehicle resembles an underactuated multirotor (e.g., a quadrotor) and as a consequence, the more coupled its lateral motion and attitude dynamics are -e.g., a lateral acceleration requires a non-zero tilting of the vehicle. The larger f xy , the more decoupled its orientation and lateral motion can be -e.g., the BLF vehicle can accelerate laterally with a small tilting and can tilt with lateral acceleration close to zero.
The BLF model has two advantages over more accurate models of the particular multi-rotor aerial vehicle at hand: 1) the BLF model is much simpler and requires the identification and use of only one actuation parameter -namely f xy ; 2) the BLF model can be made asymptotically stable using a controller (see [8]) that is analytically proven to converge and it has been experimentally demonstrated to effectively stabilize real multirotor platforms modeled as BLF, such as the platform shown in Fig. 1. More accurate models can be introduced [11], however, they require the complex identification of many parameters, which may be impractical. Furthermore, due to their complexity, they can be controlled only resorting to numerical optimization-based control, which typically requires a high computational power that may not be available onboard. Last but not least, such numerical methods do not typically have an analytical guarantee of asymptotic stabilization. A BLF vehicle can be stabilized along a time-varying and full-pose reference trajectory q r (t) = (p r R (t), R r (t)) using the analytically-proven control law presented in [8], which has the following form: where Considering the goal of this letter, we omit the details for the sake of compactness and readability, and we refer the reader to [8] for the exact definition of all the terms in the controller as well as its stability proof. In the next section, we focus on the discussion of the parameters used in this control law.

III. DISCUSSION ON THE CONTROL PARAMETERS AND NEED FOR AUTOMATIC TUNING
The BLF model (1)-(5) has three parameters: m R , J R , and f xy , which are all used in the corresponding controller in (6)- (8) together with the four additional sets of parameters representing the control gain matrices K p , K v , K R , and K ω . In the following, we analyze each parameter from the point of view of interdependency and easiness of identification with methods available in the state-of-the-art.

A. Inertial Parameters
The inertial parameters m R and J R have clear physical meaning and their offline identification or online estimation is rather straightforward and established (see, e.g., [12] and [13]). Furthermore, their nominal values are typically accurate because they can be retrieved from the CAD model of the system. Therefore, one can safely assume their values to be identifiable with good accuracy using standard methods.

B. Gains of the Attitude Control Loop
The gain matrices K R and K ω appear in (7) and affect the attitude dynamics (2),(4), which is independent of the rest of the vehicle dynamics (the position dynamics) and contains only the parameter J R , which, as explained before, can be fairly assumed to be known with good accuracy. Furthermore, the attitude dynamics is fully-actuated and no limits in the control moments appear in the BLF model. As a consequence, the gains K R and K ω can be easily tuned independently from the other control parameters by using standard PD tuning methods such as the one presented in [14]. Therefore, we can also in this case safely assume that K R and K ω are tuned with state-of-the-art methods and do not require special attention.

C. Maximum Magnitude of the Lateral Force
In a real multi-rotor platform, see [15], the maximum magnitude of the lateral force depends on the applied vertical component of the force and the applied full moment. Such lateral bound is typically larger when the requested vertical force exactly compensates for the gravity force and the total moment is zero. The farther the vertical force and the moment are from such two neutral conditions, the smaller the lateral bounds on the horizontal component of the force. Figure 2 shows an example of a feasible force set at hover and a corresponding BLF model calculated when applying a vertical force opposing gravity (static hovering has been formally defined in [16]).
In the BLF model, on the contrary, f xy is a lumped constant value. If f xy is set too small, then the controller will let the platform behave too close to an underactuated platform, while if f xy is set too large, it could lead to suboptimal behaviors because it may not represent well the lateral bounds induced by the moment and vertical force required by the task.
In conclusion, the parameter f xy plays the role of a 'lateralactuation slider' which has to be tuned in order to optimize the behavior of the real controlled platform for the particular task at hand. Such a need calls for an automated tuning algorithm that can optimize the value of f xy based on the controller performance.

D. Gains of the Position Control Loop
The gain matrices K p and K v appear in (8) and affect the position dynamics (1), (3). It is standard to assume a diagonal structure of K p and K v considering the symmetry of the model and in order to avoid an unnecessary cross-direction coupling induced by the controller. Furthermore, thanks to the horizontal symmetry of the model and controller, one can assume that the corresponding first two entries of each diagonal are equal. Therefore, it is reasonable to assume the following structure for K p and K v : The choice of k pz and k vz affects the closed-loop vertical dynamics along which the system has a large control authority and is not influenced by the rest of the dynamics. Therefore -similarly to K R and K ω -the gains k pz and k vz can be tuned independently, e.g., letting the vehicle move up and down and using standard PD tuning techniques [14].
The remaining parameters, namely k p and k v , cannot be chosen independently from f xy , because there is a nonlinear saturation on the lateral dynamics that depends on f xy (6). Therefore, k p and k v have to be chosen in a way that lets the system behave optimally in the lateral motion, while well coping with the saturation induced by f xy .
To provide an insight into the complexity of such an interplay, let us first consider the two extreme cases. If f xy is chosen very small, the platform lateral dynamics is in practice underactuated and the platform needs to tilt in order to move laterally. Therefore, the gains k p and k v have to be optimized to let the position dynamics be as fast as possible but 'slower' than the attitude dynamics, following a time-scale separation principle, as in a quadrotor. On the contrary, if f xy is large, the system can move laterally (up to a certain acceleration) without tilting, therefore there is virtually no need to take the attitude dynamics and obeying a time-scale separation principle in the tuning of k p and k v . On the other side, there is still the dynamics of the motor/propeller to consider. In fact, lateral motions without tilting require a much more ample range of propeller spinning velocities compared to the case in which the system moves laterally by tilting (with small f xy ). This phenomenon can be easily appreciated looking at the experiments reported in [8]. Therefore, for large f xy , the dynamics to consider is the motor/propeller one, which has of course different characteristics than the attitude one.
For intermediate values of f xy , a mixture of attitude and motor dynamics influences the optimal choice of the gains k p and k v in a way that is hard to predict a priori.

E. Conclusion
From the discussion carried out in this section, it emerges that there are two different types of control parameters in (6)-(8). The first type, namely m R , J R , K R , K ω , k pz and k vz can be tuned mostly independently and resorting to state-of-the-art methods such as, e.g., physical parameter identification using least squares approach or PD tuning. The second type, namely f xy , k p , and k v , are tightly coupled, and their effects on the system behavior are coupled and nonlinear and one cannot use straightforward methods like PD tuning to tune these parameters. In particular: r different values of f xy may be chosen depending on the motion task at hand, where there is no clear 'best value' until the task is specified; r for each value of f xy it is expected to obtain different optimized values for k p and k v , due to the nonlinear interplay explained before. Therefore, in the remaining part of this letter, for the first time in the literature, we focus our attention on the optimal tuning of k p and k v for different values of f xy in real platforms modeled and controlled as BLF. First, we describe the automatic method used for the tuning (Sec. IV), and then we test the presented method on a real platform. These tests demonstrate the existence of the expected dependency as well as the improvement of the controller performance following the presented tuning method (Sec. V).
Note that the stability of the control system against unmodeled and external disturbances following the choice of k p and k v has been thoroughly studied in Appendix II of the attached technical report.

IV. DATA-BASED PARAMETER TUNING ALGORITHM
The optimization algorithm that is used to tune the gains k p and k v , for a given value of the parameter f xy , is an instantiation of the model-free OPTIM-tune algorithm presented in [10] and requires only a measurable metric of the performance of the controller in order to work. Further analysis on the convergence of the OPTIM-tune algorithm can be found in Appendix I of the attached technical report. The overall method is a combination of two nested loops:i) an outer loop, described in Algorithm 1, and ii) an inner loop, also called single parameter tuning, described in Algorithm 2.

Algorithm 1 (the outer loop) receives as input:
i) the maximum lateral force f xy (which is kept constant during the tuning), ii) the two sets D (1) k p , D (1) k v that represent the intervals over which the gains k p and k v are optimized, and iii) two integers, N b and N , representing the number of iterations in the outer and inner loop, respectively. Algorithm 2 (inner loop, or single parameter tuning) receives as input: i) f xy and N (the same of Algorithm 1), ii) the starting set, denoted with D (1) , in which one of the two gains (either k p or k v ) will be optimized, and iii) the value of the other parameter (either k v or k p ) that is kept fixed during the execution of Algorithm 2, denoted with ξ. The algorithm provides a new set D (N ) as output, which is a contraction of D (1) and which is guaranteed to contain the optimum value of the corresponding parameter.
Algorithm 1 executes a basic iteration N b times, in which two instances of Algorithm 2 are performed sequentially to contract D (i) In the first instance, k v is kept fixed at its current estimate and the set to which the optimal k p belongs is contracted, thus generating an improved estimate of k p . In the second instance -symmetrically -the new estimate of k p is kept fixed while the set to which the optimal k v belongs is contracted, thus generating a new improved estimate of k v . At the end of Algorithm 1 the optimized values of the gains are returned in the form of the mid-values of the intervals generated by the contractions of the last (N b -th) iteration, i.e., D Algorithm 2 performs the set contraction implementing N smaller consecutive contraction steps. Each step executes two flight tests with the vehicle, using f xy as lateral force bound and ξ as the temporarily-fixed gain. The goal of each flight test is to evaluate the effect of a new candidate for the upper and lower bound of the set containing the gain to be optimized. A new upper bound candidate +θ(i+1) is tested in the first flight test, while a new lower bound candidate −θ(i+1) is tested in the second one. Each flight test is followed by the evaluation of a cost function f that depends on the state error s e , i.e., the vector describing the error between the desired and the measured state of the system during the execution of a flight test. The candidate bound that corresponds to the test which returned the lower value of f is used as new upper or lower bound for the set of the estimated parameter, thus producing the sought contraction for the particular step. This process is repeated N times. The last obtained set D (N ) is returned as the result of the algorithm.
In our specific case, the goal is to find the optimal controller gains that ameliorate the lateral trajectory tracking while the platform remains as much as possible horizontal -thus exploiting at best the lateral force capability of BLF platforms. In line with such goal, and assuming that the position trajectory of a flight test is composed by N c reference points, the corresponding cost function f is defined as follows: where |e k | is the norm of the lateral position error, |φ k | is the norm of the tilt angular error and J is the weighted error per reference point. The parameter Q is used to weight the contribution of the angular error in the overall performance index, giving more or less importance to the fact that the platform remains horizontal while following the position trajectory.

V. TEST OF TUNING ON A REAL PLATFORM AND VALIDATION OF THE INTERDEPENDENCY HYPOTHESIS
We validate the proposed approach with the BLF platform presented in [8]; the platform is referred to as the Tilt-Hex and is shown in Fig. 1. The platform is a hexarotor constructed from six 12" tilted propellers equally-spaced about the platform center of mass. The platform has a mass of 1.8 kg, and an inertia tensor J R = diag{11. 5, 11.4, 19.4} · 10 −6 kg · m 2 .
In addition, the platform is endowed with an Inertial Measurement Unit (IMU) providing acceleration and angular velocity measurements at 1 kHz, and is tracked with a motion capture system at 100 Hz. Both measurements are fused with an Unscented Kalman Filter running at 1 kHz, providing an estimate of the platform state. The motion controller runs on-board at 1 kHz, and brushless motor controllers (BLDC ESC) regulate the propeller speeds using an in-house developed closed-loop speed controller [17]. Most of the software is developed in C++ and runs on an on-board PC, with the exception of the gain tuning algorithm which runs in MATLAB/Simulink on a ground PC. Most of the on-board software are open source, and can be found at https://git. openrobots.org/projects/telekyb3 , while the OPTIM-tune software is available at https://github. com/AppliedControlTechniques/Optim-tune.
A simulation and an experimental campaign have been carried out, in which the task has been to tune the controller gains, for the selected values of f xy and different Q ratios. The interested reader is referred to the multimedia attachment of this letter for the experiment videos. In all the experiments and simulations, the maximum lateral acceleration of the reference trajectory has been set at 1.5 ms −2 , jerk at 10 ms −3 , lateral velocity at 2 ms −1 , to bring the platform to its lateral motion limits. During each of the tuning experiments, the initial domains of the controller gains have been chosen such that D (1) k p = [10,30] and D (1) k v = [5,15], and each domain has been contracted N = 12 times by the inner loop in each of the N b = 2 outer loop iterations.
Finally, to stress the lateral position tracking and horizontality of the platform (zero tilt), the reference trajectory has been chosen as a back and forth path parallel to x W .

A. Simulative Analysis of the Cost Function Landscape
To study the cost function landscape, we simulated the above-mentioned platform with the corresponding controller, and computed the different components of the cost function while varying the controller positional gains k p and k v over a discretized grid of D (1) Fig. 3 shows the contour plots of the two components of f (s e ) at f xy = 2 N and f xy = 8 N. The functions f e and f φ are shown separately to understand the effect of each on the performance of the presented tuning scheme. This figure shows that as f xy is increased from 2 N to 8 N, the lateral position error component f e decreases slightly for almost all values in the given range, and the number of local minima slightly increases as the position changes moderately. On the other hand, f φ shows a different behavior, where it can be seen that the number of local minima increases substantially for f xy = 8 N. In addition, as f xy is increased, the values of f φ decrease substantially; this can be seen from the different scales of the corresponding contour plots. As such, as f xy is increased the effect of the angular component on the overall cost function decreases; this is similar to an increase in the Q value. This shows the decreased effect of f φ (and correspondingly the angular dynamics) on the tuning of the position controller gains as f xy increases, even when Q is kept constant.

B. Experimental Test of the Tuning Algorithm
We conduct an experimental campaign to demonstrate the tuning of the proposed algorithm and to show the relation between the chosen f xy and the optimized controller gains. Fig. 4 shows the average of the optimized controller gains and standard deviation of each for different values of f xy and Q, where the optimization at each f xy and Q value have been repeated thrice. This figure depicts that as f xy increases, the optimized k p increases and the optimized k v decreases for both Q values. In the case of Q = 300, the contribution of f φ is reduced substantially leading to higher optimized k p and k v values as the optimization allows for more aggressive position tracking without taking the angular tracking error into consideration. In order to get an improved understanding of how the algorithm operates, we show the evolution of the optimization for two of the above optimization cases, corresponding to f xy ∈ {2 N, 8 N} at constant Q = 50. Fig. 5 shows the corresponding evolution for f xy = 2 N and f xy = 8 N. This figure depicts the evolution of the controller gains and the resulting performance index for each of the two f xy values. These experiments clearly show the improved trajectory tracking of the controller with the optimized gains, and that while the initial controller gains are the same for both experiments, the optimized gains vary substantially for different values of f xy , supporting the interdependence of such parameters that is claimed in this work.

VI. CONCLUSIONS
In this letter, we studied the interplay between the parameters and gains of the BLF platform while controlled via a full-pose controller. We showed that the optimally-chosen position control gains rely largely on the estimated lateral force limit.
While one can fix the estimated lateral force limit at one of its extreme values, we discussed the effect of these extremes, where if the limit is chosen small enough the platform behaves as an underactuated one, while if chosen large enough, it might exceed the physical capabilities of the platform, and thus the controller could behave sub-optimally.
We then presented a detailed method for the auto-tuning of the position control gains for different estimated lateral force limits, and showed how these optimized gains vary accordingly. However, the choice of this parameter is still an open question, where for each application, different values of the lateral force limit should be chosen. Moreover, based on the applied lift force, this parameter has to be changed with the corresponding optimized gains. As such, in the future, we propose to apply a gain scheduling approach to choose online the 'best' value of f xy and the corresponding optimized gains.