Next Article in Journal
Sliding Mode Controller for Quadcopter UAVs: A Comprehensive Survey
Previous Article in Journal
Resilient Task Allocation for UAV Swarms: A Bilevel PSO-ILP Optimization Approach
Previous Article in Special Issue
Fuzzy Adaptive Fixed-Time Bipartite Consensus Self-Triggered Control for Multi-QUAVs with Deferred Full-State Constraints
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Model-in-the-Loop Design and Flight Test Validation of Flight Control Laws for a Small Fixed-Wing UAV

Department of Aeronautics and Astronautics, National Cheng Kung University, Tainan 701, Taiwan
*
Author to whom correspondence should be addressed.
Drones 2025, 9(9), 624; https://doi.org/10.3390/drones9090624
Submission received: 5 August 2025 / Revised: 1 September 2025 / Accepted: 2 September 2025 / Published: 4 September 2025
(This article belongs to the Special Issue Path Planning, Trajectory Tracking and Guidance for UAVs: 3rd Edition)

Abstract

This study provides an experimentally validated workflow for the development and model-in-the-loop (MIL) validation of flight control laws for a small, low-cost fixed-wing UAV within a model-based design (MBD) framework, addressing the limitation that previous workflow demonstrations largely remain conceptual or simulation-only and that systematic processes for low-cost UAVs are lacking. A key advantage is that control law methods or parameters can be determined prior to flight testing, avoiding on-site tuning, a major challenge in UAV deployment. The Skysurfer X8 UAV served as the experimental platform. Linearized dynamic models were derived to design rate and attitude controllers using frequency-domain techniques, where loop shaping was applied to meet U.S. military flight quality standards. The control algorithms were validated in an MIL environment, enabling early evaluation of control logic, dynamic response, and robustness under idealized and perturbed conditions. Following MIL verification, the control logic was generated via Simulink Coder and deployed on a Pixhawk 6C flight controller with the PX4 autopilot. Flight test results on the Skysurfer X8 showed good agreement with MIL simulations, confirming the reliability and consistency of the proposed methodology in both simulated and real domains, while also demonstrating a systematic workflow that fills a practical gap in low-cost UAV development.

1. Introduction

Unmanned Aerial Vehicles (UAVs) are increasingly adopted in a wide range of civil and military applications due to their flexibility, cost-efficiency, and mission versatility. Among the various types, small fixed-wing UAVs are particularly suited for long-range reconnaissance and low-power operations. A key challenge, however, lies in ensuring that control systems designed in simulation can be seamlessly deployed to real platforms without extensive on-site tuning. The present study directly addresses this gap by proposing a model-based design (MBD) workflow in which controllers designed according to established flying quality standards can be validated in real flight with minimal modification. This ability to transition from regulation-driven design to actual flight testing underscores the practical value and reproducibility of the proposed approach.
Aerodynamic modeling forms the foundation of simulation-driven control law synthesis. In this study, the Athena Vortex Lattice (AVL) tool developed by Drela and Youngren [1] was used to compute linearized aerodynamic coefficients and stability derivatives for the Skysurfer X8 UAV. The geometry was directly measured from the physical airframe, while inertia properties were adopted from prior flight-based identification studies [2,3]. Recent advances in UAV aerodynamic modeling [4,5] and system identification of small fixed-wing aircraft [6], as well as validation efforts using DATCOM-based modeling frameworks benchmarked with open-loop flight data [7], further emphasize the importance of combining computational tools with flight-derived data to achieve predictive fidelity.
The controller design process in this work is explicitly guided by standardized flying quality requirements. The MIL-F-8785C specification [8] serves as the baseline for evaluating short-period damping ratio, natural frequency, and bandwidth. Interpretations provided in [9] extend these standards to UAV contexts, while recent handling-quality assessments [10,11,12] reaffirm their applicability for modern unmanned platforms. By adhering to these criteria, the proposed controllers are not only tuned for robustness and responsiveness but also evaluated against formal guidelines traditionally applied to piloted aircraft.
To verify the designed controllers before flight, this study primarily employs model-in-the-loop (MIL) testing, supported by complementary software-in-the-loop (SIL) verification to ensure functional aspects such as flight-test procedures and mode switching. Recent UAV studies consistently position MIL as the first gate for control law vetting and scenario validation before any software or hardware deployment, demonstrating its effectiveness for catching requirement and integration issues early [13,14,15], with additional simulation-based case studies such as Huang et al. on obstacle avoidance using Gazebo/ROS [16] and Kapeel on high-fidelity 6-DoF fixed-wing modeling [17] further confirming the role of MIL/SIL as indispensable stages before flight deployment. hardware-in-the-loop (HIL) testing is generally recognized as an important step for validating hardware–software integration [18], but it is not the focus of this work and is left for future development. By emphasizing MIL and SIL, the staged approach ensures that the control laws are sufficiently examined prior to real flight while keeping the validation process practical and efficient. State-of-practice MIL/SIL workflows for PX4/Simulink-based UAVs have shown reproducible pipelines from plant-controller simulation to on-aircraft execution, which aligns with the verification strategy adopted here. Similarly, SIL platforms have been applied to waypoint navigation testing of fixed-wing UAVs [19], highlighting their utility in verifying mission-level functionalities beyond basic control laws.
The control architecture adopts a cascaded loop structure, with an inner loop stabilizing angular rates and an outer loop regulating attitude. Classical frequency-domain techniques, including loop shaping and phase/gain margin adjustments [20], are employed to ensure robustness and compliance with MIL-F-8785C criteria. Linearized models and controllers around trim conditions are reduced to second-order approximations for handling quality assessment, directly linking control synthesis to regulatory standards. It should be emphasized that the focus of this study is to investigate the MIL-based validation process rather than to introduce novel control law design methods.
The proposed controllers were deployed to a Pixhawk 6C autopilot using the MathWorks PX4 Autopilot Support Package [21]. Flight testing on the Skysurfer X8 demonstrated close agreement between simulation and real-world responses, validating both the aerodynamic modeling assumptions and the control laws. Unlike many prior approaches that require substantial field tuning, this study confirms that controllers synthesized under formal flying quality standards can be executed in real flight without on-site adjustment. This contribution situates the work within the recent emphasis on reproducible UAV design and validation pipelines [22,23], providing a traceable methodology that bridges regulation-driven design, progressive simulation verification, and successful real-world demonstration.

