Next Article in Journal
Vision-Based Unmanned Aerial Vehicle Swarm Cooperation and Online Point-Cloud Registration for Global Localization in Global Navigation Satellite System-Intermittent Environments
Previous Article in Journal
Fixed-Time Target Tracking and Encirclement Control for Multi-UAVs with Bearing-Only Measurements
Previous Article in Special Issue
WA-LPA*: An Energy-Aware Path-Planning Algorithm for UAVs in Dynamic Wind Environments
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Hamiltonian Neural Differential Dynamics Model and Control Framework for Autonomous Obstacle Avoidance in a Quadrotor Subject to Model Uncertainty

1
School of Astronautics, Harbin Institute of Technology, Harbin 150001, China
2
Suzhou Research Institute of HIT, Suzhou 215104, China
3
Zhengzhou Advanced Research Institute of HIT, Zhengzhou 450000, China
*
Author to whom correspondence should be addressed.
Drones 2026, 10(1), 64; https://doi.org/10.3390/drones10010064
Submission received: 22 November 2025 / Revised: 12 January 2026 / Accepted: 15 January 2026 / Published: 19 January 2026

Highlights

What are the main findings?
  • A Hamiltonian neural differential model (HDM) is proposed, which formulates quadrotor dynamics on the SE(3) manifold with learnable inertia parameters and a neural network-approximated control input matrix.
  • The model is reformulated into a control-affine form, enabling controller synthesis with control Lyapunov functions (CLFs) for stability and exponential control barrier functions (ECBFs) for rigorous safety guarantees.
What are the implications of the main findings?
  • The HDM provides a physically interpretable and plausible dynamics representation by incorporating physical priors (e.g., SE(3) constraints, energy conservation), overcoming the limitations of handcrafted and black-box models.
  • The integrated safety-critical control framework ensures stable and safe trajectory tracking in obstacle-dense environments, advancing the reliability of autonomous quadrotor operations.

Abstract

Establishing precise and reliable quadrotor dynamics model is crucial for safe and stable tracking control in obstacle environments. However, obtaining such models is challenging, as it requires precise inertia identification and accounting for complex aerodynamic effects, which handcrafted models struggle to do. To address this, this paper proposes a safety-critical control framework built on a Hamiltonian neural differential model (HDM). The HDM formulates the quadrotor dynamics under a Hamiltonian structure over the SE ( 3 ) manifold, with explicitly optimizable inertia parameters and a neural network-approximated control input matrix. This yields a neural ordinary differential equation (ODE) that is solved numerically for state prediction, while all parameters are trained jointly from data via gradient descent. Unlike black-box models, the HDM incorporates physical priors—such as SE ( 3 ) constraints and energy conservation—ensuring a physically plausible and interpretable dynamics representation. Furthermore, the HDM is reformulated into a control-affine form, enabling controller synthesis via control Lyapunov functions (CLFs) for stability and exponential control barrier functions (ECBFs) for rigorous safety guarantees. Simulations validate the framework’s effectiveness in achieving safe and stable tracking control.

1. Introduction

The widespread use of quadrotors has increased the need for safe-critical control, mainly owing to the highly dynamic uncertain environments such as the multiple obstacles that quadrotors work on [1,2,3]. Operating in such an environment requires an efficient controller that can track reference trajectories by utilizing the full dynamics, which remains challenging when accounting for constraints to guarantee safety [4].
Classic control consider the safe as the critical distance in the form of collision constraints, but this requires complex nonlinear optimization [5,6,7]. A prevalent way to calculate with these constraints is by imposing them directly to model predictive control (MPC) in a finite-horizon, and the optimization scheme can be addressed by quadratic programming (QP) to ensure safety and stability. Nevertheless, such nonlinear optimization is difficult to solve in real time or can even be unsolvable [8].
Moreover, the existence of model inaccuracies creates a more significant challenge for safe controller design, in which model error degrades the safety guarantee. The hand-designed models used by the classic control methods are often insufficiently accurate even after careful parameter identification because such models often oversimplify the underlying structure of the aerodynamic effect, leading to modeling bias that cannot be corrected by optimizing few parameters [9,10,11].
In recent years, data-driven approaches have demonstrated the astonishing capability to capture complex dynamic effects and actively improve the control performance [9,10]. This approach requires fewer expert knowledge and structure assumptions about the system, and directly learns the dynamic models by neural networks (NNs) or Gaussian process (GP) from collected data [12,13]. Thus, data-driven modeling and control approaches show great popular to address inaccurate models to improve control performance [14,15] because their can approximate unknown and complex effects directly from dataset. However, data-driven learning approaches struggle to providing safety guarantees, which brings great limitations to safety-critical systems control [16].
To improve the applicability of data-driven control methods in safety-critical dynamical systems, the integration of control Lyapunov functions (CLFs) and control barrier functions (CBFs) based on learned models is a promising approach [17,18]. The CLF-CBF-QP formulation [19,20,21] effectively ensures safety by cooperating full dynamics with Lyapunov-like functions and can also be promoted for high-order dynamical systems based on exponential CBFs (ECBFs) [22,23]. In [24], a learning-based MPC is proposed, which augments the handcraft model with incremental GPs to learn the dynamics, and an auxiliary controller is devised with the CLF-CBF form to ensure high probabilistic safety. However, limited by the black-box GP dynamics model, the control can be solved only by the sample-based method, which is time consuming. Reference [25] established barrier certificates for safety control, in which high probability safety is guaranteed by the statistics formulation of the GP. However, reformulating GP to CBFs requires a sophisticated design and has no generalization.
While black-box machine learning models, such as pure NNs and GPs, are capable of approximating complex dynamics, they fundamentally lack embedded physical laws. This absence of inductive bias renders them prone to overfitting, heavily dependent on the quality and quantity of training data, and consequently results in poor generalization to unseen operating conditions.
More critically, these methods typically learn an end-to-end input–output mapping from states to derivatives that is inherently opaque, lacking both an explicit analytical form and reliable gradient structure. This characteristic introduces tremendous difficulty for the design of safety-critical controllers, which fundamentally require interpretable models and reliable gradient information to enforce stability and safety guarantees.
In contrast, physics-informed learning methods grounded in Lagrangian and Hamiltonian mechanics offer a principled alternative [26,27]. By integrating analytical physical structures with the universal [28,29], data-driven representational power of NNs [30,31,32], these hybrid models can learn the underlying system differential equations directly from data, thereby achieving superior data efficiency and generalization [33]. For instance, ref. [32] proposes a symplectic Hamiltonian-based ODE-net (SymODEN), which employs three separate neural networks to learn the mass matrix, potential energy, and input matrix. By incorporating this physical inductive bias, SymODEN achieves better data efficiency and stable control on simple systems such as the pendulum. Furthermore, ref. [34] introduces a Hamiltonian formulation on the SE ( 3 ) manifold for rigid-body dynamics, using a similar multi-network framework and combining it with energy shaping control to achieve stable tracking on various platforms.
Although these Hamiltonian-based frameworks offer interpretable and physically consistent models that enhance the generalization of NN-based methods, they rely on training several independent NNs to approximate individual terms of the Hamiltonian. This multi-network architecture increases model complexity, complicates the training process, and often hinders convergence, especially for high-dimensional underactuated systems like quadrotors.
This paper addresses these limitations by proposing a Hamiltonian neural differential dynamics model (HDM) specifically designed for quadrotors and seamlessly integrating it into a safety-critical control framework. As illustrated in Figure 1, the core of our approach is a novel, physics-informed HDM that formulates quadrotor dynamics on the SE ( 3 ) manifold with explicitly learnable inertia parameters and an NN approximated control input matrix. Compared to prior Hamiltonian NN structures that use multiple networks, HDM incorporates stronger physical priors, reduces the number of networks to be trained, and yields a more concise and tractable representation. Crucially, the HDM is inherently reformulated into a control-affine form, providing explicit data-driven drift and control input vectors that are directly compatible with formal control synthesis.
To achieve both stability and rigorous safety guarantees for quadrotors in cluttered environments, this paper utilized a CLF-ECBF-QP algorithm framework based on HDM, which constructs a safe operation region with ECBF, a CLF for trajectory tracking, that is solved by quadratic-programming (QP).
The main contributions of this paper are as follows:
  • A novel Hamiltonian neural differential dynamics model (HDM) for quadrotors is proposed, which incorporates physical priors, including SE ( 3 ) manifold constraints and energy conservation, while maintaining a simple and trainable structure. By making inertia parameters explicitly learnable and using a single NN for the control input matrix, the HDM provides a physically interpretable, data-driven representation that is both accurate and easy to train.
  • A safety-critical control framework that integrates the learned HDM with a CLF-ECBF-QP controller is proposed. A key step is the reformulation of the HDM into a control-affine form, enabling the direct application of CLFs and ECBFs for stability and safety certification. This integration provides a rigorous and practical solution for safe and stable trajectory tracking in obstacle environments.
  • The proposed method is validated through simulations and real-world flight experiments. Results demonstrate that the framework enables a quadrotor to accurately track desired trajectories while actively avoiding multiple obstacles, confirming its effectiveness, generalization capability, and practical viability.
