Fusion of Unscented Kalman Filter and Nonlinear Model Predictive Control for Airspeed-Attitude Control of Fixed-Wing Unmanned Aerial Vehicles

We investigate the airspeed-attitude control problem for a fixed-wing drone operating under strong sensor measurement noise and actuator constraints. The nonlinear dynamics, inherent coupling between aerodynamic angles and body rates, and the need to respect flight envelope boundaries make this a challenging multi-variable control task. To address these issues, we propose a control framework that integrates a nonlinear model predictive controller with an unscented Kalman filter for state estimation. The UKF provides accurate and robust estimates of the angle of attack, sideslip angle, and body angular rates—states that are directly corrupted by low-cost MEMS sensors. The NMPC then uses these estimates to compute optimal control inputs while enforcing constraints on control surfaces and states. We validate the approach through numerical simulations and compare it with an extended Kalman filter based counterpart. Results show that the UKF-based estimator reduces the root-mean-square estimation errors by at least 43% for all critical states, and the closed-loop attitude tracking errors are reduced by up to 80% compared with the EKF-based approach, demonstrating the superiority of the UKF-NMPC fusion for fixed-wing drone control in noisy environments.

1. Introduction

The fixed-wing drone has become indispensable in both military and civilian applications due to its endurance, payload capacity, and operational flexibility. Precise attitude control is essential for mission success, whether in surveillance, mapping, or cargo delivery. However, small fixed-wing drones are often equipped with low-cost micro-electromechanical system sensors that suffer from significant noise, bias, and drift. This measurement uncertainty directly degrades the performance of conventional controllers if the raw sensor outputs are used as feedback.

Model predictive control has emerged as a powerful technique for handling multivariable constrained systems. For fixed-wing drones, nonlinear model predictive control can naturally incorporate constraints on angle of attack (to prevent stall), control surface deflections, and angular rates. Nevertheless, the effectiveness of NMPC heavily relies on the accuracy of the state feedback. When the measured angle of attack, sideslip angle, and body angular rates are contaminated by noise, the predicted future states diverge from the actual ones, leading to poor tracking and potential instability.

To mitigate this problem, we employ a state estimator within the control loop. The extended Kalman filter is commonly used for nonlinear systems, but it requires linearization of the model around the current estimate, which can introduce large errors when the system behaves highly nonlinearly. The unscented Kalman filter, on the other hand, uses a deterministic sampling technique to propagate the mean and covariance through the true nonlinear dynamics, avoiding the need for Jacobian computations and offering superior accuracy for strongly nonlinear systems. Compared with the EKF, the UKF is especially beneficial for the fixed-wing drone’s airflow angle dynamics, which exhibit rapid variations and strong coupling.

In this work, we design a UKF-based state estimator that estimates the angle of attack α, sideslip angle β, roll rate p, pitch rate q, and yaw rate r—the states most affected by sensor noise. The estimated states are then fed into an NMPC controller that tracks reference commands for airspeed VT, roll angle φ, pitch angle θ, and yaw angle ψ. We formulate the NMPC optimization problem with constraints on control inputs (surface deflections and deflection rates) and states (stall margin). The stability of the closed-loop system is guaranteed by a terminal cost and terminal constraint derived from a local Lyapunov function.

We compare the proposed UKF-NMPC scheme with an EKF-NMPC scheme through simulation. The aircraft model used in all tests is a general-aviation fixed-wing drone with five independent control surfaces (left aileron, right aileron, left elevator, right elevator, and rudder), as described in the reference literature. The simulation environment includes realistic actuator dynamics (second-order lag with natural frequency 100 rad/s and damping ratio 0.75), control surface limits (±25° deflection, ±120°/s deflection rate), and sensor noise with standard deviations of 2°/s for airflow angles and 5°/s for angular rates. The sampling time of the controller is 50 ms.

The structure of this paper is as follows: Section 2 presents the nonlinear model of the fixed-wing drone. Section 3 describes the UKF-based local flight state estimator. Section 4 details the NMPC airspeed-attitude controller design and its stability analysis. Section 5 reports the simulation results and the comparison between UKF and EKF. Section 6 concludes the work.

2. Fixed-Wing Drone Dynamical Model

We consider a standard six-degree-of-freedom nonlinear model for the fixed-wing drone. Assuming a flat Earth, constant mass, and a plane of symmetry, the dynamics expressed in the wind frame and body frame are given by:

$$
\begin{aligned}
\dot{V}_T &= \frac{X_w + F_T \cos\alpha \cos\beta + m g_w^x}{m} \\
\dot{\alpha} &= q – (p \cos\alpha + r \sin\alpha) \tan\beta + \frac{Z_w – F_T \sin\alpha + m g_w^z}{m V_T \cos\beta} \\
\dot{\beta} &= p \sin\alpha – r \cos\alpha + \frac{Y_w – F_T \cos\alpha \sin\beta + m g_w^y}{m V_T} \\
\dot{\phi} &= p + (q \sin\phi + r \cos\phi) \tan\theta \\
\dot{\theta} &= q \cos\phi – r \sin\phi \\
\dot{\psi} &= \frac{q \sin\phi + r \cos\phi}{\cos\theta} \\
\dot{p} &= (c_1 p + c_2 r) q + c_3 L + c_4 N \\
\dot{q} &= c_5 p r – c_6 (p^2 – r^2) + c_7 M \\
\dot{r} &= (c_8 p – c_1 r) q + c_4 L + c_9 N
\end{aligned}
$$

where the state vector is x = [VT, α, β, φ, θ, ψ, p, q, r]T and the control input vector is u = [δT, δal, δar, δel, δer, δr]T. The aerodynamic forces Xw, Yw, Zw and moments L, M, N are expressed as polynomial functions of the aerodynamic coefficients. The constants ci (i=1,…,9) are functions of the moments of inertia Ix, Iy, Iz and the product Ixz. The thrust FT is aligned with the body x-axis. The gravity vector in the wind frame is denoted by gw.

3. Unscented Kalman Filter for Local State Estimation

The sensor measurements of the fixed-wing drone are corrupted by additive Gaussian white noise. We define the local state vector to be estimated as xs = [α, β, p, q, r]T, which corresponds to the available noisy measurements ys. The discrete-time nonlinear system is:

$$
\begin{aligned}
x_s(k+1) &= F_s(x_s(k), u(k)) + w(k) \\
y_s(k+1) &= H(x_s(k)) + v(k)
\end{aligned}
$$

where w(k) and v(k) are process and measurement noise with covariance matrices Qk and Rk, respectively. The UKF proceeds via the following steps.

3.1 Sigma Point Generation

At time step k, given the state estimate ŝk|k and covariance Pk|k, we generate 2n+1 sigma points (with n=5):

$$
\begin{aligned}
\hat{x}^{(0)}_{k|k} &= \hat{x}_{k|k} \\
\hat{x}^{(i)}_{k|k} &= \hat{x}_{k|k} + \left( \sqrt{\alpha^2 (n+\kappa) P_{k|k}} \right)_i, \quad i=1,\dots,n \\
\hat{x}^{(i)}_{k|k} &= \hat{x}_{k|k} – \left( \sqrt{\alpha^2 (n+\kappa) P_{k|k}} \right)_i, \quad i=n+1,\dots,2n
\end{aligned}
$$

with scaling parameters α=0.01, κ=0, and a secondary parameter β=2.

3.2 Time Update (Prediction)

Each sigma point is propagated through the nonlinear dynamics:

$$
\hat{x}^{(i)}_{k+1|k} = F_s( \hat{x}^{(i)}_{k|k}, u(k) )
$$

Then the predicted state mean and covariance are:

$$
\begin{aligned}
\hat{x}_{k+1|k} &= \sum_{i=0}^{2n} w_m^{(i)} \hat{x}^{(i)}_{k+1|k} \\
P_{k+1|k} &= \sum_{i=0}^{2n} w_c^{(i)} \left( \hat{x}^{(i)}_{k+1|k} – \hat{x}_{k+1|k} \right) \left( \hat{x}^{(i)}_{k+1|k} – \hat{x}_{k+1|k} \right)^T + Q_k
\end{aligned}
$$

The weights are:

$$
\begin{aligned}
w_m^{(0)} &= 1 – \frac{n}{\alpha^2 (n+\kappa)} \\
w_c^{(0)} &= (2 – \alpha^2 + \beta) – \frac{n}{\alpha^2 (n+\kappa)} \\
w_m^{(i)} &= w_c^{(i)} = \frac{1}{2\alpha^2 (n+\kappa)}, \quad i=1,\dots,2n
\end{aligned}
$$

3.3 Measurement Update (Correction)

A new set of sigma points is generated from the predicted state, and each is passed through the measurement function h(x)=x (direct measurement of the local states):