2. Modeling and Flying Qualities

Figure 1 presents a comprehensive, traceable workflow for the model-based development of a flight control system, integrating both physical modeling and progressive simulation stages. The process begins with the definition of system-level mission requirements, which drive the collection of physical parameters—including aerodynamic coefficients, mass distributions, and propulsion data—organized into an aerodynamic database. This database is used to construct a high-fidelity six-degree-of-freedom (6DoF) nonlinear model that serves as the foundation for model-in-the-loop (MIL) validation. At this MIL stage, the control logic is tested in conjunction with the plant model to evaluate dynamic response and robustness before proceeding to more resource-intensive stages. The 6DoF model is further linearized to support controller design through frequency-domain techniques. A reduced-order model is derived and compared against flying quality standards to support compliance. After controller synthesis, the system undergoes a series of embedded simulations: first in software-in-the-loop (SIL), then in hardware-in-the-loop (HIL), leading to full flight testing. The loop is closed by feeding back flight results and system capabilities to refine the original requirements and design.
To facilitate controller design, the nonlinear model is linearized around predefined trim points, typically corresponding to steady-level flight conditions, in order to extract a reduced-order linear system. This linear model is used to evaluate flying quality metrics and serves as the basis for frequency-domain control design techniques, including gain/phase margin tuning and loop shaping. The resulting controller undergoes iterative verification steps, including flying quality checks, model reduction comparisons, and closed-loop simulations.
Once validated, the controller is deployed into the full nonlinear 6DoF environment and tested under software-in-the-loop (SIL), with HIL considered as a future step. This supports consistency between simulated and real-world behavior, facilitating a robust transition to flight validation. The workflow depicted in Figure 1 ensures a systematic and standards-compliant pathway for developing reliable UAV control systems.

2.1. Skysurfer X8 Six-Degree-of-Freedom Aircraft Model Derivation

This study formulates the six-degree-of-freedom (6-DoF) equations of motion for a rigid-body fixed-wing aircraft expressed in the body frame. The translational motion is modeled using Newton’s second law, as shown in Equation (1), where m is the mass of the aircraft, V is the velocity vector in the body frame, ω is the angular velocity vector, and F B is the total external force applied in the body frame. The rotational dynamics are governed by Euler’s equations, as shown in Equation (2). These two vector equations serve as the foundation for the nonlinear dynamic model used throughout this study for control design and flight simulation.
m V ˙ + m ω × V = F B
I ω ˙ + ω × I ω = M B
To further detail the sources of external forces and moments acting on the aircraft, Equations (3) and (4) present a decomposition of the total force and moment in the body frame. The total force F B consists of three components: the aerodynamic force transformed from the stability frame R S B F A e r o , the thrust force F T , and the gravitational force projected from the Earth frame R E B F g . Similarly, the total moment M B arises from the aerodynamic moment, which is also transformed from the stability frame to the body frame using R S B . This formulation clarifies the contributions of various physical effects and supports subsequent aerodynamic modeling and flight control design.
F B = R S B F A e r o + F T + R E B F g
M B = R S B M A e r o
To facilitate transformation between reference frames, two direction cosine matrices are introduced. Equation (5) presents the rotation matrix R E B , which transforms vectors from the Earth frame (E) to the body frame (B), based on three Euler angles: roll ( ϕ ), pitch ( θ ), and yaw ( ψ ). Equation (6) provides the rotation matrix R S B , used to project aerodynamic forces and moments defined in the stability (wind) frame (S) into the body frame. Here, α denotes the angle of attack and β the sideslip angle. The shorthand notations S X and C X represent s i n   ( x ) and c o s   ( x ) , respectively, for notational simplicity.
R E B   =   C θ C ψ C θ S ψ S θ S ϕ S θ C ψ C ϕ S ψ S ϕ S θ S ψ + C ϕ C ψ S ϕ C θ C ϕ S θ C ψ + S ϕ S ψ C ϕ S θ S ψ S ϕ C ψ C ϕ C θ
R S B   =   C α C β C α S β S α S β C β 0 S α C β S α S β C α
This study adopts a conventional aerodynamic coefficient model to describe the aerodynamic forces and moments in the stability frame. As shown in Equation (7), the aerodynamic force vector F A e r o   =   [ D , Y , L ] T consists of drag, side force, and lift. It is proportional to the dynamic pressure 1 2 ρ V 2 , reference wing area S r e f , and the non-dimensional coefficients [ C D , C Y , C L ] T . Equation (8) defines the aerodynamic moment vector M A e r o   =   [ l , m , n ] T , representing roll, pitch, and yaw moments. The coefficients [ C l , C m , C n ] T are scaled by the wingspan b and mean aerodynamic chord c ¯ , and multiplied by the same dynamic pressure and reference area. This formulation facilitates integration of wind tunnel data and flight test results into dynamic simulations.
F A e r o   =   D Y L = 1 2 ρ V 2 S r e f   C D C Y C L
M A e r o   =   l m n = 1 2 ρ V 2 S r e f   b C l c ¯ C m b C n
To represent the complete motion of an aircraft in the body frame, Equations (9) and (10) detail the translational and rotational dynamics, respectively. Equation (9) formulates Newton’s second law along the body axes, including inertial coupling terms such as q w r v , accounting for apparent accelerations in a rotating frame. Equation (10) describes Euler’s rotational equations for roll, pitch, and yaw dynamics, incorporating products of inertia I x z and cross-coupling terms such as p q and q r . These terms reflect the gyroscopic and dynamic coupling effects that may arise in asymmetric rigid-body flight. This formulation constitutes a fundamental component for nonlinear flight simulation and control system development.
m u ˙ + q w r v = F B m v ˙ + r u p w = F B m ( w ˙ + p v q u ) = F B
I x x p ˙ I x z r ˙ + q r I z z I y y p q I x z = M B I y y q ˙ + I x x I z z p r + I x z p 2 r 2 = M B I z z r ˙ I x z p ˙ + p q ( I y y I x x ) + q r I x z = M B

