Nonlinear Model Predictive Velocity Control of a VTOL Tiltwing UAV

This letter presents the modeling, system identification and nonlinear model predictive control (NMPC) design for longitudinal, full envelope velocity control of a small tiltwing hybrid unmanned aerial vehicle (H-UAV). A first-principles based dynamics model is derived and identified from flight data. It captures important aerodynamic effects including propeller-wing interaction and stalled airfoils, but is still simple enough for on-board online trajectory optimization. Based on this model, a high-level NMPC is formulated which optimizes throttle, tilt-rate and pitch-angle setpoints in order to track longitudinal velocity trajectories. We propose and investigate different references suitable to regularize the optimization problem, including both offline generated trims as well as preceding NMPC solutions. In simulation, we compare the NMPC with a frequently reported dynamic inversion approach for H-UAV velocity control. Finally, the NMPC is validated in flight experiments through a series of transition maneuvers, demonstrating good tracking capabilities in the full flight envelope.

. The tiltwing UAV used to flight-test the presented velocity control system, here shown in transition flight with partially tilted wing. by strongly nonlinear aerodynamic effects which complicate control system development. For designs like the tiltwing or the aerodynamically similar tailsitter, these effects are mainly caused by high angles of attack on the wing with stalled flow states or the interaction between the propeller slipstream and the wing.
In a previous work [1], we designed and flight-tested a modelbased, full-envelope attitude controller using nonlinear dynamic inversion, the platform is shown in Fig. 1. In this work we present the next step towards fully automated flight -a cascaded control approach that includes the development of a high-level velocitycontrol system and which lends itself for future extensions to position control and guidance.
1) Related Work: The task of velocity-, or cruise-control on UAVs is most commonly studied for fixed-wing UAVs, where non-linear, velocity-dependent aircraft trims and the dominant interrelations between potential and kinetic energy require particular attention. Furthermore, such control systems need to respect flight envelope boundaries to protect the aircraft from entering stall. Low-fidelity approaches such as total energy control (TECS) [2] implemented in the PX4 autopilot 1 , modelbased nonlinear dynamic inversion (NDI) [3], [4] as well as full receding horizon optimal control approaches (RHC) [5], [6] are reported, with the latter two being applicable to both fixed-and rotary-wing UAVs. By optimizing over the forward simulated system response, receding horizon control approaches offer the advantage to explicitly deal with actuator-and state constraints that become relevant when flying highly dynamic maneuvers and to ensure flight envelope protection. A purely reactive approach, such as NDI, cannot 'foresee' these constraints and either violates them, risking unstable dynamics, or needs to be tuned conservatively, which potentially limits the full use of the system's dynamic potential.
Naturally, velocity control on H-UAVs concerns the extension, or combination, of above methods for use in the transition flight regime, a task which is complicated by the aforementioned nonlinear aerodynamic effects. The few existing velocity control systems for tiltwing and tailsitter UAVs are almost exclusively based on NDI [1], [3], [4], [7] where control inputs are calculated to follow a desired model reference. While those systems are shown to work well in general, careful tuning and heuristics in the reference generation are required to prevent, e.g., actuator saturation. Furthermore, being based on a local linearization of the system, non-minimum phase vertical velocity dynamics and 'misleading' gradients 2 can lead to oscillations that require special consideration [4].
Using a non-linear model predictive control (NMPC) approach instead, we aim to improve on existing approaches by: r explicitly adhering to, and planning under, actuator and state constraints, r resolving problems with non-minimum phase dynamics or locally vanishing gradients, by optimizing a trajectory instead of a single input, r enabling direct future extensions to predictive position control and guidance, and r performing a dynamic control allocation for the overactuated combination of wing-tilt and pitch attitude. To the best of our knowledge, no NMPC system for high-level control has been described and flight tested on either a tiltwing or the comparable tailsitter. A single example [8] investigates hybrid MPC for level flight conversion on a tandem-tiltwing in simulation, using a piecewise affine, simplified aerodynamic model (no propeller-wing interaction, angle of attack only a function of wing tilt). For tilt rotor designs, a few examples apply (N)MPC in real flight experiments, e.g. [9]. For the standard flight envelope of a tiltrotor, however, modeling of stalled airfoils is not necessary and often, propeller-wing interaction is omitted by design.
2) Contribution: First, we develop and identify a firstprinciples based model from flight data that captures the main aerodynamics, including stalled airfoils and the propeller-wing interaction, but is still lightweight enough for RHC. Following [6], an attitude control augmented formulation is adopted to reduce model complexity and to limit aerodynamic modeling to the translational dynamics. To model involved forces, we consider elements proposed in [1] as well as an alternative formulation for the forces of the propeller-wing interaction. The models are compared and validated for their prediction accuracy required in RHC. Secondly, we derive an objective function for the targeted velocity control task which, together with the system model, forms the velocity NMPC. Special consideration is taken of additional input and state regularization to limit aggressiveness of the resulting control inputs and to resolve the tilt/pitch over-actuation. There we focus on using both off-line optimized trims as well as trim-independent regularization. In simulation, the NMPC is evaluated on different reference trajectories and compared to a popular NDI control approach which we base on an identical internal model. Finally, we conclude with a set of flight experiments to evaluate the NMPC performance on a real tiltwing H-UAV.