The rest of the paper is organized as follows. The relative basic theories are described in Section 2. Section 3 presents the HDM model. The proposed safety-critical controller is designed in Section 4. Simulation results are displayed and analyzed in Section 5. Experimental results are discussed in Section 6. Finally, conclusions and future work are provided in Section 7.

2. Preliminaries

2.1. Control Lyapunov Function (CLF) on SO(3)

Consider a control affine system as follows:
x ˙ = f ( x ) + g ( x ) u ,
where x R n and u R m are the vector of the state and control, and f ( x ) , g ( x ) are the drift and control vector fields, respectively. For such a control affine system, a function V ( x ) : R n R is called the CLF if there exist constants c 1 , c 2 , c 3 > 0 such that x R n
c 1 x 2 V ( x ) c 2 x 2 , sup u R m L f V ( x ) + L g V ( x ) u + c 3 V ( x ) 0 .
where L f V = V / x · f , L g V = V / x · g are the Lie derivatives of V corresponding to f , g , respectively [35].
The above definition describes a CLF constrained to systems in Cartesian space. Consider CLFs over the SO ( 3 ) manifold [36], the attitude dynamics of a single rigid body represented by rotation matrix are given:
R ˙ = R Ω ^ , I Ω ˙ + Ω × I Ω = τ ,
where R = [ r 1 T , r 2 T , r 3 T ] T SO ( 3 ) is the orientation of the rigid body with row vectors r i , i = 1 , 2 , 3 . Ω R 3 represents the angular velocity, τ denotes the input torque vector, I denotes the inertia matrix and the hat map · ^ : R 3 s o ( 3 ) is defined to map a vector to a skew-symmetric matrix, and also has x ^ y = x × y , x , y R 3 . Given a planning trajectory R d ( t ) , Ω d ( t ) , following geometric CLF can stable the system in (3) to the desired trajectory, which has the following:
V = α Ψ ( R , R d ) + e Ω T J e Ω + ϵ e R · e Ω ,
where α , ϵ > 0 are positive gains, Ψ ( R , R d ) = 1 2 trace ( I R d T R ) denotes the configuration error, and e R = 1 2 ( R d T R R T R d ) , e Ω = ( Ω R T R d Ω ) are the position error and the velocity error, respectively. · is the inverse operation of hat map · ^ , such that x ^ = x , x R 3 .
Thus, a control theory-based geometric CLF is demonstrated as a global CLF in [37], which can be used as a CLF to design tracking controllers for almost all orientation states.

2.2. Control Barrier Function (CBF)

Considering the control affine dynamic system (1), safety can be formalized as a constraint by specifying a safe set. Let C R n be a set on which there is a differentiable function h : R n R has
C = { x R n : h ( x ) 0 } .
If the dynamics as (1) is locally Lipschitz, the formal definition of CBF can be given as follows:
Definition 1. 
Let C denotes a safety set for a continuously differentiable function h : R n R and α be a K function α : R R that is strictly monotonic increasing with α ( 0 ) = 0 ; then, h is a CBF for the control system (1) if:
sup u R m L f h ( x ) + L g h ( x ) + α ( h ( x ) ) 0 ,
where L f h ( x ) and L g h ( x ) stand for the Lie derivation of h ( x ) [21].
Thus the control u satisfying the above equation renders the system (1) safe with respect to the set C .
But the above CBFs just work in systems with relative degree 1, δ = 1 , i.e., the first time-derivations of the h ( x ) must directly affected by the control vector. However, this assumption is too restrictive since most system are 2-order degree i.e., the two-order deviation of object position is controlled by the input force, or even higher. Thus, an exponential CBF (ECBF) is extended to guarantee the safety of arbitrarily high relative-degree safety sets, i.e., δ > 1 .
Definition 2. 
The continuously differentiable function h ( x ) , with δ 1 , is an exponential control barrier function (ECBF), if there exists vector K R δ satisfies
sup u U L f δ h ( x ) + L g δ 1 h ( x ) + K T B 0 ,
where B = [ h ( x ) , L f h ( x ) , L f 2 h ( x ) , , L f δ 1 h ( x ) ] T is the vector of Lie derivatives for h ( x ) , and K = [ k 0 , k 1 , , k δ 1 ] T is the vector of coefficient gains for B . The vector K can be determined by using the pole placement technique on the closed-loop matrix determined from h ( x ) C e F G K B ( x 0 ) 0 , where
F = 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 , G = 0 0 0 1 , C = 1 0 0 0 T ,
Forward invariance is also satisfied for ECBFs, and detailed proof can be found in [22].

2.3. Data-Driven Model Based on Neural ODE Networks

The previous subsection describes a control affine dynamics system as (1), which in this subsection is rewritten as f cl ( x , u ) = f ( x ) + g ( x ) u for ease of notation. For approximating the function f cl ( x , u ) when its elements are unknown, neural ODE [33] gives an existing way to approximate the dynamics based on NNs f ˜ cl ( x , u , θ ) , where θ is the network parameter. The control input u needs to be a constant for a trajectory sequence, leading to the following augmented form to approximate the dynamic differential equation:
x ˙ u ˙ = f ˜ cl ( x , u , θ ) 0 .
The parameters of the network f ˜ cl ( x , u , θ ) are trained by using a dataset D = { t 0 : N ( i ) , x 0 : N ( i ) , u ( i ) } i = 1 D of state trajectory samples via simulators or practical environments, where i = 1 , , D is the trajectory index and N is the length of the trajectories.
Given an initial state x 0 ( i ) at time t 0 ( i ) , and the dynamic function f ˜ cl approximated by NNs, the prediction state [ x ˜ 0 , x ˜ 1 , , x ˜ T ] corresponding to the control series u 0 : T ( i ) under time t 0 : T = [ 0 , , T ] is obtained by the ODE solver (ODEsolver):
[ x ˜ 0 ( i ) , x ˜ 1 ( i ) , , x ˜ T ( i ) ] = x 0 ( i ) + 0 T f ˜ cl ( x t ( i ) , u 0 : T ( i ) , t 0 : T , θ ) d t = ODESolver ( x t ( i ) , f ˜ cl , u 0 : T ( i ) , t 0 : T , θ ) .
The training loss is calculated by the following:
L = i = 1 D t = 1 T l x ˜ t ( i ) , x t ( i ) ,
where l is a function to measure the distance between the prediction and the ground truth states. The parameters θ of NNs are trained by gradient descent algorithm.

3. Hamiltonian Differential Dynamics Model for Quadrotor

3.1. Kinematics of Quadrotor on SE(3)

This section conducts the kinematics of the quadrotor over the SE ( 3 ) . The pose of the quadrotor are denoted as follows:
ρ = x , y , z T R 3 , R S O ( 3 ) .
The position and rotation matrix of quadrotor can be integrated as a pose matrix T SE ( 3 ) :
SE ( 3 ) = R ρ 0 T 1 R 4 × 4 : R SO ( 3 ) , ρ R 3 .
The kinematics equation of the quadrotor can be expressed by the generalized velocity ξ = v T , Ω T T R 6 , where v represents the linear velocity and Ω denotes the angular velocity on body-frame coordinates. In SE ( 3 ) ,
T ˙ = T ξ ^ = : T Ω ^ v 0 T 0 ,
where · ^ denotes the mapping from the generalized velocity ξ R 6 to a twist matrix ξ ^ and from Ω R 3 to a matrix Ω ^ .
Then, defining the generalized position as q = p T , r 1 T , r 2 T , r 3 T T R 12 , the (14) can be repressed as follows:
q ˙ = q × ξ , q × = R T 0 0 0 0 r ^ 1 T r ^ 2 T r ^ 3 T T .

3.2. Dynamics of Quadrotor Based on Port-Hamiltonian Formulation

