1. Introduction
Common non-fixed-wing Vertical Take-Off and Landing (VTOL) aircraft, such as multi-rotor systems and helicopters, control their position and orientation in three-dimensional space by adjusting attitude and thrust magnitude. An attitude controller computes the inputs required to drive the vehicle from its current orientation toward a desired attitude. The method of attitude representation and the definition of attitude error jointly determine the trajectory from the present to the target orientation.
In many contemporary attitude control designs, the error for each channel is typically derived from the difference between a single attitude parameter and its desired value. When Euler angles are used for attitude representation, control strategies often account for rigid-body rotation dynamics to reduce coupling among parameters, thus treating attitude control as a set of single-channel problems [
1,
2,
3]. A variety of control methods have been applied to Euler-angle-based attitude representations, such as ADRC, fuzzy control, and sliding mode control [
4,
5,
6,
7,
8,
9,
10]. However, such Euler-angle-based approaches can encounter singularities and increased nonlinear coupling during large-angle maneuvers, as noted in surveys on attitude control strategies [
11].
The kinematic model of a UAV is fundamentally built upon the overall relationships among angular velocity, attitude, acceleration, velocity, and position. Therefore, treating the attitude-dependent coefficients in the acceleration terms as control objectives and decoupling the interactions between different acceleration channels is a more advantageous approach [
12,
13]. This method not only simplifies and partially linearizes the outer-loop mathematical model but also generates attitude trajectories with clear physical meaning [
14]. In recent years, control methods based on SO(3) or quaternions (such as geometric control) have achieved a certain degree of decoupling and theoretically guaranteed global stability [
8,
15,
16,
17,
18,
19]. Compared to SE(3), NMPC for outer-loop control can better handle the physical constraints of states and control inputs. However, the high computational cost of optimization limits its application in embedded deployment to only the outer loop, where the inner-loop dynamics are estimated to generate attitude sequences for inner-loop control [
20,
21].
To design a more suitable inner-loop controller for the outer-loop NMPC control, and through the design goal of a first-order approximation of the acceleration coefficient, the inner-loop model in the outer-loop NMPC is made more accurate while saving parameters and optimization computational effort. This study derives a novel attitude error calculation method and generates corresponding trajectories. Given that the yaw angle is typically treated as an independent control objective decoupled from position control, we propose a new computational framework using quaternions that separates the yaw parameters from the roll and pitch parameters. During attitude calculation, roll and pitch are considered together to decouple the interactions between multiple acceleration channels. The designed attitude trajectory is suitable for attitude ranges with tilt angles less than , and can achieve first-order tracking of the horizontal dual-channel acceleration coefficients under given attitude constraints and angular velocity limits, thereby providing a more concise mathematical representation for the outer-loop model. This approach is based on and extends previous research work on nonlinear decoupling and quaternions.
2. Mathematical Model of UAV
Common underactuated mathematical models for non-fixed-wing vertical take-off and landing (VTOL) aircraft share some notable structural similarities, including quadrotors, helicopters, and ducted fan drones. The core characteristic of an underactuated system is that the number of control inputs is fewer than the system’s degrees of freedom, typically featuring 6 degrees of freedom (3 translational + 3 rotational) but only 4 control inputs. The control of these UAVs often adopts a hierarchical design, divided into attitude control (inner loop) and position control (outer loop) [
22]. The desired attitude angles and total thrust serve as virtual inputs for the outer loop.
And these VTOL aircraft mathematical models all share similar kinematic and dynamic frameworks, with the main distinction lying in how torque and lift are generated. Here, we abstract the control inputs as torque and total thrust. Taking the equilibrium point as the origin of the body attitude, the total thrust is oriented vertically upward in the body-fixed coordinate system.
2.1. Dynamics and Kinematics
Let the world coordinate frame
and the body coordinate frame
be defined as right-handed systems. In the world coordinate system, the translational dynamics equations of the VTOL aircraft can be expressed as follows:
where
m denotes the mass of the UAV,
represents the velocity in the North-East-Down (NED) coordinate frame,
is the rotation matrix of the vehicle attitude,
T is the total thrust from the rotors, and
is the aerodynamic drag and other disturbances.
In the body-fixed coordinate system, the rotational dynamics equation of the VTOL aircraft can be expressed as:
where
denotes the inertia matrix of the vehicle,
represents the three-axis torque, and
is the angular velocity.
In the world coordinate system, the position kinematics equation of the VTOL aircraft can be expressed as follows:
Construct the mathematical model of the UAV in the sequence of position-velocity-acceleration-attitude-angular velocity. Considering the conventional flight attitudes of this type of aircraft, this paper excludes inverted flight conditions.
2.2. Attitude Representation and Acceleration Coefficients
Two commonly used attitude representations for UAVs are Euler angles and quaternions. They primarily influence the horizontal acceleration coefficients through the rotation matrix R defined in Equation (
1).
Using the commonly adopted ‘Z-Y-X’ rotation sequence of Euler angles
to represent the vehicle attitude,
represent the rotation matrix. The rotational kinematics of the VTOL aircraft can be expressed using Euler angles as follows:
The attitude kinematics equation of the VTOL aircraft can be expressed using Euler angles as follows:
Using quaternions
to represent attitude,
represent the rotation matrix. The rotational kinematics of the VTOL aircraft can be expressed using quaternions as follows:
The attitude kinematics equation of the VTOL aircraft can be expressed using quaternions as follows:
The Euler angle representation suffers not only from the gimbal lock problem but also from induced heading changes during purely oblique tilting maneuvers. The quaternion representation, on the other hand, is constrained by its four interdependent parameters (subject to the unity-norm condition), which are not fully independent. Furthermore, in both methods, the horizontal acceleration coefficients are mutually coupled and nonlinear. When combined with the rigid-body rotational dynamics, this makes it difficult to directly map the desired acceleration coefficients to angular velocity commands for achieving first-order tracking of the acceleration coefficients [
12].
2.3. Attitude Decomposition
The subsequent analysis utilizes two specific decompositions of the vehicle’s attitude, each constituting a horizontal tilt and a rotation about the z-axis , with and . These decompositions differ in their order of operations: one is a tilt-yaw sequence, and the other is a yaw-tilt sequence. With inverted flight excluded, we have .
The vehicle attitude representation is
. The attitude representation under the tilt-yaw decomposition is given by:
Solving for the decomposed parameters yields:
Substituting into Equation (
6), we obtain:
Analysis of Equation (
10) shows a direct correlation between the
term in the tilt-yaw decomposition and the translational dynamics. This correlation has a clear physical basis: the UAV’s acceleration is governed exclusively by the tilt of the thrust vector, while rotation about the z-axis (yaw) is dynamically decoupled from translational acceleration.
As shown in
Figure 1, the horizontal acceleration along the north and east directions is only related to the thrust and the tilt angle of the z-axis in body frame, and is independent of the heading. In the North-East-Down (NED) coordinate frame, the result of rotating the D-axis by the quaternion
yields the body z-axis.
Consequently, by taking and as the control objectives for attitude, the downward acceleration is . Moreover, the attitude controller utilizes the error signal derived from the difference between the desired value and its measured value . An identical error computation method is applied to the lateral acceleration .
Proof. Substitution of the quaternion properties into
gives:
Multiply both sides by
and transpose the terms to the left-hand side.
With
, Solving the equations yields:
Substituting the quaternion properties into Equation (
10), followed by insertion into the above equation, gives:
□
The attitude representation under the yaw-tilt decomposition is given by:
With the quaternion properties
:
With
,
. Solving for the decomposed parameters yields:
The yaw-tilt decomposition is akin to the standard yaw-pitch-roll Euler angle formulation. This analogy is grounded in the underlying physics: owing to their strong dynamic coupling and identical mechanism for moment generation, roll and pitch are aggregated into a single horizontal tilt component, denoted . Whereas, the yaw moment, generated by a fundamentally different mechanism, is represented by a separate term .
The mathematical representation of the yaw component is common to both decompositions.
3. Attitude Planning for Tracking First-Order Acceleration
In common inner-loop attitude controllers for UAVs, the attitude error between the current and desired orientation is computed based on the difference of a single parameter from the chosen attitude representation (typically Euler angles or quaternions). This derived error is then fed into the attitude dynamics equations to obtain the desired angular velocity.
3.1. Design Objective
A fundamental challenge arises when simplified attitude control couples with translational dynamics. If we model the attitude loop as an ideal first-order system (ignoring angular rate dynamics and delays), the resulting horizontal acceleration becomes a nonlinear function of the attitude command. A clear example is rolling from [roll, pitch, yaw] to [-roll, pitch, yaw]: this not only reverses the lateral acceleration but also introduces an undesired longitudinal component. This nonlinearity motivates the design of a new method for generating desired angular velocity that directly facilitates first-order tracking of the desired acceleration vector.
The outer-loop Nonlinear Model Predictive Control (NMPC) generates a desired attitude command sequence at a low frequency based on position, velocity, and attitude. The inner loop consists of an angular velocity closed-loop controller. This paper focuses on designing an attitude-to-angular-velocity controller that converts the desired attitude into a desired angular velocity, using quaternions as the attitude representation.
Due to the limited computational frequency of the NMPC algorithm on the onboard processor, we aim for the attitude trajectory to track changes in acceleration linearly. This approach is intended to reduce the computational burden on the NMPC and improve overall control performance.
3.2. Acceleration Decoupling Compensation
In the tilt-yaw decomposition, assuming the angular velocity corresponding to during the attitude change is .
In Equation (
10), the three-axis accelerations of the UAV are determined by
. From the perspective of control allocation,
are primarily used to control
, respectively. Due to the moment of inertia being significantly smaller than the mass and the performance of gyroscopes being substantially higher than that of accelerometers, the UAV’s moment control loop is generally much faster than that of the total thrust control loop. And since the value of
T typically fluctuates around the gravitational acceleration g,
T can be approximated as a constant in
and
over short time intervals.
It is known that (North acceleration) depends only on , and (East acceleration) depends only on . However, it is evident that due to the nature of the quaternion derivative, and are not decoupled. In practice, a PD controller may also be employed; however, the following discussion uses a simple P controller for illustrative purposes. For example, if follows a first-order trajectory , then the required , where represents the desired value of . And it is necessary to enforce .
With the quaternion properties
Solving the equations yields the decoupled compensation amount:
Similarly, when
follows the first-order trajectory
, we obtain:
Furthermore, rotations
and
alter the initial yaw component of
. Imposing the constraint that the initial yaw within
must remain invariant:
Thus,
becomes:
3.3. First-Order Acceleration Tracking
Since the
component from the decomposition in Equation (
10) directly determines the UAV’s acceleration, achieving a linear change in acceleration first requires the horizontal tilt to track a specific trajectory. This reference trajectory is constrained to have a yaw component that is zero.
The desired dynamics for
are specified as a first-order response
. However, the actual implemented dynamics in practice is Equation (
17). Substituting into Equation (
21) yields:
Solving the equations yields the first-order control quantity:
Similarly, when
follows the first-order trajectory
, we obtain:
3.4. Body-Frame Attitude Velocity
From the angular velocity of the horizontal tilt trajectory, we need to obtain the body-frame angular velocity .
For the tilt-yaw decomposition attitude presented in
Section 3.3, applying an angular velocity
to the horizontal tilt over an infinitesimal time interval
yields a new vehicle attitude expressed as:
When the vehicle rotates with an angular velocity
, its attitude after an infinitesimal time step dt is represented as:
Because Equations (
25) and (
26) correspond to the same attitude, the two expressions are equivalent. Equating them and substituting the result into Equation (
9), the solution is obtained as:
Since
, it follows that:
3.5. Angular Rate Limit
In practical deployment, maximum angular rates and attitude angles are always constrained in the controller design due to limitations in the UAV’s structural strength and actuators. For VTOL platforms, the roll and pitch axes are typically controlled by coupled actuators (e.g., the swashplate servos of a helicopter or the control allocation of a quadrotor). Therefore, we consider the maximum angular rate limit to be
, the maximum angular limit to be
in Equation (
13).
Considering Equations (
28) and (
21),
:
Considering Equations (
23) and (
24). Therefore, the angular-rate scaling factor
K can be computed as follows:
By computing and processing
K, it can be concluded that the maximum of
K is independent of
and depends only on
:
Detailed derivation is provided in
Appendix A. Therefore, for UAV maneuvers where the attitude angle is constrained within
, it is sufficient to limit the rate of change of the acceleration coefficient:
This ensures that the angular velocity remains within its prescribed limits during attitude planning, while also achieving first-order tracking of the acceleration coefficient with bounded rate of change.
Certainly, under the same angular-rate limit, a tighter attitude constraint (closer to 90°) imposes a more restrictive bound on the actual angular velocity, thereby requiring a smaller allowed rate of change for the acceleration coefficients. However, as the allowed attitude range moves away from 90°, the corresponding scaling factor decreases rapidly. For instance, with a limit of 60°, ; for 45°, ; and for 30°, . These values demonstrate considerable practicality for real-world UAV flight environments. Alternatively, the constraint can be applied in a piecewise manner during actual flight operations.
4. Attitude Planning
4.1. Algorithm Construction
Thus, we have derived a technique to convert desired acceleration into attitude error and angular rate commands. A key advantage of this method is that it decouples the problem from horizontal acceleration disturbances due to attitude changes. Additionally, it calculates an attitude trajectory that achieves first-order tracking of the target acceleration from current attitude.
The desired yaw angle for the UAV is specified by either a navigation path or a remote command. Using the to represent the current yaw attitude, the yaw error quaternion is computed as and combined with the output from Algorithm 1.
The desired total thrust
T is determined by the outer-loop controller and is subsequently transmitted to the inner-loop controller to execute closed-loop tracking of the thrust command. For the purposes of outer-loop analysis and design, the closed-loop dynamics of the inner thrust control system are sufficiently characterized by a first or second-order approximation
. And the inner angular rate loop’s dynamics can be simplified to a system with negligible transients (approximated as instantaneous).
| Algorithm 1: Attitude Planning Algorithm |
- Input:
Current attitude ; Desired value ; - Output:
Target attitude ; Desired angular rate ; - 1:
Evaluate using by Equation ( 33); Obtain the control limits under the current angular velocity and angle constraints; - 2:
Evaluate using by Equation ( 9); Obtain the decomposition parameters of the current attitude; - 3:
Evaluate using by Equation ( 23); Obtain the rotation amount generated by the desired eastward acceleration coefficient; - 4:
Evaluate using by Equation ( 24); Obtain the rotation amount generated by the desired northward acceleration coefficient; - 5:
Evaluate using by Equation ( 30), if the limit is exceeded,
is scaled down proportionally; Obtain the rotation amount after applying the limits; - 6:
Evaluate using by Equation ( 21); Obtain the rotation amount after first-order approximation compensation; - 7:
Evaluate using by Equation ( 28); Convert to the rotation amount in the body coordinate system.
|
After these processing steps, substituting into Equation (
12) and replacing
with
to express it as independent variables, the outer-loop model of the system is simplified as:
With .
4.2. Commonly Used Method
In UAV attitude control, both Euler angles and quaternions are widely adopted for attitude representation. When using Euler angles, the standard approach to generate attitude error and angular rate commands from desired acceleration is:
By employing a front-right-down right-handed coordinate system and a yaw-pitch-roll rotation sequence, and substituting the corresponding attitude kinematics, the desired angular velocity is obtained as:
Under Euler angles, the commonly used outer-loop NMPC model is:
When using quaternions, the standard approach to generate attitude error and angular rate commands from desired acceleration is:
If the scalar part of the error quaternion , all components of are negated. This ensures that the error quaternion represents the shortest rotational path. The vector part of the attitude error quaternion is extracted to form the error vector that is used as the input to the controller .
The difference between the desired angular velocity and the current angular velocity is computed and fed into a P or PD controller. This is a commonly used method for attitude trajectory tracking.
Under quaternion, the commonly used outer-loop NMPC model is:
Comparing the NMPC outer-loop models of the three methods, i.e., Equations (
34), (
37) and (
39). Compared with the other two methods, the method proposed in this paper reduces both the number of parameters and the model complexity, which is beneficial for reducing the computational burden of NMPC optimization. Compared with the Euler-angle-based outer-loop model, it reduces one state variable and eliminates a large number of trigonometric function calculations. Compared with the quaternion-based outer-loop model, it reduces two state variables and significantly lowers the complexity of attitude estimation. Due to the unit norm constraint of quaternions, the complexity of attitude estimation is difficult to simplify.
5. Simulation and Results Analysis
Referring to the kinematic and dynamic models of the UAV, the dynamic response of the body angular velocity loop tracking is temporarily ignored for the validation of attitude trajectory planning. Taking the quaternion-based attitude representation as an example, this mathematical model defines as the system state variables and as the system input variables. The attitude controller computes the planned value as the system input, while the UAV thrust T is controlled in a closed-loop manner by the outer-loop controller, which does not affect the simulation verification results.
According to the design objectives, we will validate the proposed method in this paper, along with the quaternion method and Euler angle method in
Section 4.2. The dynamic response of the horizontal plane acceleration coefficient
, from the current state to the target setting, will be derived from Equation (
6). Under the assumptions of no inverted flight and a given heading angle (where the heading angle representation follows the decomposition defined in Equation (
13)), the attitude corresponds uniquely to the north-east acceleration coefficient. Since we intend the attitude trajectory to act as a first-order follower to the acceleration, we will compute the step response under various attitude conditions. The following simulations will be conducted at a control frequency of 1000 Hz, obtaining trajectory plots and time-domain evolution diagrams of the horizontal acceleration coefficient under attitude control using multiple methods, followed by analysis.
With identical control gain P and without considering the maximum angular rate limit, the horizontal acceleration coefficient is calculated from the current state
to the target
. The results for the quaternion-based method, the Euler-angle method, and the method proposed in this paper are as
Figure 2.
For any heading angle, both the quaternion method and the proposed method compute identical horizontal acceleration coefficient trajectories. Due to the use of the ‘Z-Y-X’ rotation sequence in the Euler-angle method, its dynamic response varies under different heading angles. In the results plotted in
Figure 2, the worst-case scenarios are selected for illustration. The responses of the Euler-angle method, calculated at heading angle intervals of
, are shown below as
Figure 3:
With identical control gain P and considering the maximum angular rate limit
, we compute the transition from the current North-East acceleration coefficient
to the target
for the quaternion method, the Euler angle method, and the method proposed in this paper. Additionally include an SO(3)-based attitude controller using
as attitude error under the same gains for comparison. The results are shown below as
Figure 4:
Due to the use of the ‘Z-Y-X’ rotation sequence in the Euler-angle method, its dynamic response varies under different heading angles. In the optimal case, its trajectory approximates that of the proposed method. The worst-case scenarios are selected for illustration in the
Figure 4.
Based on the experimental results presented above, if we regard the acceleration coefficient as a spherical surface, the attitude control trajectory planned by the quaternion method and SO(3) method corresponds to the shortest path on the sphere. The results shown in
Figure 4 indicate that when using the SO(3) method, the target attitude is achieved more quickly in the time domain. In contrast, the attitude control trajectory planned by the method proposed in this paper is a straight line projected onto the horizontal plane, which also satisfies first-order tracking of the target horizontal acceleration in the time domain. Minor errors arise from the nonlinear mapping introduced during discretization in the control process.
However, in practical applications, the inner loop is non-ideal, and the angular velocity cannot achieve the desired target value in real time. Considering the complete rigid-body rotation (including gyroscopic torque, aerodynamic damping, and control torque), the angular velocity controller adopts a common PI controller with feedforward. Under the condition of amplitude limiting, the attitude is controlled from
to the target
(same as in Simulation 1). The actual values of the acceleration coefficient are compared with the first-order reference and the second-order reference, respectively. The results are shown below as
Figure 5:
In fact, the complete attitude mathematical model with the controller is third-order nonlinear. However, for outer-loop control estimation, the full third-order estimation is rarely used. Therefore, common first-order and second-order references are selected for comparison. From the acceleration coefficient
in
Figure 5, it can be seen that the control method proposed in this paper achieves the best decoupling performance for the horizontal acceleration coefficient. From the acceleration coefficient
in
Figure 5, it can be seen that the proposed control method consistently exhibits the smallest deviation when compared with either the first-order or second-order reference, and a significant improvement is achieved when using the second-order reference.