II. SYSTEM MODELING
Following a cascaded approach analogous to [6], the NMPC is formulated as a high-level controller that optimizes throttle inputs (u t ), wing tilt rate (u w ) and pitch attitude setpoints (θ r ) to track a given velocity trajectory. As such, the NMPC interfaces with the low-level attitude-controlled system and, apart from the wing-tilt, not directly with the aircraft actuators. This abstraction reduces the aerodynamic modeling required for the NMPC to the translational dynamics. The reduced dimensionality and non-linearity of the problem is important to enable real-time RHC, specifically also in light of the increased feedback rates (>50 Hz) that would be required for attitude stabilization in a unified framework [9].
In the following, we derive and identify a reduced 3-DOF formulation of the control augmented dynamics suitable for velocity NMPC, i.e. targeting accurate forward simulation of the velocity dynamics. For the aerodynamically complex propellerwing interaction, we evaluate two different, physically motivated models.

A. Control-Augmented Longitudinal Dynamics
The 3-DOF model employed for longitudinal velocity NMPC is formulated in body-frame coordinates B () and comprises the translational rigid-body dynamics in (v x , v z ) coupled with a second-order model for the closed-loop angular pitch (θ) dynamics. The wing-tilt δ w is modeled as a rate-constrained second order system, and propeller speed n as an input-constrained first order system:v with state x = [v x , v z , θ, q, δ w ,δ w , n] and input u = [u t , u w , θ r ]. q =θ is the pitch rate, κ i , τ i , ω θ , ζ θ are model parameters identified from flight data. F x (x) and F z (x) denote the state-dependent aerodynamic forces acting on the aircraft, summed from lifting surface, propeller and fuselage contributions, g is the gravitational acceleration and m the mass of the aircraft. Fig. 2 illustrates the different aerodynamic forces considered within the model F x,z (x). For notational brevity, we assume zero wind such that inertial B v = (v x , v z ) and air-relative B v a = (u, w) velocity are identical. An extension to include a (constant) wind estimate would be straightforward.