The Hamiltonian quantity H ( q , p ) represents the whole energy of the dynamical systems described by the generalized position-momenta pairs [ q T , p T ] T has
H ( q , p ) = 1 2 p T M 1 ( q ) p + V ( q ) ,
where M ( q ) S 0 6 × 6 is the symmetric positive matrix representing the generalized mass matrix of the quadrotor and V ( q ) is the potential energy. Since the quadrotor dynamics are described on the SE ( 3 ) manifold, the generalized momenta is: p = [ p v T , p Ω T ] T R 6 , which is obtained by
p = p v p Ω = M ( q ) ξ R 6 ,
The quadrotor can be regarded as a rigid body; thus, the general mass matrix can be decoupled in block-diagonal form
M ( q ) = M 1 ( q ) 0 0 M 2 ( q ) S 0 6 × 6 , M 1 , M 2 S 0 3 × 3 ,
Furthermore, if the body frame is established on the mass center of the quadrotor and the direction of the axis along the principle axis of inertia, the matrix M has the explicit form
M 1 = m 0 0 0 m 0 0 0 m , M 2 = I x 0 0 0 I y 0 0 0 I z ,
where m is the mass and I x , I y , I z are the inertia of the quadrotor along three directions of the body frame.
The system dynamics according to the Hamiltonian formulation can be represented by
q ˙ p ˙ = J ( q , p ) q H ( q , p ) p H ( q , p ) + G ( q , p ) u ,
where u R m represents the control input, J ( x ) = J T ( x ) is a skew-symmetric interconnection matrix, and G ( x ) : R n R m × n denotes the control affine matrix.
Combined with the kinematics as (14), the differential of the generalized coordinated can be given as follows:
q ˙ = q × p H ( q , p ) ,
The differential of the generalized momenta can be expressed as follows:
p ˙ = q × T q H ( x ) + p × p H ( x ) + g ξ ( q , p ) u ,
where
p × = 0 p ^ v p ^ v p ^ Ω ,
The control vector is u = [ ϖ 1 2 , ϖ 2 2 , ϖ 3 2 , ϖ 4 2 ] T R 4 , where ϖ is the rotor speed.
Therefore, the dynamic equation is expressed as follows:
H = 1 2 p T M 1 ( q ) p + V ( q ) q ˙ p ˙ = 0 q × q × T p × q H p H + 0 g ξ ( q , p ) u ,
where g ξ ( q , p ) = [ g v T ( q , p ) , g Ω T ( q , p ) ] T .
The differential of generalized velocity can be calculated by the following:
ξ ˙ = d d t M 1 ( q ) p + M 1 ( q ) p ˙ .

3.3. Data-Driven Hamiltonian Neural Differential Dynamics Model (HDM)

The dynamics function of the quadrotor based on the SE ( 3 ) is presented by (24) and (25) satisfying (17). Since the mass matrix M ( q ) , potential energy V ( q ) , and input matrix g ( q , p ) are unknown, they need to be learned from data.
To learn the above Hamiltonian formulation directly from dataset D , ref. [34] designs a neural ODE network model consisting of four individual NNs to approximate the above unknown terms. This framework provides an appropriate combination of Hamiltonian mechanics with NNs for data-driven modeling but introduces more redundant parameters.
Considering that the body frame is established along the principle axis of inertia, (24) can be learned more precisely by approximating the generalized mass matrix in (18) as the following form
M ˜ = M ˜ 1 0 0 M ˜ 2 ,
where
M ˜ 1 = m ˜ 0 0 0 m ˜ 0 0 0 m ˜ , M ˜ 2 = I ˜ x 0 0 0 I ˜ y 0 0 0 I ˜ z ,
Then the inertia parameters are collected as θ 1 = [ m ˜ , I ˜ x , I ˜ y , I ˜ z ] T to be optimized. Thus, the potential energy term can also be obtained by the learned parameter V ˜ ( q ) = m ˜ g z . Then, the input matrix g ξ ( q , p ) is approximated by an NN to learn the complex aerodynamic effort of the quadrotor, which has g ˜ ξ ( q , p , θ 2 ) = [ g ˜ v T ( q , p , θ 2 ) , g ˜ Ω T ( q , p , θ 2 ) ] T . Therefore, the data-driven form for Hamiltonian mechanics (16) has
H ˜ ( q , p ) = 1 2 p T M ˜ 1 p + V ˜ ( q ) ,
Then, the differential equation of the quadrotor can be calculated by (24). To approximate quadrotor dynamics modeling through the above framework, θ = θ 1 , θ 2 are the parameters that need to be trained, as shown in Figure 2.
Based on the above NN architecture, here obtaining a data-driven Hamiltonian neural differential dynamics model (HDM) for quadrotors can be represented as follows:
x ˙ ˜ = f ˜ ( x , u , θ ) ,
where x = [ q T , ξ T ] T denotes the system state.

3.4. Data Collection and Training Process

The collected dataset D = { t 0 : N ( i ) , x 0 : N ( i ) , u ( i ) } i = 0 D consists of state sequence x 0 : N ( i ) , where x 0 : N ( i ) = [ q 0 : N ( i ) , ξ 0 : N ( i ) ] T R 18 , q n ( i ) = [ ρ n ( i ) , r 1 n ( i ) , r 2 n ( i ) , r 3 n ( i ) ] T R 12 , ξ n ( i ) = [ v n ( i ) , Ω n ( i ) ] T R 6 for subscript n = 0 , N representing the discrete time step and i = 0 , , D denotes the trajectory index. Such dataset is generated by applying a control input u ( i ) to the quadrotor and sampling x n ( i ) at time t n ( i ) , n = 0 , , N .
In the training process, the initial state x 0 ( i ) and constant control u ( i ) are fed into the HDM as input. The prediction states x ˜ 0 : N ( i ) at time step t 0 : N ( i ) are calculated by the ODEsolver (10) by using 4-order Runge-Kutta. The square Euclidean norm is used as loss function for the position and linear and angular velocity states. The geodesic distance is used to calculate the rotation loss [34]. Thus, the total loss has
L ( θ ) = i = 1 D j = 1 N l ( x ˜ n ( i ) , x n ( i ) ) = i = 1 D j = 1 N ρ n ( i ) ρ ˜ n ( i ) 2 + ξ n ( i ) ξ ˜ n ( i ) 2 + ( log ( R ˜ n ( i ) R n ( i ) T ) ) 2 ,
The training problem can be illustrated as
θ 1 , θ 2 = argmin θ 1 , θ 2 i = 1 D n = 1 N l ( x ˜ n ( i ) , x n ( i ) ) s . t . [ x ˜ 0 ( i ) , x ˜ 1 ( i ) , , x ˜ T ( i ) ] = ODESolve ( x 0 ( i ) , f ˜ ( θ ) , t 0 : T ( i ) ) θ 1 > 0 ,
and can be optimized by the gradient descent method. The training process of the HDM is shown in Figure 3.

4. Safety-Critical Control Based on Learned HDM

4.1. Rectellipsoidal Safety Barrier Regions

To ensure quadrotor safety, this paper utilizes rectellipsoidal safety regions the model the barrier function as
h ( x i , , x n ) = x i c i p i r + + x n c n p n r 1 0 ,
where x i is the position of the plant, c i is the center position of ellipse, and p i is the limit range. Here, choosing r = 4 results in a richer safety set and hence permits greater freedom for high order ECBF. Thus, the quadrotor motions within an ellipsoid safe region must satisfy
h ( x ) = x x o r x 4 + y y o r y 4 + z z o r z 4 1 0 ,
where ρ o = [ x o , y o , z o ] T R n is the position of the obstacles and r x , r y , r z is its outlines.

4.2. Safety Control Based on ECBF