2.2. Skysurfer X8 Aerodynamic Characteristics and Parameters

To characterize the aerodynamic and inertial properties of the Skysurfer X8 platform, this study adopts the Athena Vortex Lattice (AVL) method developed at MIT [1], which provides an efficient and widely used framework for potential flow analysis of lifting surfaces. The AVL tool estimates aerodynamic forces and moments using a linearized potential flow model, making it especially suitable for early-stage design and control-oriented modeling. The geometric configuration of the Skysurfer X8—covering wingspan, mean aerodynamic chord, wing surface area, and airfoil profiles—was measured from the actual airframe. These geometric parameters were then input into AVL to construct a complete aerodynamic model that includes the main wing, horizontal stabilizer, and vertical fin, with appropriate symmetry boundary conditions being applied to reduce computational complexity.
For the inertial modeling, the aircraft configuration used here follows prior studies conducted at TU Delft. Specifically, the moment of inertia values were adopted from the system identification results reported by Kuijpers [2] and Juffermans [3], who estimated these parameters using flight test data and validated dynamic models. These validated inertia values were applied within the AVL framework to enhance the accuracy of the rotational dynamics representation, which is critical for capturing control responses and dynamic coupling effects—particularly in the roll and yaw modes. By aligning with both physical measurements and literature-validated parameters, the resulting model supports reliable simulation and controller design throughout this work.
To assess the aerodynamic control effectiveness and identify possible asymmetries induced by control surface deflections, individual perturbations were introduced to the aileron, elevator, and rudder. The computed aerodynamic response revealed spanwise variations in loading distribution, with nonuniform force generation observed, especially in the rolling and yawing axes. These effects reflect the inherent dynamic coupling between lateral and directional control channels in the Skysurfer X8 platform. As shown in Figure 2, the AVL-generated visualization illustrates how deflections of specific surfaces produce asymmetrical lift across the main wing and tailplane.
Beyond qualitative visualization, AVL also provides aerodynamic stability derivatives, which are essential for constructing the aircraft’s 6-DOF dynamic model. These terms capture how aerodynamic forces and moments vary with respect to changes in flight states such as angle of attack, pitch rate, and sideslip angle. In the longitudinal axis, derivatives like C m q , C m α , and C L α govern pitch damping, equilibrium trimming, and static stability characteristics. The inclusion of these terms enhances model fidelity in time-domain simulation and enables accurate controller synthesis, particularly for flight modes involving transient maneuvers or gust disturbances.
The primary physical parameters of the Skysurfer X8 used in this study are summarized in Table 1, which includes the vehicle’s geometric dimensions, mass properties, and propulsion specifications. These values form the foundational inputs for both aerodynamic and dynamic modeling. The wingspan and mean aerodynamic chord (MAC) reflect actual measured dimensions of the physical airframe, yielding an aspect ratio that supports efficient and stable cruise flight. The wing area and airfoil types, including NACA 2410 for the main wing and NACA 0012 for the tail, were selected to balance lift performance with controllability.
The center of gravity (CG) is positioned at 25% of the MAC, which aligns with common aircraft design practices to maintain static longitudinal stability while preserving sufficient pitch maneuverability. The aerodynamic center (AC) is at 50% MAC based on AVL’s simulation output, enabling consistent moment coefficient calculations. This configuration yields a negative slope in the pitching moment coefficient with respect to angle of attack C M α < 0 , thus satisfying the necessary conditions for static pitch stability. The moment of inertia values I x x ,   I y y ,   I z z , and I x z were adopted from the thesis by Kuijpers [2] and Juffermans [3] at TU Delft. These inertia values were incorporated into the six-degree-of-freedom (6-DOF) simulation model to accurately represent the aircraft’s rotational behavior and dynamic coupling effects essential for control system development.

2.3. Example Selection of Flying Quality Standard: Skysurfer X8 Short-Period

Flying quality standards serve as established benchmarks for evaluating an aircraft’s dynamic behavior, handling characteristics, and overall controllability from a pilot’s perspective. The MIL-F-8785C specification outlines specific requirements based on two primary axes: flight phase category (CAT A: maneuvering, CAT B: cruise, CAT C: terminal) and aircraft classification (e.g., Class I for small, light UAVs). These standards provide structured guidance for assessing key dynamic modes, including short-period, phugoid, Dutch roll, and roll subsidence, to ensure both stability and acceptable handling qualities.
Among these, the short-period mode is particularly essential for evaluating longitudinal stability and control. It describes the aircraft’s pitch axis dynamics and is highly influential in pilot perception of responsiveness and trim control. MIL-F-8785C mandates that this mode must meet minimum damping ratio ζ s and natural frequency ω n s p criteria to achieve various quality levels. These metrics help ensure that aircraft motion is neither too oscillatory nor sluggish, maintaining a balance between controllability and workload. The specific damping ratio bounds, categorized by flight phase and flying quality level, are presented in Table 2. For example, in Category B (cruise), Level 1 flying qualities require ζ s to lie between 0.30 and 2.00, ensuring that the aircraft behaves stably and predictably during typical mission flight profiles.
In addition to specifying damping ratio requirements, MIL-F-8785C also provides a graphical framework to evaluate whether an aircraft’s short period natural frequency satisfies flying quality standards. This is done by referencing the nondimensional parameter n / α , where n is the load factor and α is the angle of attack. This ratio serves as an indicator of the aircraft’s stiffness characteristics and pitch responsiveness under aerodynamic loading.
The relationship between the short-period natural frequency ω n s p and n / α is visualized in Figure 3, where the hatched regions delineate the boundaries for Level 1 and Level 2/3 flying qualities under Category B (cruise) conditions. This chart can be applied to plot the system’s computed dynamic parameters and assess whether the aircraft resides within the desired flying quality envelope. It is especially useful during the control law design and verification phase, as it offers a compact visual assessment that complements frequency-domain and time-domain evaluations. Ensuring compliance with this envelope helps guarantee favorable pilot handling characteristics and reduces the risk of instability or poor response during operational flight.
In this study, the short-period mode is adopted as the primary benchmark for evaluating the longitudinal dynamic performance of the aircraft. This mode is particularly sensitive to control law design and serves as a key indicator of pitch stability and responsiveness. The control system developed herein is assessed against the Level 1 flight quality standards defined under Category B of MIL-F-8785C, which corresponds to cruise-phase operation for small, lightweight UAVs.
Satisfying the Level 1 requirements under this classification ensures that the aircraft exhibits favorable handling characteristics, including appropriate pitch damping, rapid disturbance rejection, and ease of pilot control. These metrics are important not only for ensuring stability but also for maintaining comfort and precision during extended flight. By using the short-period mode as the evaluation basis, this study aligns control performance with well-established aeronautical standards, thereby supporting safer and more reliable UAV deployment in practical missions.