1) Lifting Surfaces:
The lift F L and drag F D forces generated by lifting surfaces (green in Fig. 2) are modeled for the full angle of attack range α ∈ [−π, π]. The coefficients C L (α) and C D (α) are approximated using differentiable, weighted (w ns ) sums of polynomials for non-stalled regimes () ns and trigonometric flat plate models for stalled regimes () s , respectively.
C L (α) = w ns (α)C L,ns (α) + (1 − w ns (α))C L,s (α) C D (α) = w ns (α)C D,ns (α) + (1 − w ns (α))C D,s (α) (7) More details on the formulation of C L and C D are available in [1]. Resolved in body-frame coordinates, the aerodynamic force components of the surfaces are given by where the subscript () i indicates both a lifting surface (wing section, tail) and a quantity local to it, u i and w i are the bodyframe aligned (local to lifting surface i) airspeed components, ρ the air density, and S i the planform area of the section. The use of local quantities is required to distinguish sections on the wing located in the propeller slipstream (wetted sections) from other surfaces such as the horizontal stabilizer which are only subject to the free stream (dry sections). For simplicity, we neglect wing downwash or propeller slipstream effects on the tail. Furthermore, body angular rate induced variations in the local airspeed (and hence forces) are only considered during system identification for increased parameter observability and for 6-DOF simulation of the open-loop aircraft dynamics for combined NMPC + low-level controller testing. Given the active attitude stabilization of the low-level controller, rates and corresponding forces are small compared to the net aerodynamic forces, so we neglect them in the translational dynamics of the control augmented formulation.
2) Propulsive Forces: The propulsive forces generated by the main propellers mounted on the wing F pm and the tail F pt are generally a function of the propeller rotational speed n as well as the relative axial (v a, ) and radial (v a,⊥ ) free-stream velocity components [10]. In Fig. 2, the propeller forces are shown in orange, including two detailing illustrations of the investigated propeller-wing interaction models. In both cases, the propeller thrust forces F T,i (acting parallel to the rotational axis) are modeled as with static and dynamic thrust coefficients c T,0 , c T,J , and propeller diameter D. Note that the allocation of main and tail propeller speeds is part of the low-level controller. Since it seeks force-conservative thrust vectoring and with the tail-thrust being generally small compared to the other forces, we assume a static trim tail-thrust within the NMPC and let it optimize only over the main throttle/propeller speed.

3) Propeller-Wing Interaction:
For the forces resulting from the propeller-wing interaction, we consider two different, physically motivated models and assess their validity within the system identification in III. For the first model, referred to as slip-I and shown in Fig. 2.I, the propeller force F pm is simply composed of the (axial) thrust force F T and we apply a superposition v a,w of the free-stream airflow v a and the induced velocity in the wake of the propeller v a,ind on the respective wetted wing segments [11]. The modified lift and drag forces then follow from (8)- (11). The second model, slip-II, shown in Fig. 2.II, instead models the interaction as an additional force F N that acts perpendicular to the wing plane. It follows the derivation of the ram-drag presented in [10] and the boundary condition of zero normal flow v a,⊥ at the wing's surface. This enforces a certain amount of flow turning, where the propeller slipstream is deflected by the wing and hence, from conservation of momentum, results in a force perpendicular to the deflecting plane (wing).
For both models the induced velocity at the propeller disk, required to calculate the propeller slipstream, is obtained from disk actuator theory [ For slip-II, we furthermore require the mass-flowṁ through the propeller disk and calculate the force F N usinġ with propeller disk area A and κ ram > 0 being a constant identified from data which controls the amount of flow turning. 4) Fuselage: Aerodynamic drag generated by the fuselage is modeled as quadratic aerodynamic form [12].

5) Pitch Dynamics:
The closed-loop pitch dynamics are formulated as a second order system to reflect the low-level attitude control structure that imposes a second order model reference to be tracked by the NDI architecture [1].

B. Implementation Considerations
The use of the presented model within gradient-based trajectory optimization methods requires a careful analysis of the state and control Jacobians ∂ẋ ∂x and ∂ẋ ∂u : ∂F (x,z),i /∂x require particular attention. While the forces F (x,z),i are continuously differentiable at the origin, the arctan2(0, 0) itself in (11) is not even defined. 3 This can be problematic when using auto-generated derivatives, so we derive the Jacobians and their (existing) limits by hand. Due to limited space, we omit the presentation of the full differentiation.
r In (12), the thrust force is a quadratic, non-monotonic function in propeller speed n > 0 if v a, > 0. For NMPC, we ignore ∂F T /∂n ≤ 0 so that the solver always chooses an increasing throttle for increasing thrust. Most of the time, however, this adjustment is not active since n is high enough to not fall in the domain of negative thrust-to-speed slope.
r The choice of Cartesian coordinates in (1), (2) over the more classical, polar flight path angle/airspeed formulation found in fixed-wing literature is necessary to omit singularity problems with the latter in hover flight and zero airspeed. We expect that the presented model is well suited to capture the dynamics of other H-UAVs with similar propeller-wing combinations and high angle of attack flight as well, including e.g. tailsitter or tandem-tiltwing designs.