Considering the ECBF as the safety certification, this section rewrites the quadrotor dynamics based on the Hamiltonian neural differential equation into the control affine form as (1). The state denotes x = ρ T , r 1 T , r 2 T , r 3 T , v T , Ω T T . Substituting (15) into (21), the differential of the generalized coordinates can be rewritten as
ρ ˙ r ˙ 1 r ˙ 2 r ˙ 3 = R 0 0 r ^ 1 0 r ^ 2 0 r ^ 3 p H = R 0 0 r ^ 1 0 r ^ 2 0 r ^ 3 v Ω .
Substituting (22) into (25) can obtain
Ω ˙ v ˙ = d d t M 1 p + M 1 p ˙ = M 1 ( q × T q H ˜ ( q , p ) + p × p H ˜ ( q , p ) + g ˜ ( q , p , θ 2 ) u ) = M 1 R T 0 0 0 0 r ^ 1 T r ^ 2 T r ^ 3 T q H ˜ ( q , p ) + M 1 0 p ^ v p ^ v p ^ Ω v Ω + g ˜ v ( q , p , θ 2 ) g ˜ Ω ( q , p , θ 2 ) u = v ^ Ω M 1 1 R T ρ H ˜ ( q , p ) + M 1 1 g ˜ v ( q , p , θ 2 ) u M 2 1 M 2 Ω ^ Ω + i = 1 3 r i ^ r i H ˜ ( q , p ) + g ˜ Ω ( q , p , θ 2 ) u .
Then, writing them into control affine form as (1), the drift vector satisfies
f ˜ x = R v r ^ 1 Ω r ^ 2 Ω r ^ 3 Ω v ^ Ω M ˜ 1 1 R T ρ H ˜ ( q , p ) M ˜ 2 1 M ˜ 2 Ω ^ Ω + i = 1 3 r i ^ r i H ˜ ( q , p ) ,
and the control vector satisfies
g ˜ x = 0 12 × 4 M 1 1 g ˜ v ( q , p , θ 2 ) M 2 1 g ˜ Ω ( q , p , θ 2 ) T .
Considering that the dynamics of the quadrotor is a 2-order systems, the 2-order ECBF is illustrated as
L f 2 h ( x ) + L g L f h ( x ) u α 1 h ( x ) + α 2 L f h ( x ) ,
where
L f h ( x ) = h ( x ) x f ˜ ( x ) = 4 ( x x o ) 3 ( r x ) 4 , 4 ( y y o ) 3 ( r y ) 4 , 4 ( z z o ) 3 ( r z ) 4 R v .
Considering the attitude of the quadrotor is stable during flying, here suppose R ˙ = 0 for the following step. Thus, there is
L f 2 h ( x ) + L g L f h ( x ) u = x ( L f h ( x ) ) [ f ˜ ( x ) + g ˜ ( x ) u ] = 12 ( x x obs ) 2 v x ( r x ) 4 12 ( y y obs ) 2 v y ( r y ) 4 12 ( z z obs ) 2 v z ( r z ) 4 0 9 × 1 4 ( x x obs ) 3 ( r x ) 4 4 ( y y obs ) 3 ( r y ) 4 4 ( z z obs ) 3 ( r z ) 4 0 3 × 1 T f ( x ) + g ( x ) u = 12 ( x x o ) 2 v x ( r x ) 4 , 12 ( y y o ) 2 v y ( r y ) 4 , 12 ( z z o ) 2 v z ( r z ) 4 R v + 4 ( x x o ) 3 ( r x ) 4 , 4 ( y y o ) 3 ( r y ) 4 , 4 ( z z o ) 3 ( r z ) 4 f ˜ ( v ) M 1 1 g ˜ v ( q , p , θ 2 ) u .
The specific expressions of ECBF of the quadrotor based on the HDM are obtained, and the constraints of quadrotor safety are constructed subject to obstacle avoidance.

4.3. CBF-CLF-QP Control for Tracking Trajectory

Based on the ECBF construct in above section, this section proposes a control framework for the CLF-ECBF-QP control design. For given smooth tracking commands ρ d ( t ) = [ x d ( t ) , y d ( t ) , z d ( t ) ] T , ψ d ( t ) , the desired attitude can be calculated by
β a = x ¨ d cos ψ d y ¨ d sin ψ d β b = z ¨ d g β c = x ¨ d sin ψ d + y ¨ d cos ψ d θ d = atan ( β a , β b ) ϕ d = atan ( β c , β c 2 + β b 2 ) .
Then, the desired rotation matrix can be computed as follows: R d = R x ( ϕ d ) R y ( θ d ) R z ( ψ d ) . Thus, the desire trajectory is translated into desire attitude R d and altitude z d , which can be solved by CLF.
Select a quadrotor CLF for altitude control as
V z = 1 2 k 1 e z T · e z + 1 2 k 2 e v · e v + ϵ e z · e v ,
where e z = z z d , e v = z ˙ z ˙ d , and k 1 , k 2 , ϵ > 0 are parameters which need to be chosen to make V z quadratic.
Similar to the above function and based on (4), here it can construct a geometric CLF as
V R = 1 2 e R K 1 e R + 1 2 e Ω K 2 e Ω + ε e R e Ω ,
Then, the CLF-CBF-QP is constructed to obtain the actual control u
u ( x ) = argmin u R 4 1 2 u 2 + 1 2 λ 1 δ 1 2 + 1 2 λ 2 δ 2 2 s . t . L f V z ( x ) + L g V z ( x ) u + α 1 V z ( x ) δ 1 L f V R ( x ) + L g V R ( x ) u + α 2 V R ( x ) δ 2 L f 2 h j ( x ) + L g L f h j ( x ) u k 1 h j ( x ) + k 2 L f h j ( x ) , j I s ( t ) ,
where I s ( t ) is the indice set of obstacles that are detected by the quadrotor, h j ( x ) is computed in (33) and α 1 , α 2 are all positive gain parameters.
Note: It is very difficult to choose the appropriate parameters such as α 1 , α 2 , to balance the stability and safety of the controller. The main reason is that the mass m is normally two orders of magnitude larger than the moment of inertia I x , I y , I z ; thus, the controller struggles to avoid obstacles while maintaining a stable quadrotor attitude.
This paper proposes a nontrivial method that balances the control stability and safety by scaling the inertia with a high factor K and that then converts the solved optimal action by the same factor. This alleviates the difficulty for parameter design and also guarantees stability and safety.
Proposition 1. 
Suppose the quadrotor systems are described as (36) and (37); if the inertia matrix is scaled by the factor K, the system is also stable and safe if the action satisfies
u * = M 1 1 g v M 2 1 g ω 1 M 1 1 g v 1 K M 2 1 g ω u ,
where u is the solution of (44) based on the scaled dynamics.
Proof of Proposition 1. 
Supposed the matrix M 2 is scaled by the factor K, and the scale drift vector and control vector are denoted as f K ( x ) and g K ( x ) , respectively. The solution action u of (44) makes the following satisfy
V x ( f K ( x ) + g K ( x ) u + α 1 V ( x ) ) 0 .
It is obvious that f K ( x ) = f ( x ) and
V x ( f ( x ) + [ 0 3 × 12 M 1 1 g v 1 K M 2 1 g ω ] T u + α 1 V ( x ) ) 0 ,
Since the input control action has (45). Thus, for the real quadrotor system with control vector u * ,
V x ( f ( x ) + g ( x ) u * + α 1 V ( x ) ) = V x ( f ( x ) + [ 0 12 × 3 M 1 1 g v M 2 1 g ω ] T u * + α 1 V ( x ) ) = V x ( f ( x ) + 0 3 × 12 M 1 1 g v M 2 1 g ω M 1 1 g v M 2 1 g ω 1 M 1 1 g v 1 K M 2 1 g ω + α 1 V ( x ) ) = V x ( f K ( x ) + g K ( x ) u + α 1 V ( x ) ) 0 .
The ECBF for safety is also guaranteed in the same way.
Thus, the quadrotor with control vector u * is also stable and safe for tracking missions. □
To ensure numerical robustness and closed-loop performance, key hyperparameters are selected with explicit physical and control theoretic justifications. Since the mass m is typically two orders of magnitude larger than the moment of inertia I x , I y , I z , an inertia scaling factor of K = 100 is introduced, which balances their numerical magnitudes in the optimization formulation. This scaling prevents the QP solver from becoming ill-conditioned and enables the controller to weigh safety and stability objectives comparably.
The controller gains k 1 and k 2 are designed using pole placement on the closed-loop dynamics matrix F G K , where K = [ k 1 , k 2 ] . This ensures that the safety condition h ( x ) C e F G K B ( x 0 ) 0 required by Definition 2 is satisfied, with the gains chosen such that the characteristic polynomial λ 2 + k 2 λ + k 1 = 0 yields real and negative roots. The α 1 , α 2 are all positive gain parameters, which can be selected properly to make the system stable.

5. Simulation Verification

5.1. Simulation Setup and Training Details