3. Control Law Design Based on Modeling and Flying Qualities

Figure 4 illustrates the hierarchical architecture of the UAV attitude control system, composed of two cascaded feedback loops: an outer loop for attitude regulation and an inner loop for angular rate stabilization. The outer loop handles attitude tracking tasks by comparing the desired attitude commands (e.g., roll, pitch, yaw angles) with current estimates. The resulting error is converted into reference angular rates, which are passed to the inner loop.
The inner loop, which constitutes the core of this study, is responsible for precise and responsive regulation of body angular velocities. It receives rate references from the attitude loop and computes actuator deflections based on angular rate errors. This rate-control loop is important in maintaining high-frequency damping of rotational dynamics and is typically designed to operate at a significantly higher bandwidth than the outer loop.
In this work, the rate loop controller is the primary focus of design and evaluation. It can adopt various structures depending on the control objectives and system characteristics. Classical PID controllers are commonly used due to simplicity and effectiveness. Alternatively, loop-shaping compensators can be implemented to provide phase margin tuning in the frequency domain.
By isolating the inner loop design, the architecture allows for flexible integration of advanced control techniques without modifying the outer loop. This modularity supports adaptability to different vehicle types, robustness under model uncertainty, and compatibility with high-fidelity simulations and flight testing procedures.
In flight control system design, linearizing the nonlinear aircraft dynamics around a steady-state trim condition, such as straight-and-level cruise, is a commonly used and effective approach. The complete equations of motion are typically nonlinear and strongly coupled, making direct controller synthesis challenging. Linearization simplifies the system into a linear time-invariant (LTI) representation valid near the operating point, which facilitates stability analysis and control law development using well-established techniques.
This study focuses on designing an inner-loop controller that regulates pitch rate q based on elevator deflection. After linearizing the system around the cruise trim condition, the aircraft dynamics are described by a fourth-order transfer function, as shown in Equation (11). This model represents both short-period and phugoid characteristics relevant to longitudinal motion. The actuator is modeled separately as a first-order lag system with a bandwidth of 20 rad/s, as expressed in Equation (12).
P l a n t : 1133 s 3 + 3.062 × 10 4 s 2 + 2.497 × 10 4 s + 2.358 × 10 12 s 4 + 65.62 s 3 + 2980 s 2 + 2501 s + 1049
A c t u a t o r : 20 s + 20
Together, the cascaded dynamics G s · G a c t s represent the controlled plant for inner-loop design. The LTI formulation enables the use of classical and modern control strategies such as P I D , N D I , and L Q R , and allows frequency-domain methods, including Bode plots, gain and phase margin assessment, and root locus analysis, to be applied systematically. This methodology aims to ensure that the resulting pitch rate controller offers sufficient damping, responsiveness, and robustness to small perturbations while remaining analytically tractable and compatible with implementation.
The present work adopts a loop shaping-based control framework to support systematic design and evaluation of various attitude controllers. This approach is particularly suited to aerospace systems where performance and stability specifications are often defined in the frequency domain, such as in MIL-F-8785C and MIL-STD-1797A. Loop shaping provides a transparent method for modifying the system’s open-loop response through gain and phase adjustments, enabling intuitive control synthesis while supporting compliance with flight quality criteria.
As shown in Figure 5, the concept of loop shaping is illustrated using Bode plots of the uncompensated and shaped systems. The control effort is concentrated within the operational frequency band of 10 1 ~ 10 1 rad/s, which covers typical pilot-induced inputs and external disturbances. The controllers in this study were designed to meet a gain margin of 6 dB and phase margin of 45 degrees, which are commonly recommended to support robust performance under model uncertainties.

3.1. Design of Longitudinal Attitude and Rate Controllers for Skysurfer X8