III. SYSTEM IDENTIFICATION
In this work, system identification, NMPC implementation and testing is performed on our small tiltwing UAV presented in detail in [1], cf. Fig. 1. It is a 0.94 m wingspan, 2.0 kg off-the-shelf RC model [13], equipped with a Holybro Durandal Pixhawk 4 that runs a customized PX4 flight stack for state estimation, low-level control, flight data measurement and collection.

A. Data Collection
For a given state, several of the parameters to be identified can have a similar or no effect on the dynamics and hence thorough coverage of the state space is required to improve parameter observability. In the present work, flight data is aggregated from several manually piloted experiments including a variety of wing-tilt configurations, static and dynamic throttle settings, and pitch references. It was furthermore ensured that the data covers the full velocity envelope to be reached by the NMPC. While a more systematic experimental design for parameter identification, as e.g. presented in [6], is generally desirable, in the present work we only use data obtained from manually guided flights. Since the final estimated model agrees well with new, unseen data, the training flights are considered diverse enough to capture the dynamics in the NMPC's intended operating envelope. Overall, approximately 30 minutes of flight data is used in a 3-1-1 ratio for training, validation and testing.
The identification process relies on an estimatex of the full longitudinal state as well as the linear and angular acceleration. Attitude and inertial velocity estimates are provided by the EKF2 Extended Kalman Filter framework implemented in the PX4 flight stack. It fuses GNSS position and velocity with barometric altitude, 3-axis linear acceleration, angular rate and magnetometer measurements. A one-dimensional pitot-static tube integrated with a flow-based differential pressure sensor provides airspeed measurements in body x-direction. These measurements, together with the estimated attitude and groundspeed, are used to estimate the wind and full airspeed vector in a post processing step. Generally, only flight data from days with low wind (<5 m/s) is used. Actuator states are either measured (wing-tilt) or propagated open-loop (propeller speeds) with the respective time constants estimated from data. Finally, the linear and angular accelerations are measured or obtained by numerical differentiation, respectively. Inertial velocity estimates are logged at a rate of 50 Hz, all other quantities at the 250 Hz update rate of the low-level attitude controller.

B. Parameter Estimation
For the two model structures defined in II, the respective parameters and aerodynamic coefficients p are estimated from the collected flight data and optimized for predictive performance. To this end, we minimize the errors e v of the open-loop simulated velocities (8), (9) together with linear and angular acceleration errors e a , eq in a least squares sense Here, only the velocities are propagated while the closedloop pitch dynamics are identified in a separate step. Hence, the actual pitch angle and rate are used in (19), (20) to focus the optimization on the aerodynamic model and prevent erroneous gravitational or centrifugal components entering the estimation. To reflect this choice,x /v denotes the vector of estimated and measured states, excluding the simulated velocities v. Including the pitch torque M and minimizing the resulting eq helps to better separate, e.g., the aerodynamic forces of wing and tail which are not individually (or less 5 ) observable from only their  I  MODEL RESIDUALS ON TRAINING-, VALIDATION-, AND TEST DATA summed effect on the linear acceleration. a m andq m (k) denote the linear and pitch angular acceleration measurements, k is the training set time index, m and I yy are the UAV mass and pitch moment of inertia, respectively.
While the minimization of acceleration errors would generally be sufficient to estimate the aerodynamic forces and hence the underlying model parameters, the open-loop propagation of the velocity proved very useful to improve the overall fit. Not only does the corresponding error minimization reflect the actual requirement of accurate velocity predictions in RHC, it also gives the optimization the flexibility to deviate from the reconstructed airspeed in favor of a more accurate acceleration fit. Since we lack a full instrumentation for 3D airspeed sensing, this is accepted and hypothesized to partially correct for errors in the training data. To penalize (too) large velocity deviations, the weight w v is introduced in (17), using a heuristically determined value of 10 based on inspection of validation data fits.
The closed-loop pitch dynamics are identified in a separate step by minimizing the sum of squared differences between simulated (3) and measured pitch angle. For parameter estimation, we employ the MATLAB lsqnonlin framework which implements a constrained nonlinear least-squares optimization.