(1) Simulation Setup
To demonstrate the proposed control framework, this paper builds a quadrotor model based on the V-rep platform for simulation. The model accounts for the aerodynamics mainly regarding linear drag term and gyroscopic torques [38]. The NN is constructed with the PyTorch (v1.7.1) platform. The QP is solved by the interior point method. The quadrotor mass 1 kg, and the inertia is [ I x , I y , I z ] = [ 7.0 , 7.0 , 13.5 ] × 10 3 kg · m 2 . The maximum thrust of a single rotor is 5 N.
When only considering the main control effort of the rotor, the thrust and torque for the quadrotor are determined as follows:
T x T y T z τ x τ y τ z = 0 0 0 0 0 0 0 0 k k k k 0 k l 0 k l k l 0 k l 0 b b b b ϖ 1 2 ϖ 2 2 ϖ 3 2 ϖ 4 2 ,
where T x , T y , T z and τ x , τ y , τ z are the thrust and torque for quadrotor body, k is the thrust constant, and b is the thrust to torque ratio of the rotor blades.
To alleviate the learning difficulty of HDM, the input control is converted to u = [ ϖ 1 2 , ϖ 2 2 , ϖ 3 2 , ϖ 4 2 ] T × 10 6 . In the simulation, here setting the main effort parameters k = 1 , l = 0.25 m , b = 0.2 , the linear drag coefficient c ¯ = 0.02 , and moment of the inertia rotor blades I r = 1.2 × 10 5 kg · m 2 for gyroscopic effect. The controller chooses inertia scale K = 100 .
(2) Training details
For data collection, the quadrotor is controlled by tracking 5 random circle desired trajectories, providing 5 s tracking data with a simulation interval 10 ms and a control step 50 ms. The dataset D = { t 0 : N ( i ) , x 0 : N ( i ) , u ( i ) } i = 0 D is generated with N = 200 and D = 5 .
All models are trained for 2000 gradient steps using the Adam optimizer with a consistent learning rate of 10 3 and a batch size of M = 1000 , which ensures convergence. For the proposed HDM, the inertia parameters are explicitly optimized, while the control input matrix is approximated by a fully connected NN with four hidden layers of dimensions [ 18 , 200 , 200 , 200 , 16 ] . All hidden layers employ the tanh ( ) activation function.
To demonstrate the efficiency of the proposed method, the HDM is compared with several representative baseline models, including both pure NN-based models and physics-based models with deliberate parameter errors:
  • 1) The NODE model [33]. This serves as a standard, non-physics-informed black-box learning baseline. As the standard NODE formulation is designed for autonomous systems, this paper adapts it to a control-affine structure to ensure a fair comparison. Specifically, the dynamics is modeled as x ˙ = f ˜ ( x , θ f ) + g ˜ ( x , θ g ) u , where f ˜ and g ˜ are two independent NNs with parameters θ = { θ f , θ g } . This model is trained using the same dataset, loss function, and optimization procedure as the HDM.
  • 2) Physics-based Models with Errors: To illustrate the limitations of traditional model-based control under model mismatch, the following two deliberately mis-specified nominal models is compared:
    -
    Nominal I: The nominal dynamics model with error in the inertia parameters.
    -
    Nominal A: The nominal dynamics model with error in the aerodynamic parameters.
This comprehensive comparison is designed to ablation and demonstrate the benefit of the proposed HDM over both a pure black-box NN model (NODE) and imperfect handcrafted physical models.
(3) Evaluating Performance
To evaluate the performance of the tracking under different models, the Root Mean Square error (RMS) is used:
R M S = 1 2 i = 1 n ( x x d ) 2 .

5.2. Prediction Result of HDM

One should note that the generalized momenta p is calculated by the velocity and does not have a truth value in the dataset, the dynamics of quadrotor will not change if p is scaled by a constant factor γ > 0 [34]. To emphasize this scale invariance, suppose the learned inertia parameter is θ 1 = γ [ m , I x , I y , I z ] T and the control matrix is g γ ( q ) = γ g ( q ) . There is M γ ( q ) = γ M ( q ) , V γ = γ V ( q ) , and
p γ = M γ ξ = γ p , p ˙ γ = γ p ˙ H γ ( q , p ) = 1 2 p γ T M γ 1 p γ + V γ ( q ) = γ H ( q , p ) q ˙ = H γ ( q , p ) p γ = M γ 1 ( q ) p γ = H ( q , p ) p ,
guaranteeing that (24) still holds. It is also worth noticing that the position loop and attitude loop can have different scale factors, which can be obviously obtained from (35).
This means that although HDM sets the particular parameter to approximate the value of θ = [ m ˜ , I ˜ x , I ˜ y , I ˜ z ] T and uses NN to learn the input matrix g ξ ( q , p ) , the prediction results are scaled by a constant factor.
The learning performance of the control input matrix is evaluated in Figure 4. Figure 4a illustrates the evolution of the learned matrix elements along a sample trajectory. At the initial stage, where the quadrotor velocity is near zero, the input matrix remains approximately constant, consistent with the negligible influence of velocity relevant aerodynamic effects. As the trajectory progresses and velocity increases, the learned matrix elements exhibit corresponding temporal fluctuations. This dynamic adaptation verifies that the HDM successfully captures not only the rigid-body dynamics but also the aerodynamic disturbances embedded in the data.
To further substantiate the structural fidelity of the learned model, the predicted and true elements of g ξ ( q , p ) are compared directly in Figure 4. A detailed element-wise comparison is provided in Figure 4b,c. The close correspondence in both value distribution and temporal structure between the predicted and true elements demonstrates that the HDM accurately infers the underlying control authority mapping of the quadrotor, affirming its capability to learn physically consistent input gains from data.
Here choosing the first few values of the learned input matrix g ξ ( q , p ) elements in the trajectory to verify the learned thrust and torque parameters, as well as the approximated value learning by HDM, can be obtained as
k ˜ = 1 4 g ξ [ 2 , 0 ] + g ξ [ 2 , 1 ] + g ξ [ 2 , 2 ] + g ξ [ 2 , 3 ] = 1.827 .
In the same way, one can obtain k l ˜ = 0.507 , b ˜ = 0.396 .
Here, the mean difference between the ground truth and prediction value is chosen as the scale γ , which has
γ 1 = 1 2 m ˜ m + k ˜ k = 1.829 ,
γ 2 = 1 5 I ˜ x I x + I ˜ x I x + I ˜ x I x + k l ˜ k l + b ˜ b = 2.03 .
The parameters can be transferred by scaling to verify the prediction accuracy of the HDM. The results are shown in Table 1.
The evolution of the learned Hamiltonian energy H ˜ is visualized in Figure 5. As shown, the predictions generated by the HDM exhibit fluctuation patterns that closely align with the true system energy. After applying the scaling factors derived from (53) and (54), the Hamiltonian energy predicted by the HDM demonstrates an excellent match with the ground-truth values. This close correspondence verifies that the HDM not only accurately captures the functional relationship governing the system’s energy but also precisely identifies the inertial parameters directly from data. These results confirm that the data-driven dynamics model learned by the HDM retains the fundamental physical characteristics of analytical models, achieving both high generalization capability and predictive accuracy.
The results show that the proposed approach learns the explicit parameter value directly from the collected data with prediction errors lower than 2.5 % . Compared with that of other identification methods, the identification result of the HDM might not be more accurate. However, one should consider that the HDM learns the whole dynamics function of the quadrotor, not for identification. This gives profound proof that the HDM learns the true physical information of the quadrotor while approximating complex aerodynamic effort with a black-box NN, which means that the HDM is more explainable and has great generalization.

5.3. Trajectory Tracking with Multiple Static Obstacles