The flexibility of this design framework allows for the implementation and evaluation of multiple controller configurations. Two representative approaches were tested: a conventional Rate PI controller and a Rate Loop-Shaping controller. Both controllers were designed based on the same linearized plant and actuator dynamics, with the elevator as the primary control surface. The closed-loop architecture for pitch rate regulation is illustrated in Figure 6, where ω r e f b is the reference body-axis angular rate, ω e s t b is the estimated angular rate, and the controller outputs the desired elevator deflection ( A c t u a t o r r e f ) to regulate the pitch rate q . Open-loop Bode analysis was used to evaluate frequency-domain characteristics, verifying adequate gain and phase margins under each controller configuration.
The Rate PI controller, as depicted in Figure 7, enhances low-frequency gain and provides effective disturbance rejection. It also achieves zero steady-state errors due to the integral action. The Bode response demonstrates sufficient gain, but the phase margin near the crossover frequency typically requires careful consideration due to the controller’s phase lag. It maintains a reasonable roll-off rate and is suitable for attitude rate control loops where tracking precision is a primary concern. The corresponding transfer function is given in Equation (13).
R a t e   P I   C o n t r o l l e r : 0.009 s + 1.025 s
The Rate Loop-Shaping controller, as shown in Figure 8, modifies the open-loop response. However, the phase plot indicates that it introduces phase lag near the crossover frequency, which may affect the phase margin. This controller is designed for applications requiring specific dynamic behavior and enhanced responsiveness while still satisfying the 6 dB/45° design specifications. Its transfer function is shown in Equation (14).
R a t e   L o o p S h a p i n g   C o n t r o l l e r : 14 s + 6.998 16.67 s 2 + 8.333 s + 1
Overall, the loop-shaping method not only facilitates controller design but also provides a scalable and visual means of verifying compliance with stability and flying quality standards. The ability to accommodate multiple controller types within the same framework further supports iterative development and performance tuning. Detailed time-domain simulations will be presented in the following section to further evaluate these designs under dynamic operating conditions.
In the time-domain responses shown in Figure 9, both the Lead-Lag and PI controllers demonstrate stable and consistent attitude tracking performance, effectively following step commands with smooth transitions. The Lead-Lag controller provides a gain margin (GM) of 18.6 dB and a phase margin (PM) of 74.4 degrees, while the PI controller achieves 23.3 dB and 76.3 degrees, respectively. Both sets of margins exceed the original design specifications of GM ≥ 6 dB and PM ≥ 45°, suggesting that the stability and phase robustness requirements of the flight control system are well satisfied.
Within the cascaded control structure, as illustrated in Figure 10, the attitude controller generates a desired body angular rate ω r e f b based on the difference between the desired and estimated pitch angles ( θ d e s θ e s t ). The error is first scaled by a proportional gain P , then transformed through a Jacobian matrix J l b , which maps local frame angular commands to the body-fixed frame. This mapping accounts for the nonlinear relationship between Euler angle rates and body angular velocity, particularly relevant when operating outside the small-angle regime. The resulting ω r e f b is then tracked by the inner-loop rate controller using elevator deflection as the actuator output.
The outer-loop proportional gain is carefully selected to match the dynamics of the inner loop, ensuring proper bandwidth separation. The gain P was tuned to 3.9811 for the loop-shaping controller and 4.217 for the PI configuration. The measured closed-loop attitude bandwidths are 6.6438 rad/s and 6.1535 rad/s, respectively, both satisfying the requirements for typical fixed-wing aircraft.

3.2. Model Reduction and Flying Quality Validation for Skysurfer X8

To facilitate analysis and design in control systems, it is often desirable to reduce high-order closed-loop dynamics into simplified second-order representations. Such reduced models highlight the dominant modes of motion, typically the short-period mode in longitudinal dynamics, and allow for intuitive evaluation of system characteristics such as stability, damping, and frequency response. This abstraction is especially useful when comparing system behavior against established flight quality standards, which are commonly formulated based on second-order dynamics. By focusing on the critical frequency range relevant to pitch control (e.g., 1–10 rad/s), the reduced-order model provides a practical yet accurate means to assess control effectiveness and dynamic performance.
To further evaluate the controller performance, the closed-loop system with the Rate PI controller was reduced to a second-order approximation and compared against the original system’s frequency response, as shown in Figure 11. The corresponding transfer function is given in Equation (15), with a natural frequency of ω n = 4.3993 rad/s and a damping ratio ζ = 1.5160 . The reduced model demonstrates consistent trends with the original system across the relevant operating frequency range (approximately 1–10 rad/s), capturing the essential short-period dynamics for flight quality and stability assessment.
0.04809 s 2 + 11.96 + 18.7 s 2 + 13.34 s + 19.35
Additionally, to verify compliance with flying quality specifications, the system response was transformed into the n / α formulation and plotted on the short-period flying quality chart, as shown in Figure 12. The resulting point lies within the Level 1 region for Category B flight phases, indicating that both the natural frequency and maneuver sensitivity satisfy required performance criteria. Furthermore, the damping ratio ζ = 1.5160 also falls within the acceptable range for CAT B Level 1 (0.30–2.00), as illustrated in Table 2. These results confirm that the controller meets key frequency-domain and flying quality standards, supporting its viability for practical attitude control applications.
To evaluate whether the designed loop-shaping controller meets flight quality requirements, the closed-loop system, comprising both the aircraft dynamics and the controller, was reduced to a second-order model. This reduction retains the dominant short-period dynamics while simplifying the analysis. As shown in Figure 13, the Bode plots of the original and reduced models demonstrate good agreement within the operational frequency range of 1–10 rad/s, indicating that the essential dynamic characteristics are preserved. The corresponding reduced transfer function is given in Equation (16), yielding a natural frequency of ω n = 4.6905 rad/s and a damping ratio of ζ = 1.6275 . This suggests a highly damped system with rapid convergence and stability, making it suitable for stability augmentation purposes.
0.05178 s 2 + 13.88 + 21.44 s 2 + 15.27 s + 22
To verify whether the short-period mode complies with MIL-F-8785C flying quality standards, the system’s dynamic response was mapped onto the Category B flying qualities chart, as illustrated in Figure 14. The data point, derived from the natural frequency and a previously computed value of n / α   ≈ 18.25 (g/rad), is located well within the Level 1 boundary. Additionally, the damping ratio lies within the prescribed range for Category B operations (ζ = 0.30–2.00), as specified in the MIL standard. These results confirm that the controller not only satisfies gain and phase margin targets but also meets the frequency-domain and time-domain flying quality criteria defined for small, light aircraft in cruise flight.

4. Controller Deployment and Flight Test Results