C. Model Selection and Validation
Both models slip-I and slip-II contain a total of 40 parameters. However, for the aerodynamic components only a subset of them is finally estimated from flight data. This subset is heuristically determined based on the expected importance of the individual parameters to the overall dynamics, their observability and the resulting model fits on the validation data. The selected set comprises the parameters of (3)-(5), the thrust coefficients c T,0/J , lift-and drag coefficients for the full α-range on the wing, the fuselage drag coefficients, and the scaling parameters in slip-I and slip-II, respectively. For the horizontal tail, only the non-stalled lift coefficients are estimated. The mixing function w ns (α) in (6), (7) are further obtained from airfoil data available in literature [14]. Table I summarizes the root mean squared errors (RMSE) in linear accelerations and velocities for the two fitted models slip-I and slip-II on the training (18 min), validation (6 min) and finally the held-out test data (6 min). The validation data was used to determine the aforementioned subset of estimated parameters and the selection of the propeller-wing interaction model. slip-I shows consistently lower velocity prediction errors on both training and validation data compared to slip-II and is thus chosen for use in the NMPC. Compared to the modelidentification for fixed-wing NMPC in [6], the acceleration and velocity residuals on the test data are similar, with the largest relative difference in the horizontal velocity, there the fit in [6] is twice as accurate. Fig. 3 shows the open-loop velocity and acceleration fits of slip-I for selected excerpts of the held-out test data, covering multiple wing-tilt angles δ w between hover and cruise flight. While the open-loop simulated velocities deviate in several instances from the measured one, the deviation is considered acceptable, in particular also because the general shape, and thus dynamic effects, are approximated well. This is also reflected in excellent acceleration fits. Applying described system ID with a model that excludes the propeller-wing interaction, as e.g. in [8], acceleration errors of up to 3˜m/s 2 remain in transition flight for the UAV at hand. This translates to roughly a third of the forces involved in steady flight (|a| = g) and highlights the importance of including this model component.
The current attitude controller and control surface layout of the employed tiltwing UAV fails to track pitch set points in several instances, either due to steady state offsets originating in model errors or elevator saturation. The use of a second order model for the resulting closed loop dynamics has therefore limited validity for the training data at hand, resulting in a comparatively high RMSE of θ e = 5.7 • for the open-loop simulated pitch dynamics on the validation set, compared to θ e = 0.9 • in [6]. Despite these inaccuracies, the resulting NMPC showed good velocity tracking so the second order formulation is kept. Improved platform design and controller tuning is expected to reduce these errors. However, the NMPC itself should also be constrained to avoid infeasible pitch setpoints in the first place.

D. Trim-Map Generation
Based on the identified model slip-I, we derive the corresponding trim-states and inputs for the planned flight envelope.
These trims are later employed in the NMPC to guide the optimization process in the form of input and state regularization. Since the velocity dynamics are overactuated, the trims are not uniquely defined. For example, a tiltwing aircraft can hover in a continuous range of pitch angles as long as the wing, and thus the thrust vector, points upward (tilt/pitch overactuation). Additional objectives such as energy efficiency or zero pitch angle close to hover, are thus introduced to obtain unique trims [1].

IV. CONTROL FORMULATION
The continuous time formulation of the optimal control problem (OCP) is given as with box-constrained set of inputs U , y and z are state-and input dependent output vectors used to define the velocity tracking objective, state-and input regularization: Q y , R z and P are the corresponding diagonal, positive-definite weighting matrices, v n and v d the horizontal -and vertical (gravity-aligned) inertial velocity components.

A. Objective Function and Regularization
In order to prevent excessive bang-bang inputs from the NMPC and address the tilt/pitch overactuation described in III-D, state-and input trajectories need to be regularized with appropriate references y ref , z ref . Two methods are investigated, 1) using offline optimized trims and 2) using the preceding RHC control-and state solution.
For constant velocity setpoints, trims provide optimal references that, e.g., also consider energy efficiency or the tilt/pitch trade-off described in III-D. Depending on the attractive region and stability properties of the trimmed steady-state, the use of trims at either the current/predicted or the reference velocities is preferred, see [3] for a similar discussion in the context of feedforward control. By specifying dynamically feasible reference trajectories, however, the tracking errors typically remain small and both cases are similar in effect.
As trims describe steady-states, their use for regularization becomes questionable when tracking increasingly dynamic references. E.g., when transitioning from hover to cruise, deviating from the steady-state θ = 0 into a nose-down attitude helps to accelerate more aggressively. Assuming a RHC solution forms an optimal dynamic reference, the second regularization method uses optimized and shifted preceding solutions as references. This stabilizes the horizon over iterations but is otherwise not biased to 'dragging' steady-state references. However, in case of unforeseen disturbances or reference changes, it is expected to have the undesirable effect of slowing down any reactive behavior.