For comparison, the baseline model is set for the same CLF-ECBF-QP control framework with nominal dynamics under inertia parameter error or aerodynamic effort error.
In this scenario, the quadrotor is controlled to track a planing trajectory with static obstacles. The obstacles are large circles and intersect the planing trajectory to verify the capability of the proposed method for safety control. The planing trajectory is [ x d , y d , z d ] = [ 1.5 1.5 cos ( 0.25 t ) , 0 , 2 1.5 cos ( 0.5 t ) ] m, the starting position is given as [ x 0 , y 0 , z 0 ] = [ 0 , 0 , 0.5 ] m and the initial angle and velocity are zero. The positions of three static obstacles are ρ o 1 = [ 0.4 , 0 , 2.2 ] m, ρ o 2 = [ 1.6 , 0 , 3.6 ] m and ρ o 3 = [ 2.2 , 0 , 2.6 ] m, with outline r x = r y = r z = 0.4 m.
The control resulting of the quadrotor is shown in Figure 6. Figure 6a depicts the tracking trajectory of the quadrotor with various models, where all controllers aim to track the planing trail while ensuring safety. Once the planning trajectory cross the obstacles, the controller relaxes tracking performance to ensure the safety guarantees.
In Figure 6a, based on the HDM, the quadrotor safely circumvents the obstacles and then tracking back to the desired reference. In contrast, controllers relying on the mis-specified nominal models (with inertia or aerodynamic parameter errors) exhibit compromised safety. Specifically, they struggle to maintain safe clearance when passing near Obstacle 2 and Obstacle 3.
More critically, the controller based on the NODE baseline fails entirely. It leads to an unsafe maneuver near Obstacle 2 and subsequently becomes unstable. After approximately 10 s, the pitch angle exceeds 60 degrees, indicating a catastrophic loss of control. This failure stems from the poor generalization and lack of physical structure in the black-box NODE model. Without embedded physical priors, the NODE fails to accurately disentangle and learn the underlying drift and input vector fields from limited data. It merely learns an opaque mapping from state x to state derivative x ˙ , resulting in a model that lacks mechanistic interpretability and generalizes poorly to unseen flight conditions.
Figure 6b quantifies the safety performance by plotting the minimum distance between the quadrotor and obstacles over time. The controller based on the nominal model with inertia error permits a critically small distance of 0.07 m at t = 7.2 s. Similarly, the model with aerodynamic error and the NODE baseline also show hazardous proximity, with minimum distances of 0.35 m at 7.9 s and 0.22 m at 6.2 s, respectively. These results demonstrate that both parametric model errors and unstructured black-box learning can lead to safety violations in cluttered environments. In stark contrast, the HDM-based controller maintains a consistently safe distance throughout the mission.
The larger tracking errors of the hand-designed methods are caused by the error models degrading the stability for tracking of the CLF controller and struggling to pass through the obstacles. The failed tracking of NODE models are suffered by the poor generalization of the pure NN, which has great prediction error in the untrained test state, making the control unstable and unsafe.
The corresponding trajectory tracking errors are presented in Figure 6c. As expected, errors increase transiently when the controller sacrifices tracking precision to ensure collision avoidance. The HDM-based controller achieves the lowest tracking error (with an RMS error of 0.15 m) while guaranteeing safety. The nominal models yield larger RMS errors of 0.20 m and 0.22 m, respectively. The NODE baseline, however, results in a complete tracking failure, as detailed in Table 2. The degraded tracking of the nominal models is attributed to their parameter errors, which undermine the stability properties of the CLF controller and safety of the ECBF. The failure of the NODE baseline is directly linked to its poor generalization capability; significant prediction errors in unseen flight regimes lead to unstable and unsafe control actions.
In summary, the results clearly demonstrate that the proposed HDM-based framework enables a quadrotor to strictly enforce safety constraints in a multi-obstacle environment while minimizing tracking error. It outperforms controllers based on hand-designed models with parameter errors and, most importantly, exhibits robust stability and safety compared to a standard black-box NODE baseline. This comparative analysis provides direct evidence that the Hamiltonian structure and physical priors embedded in the HDM are key contributors to its superior performance.

5.4. Trajectory Tracking with Dynamic Obstacles

In this mission, the quadrotor is controlled to tracking subject to a time-varying obstacle and a static obstacle. The planning trajectory is set as [ x d , y d , z d ] = [ 1.5 1.5 cos ( 0.25 t ) , 0 , 2 1.5 cos ( 0.5 t ) ] m, the initial position is set as [ x 0 , y 0 , z 0 ] = [ 0 , 0 , 0.5 ] m and the initial angle and velocity is zero. One obstacle is moving along a line across the tracking trajectory with the center reference given by ρ o 1 = [ 0.1 t , 0 , 0.1 t + 0.5 ] m, and the other is static with ρ o 2 = [ 1.6 , 0 , 3.5 ] m.
Figure 7 depicts the resulting obtained by the CLF-ECBF-QP controllers under various models. Figure 7a illustrates the tracking trajectories alongside the motion of the dynamic obstacle. The controller utilizing the HDM accurately tracks the planned trajectory while rigorously maintaining the forward invariance of the time-varying safety set, thereby ensuring collision avoidance. In contrast, the controller based on the nominal model with parameter error fails to guarantee safety in this complex scenario where static and dynamic obstacles are in close proximity.
Critically, the controller based on the NODE baseline also violates safety near the static obstacle, rapidly becomes unstable, and ultimately fails to complete the tracking task. This failure is primarily attributed to the poor generalization and overfitting of the black-box NN when confronted with unseen state configurations during dynamic interaction.
Safety performance is quantified in Figure 7b. The controller with inertia error nominal model permits unsafe proximities of 0.37 m at t = 2.0 s and 0.36 m at t = 6.7 s. Similarly, the aerodynamic error model leads to an unsafe distance of 0.36 m at 7.5 s. The NODE-based controller exhibits an even more critical safety violation, with a minimum distance of only 0.28 m at 6.5 s.
In terms of tracking accuracy, the HDM-based controller achieves the lowest RMS error of 0.45 m, while the controllers based on the erroneous nominal models yield higher errors of 0.47 m and 0.62 m, respectively. Detailed quantitative results are provided in Table 3.
In summary, the results in the dynamic obstacle scenario consistently demonstrate that only the CLF-ECBF-QP framework integrated with the HDM successfully satisfies all safety constraints during trajectory tracking. It enables safe obstacle avoidance while minimizing tracking error, thereby confirming the robustness and generalizability of the proposed approach under more challenging conditions.

6. Experiments

This section presents a hardware validation of the proposed safety-critical control framework. Experiments are conducted using a Bitcraze Crazyflie 2.1 nano-quadrotor [39], a widely adopted platform for quadrotor research, as shown in Figure 8.
Experimental Setup: The entire control pipeline is implemented in Python on a laptop, equipped with an Intel-i7 CPU, Windows operating system. The CLF-ECBF-QP optimization problem is formulated using the CasADi symbolic framework and solved with interior-point method. Crucially, the complete HDM-based CLF-ECBF-QP control loop is executed within 10 ms, enabling a real-time control frequency of 100 Hz.
Task Description: The quadrotor is tasked with tracking a predefined trajectory while avoiding two static, circular obstacles, as illustrated in Figure 8a. The desired trajectory is given by [ x d , y d , z d ] = [ 0.5 0.5 cos ( 0.12 t ) , 0 , 0.7 0.5 cos ( 0.25 t ) ] m, starting from [ x 0 , y 0 , z 0 ] = [ 0 , 0 , 0.2 ] m with zero initial attitude and velocity. The obstacles are centered at ρ o 1 = [ 0.0 , 0 , 0.6 ] m and ρ o 2 = [ 0.8 , 0 , 1.0 ] m, each with a radius of 0.2 m in all axes.
Figure 8b presents the experimental results. In this real-world scenario, only the controller based on the proposed HDM succeeded. Controllers utilizing the nominal models or the pure NODE baseline failed to achieve stable flight upon deployment and were therefore not viable for this hardware test. As shown, the quadrotor using the HDM controller safely avoids both obstacles and then returns accurately to the desired path.
This successful hardware demonstration provides tangible evidence that the proposed learnable HDM based safe control framework is not only effective in theory but also practically viable for real-time, safety-critical operation on physical quadrotor systems.
Furthermore, the successful real-world validation of the single-quadrotor framework provides a solid foundation for extending it to multi-quadrotor systems. The architecture is inherently scalable, as the data-driven HDM enables decentralized and individualized dynamics learning across agents, while the CLF-ECBF-QP controller can directly encode inter-agent collision avoidance through additional pairwise barrier constraints within the same optimization framework. Consequently, the key challenge for swarm deployment shifts to implementing efficient distributed optimization and communication that ensure safety and scalability.

7. Conclusions

This paper presents a novel, safety-critical control framework for quadrotors that seamlessly unifies data-driven dynamics with formal stable and safe control theory guarantees. The core of the proposed approach is the Hamiltonian neural differential model (HDM), a physics-informed neural ODE that learns accurate dynamics on the SE ( 3 ) manifold while preserving energy conservation and interpretability. It not only achieves precise identification of inertia and complex aerodynamic effects but also yields a control-affine model structure by construction. This unique property enables the direct synthesis of a certifiable controller via control Lyapunov and exponential control barrier functions (CLF-ECBF) within a quadratic programming (QP) framework, effectively bridging the gap between high-capacity learning models and rigorous safety constraints.
The efficacy of the proposed framework is thoroughly validated through both simulations and real-world flight experiments. In simulation, the training results show that HDM learns the precise inertia parameters and underlying input vector of the quadrotor, demonstrate that the proposed data-driven model is more explainable and generalized. And for tracking task in simulation, the HDM-based CLF-ECBF-QP controller demonstrates superior tracking performance and guaranteed safety in complex obstacle environments, outperforming both nominal model-based and black-box neural ODE counterparts. Most importantly, the proposed learning-based controller is successfully deployed on a physical quadrotor platform. These hardware experiments confirm that the framework maintains stable and safe flight in the presence of real-world disturbances, unmodeled dynamics, and state estimation noise, thereby transitioning the method from a theoretical construct to a practically viable solution.
This work opens several avenues for future research, with subsequent studies advancing along two main directions to enhance practical deployment. The first direction focuses on robustness in uncertain environments, aiming to mitigate the effects of sensor noise and external disturbances through the integration of disturbance observers or robust safety filters. The second direction targets scalable multi-agent coordination, extending the current safety-critical control formulation with distributed communication and optimization protocols to enable safe, collision-free operations in dense multi-quadrotor systems.