To verify the proposed flight control system in a real-world setting, the Simulink-based controller design was transitioned from simulation to embedded deployment using the MathWorks PX4® Autopilot Support Package (MATLAB v2024). This toolbox enables automatic generation of C/C++ code from Simulink models and supports direct integration with PX4-compatible flight control units. Through this process, the original simulation control logic can be executed on actual flight hardware with minimal manual intervention.
The resulting code was deployed to a Pixhawk 6C flight controller mounted on the SkySurfer X8 airframe, as shown in Figure 15. Although exact equivalence between real-world dynamics and the simulation model is inherently uncertain, the system was thoroughly validated through a software-in-the-loop (SIL) process. This included verification from linearized models to high-fidelity nonlinear dynamics. Additionally, the controller was designed under the protection of MIL-F-8785C flight quality criteria to ensure safe behavior during test flights. This approach helps maintain robustness during the transition to real flight, even in the presence of modeling uncertainties, and ensures performance remains within safe operational limits.
To examine the behavior of the rate feedback PI controller under real flight conditions, a series of flight tests were conducted and compared against a six-degree-of-freedom (6-DoF) simulation model, as illustrated in Figure 16. The blue line represents the commanded attitude inputs from the RC transmitter, while the orange and yellow lines correspond to the measured aircraft attitude during flight and the simulated response, respectively. The simulation was driven using the recorded RC input signals from the flight to ensure consistency in evaluation. The agreement between simulation and flight data is further quantified by the pitch RMSE values: 1.496 deg (256–272 s), 1.418 deg (295–304 s), and 1.535 deg (328–341 s).
For clarity, the overall flight trajectory, including altitude, airspeed, roll, and pitch responses, is presented in Figure 17, where the shaded regions highlight the time segments analyzed in Figure 16. This provides contextual information showing that the selected test segments are representative portions of the complete flight data. At the beginning and end of the flight, the pilot manually controlled takeoff and landing, which explains the mismatch between the controller setpoints and the measured attitude during these phases.
The comparison shows that the simulated response and the actual flight data exhibit similar trends across multiple test segments. Although discrepancies such as overshoot and transient oscillations are present in the flight data, the general attitude tracking behavior remains consistent with the simulation. This alignment indicates that the implemented controller and the associated modeling framework adequately capture the dominant dynamic characteristics of the physical system. The results also reflect the feasibility of using model-based design workflows and Simulink–PX4 integration for preliminary control system verification and prototyping.
The flight test results using the loop-shaping controller are shown in Figure 18. The measured pitch responses of the aircraft exhibit general agreement with the 6-DoF simulation outputs, which were generated using the same RC command inputs. While some differences in phase and amplitude are observed—particularly during rapid transitions—the overall trend and dynamic behavior are preserved. These results indicate that the loop-shaping controller performs consistently under actual flight conditions and that the implemented model captures the key dynamic features relevant to attitude tracking. The agreement between simulation and flight data is further quantified by the pitch RMSE values: 2.72 deg (252–265 s), 2.86 deg (287–303 s), and 1.38 deg (355–369 s). The larger RMSE values in the first two segments are primarily due to simultaneous roll inputs commanded by the pilot under flight conditions, whereas the third segment corresponds to a pure pitch response (as also illustrated in Figure 19).
To complement the segment analysis in Figure 18, the overall flight data are summarized in Figure 19, including altitude, airspeed, roll, and pitch responses. The shaded regions mark the intervals selected for the pitch angle comparisons shown in Figure 18, confirming that the analyzed portions are representative of the complete flight profile. At the beginning and end of the flight, the pilot manually controlled takeoff and landing, which explains the mismatch between the controller setpoints and the measured attitude during these phases.

5. Discussion

Despite the reasonable agreement between the six-degree-of-freedom (6-DoF) simulations and actual flight test results, some deviations are observed, especially during transient phases. These differences can be attributed to several modeling and environmental factors. The aerodynamic coefficients and stability derivatives used in this study were derived from AVL simulations by segmenting the flight envelope into several steady-state trim conditions. These trim points balance simulation resolution and computational cost. However, this segmentation may not fully capture nonlinear variations across the entire flight envelope, potentially leading to local mismatches when operating away from nominal conditions or under rapid state changes.
Another factor involves actuator behavior during flight. In real-world conditions, aerodynamic forces acting on control surfaces such as the elevator may lead to discrepancies between the commanded and the actual deflection angles. This effect is often neglected in simulations unless detailed hinge moment or servo dynamics are modeled. Additionally, disturbances such as gusts and atmospheric turbulence, which are not explicitly simulated, may cause temporary deviations in system response. While the designed controllers remain robust under such disturbances, minor overshoot or phase lag in the real data is expected.
Sensor-related imperfections also play a role. Simulated sensor data is idealized, whereas real onboard sensors introduce measurement noise, bias, and latency. For example, the IMU and state estimator may cause delays or inaccuracies during aggressive maneuvers. These discrepancies in sensor feedback can slightly alter control responses. Nevertheless, the close agreement observed between simulation and flight indicates that the developed control law is reliable, and the trim-based modeling approach remains effective for fixed-wing UAV control design. The results reinforce the feasibility of using Simulink–PX4 integration for rapid prototyping and deployment in realistic conditions
To further illustrate this process, Figure 20 presents an integrated development workflow that spans software-in-the-loop simulation and model-in-the-loop validation, and points toward hardware-in-the-loop testing as a future goal. Using Simulink and the PX4 Support Package, control algorithms are automatically converted into embedded C code and deployed on Pixhawk 6C hardware. The same control logic is tested across 6-DoF simulation and actual flight using the SkySurfer X8 platform, enabling traceable and consistent performance validation.

6. Conclusions

This study presents a comprehensive, standards-oriented workflow for the development, simulation, and flight testing of flight control laws for small fixed-wing UAVs. The process begins with first-principles-based modeling, where aircraft dynamics are derived and validated using AVL and MATLAB(v2024)/Simulink to establish both linear and nonlinear models. These models form the foundation for classical control law design, including PI and loop-shaping controllers. Flight quality criteria from MIL-F-8785C are incorporated to ensure compliance in damping ratio and natural frequency, particularly for short-period dynamic modes.
The results show good alignment between simulation and flight data, supporting the fidelity of the development pipeline. This work contributes a replicable design methodology that combines frequency-domain control design, MIL-compliant flight standards, and automatic deployment into a unified process. The use of model-based tools ensures transparency, safety, and reduced trial-and-error in field testing. In summary, this study provides a practical reference for robust and certifiable UAV control system design, with a workflow that is extensible to future HIL-based verification.

Author Contributions

Conceptualization, T.-J.S. and C.-L.C.; methodology, T.-J.S. and C.-L.C.; software, T.-J.S.; validation, C.-L.C.; formal analysis, T.-J.S. and C.-L.C.; data curation, T.-J.S.; writing—original draft preparation, T.-J.S.; writing—review and editing, C.-L.C.; supervision, C.-L.C.; funding acquisition, C.-L.C. All authors have read and agreed to the published version of the manuscript.

Funding

Part of this work was supported by National Science and Technology Council under Grant No. NSTC 113-2221-E-006-131.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

No new data were created.

Acknowledgments