B. Implementation
The OCP is implemented using the ACADO [15] toolkit for fast c-code solver generation. It implements a real-time iterative scheme using direct multiple shooting on the time-discretized horizon and the qpOASES 6 solver for active-set based sequential quadratic programming of the resulting boundary value problems.

V. SIMULATION RESULTS
All simulations are set up in a MATLAB Simulink environment, using a longitudinal dynamic model based on sec. II, slip-I, with added low-level actuation, pitch dynamics and pitch angular rate effects. The low-level loop is closed using the actual attitude controller, running at 250 Hz. In the high-level, we use the same ACADO generated c-code for NMPC that is later used on the real platform in VI, running it at the targeted update frequency of 20 Hz and 0.1 s discretization. For model parameters used in both the dynamics simulation and the NMPC model, identical values are employed. Furthermore, we assume perfect state information and instead demonstrate practical robustness in actual flight experiments.
For a qualitative comparison with reported dynamic inversion based velocity control, we additionally simulate an NDI controller based on the same model used in the NMPC. It is formulated as detailed in [1], and calculates throttle and pitch setpoints to follow a desired, second-order (citically-damped) reference model for the velocity. In NDI, the wing-tilt is solely feed-forward controlled using trims at the reference velocity.

A. Horizon Length
For the identified model, gradually increasing the horizon length from 0.5 s to 4 s did not yield noticeable improvements in tracking of representative (e.g. Fig. 5) velocity references, however, the control inputs tend to become smoother. This helps to lower the risk of low-level pitch control saturation which is currently not modeled in the NMPC. Fig. 4, right, illustrates said pitch saturation for horizon lengths T < 2 s, cf. θ r (thin line, annotated) vs. θ (thicker line). The observation that short horizons (0.5 s -2 s) already perform well agrees with the good performance of the NDI controller, which is purely reactive, shown in Fig. 5. The identified dynamics are non-linear, but still rather smooth and we assume that this is one of the main reasons why short horizons, or even purely reactive methods, work well for our tiltwing H-UAV. We can support this hypothesis by creating examples where stall effects are more pronounced, a case potentially relevant to platforms with mostly slip-stream-free wing-sections. There, purely reactive NDI or short-horizon NMPC either fail in transitioning or exhibit coupled errors in velocity tracking, whereas longer For reference against purely reactive behavior, the corresponding NDI control is also shown. In the θ-plots, the annotated lines additionally show pitch references θ r for cases where low-level pitch control saturation occurs.
horizons T > 1 s yield improved tracking. This is illustrated in Fig. 4, right, where we use a modified lift curve with a distinctive stall point (similar to a NACA4415, AR12 [14]) and assess how this non-linearity affects the control behavior for different horizon-lengths. For the remaining simulations and real flight tests, we choose an intermediate horizon length of 2 s, with 0.1 s time-discretization and 20 Hz update rate for good computational feasibility (< 20ms/iter) and acceptable (cf. V-C) tracking results in simulation.

B. Regularization
The two introduced state and input regularization methods can be tuned for similar tracking performance while omitting excessive, or high-frequency, control inputs. See Fig. 4 for a comparison in tracking exemplary references. However, overall performance showed lowered sensitivity to tuning when using trims as state and input references. Utilizing the previous RHC solution instead, causes the regularization to depend on past references and is thus more specific to a particular trajectory, a suspected reason for the objective weighting to become more maneuver dependent in this case. Also, opposed to trim references, the absolute control input is not directly penalized (only the deltas between successive solutions at a given time in the horizon) and as such it can meander within the given, hard input constraints. While this might be beneficial for dynamic maneuvers, in Fig. 4 the NMPC with this prv-sol regularization saturates low-level pitch control and thus violates the controlaugmented formulation, cf. θ r (thin line, annotated) vs. θ (thicker line). Trim references instead foster solutions close to nominal flight with improved pitch authority and thus offer a simpler, though not as rigorous, solution compared to state-dependent pitch input constraints. Given these considerations and the tendency of the second method to 'lock' to an outdated RHC solution upon reference change, we choose trims at the reference velocity for regularization in all subsequent experiments.