Author Contributions

Conceptualization, X.W. and Y.L.; methodology, N.Q.; software, X.W.; validation, H.X., D.D., and X.W.; formal analysis, X.W.; investigation, N.Q.; resources, Y.L.; data curation, H.X.; writing—original draft preparation, X.W.; writing—review and editing, X.W.; visualization, Y.L.; supervision, Y.L.; project administration, D.D.; funding acquisition, Y.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work was funded by National Key Research and Development Program of China (2022YFB3902701), the National Science Foundation of China (52272390), and National High-Level Young Scholars Program (Q2022335).

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Acknowledgments

I would like to express my gratitude to the professor and colleagues for their assistance and encouragement regarding my research project.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
HDMHamiltonian neural differential model
CLFcontrol Lyapunov function
ECBFexponential control barrier function
QPquadratic programming

References

  1. Chen, J.Y. Uav-guided navigation for ground robot tele-operation in a military reconnaissance environment. Ergonomics 2010, 53, 940–950. [Google Scholar] [CrossRef] [PubMed]
  2. Ma, Z.; Wang, Q.; Chen, H. A joint guidance and control framework for autonomous obstacle avoidance in quadrotor formations under model uncertainty. Aerosp. Sci. Technol. 2023, 138, 108335. [Google Scholar] [CrossRef]
  3. Guo, J.; Qi, J.; Wang, M.; Wu, C.; Ping, Y.; Li, S.; Jin, J. Distributed cooperative obstacle avoidance and formation reconfiguration for multiple quadrotors: Theory and experiment. Aerosp. Sci. Technol. 2023, 136, 108218. [Google Scholar] [CrossRef]
  4. Gong, W.; Li, B.; Ahn, C.K.; Yang, Y. Prescribed-time extended state observer and prescribed performance control of quadrotor UAVs against actuator faults. Aerosp. Sci. Technol. 2023, 138, 108322. [Google Scholar] [CrossRef]
  5. Bemporad, A.; Morari, M. Robust model predictive control: A survey. In Robustness in Identification and Control; Springer: London, UK, 1999; pp. 207–226. [Google Scholar]
  6. Fukushima, H.; Kim, T.-H.; Sugie, T. Adaptive model predictive control for a class of constrained linear systems based on the comparison model. Automatica 2007, 43, 301–308. [Google Scholar] [CrossRef]
  7. Guo, J.; Qi, J.; Wang, M.; Wu, C.; Ping, Y.; Li, S.; Jin, J. Collision-free formation tracking control for multiple quadrotors under switching directed topologies: Theory and experiment. Aerosp. Sci. Technol. 2022, 131, 108007. [Google Scholar] [CrossRef]
  8. Wang, X. Research on Trajectory Tracking and Obstacle Avoidance Control of UAV Based on Data-Driven Modeling; Harbin Institute of Technology: Harbin, China, 2022. [Google Scholar]
  9. Bauersfeld, L.; Kaufmann, E.; Foehn, P.; Sun, S.; Scaramuzza, D. Neurobem: Hybrid aerodynamic quadrotor model. arXiv 2021, arXiv:2106.08015. [Google Scholar] [CrossRef]
  10. Saviolo, A.; Li, G.; Loianno, G. Physics-inspired temporal learning of quadrotor dynamics for accurate model predictive trajectory tracking. IEEE Robot. Autom. Lett. 2022, 7, 10256–10263. [Google Scholar] [CrossRef]
  11. Faessler, M.; Franchi, A.; Scaramuzza, D. Differential flatness of quadrotor dynamics subject to rotor drag for accurate tracking of high-speed trajectories. IEEE Robot. Autom. Lett. 2018, 3, 620–626. [Google Scholar] [CrossRef]
  12. Vinogradska, J.; Bischoff, B.; Nguyen-Tuong, D.; Schmidt, H.; Romer, A.; Peters, J. Stability of controllers for gaussian process forward models. In Proceedings of the 33rd International Conference on Machine Learning, New York, NY, USA, 20–22 June 2016; pp. 545–554. [Google Scholar]
  13. Lopez-Sanchez, I.; Moyrón, J.; Moreno-Valenzuela, J. Adaptive neural network-based trajectory tracking outer loop control for a quadrotor. Aerosp. Sci. Technol. 2022, 129, 107847. [Google Scholar] [CrossRef]
  14. Pan, Y.; Theodorou, E. Probabilistic differential dynamic programming. In Proceedings of the 28th International Conference on Neural Information Processing Systems, Montreal, QC, Canada, 8–13 December 2014; Volume 27, pp. 1–9. [Google Scholar]
  15. Deisenroth, M.P.; Fox, D.; Rasmussen, C.E. Gaussian processes for data-efficient learning in robotics and control. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 408–423. [Google Scholar] [CrossRef]
  16. Aswani, A.; Gonzalez, H.; Sastry, S.S.; Tomlin, C. Provably safe and robust learning-based model predictive control. Automatica 2013, 49, 1216–1226. [Google Scholar] [CrossRef]
  17. Khansari-Zadeh, S.M.; Billard, A. Learning control lyapunov function to ensure stability of dynamical system-based robot reaching motions. Robot. Auton. Syst. 2014, 62, 752–765. [Google Scholar] [CrossRef]
  18. Ravanbakhsh, H.; Sankaranarayanan, S. Learning lyapunov (potential) functions from counter examples and demonstrations. arXiv 2017, arXiv:1705.09619. [Google Scholar]
  19. Ito, Y.; Fujimoto, K.; Tadokoro, Y. Second-order bounds of gaussian kernel-based functions and its application to nonlinear optimal control with stability. arXiv 2017, arXiv:1707.06240. [Google Scholar]
  20. Akametalu, A.K.; Fisac, J.F.; Gillula, J.H.; Kaynama, S.; Zeilinger, M.N.; Tomlin, C.J. Reachability-based safe learning with gaussian processes. In Proceedings of the 2014 IEEE 53rd Annual Conference on Decision and Control, Los Angeles, CA, USA, 15–17 December 2014; pp. 1424–1431. [Google Scholar]
  21. Ames, A.D.; Xu, X.; Grizzle, J.W.; Tabuada, P. Control barrier function based quadratic programs for safety critical systems. IEEE Trans. Autom. Control 2017, 62, 3861–3876. [Google Scholar] [CrossRef]
  22. Nguyen, Q.; Sreenath, K. Exponential control barrier functions for enforcing high relative-degree safety-critical constraints. In Proceedings of the 2016 American Control Conference, Boston, MA, USA, 6–8 July 2016; pp. 322–328. [Google Scholar]
  23. Xiao, W.; Belta, C. Control barrier functions for systems with high relative degree. In Proceedings of the 2019 IEEE 58th Conference on Decision and Control, Nice, France, 11–13 December 2019; pp. 474–479. [Google Scholar]
  24. Zheng, L.; Yang, R.; Wu, Z.; Pan, J.; Cheng, H. Safe learning-based gradient-free model predictive control based on cross-entropy method. Eng. Appl. Artif. Intell. 2022, 110, 104731. [Google Scholar] [CrossRef]
  25. Wang, L.; Theodorou, E.A.; Egerstedt, M. Safe learning of quadrotor dynamics using barrier certificates. In Proceedings of the 2018 IEEE International Conference on Robotics and Automation, Brisbane, Australia, 21–25 May 2018; pp. 2460–2465. [Google Scholar]
  26. Lurie, A.I. Analytical Mechanics; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013. [Google Scholar]
  27. Holm, D.D. Geometric Mechanics; World Scientific Publishing Company: Singapore, 2008. [Google Scholar]
  28. Shivarama, R.; Fahrenthold, E.P. Hamilton’s equations with euler parameters for rigid body dynamics modeling. J. Dyn. Syst. Meas. Control 2004, 126, 124–130. [Google Scholar] [CrossRef]
  29. Lee, T.; Leok, M.; McClamroch, N.H. Global Formulations of Lagrangian and Hamiltonian Dynamics on Manifolds; Springer: Berlin/Heidelberg, Germany, 2017. [Google Scholar]
  30. Finzi, M.; Wang, K.A.; Wilson, A.G. Simplifying hamiltonian and lagrangian neural networks via explicit constraints. Adv. Neural Inf. Process. Syst. 2020, 33, 13880–13889. [Google Scholar]
  31. Greydanus, S.; Dzamba, M.; Yosinski, J. Hamiltonian neural networks. In Proceedings of the 33th International Conference on Neural Information Processing Systems, Vancouver, BC, Canada, 8–14 December 2019; Volume 32. [Google Scholar]
  32. Zhong, Y.D.; Dey, B.; Chakraborty, A. Symplectic ode-net: Learning hamiltonian dynamics with control. arXiv 2019, arXiv:1909.12077. [Google Scholar]
  33. Chen, R.T.; Rubanova, Y.; Bettencourt, J.; Duvenaud, D. Neural ordinary differential equations. In Proceedings of the 32th International Conference on Neural Information Processing Systems, Montreal, QC, Canada, 2–8 December 2018; Volume 31. [Google Scholar]
  34. Duong, T.; Atanasov, N. Hamiltonian-based neural ode networks on the se(3) manifold for dynamics learning and control. arXiv 2021, arXiv:2106.12782. [Google Scholar] [CrossRef]
  35. Ames, A.D.; Galloway, K.; Sreenath, K.; Grizzle, J.W. Rapidly exponentially stabilizing control lyapunov functions and hybrid zero dynamics. IEEE Trans. Autom. Control 2014, 59, 876–891. [Google Scholar] [CrossRef]
  36. Wu, G.; Sreenath, K. Safety-critical and constrained geometric control synthesis using control lyapunov and control barrier functions for systems evolving on manifolds. In American Control Conference; IEEE: Piscataway Township, NJ, USA, 2015; pp. 2038–2044. [Google Scholar]
  37. Bullo, F. Geometric Control of Mechanical Systems; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2005. [Google Scholar]
  38. Bangura, M.; Mahony, R.E. Real-time model predictive control for quadrotors. In Proceedings of the 19th IFAC World Congress, Cape Town, South Africa, 24–29 August 2014; Volume 47, pp. 11773–11780. [Google Scholar]
  39. Giernacki, W.; Skwierczynski, M.; Witwicki, W. Crazyflie 2.0 quadrotor as a platform for research and education in robotics and control engineering. In International Conference on Methods and Models in Automation and Robotics; IEEE: Piscataway Township, NJ, USA, 2017; pp. 37–42. [Google Scholar]