$$
\hat{y}^{(i)}_{k+1|k} = \hat{x}^{(i)}_{k+1|k}
$$

The predicted measurement mean, innovation covariance, and cross-covariance are:

$$
\begin{aligned}
\hat{y}_{k+1} &= \sum_{i=0}^{2n} w_m^{(i)} \hat{y}^{(i)}_{k+1|k} \\
P_y &= \sum_{i=0}^{2n} w_c^{(i)} \left( \hat{y}^{(i)}_{k+1|k} – \hat{y}_{k+1} \right) \left( \hat{y}^{(i)}_{k+1|k} – \hat{y}_{k+1} \right)^T + R_k \\
P_{xy} &= \frac{1}{2\alpha^2 (n+\kappa)} \sum_{i=1}^{2n} \left( \hat{x}^{(i)}_{k+1|k} – \hat{x}_{k+1|k} \right) \left( \hat{y}^{(i)}_{k+1|k} – \hat{y}_{k+1} \right)^T
\end{aligned}
$$

The Kalman gain and updated state-covariance pair are:

$$
\begin{aligned}
K_{k+1} &= P_{xy} P_y^{-1} \\
\hat{x}_{k+1|k+1} &= \hat{x}_{k+1|k} + K_{k+1} (y_{k+1} – \hat{y}_{k+1}) \\
P_{k+1|k+1} &= P_{k+1|k} – K_{k+1} P_y K_{k+1}^T
\end{aligned}
$$

This UKF estimator runs at every sampling instant and provides filtered estimates of α, β, p, q, and r to the NMPC.

4. Nonlinear Model Predictive Control for Airspeed and Attitude

4.1 System Discretization and Constraints

We discretize the full-state nonlinear dynamics (including the unmeasured states VT, φ, θ, ψ) using forward Euler with sampling time Ts=0.05 s:

$$
x(k+1) = x(k) + T_s f(x(k), u(k))
$$

Denote F(x,u) the discrete dynamics. The system output is y=[VT, φ, θ, β]T. The control inputs are subject to magnitude and rate limits:

$$
\begin{aligned}
u_{\min} &\leq u(k) \leq u_{\max} \\
\Delta u_{\min} &\leq \Delta u(k) \leq \Delta u_{\max}
\end{aligned}
$$

where umin and umax are the deflection limits (±25°) and the throttle range (0 to 1). The rate limits are ±120°/s for control surfaces. State constraints ensure that the angle of attack remains below the stall angle and that angular rates stay within structural limits.

4.2 Optimization Problem

At each time step k, given the current (estimated) state x(k), we solve the following optimal control problem over a prediction horizon Np=2 and control horizon Nc=1:

$$
\begin{aligned}
\min_{U(k)} \quad & J = \sum_{i=0}^{N_p-1} \left( \| x_e(k+i|k) \|_Q^2 + \| u(k+i) \|_R^2 \right) + \| x(k+N_p|k) \|_P^2 \\
\text{s.t.} \quad & x(k+1+i|k) = F(x(k+i|k), u(k+i)), \quad i=0,\dots,N_p-1 \\
& y(k|k) = H(x(k)) \\
& u_{\min} \leq u(k+i) \leq u_{\max}, \quad i=0,\dots,N_c-1 \\
& \Delta u_{\min} \leq \Delta u(k+i) \leq \Delta u_{\max}, \quad i=0,\dots,N_c-1 \\
& x_{\min} \leq x(k+i|k) \leq x_{\max}, \quad i=0,\dots,N_p-1 \\
& x(k+N_p|k) \in \Omega
\end{aligned}
$$

where xe = xxref, Q = diag(3,0,0,3,3,3,0,0,0), R = 0 (we penalize only state error because the actuators already have rate limits), and P = diag(3,0.01,0.01,3,3,3,0.01,0.01,0.01). The terminal set Ω is defined through a local Lyapunov function.

4.3 Terminal Cost and Feasibility/Stability

We linearize the system at the steady-state operating point and design a state feedback gain K such that A+BK is stable. Then we solve the discrete Lyapunov equation:

$$
A_K^T P A_K – P + \varepsilon (Q + K^T R K) = 0
$$

with ε=1.01 to guarantee a margin. The terminal set is defined as:

$$
\Omega = \{ x \in \mathbb{R}^9 \,|\, x^T P x \leq a \}
$$

where a is a positive constant. It can be shown that for any state inside Ω, the terminal controller u=Kx keeps the state inside Ω for all future times and satisfies all constraints. Then by standard receding horizon arguments, the closed-loop system under NMPC is recursively feasible and asymptotically stable.

5. Simulation Results and Discussion

We conduct numerical simulations in MATLAB/Simulink using the model of a fixed-wing drone from the literature. The sensor noise is added to the measurements of α, β, p, q, r with standard deviations of 2°/s and 5°/s respectively. The NMPC uses the UKF estimates (or EKF estimates for comparison) as the initial state for prediction. For a fair comparison, the same process and measurement noise covariances are used in both filters.

5.1 Local State Estimation Performance

We first evaluate the estimation accuracy of the open-loop estimation (without closing the control loop with the estimated states). The true states are used for feedback, and the filters only run in parallel to observe their performance. The estimation results are summarized in the following table:

Table 1: Root Mean Square Error of State Estimation
State UKF RMSE EKF RMSE Reduction (%)
Angle of attack α (°) 0.5493 2.1785 74.49
Sideslip angle β (°) 0.0335 0.2530 86.86
Roll rate p (°/s) 1.0901 1.9202 43.23
Pitch rate q (°/s) 1.4182 3.8164 62.84
Yaw rate r (°/s) 0.7311 1.7608 58.49

As shown in Table 1, the UKF outperforms the EKF in all five local states. The reduction in estimation error ranges from 43.23% for roll rate to 86.86% for sideslip angle. The improvement is particularly significant for the angles of attack and sideslip, which are highly nonlinear. The reason is that the UKF does not rely on linearization and can capture the true mean and covariance more accurately, especially during rapid transient maneuvers (e.g., after a step command at 5 s or 10 s). In contrast, the EKF suffers from linearization errors that become pronounced when the system trajectory moves into strongly nonlinear regions.

5.2 Closed-Loop Attitude Control Performance

We then close the loop: the NMPC receives either raw noisy measurements, UKF estimates, or EKF estimates. The reference commands for roll, pitch, and yaw angles are step changes. The following table compares the maximum tracking errors for each scheme:

Table 2: Maximum Attitude Tracking Error under Strong Noise
Scenario Roll angle φ_max error (°) Pitch angle θ_max error (°) Yaw angle ψ_max error (°)
No filter (raw measurements) 4.30 0.91 7.72
With UKF 0.24 0.28 0.60
With EKF 0.94 0.31 3.01

Without any filter, the tracking performance is unacceptable, with yaw angle errors exceeding 7°. With the EKF, the errors are reduced significantly but still show noticeable fluctuations (roll error up to 0.94°, yaw error up to 3.01°). With the UKF, the tracking is smooth and accurate: the maximum errors are only 0.24° for roll, 0.28° for pitch, and 0.60° for yaw. The improvements over the EKF are 74.47%, 9.68%, and 80.07% respectively. The pitch angle improvement is modest because the pitch dynamics are relatively linear in the operating region, but for roll and yaw, the coupling and nonlinearities make the UKF much more beneficial.

The reason for the superior closed-loop performance of the UKF can be understood as follows: In the presence of measurement noise, the NMPC relies on the filtered states to predict future trajectories. If the filter provides inaccurate estimates, the predicted states will deviate from the true states, leading to suboptimal control decisions. The EKF’s linearization errors become amplified when the system is excited by noise, causing the estimated states to oscillate. In contrast, the UKF maintains consistency even under rapid state changes, providing the NMPC with a reliable initial condition for the optimization. Consequently, the control inputs (throttle and surface deflections) are smoother, and the fixed-wing drone follows the reference commands with minimal oscillation.

6. Conclusion

We have presented a complete framework that integrates the unscented Kalman filter with nonlinear model predictive control for the airspeed-attitude control of a fixed-wing drone. The UKF effectively mitigates the adverse effects of sensor noise on the critical flight states (angle of attack, sideslip angle, and body angular rates), providing accurate state estimates even during rapid maneuvers. The NMPC, using these estimates, achieves precise tracking of attitude commands while respecting actuator limits and flight envelope constraints. Simulation results confirm that the UKF-based approach reduces estimation errors by 43%–87% and attitude tracking errors by up to 80% compared with the EKF-based approach. These findings demonstrate that the fusion of UKF and NMPC is a promising solution for fixed-wing drone control in real-world noisy environments, where low-cost sensors are commonly used. Future work will focus on real-time implementation and experimental validation on an actual fixed-wing drone platform.

Scroll to Top