C. Velocity Tracking Scenarios
Both in simulation and real experiments, we restrict velocity reference trajectories to be (approximately) dynamically feasible, with the main constraining component being the slow wingtilt rate of −9 • /s <δ w < 18 • /s. To assess control performance, we focus on transitions coupled with varying vertical velocities (Fig. 5) to cover states of low and high (stalled) angles of attack α wing , different slipstream influences and varying power settings. Fig. 5 depicts the simulated tracking of such dynamic velocity references for both the NMPC and NDI controller. Both controllers are manually tuned and show comparable performance (|v − v r | rmse < 0.67m/s for the NMPC).

VI. FLIGHT EXPERIMENTS
For flight testing, the NMPC (ACADO-generated solver with custom wrapper) is implemented on an UP board 7 (Intel Atom x5-z8350, 1.92 GHz). The 20 Hz update frequency and 20 × 0.1s horizon yield a solver time of <20 ms, conservative upper limit per iteration at an average 25% CPU-load. Further details on the UAV and low-level control are given in [1]. Fig. 6 shows tracking of steady and dynamic velocity references, including similar reference combinations as investigated in simulation. The NMPC is tuned manually, using a 3-times higher weight on vertical v n -compared to horizontal v d velocity to 1) favour vertical responsiveness for safety and 2) reduce v n errors caused by a partially unreliable wing-tilt actuation from affecting v d tracking accuracy. A relatively high penalty on pitch is used (θ/v d penalty equivalent of 10 • s/m), to prevent excitation and/or saturation of the low-level pitch control. Still, there are cases where the low-level saturates (grey overlay in Fig. 6), leading to vertical velocity tracking errors. During flight experiments, reference velocities had to be provided manually. To ensure a reactive behavior for platform safety when flying close to ground or trees, the NMPC is therefore operated in a 'reactive' mode, using the most recent velocity command as constant reference throughout the horizon. The lack of information about future references is reflected in the constant v n offsets of up to 3 m/s during horizontal velocity ramps, see Fig. VI. For the entire experiment, steady reference tracking errors are unimodally distributed with μ n = -0.5 m/s, σ n = 0.9 m/s in horizontal and μ d = -0.05 m/s, σ d = 0.6 m/s in vertical direction. In light of added outer feedback from path/position control in future extensions, overall performance is considered acceptable. Reported NDI-based velocity control on tiltwing UAVs, such as [1], [3], indicate a similar performance in flight experiments as the presented NMPC in 'reactive' mode. This supports our findings from simulation that both methods are, generally, viable candidates for velocity control.

VII. CONCLUSION AND FUTURE WORK
We derived and identified the longitudinal dynamic model of a tiltwing H-UAV with a special focus on the aerodynamic propeller-wing interaction and good predictive capabilities required for RHC. Based on this model, an NMPC for velocity tracking is implemented and good control performance demonstrated in flight tests. The use of (optimized) trims to regularize the NMPC solution is preferred over preceding RHC solutions for 1) more intuitive and less maneuver dependent tuning and 2) less exhausting control inputs to reduce risk of low-level control saturation. Here, a future point of improvement concerns the inclusion of low-level pitch control limits to prevent saturation and loss in tracking accuracy by design. In simulation, the NMPC performs similarly to a more lightweight NDI control approach. However, by optimizing over an entire horizon, NMPC can better accommodate locally ill-conditioned control gradients (e.g. originating from modeled airfoil stall effects) and provides constraint-aware planning of the control effort. Furthermore, the NMPC's predictive qualities are a valuable component for future extensions to position control and guidance where path following is expected to greatly benefit from dynamic planning capabilities.