The aircraft platform, flight control hardware, and related testing equipment used in this study were kindly provided by Chao-Chung Peng of the Department of Aeronautics and Astronautics, National Cheng Kung University.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Drela, M.; Youngren, H. AVL-aerodynamic analysis, trim calculation, dynamic stability analysis, aircraft configuration development. Athena Vortex Lattice 2006, 3, 26. [Google Scholar]
  2. Kuijpers, J. Determining the Lateral-Directional Handling Characteristics of a Skysurfer X8. Master’s Thesis, TU Delft, Delft, The Netherlands, 2021. [Google Scholar]
  3. Juffermans, S. The Longitudinal Handling Characteristics of the Skysurfer X8. Master’s Thesis, Delft University of Technology, Delft, The Netherlands, 2021. [Google Scholar]
  4. Liao, J.; Bang, H. Transition nonlinear blended aerodynamic modeling and anti-harmonic disturbance robust control of fixed-wing tiltrotor UAV. Drones 2023, 7, 255. [Google Scholar] [CrossRef]
  5. İnan, A.T.; Ceylan, M. Aerodynamic analysis of fixed-wing unmanned aerial vehicles moving in swarm. Appl. Sci. 2024, 14, 6463. [Google Scholar] [CrossRef]
  6. Løw-Hansen, B.; Hann, R.; Gryte, K.; Johansen, T.A.; Deiler, C. Modeling and identification of a small fixed-wing UAV using estimated aerodynamic angles. CEAS Aeronaut. J. 2025, 16, 501–523. [Google Scholar] [CrossRef]
  7. Safwat, E.; Reda, M.; Kamel, A.M. Model-based simulation and validation of small fixed wing UAV. J. Eng. Sci. Mil. Technol. 2025, 9, 33–51. [Google Scholar]
  8. Specification, M. Flying Qualities of Piloted Airplanes; MIL-F-8785C: 1980; NASA: Washington, DC, USA, 1982.
  9. Mitchell, D.G.; Hoh, R.H.; Aponso, B.L.; Klyde, D.H. Proposed Incorporation of Mission-Oriented Flying Qualities into MIL-STD-1797A; Defense Technical Information Center: Fort Belvoir, VA, USA, 1994. [Google Scholar]
  10. Callaghan, P.M.; Kunz, D.L. Evaluation of unmanned aircraft flying/handling qualities using a stitched learjet model. J. Guid. Control Dyn. 2021, 44, 842–853. [Google Scholar] [CrossRef]
  11. Campos, L.M.; Marques, J.M. On the handling qualities of two flying wing aircraft configurations. Aerospace 2021, 8, 77. [Google Scholar] [CrossRef]
  12. Torelli, R.; Stroosma, O.; Vos, R.; Mulder, M. Piloted Simulator Evaluation of Low-Speed Handling Qualities of the Flying-V. In Proceedings of the AIAA SCITECH 2023 Forum, National Harbor, MD, USA, 23–27 January 2023; p. 0907. [Google Scholar]
  13. Dai, X.; Ke, C.; Quan, Q.; Cai, K.-Y. RFlySim: Automatic test platform for UAV autopilot systems with FPGA-based hardware-in-the-loop simulations. Aerosp. Sci. Technol. 2021, 114, 106727. [Google Scholar] [CrossRef]
  14. Welcer, M.; Sahbon, N.; Zajdel, A. Comparison of Flight Parameters in SIL Simulation Using Commercial Autopilots and X-Plane Simulator for Multi-Rotor Models. Aerospace 2024, 11, 205. [Google Scholar] [CrossRef]
  15. Khatiri, S.; Panichella, S.; Tonella, P. Simulation-based test case generation for unmanned aerial vehicles in the neighborhood of real flights. In Proceedings of the 2023 IEEE Conference on Software Testing, Verification and Validation (ICST), Dublin, Ireland, 16–20 April 2023; pp. 281–292. [Google Scholar]
  16. Huang, P.; Tang, Y.; Yang, B.; Wang, T. Research on scenario modeling for V-tail fixed-wing UAV dynamic obstacle avoidance. Drones 2023, 7, 601. [Google Scholar] [CrossRef]
  17. Kapeel, E.H.; Safwat, E.; Kamel, A.M.; Khalil, M.K.; Elhalwagy, Y.Z.; Hendy, H. Physical modeling, simulation and validation of small fixed-wing UAV. Unmanned Syst. 2023, 11, 327–350. [Google Scholar] [CrossRef]
  18. Lu, W. Hardware-in-the-loop simulation test platform for UAV flight control system. Int. J. Model. Simul. Sci. Comput. 2024, 15, 2441018. [Google Scholar] [CrossRef]
  19. Kaviyarasu, A.; Saravanakumar, A.; Logavenkatesh, M. Software in Loop Simulation based Waypoint Navigation for Fixed Wing UAV. Def. Sci. J. 2021, 71, 448–455. [Google Scholar] [CrossRef]
  20. Kopsakis, G. Feedback Control Systems Loop Shaping Design with Practical Considerations; NASA: Washington, DC, USA, 2007.
  21. Asper, G.D.; Simmons, B.M. Rapid Flight Control Law Deployment and Testing Framework for Subscale VTOL Aircraft; NASA: Washington, DC, USA, 2022.
  22. Jordan, T.; Foster, J.; Bailey, R.; Belcastro, C. AirSTAR: A UAV platform for flight dynamics and control system testing. In Proceedings of the 25th AIAA Aerodynamic Measurement Technology and Ground Testing Conference, San Francisco, CA, USA, 5–8 June 2006; p. 3307. [Google Scholar]
  23. Qi, D.; Cai, M.; Jiao, Z.; He, X.; Ren, X.; Hou, Y. Design and Implementation of Simulation System for Multi-UAV Mission. Appl. Sci. 2023, 13, 1490. [Google Scholar] [CrossRef]
Figure 1. Workflow of flight control system development from modeling to flight test.
Figure 1. Workflow of flight control system development from modeling to flight test.
Drones 09 00624 g001
Figure 2. Skysurfer X8 aerodynamic loading visualization under control surface deflections.
Figure 2. Skysurfer X8 aerodynamic loading visualization under control surface deflections.
Drones 09 00624 g002
Figure 3. MIL-F-8785C short-period natural frequency vs. stiffness envelope for Category B flight phases, plotted over n / α and ω n s p [8].
Figure 3. MIL-F-8785C short-period natural frequency vs. stiffness envelope for Category B flight phases, plotted over n / α and ω n s p [8].
Drones 09 00624 g003
Figure 4. Cascaded attitude control architecture with focus on inner-loop angular rate control law.
Figure 4. Cascaded attitude control architecture with focus on inner-loop angular rate control law.
Drones 09 00624 g004
Figure 5. Loop shaping concept illustrated with uncompensated and shaped Bode plots.
Figure 5. Loop shaping concept illustrated with uncompensated and shaped Bode plots.
Drones 09 00624 g005
Figure 6. Pitch rate controller structure using elevator deflection.
Figure 6. Pitch rate controller structure using elevator deflection.
Drones 09 00624 g006
Figure 7. Bode plot of system with Rate PI controller applied.
Figure 7. Bode plot of system with Rate PI controller applied.
Drones 09 00624 g007
Figure 8. Bode plot of system with Rate Loop-Shaping controller applied.
Figure 8. Bode plot of system with Rate Loop-Shaping controller applied.
Drones 09 00624 g008
Figure 9. The time step response of pitch responses.
Figure 9. The time step response of pitch responses.
Drones 09 00624 g009
Figure 10. Cascaded attitude-rate control structure with Jacobian-based transformation.
Figure 10. Cascaded attitude-rate control structure with Jacobian-based transformation.
Drones 09 00624 g010
Figure 11. Bode plot of reduced order system with Rate Loop-Shaping controller applied.
Figure 11. Bode plot of reduced order system with Rate Loop-Shaping controller applied.
Drones 09 00624 g011
Figure 12. Resulting ω n of the reduced short-period mode with Rate PI controller on the Category B flying qualities chart.
Figure 12. Resulting ω n of the reduced short-period mode with Rate PI controller on the Category B flying qualities chart.
Drones 09 00624 g012
Figure 13. Frequency response comparison of the original and reduced-order systems for the loop-shaping controller.
Figure 13. Frequency response comparison of the original and reduced-order systems for the loop-shaping controller.
Drones 09 00624 g013
Figure 14. Resulting ω n of the reduced short-period mode with Rate Loop-Shaping controller on the Category B flying qualities chart.
Figure 14. Resulting ω n of the reduced short-period mode with Rate Loop-Shaping controller on the Category B flying qualities chart.
Drones 09 00624 g014
Figure 15. SkySurfer X8 flight platform equipped with Pixhawk 6C for controller deployment.
Figure 15. SkySurfer X8 flight platform equipped with Pixhawk 6C for controller deployment.
Drones 09 00624 g015
Figure 16. Comparison between RC command, flight data, and 6-DoF simulations using the PI controller.
Figure 16. Comparison between RC command, flight data, and 6-DoF simulations using the PI controller.
Drones 09 00624 g016
Figure 17. Overall flight test data showing altitude, airspeed, roll, and pitch responses. Shaded regions indicate time segments analyzed in Figure 16.
Figure 17. Overall flight test data showing altitude, airspeed, roll, and pitch responses. Shaded regions indicate time segments analyzed in Figure 16.
Drones 09 00624 g017
Figure 18. Comparison between RC command, flight data, and 6-DoF simulation using loop-shaping controller.
Figure 18. Comparison between RC command, flight data, and 6-DoF simulation using loop-shaping controller.
Drones 09 00624 g018
Figure 19. Overall flight test data showing altitude, airspeed, roll, and pitch responses. Shaded regions indicate the time intervals analyzed in Figure 18.
Figure 19. Overall flight test data showing altitude, airspeed, roll, and pitch responses. Shaded regions indicate the time intervals analyzed in Figure 18.
Drones 09 00624 g019
Figure 20. Integrated development workflow covering MIL, SIL, and future HIL validation for UAV flight control systems.
Figure 20. Integrated development workflow covering MIL, SIL, and future HIL validation for UAV flight control systems.
Drones 09 00624 g020
Table 1. Geometric, inertial, and propulsion parameters of the Skysurfer X8.
Table 1. Geometric, inertial, and propulsion parameters of the Skysurfer X8.
ParameterValueUnit
Weight1.3kg
Max Thrust24N
Propeller8 × 6inch
Battery6SLiPo
Span1.41m
MAC0.22m
Wing Area0.24m2
I x x 0.023kg·m2
I y y 0.029kg·m2
I z z 0.05kg·m2
I x z −0.00002266kg·m2
CG25%MAC
AC50%MAC
Wing AirfoilNACA 2410-
Tail AirfoilsNACA 0012-
Table 2. MIL-F-8785C short-period damping ratio limits across flight phases and quality levels [8].
Table 2. MIL-F-8785C short-period damping ratio limits across flight phases and quality levels [8].
Flight PhaseLevel 1Level 2Level 3
ζ s   m i n ζ s   m a x ζ s   m i n ζ s   m a x ζ s   m i n
CAT A0.351.300.252.000.10
CAT B0.302.000.202.000.10
CAT C0.501.300.352.000.25
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Shen, T.-J.; Chen, C.-L. Model-in-the-Loop Design and Flight Test Validation of Flight Control Laws for a Small Fixed-Wing UAV. Drones 2025, 9, 624. https://doi.org/10.3390/drones9090624

AMA Style

Shen T-J, Chen C-L. Model-in-the-Loop Design and Flight Test Validation of Flight Control Laws for a Small Fixed-Wing UAV. Drones. 2025; 9(9):624. https://doi.org/10.3390/drones9090624

Chicago/Turabian Style

Shen, Ting-Ju, and Chieh-Li Chen. 2025. "Model-in-the-Loop Design and Flight Test Validation of Flight Control Laws for a Small Fixed-Wing UAV" Drones 9, no. 9: 624. https://doi.org/10.3390/drones9090624

APA Style

Shen, T.-J., & Chen, C.-L. (2025). Model-in-the-Loop Design and Flight Test Validation of Flight Control Laws for a Small Fixed-Wing UAV. Drones, 9(9), 624. https://doi.org/10.3390/drones9090624

Article Metrics

Back to TopTop