Figure 1. Overall control framework.
Figure 1. Overall control framework.
Drones 10 00064 g001
Figure 2. Framework of HDM.
Figure 2. Framework of HDM.
Drones 10 00064 g002
Figure 3. Training process of the HDM.
Figure 3. Training process of the HDM.
Drones 10 00064 g003
Figure 4. The elements of input matrix g ξ ( q , p ) . (a) The value changed with time. (b) The value distribution of the true g ξ ( q , p ) at initial state. (c) The value distribution of the g ξ ( q , p ) predicted by HDM at initial state.
Figure 4. The elements of input matrix g ξ ( q , p ) . (a) The value changed with time. (b) The value distribution of the true g ξ ( q , p ) at initial state. (c) The value distribution of the g ξ ( q , p ) predicted by HDM at initial state.
Drones 10 00064 g004
Figure 5. The learned Hamiltonian energy by HDM.
Figure 5. The learned Hamiltonian energy by HDM.
Drones 10 00064 g005
Figure 6. Tracking planing trail with multiple static obstacles. This results is obtained by the CLF-ECBF-QP controller apply to track a planing trajectory with multiple obstacles. (a) Tracking trajectory of quadrotor under different dynamic models subject to multiple static obstacles. (b) Distance between quadrotor and obstacles, where t = 0–5 s illustrates obstacle 1, t = 5–7.5 s for obstacle 2 and t = 7.5–12.5 s for obstacle 3. (c) Translational error with respect to time for different dynamics models with the CLF-ECBF-QP controller.
Figure 6. Tracking planing trail with multiple static obstacles. This results is obtained by the CLF-ECBF-QP controller apply to track a planing trajectory with multiple obstacles. (a) Tracking trajectory of quadrotor under different dynamic models subject to multiple static obstacles. (b) Distance between quadrotor and obstacles, where t = 0–5 s illustrates obstacle 1, t = 5–7.5 s for obstacle 2 and t = 7.5–12.5 s for obstacle 3. (c) Translational error with respect to time for different dynamics models with the CLF-ECBF-QP controller.
Drones 10 00064 g006
Figure 7. Trajectory tracking subject to a time-vary dynamic obstacle and a static obstacle. (a) Position trajectories of the quadrotor controlled under different models and the moving obstacle are shown. The thick solid gray line represent the trajectory of the dynamic obstacle. (b) The distance between the quadrotor and obstacle is shown. t = 0.55–0.75 s shows the distance with the static obstacle, and the others show the distance with the dynamics obstacle. (c) The distance between the quadrotor track and reference trajectory.
Figure 7. Trajectory tracking subject to a time-vary dynamic obstacle and a static obstacle. (a) Position trajectories of the quadrotor controlled under different models and the moving obstacle are shown. The thick solid gray line represent the trajectory of the dynamic obstacle. (b) The distance between the quadrotor and obstacle is shown. t = 0.55–0.75 s shows the distance with the static obstacle, and the others show the distance with the dynamics obstacle. (c) The distance between the quadrotor track and reference trajectory.
Drones 10 00064 g007
Figure 8. Hardware experiment with the Bitcraze Crazyflie 2.1 quadrotor. (a) A snapshot of the experimental environment. The dashed black line represents the desired trajectory, and the solid green line depicts the actual, safe trajectory flown by the quadrotor using the proposed method. (b) The trajectory executed by the quadrotor under the HDM based controller.
Figure 8. Hardware experiment with the Bitcraze Crazyflie 2.1 quadrotor. (a) A snapshot of the experimental environment. The dashed black line represents the desired trajectory, and the solid green line depicts the actual, safe trajectory flown by the quadrotor using the proposed method. (b) The trajectory executed by the quadrotor under the HDM based controller.
Drones 10 00064 g008
Table 1. Predicting result of HDM.
Table 1. Predicting result of HDM.
TruthPredictionScaledError
m [kg]11.8311.001 0.1 %
k11.8260.998 0.2 %
I x [ 10 3 kg · m 2 ]7.014.277.03 0.4 %
I y [ 10 3 kg · m 2 ]7.014.277.03 0.4 %
I z [ 10 3 kg · m 2 ]13.728.4314.00 2.2 %
k l 0.250.5070.249 0.4 %
b0.20.3960.195 2.5 %
Table 2. Tracking error and minimum obstacle distance of different models. × means the control based on corresponding models is unsafe or unstable.
Table 2. Tracking error and minimum obstacle distance of different models. × means the control based on corresponding models is unsafe or unstable.
Minimal Distance with Obstacle [m]Tracking Error [m]
1 2 3
HDM0.4210.4050.4030.151
Nominal I0.4010.223 (×)0.4150.203
Nominal A0.4820.4890.348 (×)0.221
NODE0.4150.22 (×)0.052 (×)×
Table 3. Tracking error and minimum obstacle distance of different models for dynamic obstacle environment. × means the control based on corresponding models is unsafe or unstable.
Table 3. Tracking error and minimum obstacle distance of different models for dynamic obstacle environment. × means the control based on corresponding models is unsafe or unstable.
Minimal Distance with Obstacle [m]Tracking Error [m]
Dynamics 1 Obstacle Dynamics 2
HDM0.4090.4020.4130.45
Nominal I0.391 (×)0.372 (×)0.4940.47
Nominal A0.4210.5120.361 (×)0.62
NODE0.385 (×)0.284 (×)0.714×
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

Wang, X.; Liu, Y.; Du, D.; Xu, H.; Qi, N. A Hamiltonian Neural Differential Dynamics Model and Control Framework for Autonomous Obstacle Avoidance in a Quadrotor Subject to Model Uncertainty. Drones 2026, 10, 64. https://doi.org/10.3390/drones10010064

AMA Style

Wang X, Liu Y, Du D, Xu H, Qi N. A Hamiltonian Neural Differential Dynamics Model and Control Framework for Autonomous Obstacle Avoidance in a Quadrotor Subject to Model Uncertainty. Drones. 2026; 10(1):64. https://doi.org/10.3390/drones10010064

Chicago/Turabian Style

Wang, Xu, Yanfang Liu, Desong Du, Huarui Xu, and Naiming Qi. 2026. "A Hamiltonian Neural Differential Dynamics Model and Control Framework for Autonomous Obstacle Avoidance in a Quadrotor Subject to Model Uncertainty" Drones 10, no. 1: 64. https://doi.org/10.3390/drones10010064

APA Style

Wang, X., Liu, Y., Du, D., Xu, H., & Qi, N. (2026). A Hamiltonian Neural Differential Dynamics Model and Control Framework for Autonomous Obstacle Avoidance in a Quadrotor Subject to Model Uncertainty. Drones, 10(1), 64. https://doi.org/10.3390/drones10010064

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop