Next Article in Journal
Optimization Design and Flight Validation of Pull-Up Control for Air-Deployed UAVs Based on Improved NSGA-II
Previous Article in Journal
A GPS-Free Bridge Inspection Method Tailored to Bridge Terrain with High Positioning Stability
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

NMPC-Based Trajectory Optimization and Hierarchical Control of a Ducted Fan Flying Robot with a Robotic Arm

1
School of Mechatronical Engineering, Beijing Institute of Technology, Beijing 100081, China
2
Chongqing Innovation Center, Beijing Institute of Technology, Chongqing 401120, China
3
School of Mechanical Engineering, Beijing Institute of Technology, Beijing 100081, China
4
Intelligent Science & Technology Academy of CASIC, Beijing 100144, China
*
Authors to whom correspondence should be addressed.
Drones 2025, 9(10), 680; https://doi.org/10.3390/drones9100680
Submission received: 11 August 2025 / Revised: 22 September 2025 / Accepted: 27 September 2025 / Published: 29 September 2025
(This article belongs to the Section Drone Design and Development)

Abstract

Ducted fan flying robots with robotic arms can perform physical interaction tasks in complex environments such as indoors. However, the coupling effects between the aerial platform, the robotic arm, and physical environment pose significant challenges for the robot to accurately approach and stably contact the target. To address this problem, we propose a unified control framework for a ducted fan flying robot that encompasses both flight planning and physical interaction. This contribution mainly includes the following: (1) A nonlinear model predictive control (NMPC)-based trajectory optimization controller is proposed, which achieves accurate and smooth tracking of the robot’s end effector by considering the coupling of redundant states and various motion and performance constraints, while avoiding potential singularities and dangers. (2) On this basis, an easy-to-practice hierarchical control framework is proposed, achieving stable and compliant contact of the end effector without controller switching between the flight and interaction processes. The results of experimental tests show that the proposed method exhibits accurate position tracking of the end effector without overshoot, while the maximum fluctuation is reduced by up to 75.5% without wind and 71.0% with wind compared to the closed-loop inverse kinematics (CLIK) method, and it can also ensure continuous stable contact of the end effector with the vertical wall target.

1. Introduction

1.1. Background and Motivation

Unmanned aerial vehicles (UAVs) are widely applied in non-contact observation tasks such as damaged building detection [1] and fire monitoring [2]. In recent years, unmanned aerial vehicles with robotic arms (i.e., flying robots or aerial manipulators) have garnered increasing attention [3], which can be applied in contact-based interaction tasks, such as remote valve operation in nuclear leakage plants [4], contact inspection on industrial oil and gas pipelines [5], vegetation sampling in dense forests [6], etc., to liberate people from dangerous work and effectively improve work efficiency. The aerial platform of a flying robot is most often a helicopter [7] or a multirotor [8]. However, such an open rotor structure necessitates that the robot maintains a sufficient distance from the surrounding environment to ensure safety and stability. Additionally, to avoid the range of the rotor disc, the operating space of the robotic arm fixed on the platform is also limited, especially for side targets (such as switches on vertical walls). In view of this, a ducted fan-based flying robot is proposed in this paper, as shown in Figure 1. Benefiting from the aerodynamic advantages of ducted fans (see [9] for details), the proposed robot has both a compact structure and high payload capacity, exhibiting better confined space adaptability and environmental interaction safety. Moreover, compared to open rotor-based flying robots, the robotic arm of the proposed robot can more easily perform side operations with small-range joint motions. However, there is a strong kinematic and dynamics coupling between the aerial platform and the robotic arm. On the one hand, the aerial platform is subjected to time-varying disturbance forces and moments generated during the motion of the robotic arm, including quasi-static effects caused by changes in the system’s center of gravity and inertia, as well as rapid dynamic effects caused by the inertial forces and moments of the robotic arm joints. Moreover, the physical contact reaction forces further exacerbate this influence. On the other hand, the floating aerial platform induces real-time changes in the position, attitude, velocity, and acceleration of the robotic arm base, thereby altering the kinematic and dynamics characteristics of the robotic arm, significantly increasing its complexity.
The general process of aerial interaction tasks includes four stages, namely, take off and free flight, approach to the target, contact with the target, and departure. In this process, there are primarily two challenges. First, the ducted fan flying robot with a robotic arm is a redundant system with multiple degrees of freedom (DOF), where there are significant differences in dynamic characteristics between the DOF of the platform and arm. In addition, the system faces various time-varying environmental constraints and self-constraints, including operation space constraints, actuator performance constraints, joint self-collision constraints, ducted fan aerodynamics constraints, etc. Thus, one challenge is how to perform redundant DOF motion planning to ensure the robot’s end effector reaches the target position accurately during the approach stage. Second, the robot’s aerial platform is different from the fixed base of conventional industrial robot arms, as there is an inevitable continuous relative motion between it and the target. Due to the limited allowable reaction force of the platform, the transient forces generated by the end effector’s physical interaction may cause the system to deviate from state equilibrium and become unstable. Thus, another challenge is how to implement compliant control to ensure the robot’s end effector interacts with the target stably during the contact stage.

1.2. Related Works

In terms of trajectory planning, the most direct approach is to consider the motions of the aerial platform and robotic arm independently [10]. Ubellacker et al. [11] proposed a minimum-snap trajectory planning method for a quadrotor platform combined with a visual three-dimensional object pose estimator for aerial rapid grasping tasks. The tracking error during the grasping process is tolerated by a soft gripper. Based on the assumption that the aerial platform can ideally hover near the target, the analytical inverse kinematics method [12] and the inverse Jacobian method [13] are applied to the trajectory planning of the robotic arm, in which the aerial platform is regarded as a fixed base. Liu et al. [14] proposed a reinforcement learning-based trajectory planning method for the robotic arm of a quadrotor flying robot, which minimizes the interference of the arm movement on the quadrotor platform while ensuring the tracking performance of the end effector. Cao et al. [15] designed a partially decoupled motion planning framework for a quadrotor flying robot with a delta arm to effectively perform a pick-and-place task. In this framework, the three-dimensional position of the aerial platform is first planned, and then the motions of the arm’s joints are planned based on this input. The independent planning method described above may lead to the arm’s joints being at their limits or even singularity when the relative position between the aerial platform and the target is close to the arm’s operation space boundary. Moreover, the hovering error of the aerial platform can directly deteriorate the end effector’s tracking accuracy. To perform trajectory planning for the platform and the arm simultaneously, a closed-loop inverse kinematics (CLIK) method based on the robot’s integrated kinematic model is proposed in [16]. Furthermore, Lee et al. [17] introduced a null-space-based CLIK method, which utilizes the joint redundancy of the flying robot to avoid pose singularity in trajectory planning by adding singularity point damping. However, CLIK is essentially an open-loop planning (but closed-loop tracking) method, and the real-time response characteristics of the system are not considered in the optimization process. The response performance of the robot’s end effector may be affected by dynamic characteristic differences between the aerial platform and the arm, and it is difficult to fully consider the environmental constraints and self-constraints of the system. Dimmig et al. [18] proposed a model-based deep reinforcement learning method for task planning in unknown environments, enabling a flying robot to autonomously plan object pushing tasks under varying friction conditions without prior dynamical knowledge. Liu et al. [19] introduced a proximal policy optimization-based intelligent planning method to bypass complex dynamic modeling and reduce disturbances during manipulation, supporting efficient trajectory planning and replanning for enhanced system stability. He et al. [20] developed an end-effector-centric planning framework that incorporates a high-level policy learned via imitation learning, allowing a fully actuated flying robot to perform versatile tasks such as writing and pick-and-place through intuitive teleoperation and policy transfer. Although these methods demonstrate superior performance, the design process is complex and exhibits low generalization, making it inconvenient for engineering implementation.
In terms of physical contact control, Zhang et al. [13] regarded the external force acting on the flying robot’s end effector as a part of the disturbances sustained by the aerial platform, and focused on improving the disturbance rejection performance of the aerial platform controller. Meng et al. [21] performed a vertical wall pressing operation using a quadrotor with a fixed rod, and the contact force was generated by adjusting the quadrotor’s desired pitch angle. Cuniato et al. [22] designed a position/force hybrid strategy to decompose the controller of the flying robot into pose space and wrench space. This method demonstrates superior control performance, but it is typically applicable to known targets and specific environments. To improve the adaptability of flying robots when interacting with different environments, joint servos with a spring–lever transmission mechanism are employed to achieve compliance [23]. Zhang et al. [24] designed controllers for a flying robot for the free flight stage and contact operation stage, focusing on the stability during the controller switching process. Different from direct force control methods, the impedance control method ensures contact stability by adjusting the robot’s motion variables to make the system show desired impedance characteristics. This method has a simple controller structure and is easy to implement. Thus, it is widely used in the compliant contact process of flying robots [25,26,27]. However, the impedance controller will degenerate into an inverse dynamics position controller in non-contact mode (target approach mode), and better compliance may deteriorate trajectory tracking performance.

1.3. Contribution

In view of the challenges discussed above, this paper proposes a unified control framework for a ducted fan flying robot with a 4-DOF robotic arm. The main contributions include the following:
  • A nonlinear model predictive control-based trajectory optimization controller for the flying robot is proposed. The designed controller achieves smooth and accurate tracking of the end effector without overshoot by balancing the aerodynamic wall effects of the ducted fan and the motion coupling of the robotic arm. Meanwhile, by considering various motion and performance constraints, potential singularities and dangers in conventional methods are avoided.
  • A unified hierarchical control framework for both approach and contact stages is proposed, which includes the physical interaction control layer, trajectory optimization layer, and motion control layer, and is easy-to-practice. The proposed framework avoids performance coupling between the flight and interaction processes, achieving stable and compliant contact for the end effector without controller switching.
  • Both simulation analyses and actual experimental tests are performed to verify the effectiveness of the controller proposed.
The remaining parts are organized as follows. The dynamics and kinematic models of the ducted fan flying robot are introduced in Section 2. Then, the NMPC-based trajectory optimization is detailed in Section 3. Section 4 details the hierarchical control framework, including the motion controller as well as the admittance contact controller of the robot. The simulation analyses and experimental tests of the proposed controller are given in Section 5 and Section 6, respectively. Conclusions are detailed in Section 7.

2. System Description of the Robot

2.1. Introduction of the Robot

Figure 1 shows the prototype of the flying robot. The aerial platform of the robot consists of four coaxial ducted fans. A 4-DOF serial robotic arm with an end effector is arranged on the front side of the robot, and correspondingly, the rear side of the robot is provided with a counterweight to balance the gravitational moment from the arm in the initial posture. The flying robot’s key structural parameters are shown in Table 1.
Figure 2 illustrates the robot’s coordinate system. Specify I X I Y I Z I as the inertial coordinate system (ICS), a X a Y a Z a as the aerial platform body-fixed coordinate system (ACS), and i X i Y i Z i as the robotic arm link coordinate system, where i = 1 , 2 , 3 , 4 refers to each link. In particular, 0 X 0 Y 0 Z 0 denotes the robotic arm base-fixed coordinate system, and e X e Y e Z e denotes the end effector coordinate system. Let p a = x a y a z a T be the position vector of the platform with respect to ICS, and Φ a = φ a θ a ψ a T be the attitude vector of the aerial platform described by Euler angles. The velocity and angular rate vector of the aerial platform with respect to ACS are defined as v a a = u a v a w a T and ω a a = p a q a r a T , and then we have v a a = R a T p ˙ a and ω a a = R a T T a Φ ˙ a , where R a is the rotation matrix describing ACS relative to ICS, and T a denotes the transformation matrix between the aerial vehicle’s Euler angles’ differential and angular rates. ω i j i , j = 1 , 2 , 3 , 4 denotes the rotational speed of each rotor of the ducted fan system. The description of the robotic arm coordinate system follows modified Denavit–Hartenberg (D-H) rules, and is illustrated in Figure 3. Let q = q 1 q 2 q 3 q 4 T be the arm joint angle vector, and the corresponding D-H parameters are given in Table 2, where link EE denotes the end effector, a i 1 , α i 1 , d i , and θ i denote the link’s length, twist, offset, and joint angle, respectively. Notice that e 1 in Figure 3 refers to the length of link 1, which is not reflected in Table 2 according to the modified D-H rules.

2.2. Kinematic Model

According to the definition of the coordinate system in Section 2.1, the velocity vector v i i of the origin of i with respect to i and the angular rate vector ω i i of link i with respect to i can be derived recursively by
v i i = R i 1 i v i 1 i 1 + ω i 1 i 1 × p i i 1 ω i i = R i 1 i ω i 1 i 1 + q ˙ i e z i
where i = 1 , 2 , 3 , 4 refers to each link, R i 1 i refers to the rotation matrix describing i 1 relative to i , p i i 1 refers to the origin’s position vector of i with respect to i 1 , and e z i refers to the Z axis unit vector of i . Notice that the base of the arm is fixed to the aerial platform, while the end effector is fixed to arm link 4, thus following Equation (1). The velocity vector v 0 0 of the arm base with respect to 0 , the angular rate vector ω 0 0 of the arm base with respect to 0 , the velocity vector v e e of the end effector with respect to e , and the arm’s angular rate vector ω e e end effector with respect to e can be derived respectively by
v 0 0 = v a a + ω a a × p 0 a ω 0 0 = ω a a
v e e = v 4 4 + ω 4 4 × p e 4 ω e e = ω 4 4
where p 0 a refers to the position vector of the arm base relative to the center of mass (CoM) of the aerial vehicle, and p e 4 refers to the end effector’s position vector with respect to 4 .
Let ζ = p a T Φ a T T be the motion variables of the aerial platform and ξ = ζ T q T T be the full state variables of flying robot, and then combine Equations (1)–(3). The end effector’s velocity with respect to e is described as
v e e = J t , e e Φ a , q ξ ˙
where J t , e e Φ a , q is called translation Jacobian matrix of the robot’s end effector in e . Specify p e = x e y e z e T as the position vector of the end effector with respect to ICS and R e as the rotation matrix describing e relative to ICS, and transform Equation (4) to ICS, and then the robot’s kinematic model is described in a compact form as follows:
p ˙ e = R e J t , e e Φ a , q ξ ˙ = J t , e Φ a , q ξ ˙

2.3. Dynamics Model

The robot’s dynamics model is established using recursive Newton–Euler (RNE) method. The Newton–Euler equations of the robotic arm in i and the aerial platform in ACS can be established, respectively, as
F i i = m l i v ˙ C i i M i i = I l i ω ˙ i i + ω i i × I l i ω i i
F a a = m a v ˙ a a + ω a a × v a a M a a = I a ω ˙ a a + ω a a × I a ω a a
In Equation (6), m l i is the mass of the robotic arm’s link i , and I l i is the inertia matrix of link i , illustrated in Table 1. F i i is the resultant force, and M i i is the resultant moment on link i , which can be derived by force and moment equilibrium equations as
F i i = f i i R i i + 1 T f i + 1 i + 1 + R i T m l i g M i i = n i i R i i + 1 T n i + 1 i + 1 p i + 1 i × R i i + 1 T f i + 1 i + 1 p C i i × ( F i i R i T m l i g )
where f i i and n i i denote the force and moment vector of link i 1 , respectively, and act on link i with respect to i , p C i i denotes the position vector of the CoM of link i with respect to i , and R i denotes the rotation matrix describing i relative to ICS. Notice that the driving torque on joint i can be expressed by the projection of n i i along the e z i axis as τ i = ( n i i ) T e z i . v ˙ C i i denotes the acceleration vector of the CoM of link i with respect to i , and ω ˙ i i denotes the angular acceleration vector of link i with respect to i , which is derived by differentiating Equation (1) as
v ˙ C i i = ω ˙ i i × p C i i + ω i i × ( ω i i × p C i i ) + v ˙ i i v ˙ i i = R i 1 i ( ω ˙ i 1 i 1 × p i i 1 + ω i 1 i 1 × ( ω i 1 i 1 × p i i 1 ) + v ˙ i 1 i 1 ) ω ˙ i i = R i 1 i ω ˙ i 1 i 1 + R i 1 i ω i 1 i 1 × q ˙ i e z i + q ¨ i e z i
In Equation (7), m a is aerial platform mass, and I a is the platform inertia matrix, illustrated in Table 1. F a a is the resultant force and M a a is the resultant moment on the ducted fan aerial platform, which can be derived as
F a a = i = 1 4 F a e r o , i a + F f u s a + F a r m a + F b a l a + R a T m a g M a a = i = 1 4 M a e r o , i a + M g y r o a + M a r m a + M b a l a
F a e r o , i a and M a e r o , i a are the aerodynamic force and aerodynamic moment of the coaxial ducted fans, which are modeled based on the blade element momentum theory (BEMT) in our previous work [28], and can be calculated by
F a e r o a = 0   0   T r 1 + T r 2 + T d u c t T M a e r o a = e d T r 1 + T r 2 + T d u c t 1 e d T r 1 + T r 2 + T d u c t 1 Q r 1 Q r 2 T
where T d u c t is the duct augmentation thrust, T r 1 and T r 2 are the thrusts of the upper and lower rotors, Q r 1 and Q r 2 are the counter-torques of the upper and lower rotors, and e d represents the distance between the rotor’s center and the CoM of the aerial platform along X a and Y a directions.
F f u s a is the fuselage resistance, which can be calculated by
F f u s a = 1 / 2 ρ S f x u a u a 1 / 2 ρ S f y v a v a 1 / 2 ρ S f z w a w a T
where S f x , S f y , and S f z are the effective resistance areas of the platform along the three axes.
M g y r o a is the rotor gyro moment, which can be calculated by
M g y r o a = n r J r q a p a 0 i = 1 4 ( 1 ) i + 1 ( ω i 1 ω i 2 )
where n r is the number of blades per rotor disc, and J r is the moment of inertia of a blade.
F a r m a and M a r m a are the force and moment of the robotic arm acting on the platform, which can be calculated from Equation (8) as
F a r m a = R 1 0 f 1 1 M a r m a = R 1 0 n 1 1 + p 0 a × R 1 0 f 1 1
F b a l a and M b a l a are the force and moment generated by the counterweight, which can be calculated by
F b a l a = R a T m b a l g M b a l a = [ e b a l 0 0 ] T × R a T m b a l g
where m b a l is the mass of the counterweight, and e b a l is the distance between the counterweight and the CoM of the aerial platform.
Combining Equations (6)–(15), the robot’s dynamics model can be solved recursively and organized into the following compact form:
M ξ ξ ¨ + C ξ , ξ ˙ ξ ˙ + g ξ = μ u + μ e x t
where M ξ denotes the inertia terms, C ξ , ξ ˙ denotes the Coriolis and centrifugal terms, and g ξ denotes the gravity terms. μ u refers to the generalized input force vector, which denotes the active force inputs corresponding to the generalized state variables. μ e x t is the generalized external force vector, which denotes the physical interaction force between the end effector and the environment expressed in the generalized state space. Let f e x t be the force vector acting on the end effector from physical interaction, and τ = τ 1 τ 2 τ 3 τ 4 T be the joint torque vector. μ u and μ e x t can be calculated by
μ u = μ u , f μ u , m μ u , τ T = R a i = 1 4 F a e r o , i a T a T R a i = 1 4 M a e r o , i a τ T μ e x t = J t , e T Φ a , q f e x t

2.4. Environment Model

In this paper, a physical contact scenario for the end effector with a vertical wall is considered. The wall is perpendicular to the ground and parallel to Y I robot axis. Therefore, the end effector is only subjected to external force from X I direction during the contact process. Following the method of Forte et al. [29], a simplified model of physical contact process can be established as follows:
f e x t , x : = k w a l l x e x w a l l if x e x w a l l > 0 0 if x e x w a l l 0
where x w a l l denotes the position of the wall in ICS, and k w a l l indicates equivalent stiffness coefficient of the wall.

3. NMPC-Based Trajectory Optimization

3.1. Problem Formulation

The flying robot has eight independent DOF (excluding the clamping DOF of the end effector), where the aerial platform has four DOF in longitude, latitude, altitude, and yaw, and the robotic arm has four DOF in four joints. Notice that the aerial platform is an under-actuated system, where its roll and pitch states, as inner-loop dependent states, are coupled with the lateral and longitudinal DOF, respectively. Separate the roll and pitch angles of the aerial platform from full state variables ξ , and let η a = p a T ψ a T , σ a = φ a θ a T , and then the independent state variables of the robot can be denoted as x = η a T q T T , which are redundant with respect to the end effector’s three-dimensional position.
The aim of trajectory optimization is to obtain the ideal trajectory of the robot’s independent state variables based on the end effector’s desired target position, in order to ensure both tracking accuracy and efficiency. During the trajectory tracking process of the robot’s end effector, the aerial platform’s motion should be dominant to reduce the disturbance of the arm acting on the aerial platform and improve tracking efficiency. However, environments will have a significant impact on the ducted fan aerodynamics when the platform is close to the target or constrained obstacles, resulting in performance degradation or even collision risks. In addition, the flying robot is also subject to constraints such as actuator performance limitations, joint angle limitations, joint self-collision limitations, etc., which must be carefully considered in trajectory optimization.
From the above, the trajectory optimization problem is formulated as follows: For a desired three-dimensional position p e , d of the end effector, find the independent state variable trajectory references x r of the robot to minimize tracking error by solving a constrained NMPC problem. As a part of the hierarchical control framework, the state variable references x r will then be used as the reference inputs of the platform position controller and the robotic arm joint controller, which will be introduced in Section 4.2.
The trajectory optimization includes three parts: prediction model, receding optimization, and feedback correction. Let u = η ˙ a T q ˙ T T be the control variables, and then the discrete state model of the robot with independent state variables x is formulated as
x k + 1 = x k + T s u k
where T s is the sampling period, and k indicates the current time step. Define Equation (19) as the prediction model to predict the future states of the system, and then the optimization problem is formulated as
min u k J x k , u k s . t . x k + i + 1 k = x k + i k + T s u k + i x k k = x k g min g x k + i k , u k + i g max x min x k + i k x max u min u k + i u max Δ u min Δ u k + i Δ u max
where x k + i k and u k + i are the predictive states and the control inputs, respectively. i = 0 , 1 , , N p , where N p is prediction horizon. Δ u k + i = u k + i u k + i 1 is the control input increments. u k = u T k u T k + 1 u T k + N m 1 T is the control input vector to be optimized, where N m is control horizon. J x k , u k is the cost function with multiple optimization objectives h j x k , u k , which can be denoted as
J x k , u k = j = 1 m h j x k , u k = j = 1 m h j x k + i k , u k + i
Notice that the prediction model in Equation (20) is an integrator, and the nonlinearity of the optimization problem is mainly manifested in the cost function. In addition, x min and x max , u min and u max , Δ u min and Δ u max , and g min and g max refer to the lower bound and upper bound of the state constraints, control constraints, control increment constraints, and general constraints, respectively. In this optimization problem, the cost function is the soft constraints of the system, which makes the overall performance optimal by balancing various optimization objectives. Correspondingly, the upper and lower bounds refer to the hard constraints of the system, which must be strictly satisfied.
The optimization problem in Equation (20) at each time step is solved based on the current states x k to obtain the control input sequence u k that optimizes the system performance criterion J x k , u k , and then the first element u k of u k is taken and combined with Equation (19) to obtain the optimal independent state variable references x r of the next time step. Finally, x r act on the low-level motion controller of the robot, and the prediction model is updated according to the actual states to resolve the above optimization problem at next time step to overcome the model errors and disturbances. The problem in Equation (20) is a constrained nonlinear programming (NLP) problem, which can be solved by sequential quadratic programming (SQP) algorithm. Notice that the position and attitude control layer of the robot is closed-loop-stable, and the trajectory optimization layer is not involved in the low-level motion feedback control and runs at a lower frequency, which can meet the requirements of the online solution algorithm.

3.2. Optimization Tasks

(1)
End effector tracking error
The accurate tracking of the desired target by the end effector of robot is the primary optimization task. Rearrange Equation (5) with independent state variables x as
p ˙ e t = J t x , e Φ a t , q t x ˙ t + J t σ , e Φ a t , q t σ ˙ a t
where J t x , e and J t σ , e are the terms related to x and σ a in the Jacobian matrix J t , e . Since the flying robot does not perform aerobatics, its attitude angles conform to the small-angle assumption and have small rates of change [30]. Thus, the first term in Equation (22) plays a dominant role in p ˙ e , and the second term can be approximately ignored. The discrete prediction model of the three-dimensional position of the end effector can be obtained according to Equation (22) as
p e k + i + 1 k = p e k + i k + T s J t x , e x k + i k u k + i
Then the end effector tracking error cost function is defined as
h 1 = i = 1 N p 1 p e k + i k p e , d k + i W 1 2 + p e k + N p k p e , d k + N p W s 1 2
where W 1 refers to the weight matrix for the tracking error, and in particular, W s 1 refers to the terminal weight matrix. The terminal cost term is used to ensure the stability of the finite horizon NMPC problem, and the detailed theoretical proof is referred to in [31].
(2)
CoM of the robotic arm
The motion of the arm brings static disturbances, i.e., gravity and gravity moment, and dynamic disturbances, i.e., inertial force and inertia moment, to the aerial platform, of which the static disturbances play a dominant role [32]. Although the position and attitude controller of the robot has disturbance stability to some extent, it is still necessary to reduce the effect of the change of the robotic arm’s CoM on the system performance.
From the kinematic model of the robot, the position vector relative to the aerial platform is
p m a t = i = 1 4 m l i p C i a q t i = 1 4 m l i 1
where p C i a denotes the position vector of the CoM of link i with respect to ACS, a function of joint angle vector q . According to Equation (25), calculate the projection of the change of the arm’s CoM on aerial platform’s X a Y a plane, and rewrite it as a function of the state variables x , then the arm’s CoM change discrete prediction model can be obtained as
e m , x y k + i k = e x y p m a x k + i k e x y p m 0 a q 0
where e x y is the unit projection matrix of the aerial platform’s X a Y a plane, and p m 0 a denotes the arm’s CoM position vector relative to the aerial platform at the initial joint posture q 0 .
Then, the cost function of the change of the arm’s CoM is defined as
h 2 = i = 1 N p 1 e m , x y k + i k W 2 2 + e m , x y k + N p k W s 2 2
where W 2 and W s 2 refer to the weight matrix and the terminal weight matrix, respectively.
(3)
Wall effect of the ducted fan
Compared to the open environment, the constrained environment, i.e., the vertical wall target, can cause the inflow of the ducted fan to be asymmetric on the near-wall and far-wall sides, leading to changes in the ducted fan aerodynamic characteristics, which is called wall effect [33]. Our previous work studied the flow field mechanism of wall effect [34,35], indicating that it can induce an unbalanced moment for the ducted fan, leading the aerial platform to tilt toward the near-wall side and rapidly deteriorating its response performance, even posing a collision risk. Therefore, despite the cost function h 2 aiming to avoid excessive extension of the robotic arm, the distance limit between aerial platform and environment (target) must be considered.
The computational fluid dynamics (CFD) simulation results of the velocity and pressure fields of the ducted fan under near-wall condition shown in Figure 4 and Figure 5 illustrate the induced tilting moment M W E accordingly, where V is the airflow velocity, C p is the normalized pressure coefficient, ω and R r are the rotor’s hovering speed and radius, and d W E denotes the distance between the ducted fan center and the wall plane (D-W distance). When the ducted fan approaches the wall plane, the airflow on the duct lip at the near-wall side (region B) decelerates and the static pressure rises, causing a decrease in the lift F B , while the airflow at the far-wall side (region A) is minimally affected by the wall, and M W E is induced by the difference between F A and F B . Notice that M W E is for single ducted fan, and for the robot in this paper, there are two ducted fans affected by wall effect simultaneously, and the total tilting moment is 2 M W E . Defining the normalized tilting moment coefficient as C W E = M W E / ρ π ω 2 R r 5 , the relationship between C W E and normalized distance d W E / R r can be obtained from CFD results, as shown in Figure 5, where the dotted line indicates the outer edge of the duct. It can be seen that when the D-W distance decreases, the induced tilting moment increases rapidly, and the relationship between C W E and d W E / R r can be approximated as a power function by fitting as
C W E = f W E d W E 0.002052 d W E / R r 1.323 + 3.153 × 10 5
The discrete prediction model of d W E can be calculated as
d W E k + i k = e x C p x k + i k p e , d k + i e d
where e x denotes the unit vector of the X axis, C p is the state selection matrix for selecting p a from x , and e d is the distance along the axis of ACS between the ducted fan center and the origin of ACS. Substitute Equation (29) into Equation (28) to have
C W E k + i k = f W E d W E k + i k
Then the cost function of the wall effect can be defined by the induced tilting moment coefficient as
h 3 = i = 1 N p 1 C W E k + i k W 3 2 + C W E k + N p k W s 3 2
where W 3 and W s 3 refer to the weight and the terminal weight, respectively.
(4)
Control action
The control action is penalized to avoid excessive control increment to the motion control layer of the robot, which can be given as
h 4 = i = 0 N m 1 Δ u k + i W 4 2
where W 4 is the weight matrix.

3.3. System Constraints

(1)
Safety D-W distance of the ducted fan
In Section 3.2, the soft constraint of wall effect is introduced into the cost function to balance the motion allocation between the aerial platform and the arm. Furthermore, direct collision between duct and wall should be strictly avoided for safety. Therefore, the minimum D-W distance should be considered as a hard constraint, which can be defined from Equation (29) as
d W E k + i k d W E , min
where d W E , min is the minimum safety D-W distance. Notice that the definition in Equation (33) conforms to the form of general constraint in Equation (20).
(2)
Self-collision avoidance of the robotic arm
Interference and self-collision between the trajectories of the arm and the aerial platform (including both the base and the ducted fan) must be avoided. For the 4-DOF serial arm in this paper, this constraint can be realized by limiting the distance between the end effector and the geometric center of the aerial platform as
p e a x k + i k 2 d e , min
where d e , min is the minimum safety distance between the end effector and the platform center. Notice that the definition in Equation (34) also conforms to the form of general constraint in Equation (20).
(3)
Joint angle limits
Consider the joint angle limits, which can be expressed as state constraints, as follows:
q j , min q j k + i k q j , max
where q j , min is the minimum and q j , max is the maximum angles of joint j j = 1 , 2 , 3 , 4 .
(4)
Velocity limits of the motion variables
The velocity limits of the motion variables are expressed as control constraints, including the aerial platform’s velocity and yaw rate limits, and the angular velocity limits of arm joints, which are given as
x ˙ a , min x ˙ a k + i x ˙ a , max y ˙ a , min y ˙ a k + i y ˙ a , max z ˙ a , min z ˙ a k + i z ˙ a , max ψ ˙ a , min ψ ˙ a k + i ψ ˙ a , max q ˙ j , min q ˙ j k + i q ˙ j , max
where Δ min and Δ max refer to the minimum and maximum limits of the corresponding motion variables, respectively.
(5)
Acceleration limits of the motion variables
Similarly to the velocity limits, the acceleration limits of the motion variables can be expressed as control increment constraints, as follows:
x ¨ a , min x ¨ a k + i x ¨ a , max y ¨ a , min y ¨ a k + i y ¨ a , max z ¨ a , min z ¨ a k + i z ¨ a , max ψ ¨ a , min ψ ¨ a k + i ψ ¨ a , max
where Δ min is the minimum and Δ max is maximum limits of the corresponding motion variables, in which the longitudinal and lateral acceleration limits denote the corresponding pitch and roll angle limits, respectively.

4. Hierarchical Control Framework

4.1. Control Framework Description

The unified hierarchical control framework is illustrated in Figure 6, which includes four layers: (a) physical interaction control layer and (b) trajectory optimization layer, constituting the top-level layer (in green) for tracking and interaction tasks, (c) aerial platform position and attitude control layer, and (d) robotic arm joint control layer, constituting the low-level layer (in yellow) for inner loop attitude stabilization.
(1)
The physical interaction controller is for achieving contact compliance through joint action and realizing the control performance decoupling between the flight and interaction processes under unified framework. Specifically, when physical contact occurs, the equivalent references q r , d of the joint variables are updated according to the environmental reaction force f e x t on the end effector.
(2)
The trajectory optimization controller is for desired target position tracking of the end effector, which has been introduced in Section 3. It obtains the independent state variable references of the platform (position and yaw angle η a , r ) and robotic arm (joint angles q r ) as the inputs of low-level layer.
(3)
The aerial platform controller and arm joint controller are for stabilization of the robot to ensure their motion performance under dynamics coupling, the outputs of which are set as the control inputs of the actuators.
In Figure 6, u a = u a l t u r o l u p i t u y a w T denotes the altitude, latitude, longitude, and yaw control channels of the aerial platform, and u m = u m 1 u m 2 u m 3 u m 4 T denotes the four joint control channels of the arm. The actuators of the aerial platform consist of eight rotor motors, and the platform is controlled by its differential speed. Define the normalized motor speed vector as u r , and then it can be calculated from the control inputs u a through mixing matrix K m i x as u r = K m i x u a . Furthermore, the actuators of the arm are four joint servos, which directly correspond to u m . Notice that since the dynamic characteristics of the platform and the arm joints are different, to improve the control performance and facilitate engineering practice, the controllers of the platform and the arm are designed separately in this framework.
A pseudocode for the control process under the hierarchical control framework is illustrated in Algorithm 1.
Algorithm 1. Algorithm of the hierarchical control framework.
Input: End effector desired target trajectory p e , d , environmental interaction force f e x t , and current system state ξ
Output: Aerial platform control input u a and robotic arm joint control input u m
1.
while true do
2.
  if contact detected then
3.
     Δ q r Admittance_Controller ( f e x t , ξ ) // Equation (40)
4.
  else
5.
     Δ q r ←0
6.
  end if
7.
   u k NMPC_Optimization ( p e , d , ξ ) // Equation (15)
8.
  ( η a , r , q r )←Take Optimal Independent State Variable from u k
9.
   q r , d q r + Δ q r
10.
   u a AerialPlatform_Motion_Controller ( η a , r ) // Section 4.2.1
11.
   u m RoboticArm_Motion_Controller ( q r , d ) // Section 4.2.2
12.
  Apply u a , u m to the actuators of the robot
13.
end while

4.2. Motion Control

4.2.1. Aerial Platform Control

Due to the ducted fan’s complex aerodynamic characteristics, it is difficult to directly design the aerial platform controller based on the platform’s nonlinear dynamics model to guarantee the control performance. Considering that the robot does not perform aerobatics and the attitude angles always conform to the small-angle assumption, linearize the dynamics model of the aerial platform in Equation (16) at the hovering equilibrium point, and the control-oriented multi-input multi-output (MIMO) state space equation can be formulated as
x ˙ a t = A a x a t + B a u a t + f m t y a t = C a x a t
where x a is the full state vector of the aerial platform composed of v a a , ω a a , and Φ a , which have clear physical meanings and are all measurable. y a is the output vector composed of v a a and ψ a , f m is the disturbance vector from robotic arm, A a , B a , and C a refer to the state matrix, control matrix, and output matrix, respectively. In our previous work [36], a robust-adaptive composite controller is proposed for the system described in Equation (38). The aerial platform controller in this section is designed in the same way, and it consists of three parts: (1) A static feedback controller based on robust H synthesis is designed as the basic controller to ensure the closed-loop system’s MIMO decoupling and robust stabilization. (2) Based on the basic controller, an auxiliary adaptive loop is designed to estimate and compensate the disturbances f m acting on platform from arm. Specifically, the adaptive loop is organized as follows: First, design a state predictor for state prediction; then design an adaptive law for disturbance estimation on the base of prediction error; finally, to compensate the disturbances f m whilst tracking the desired references y a , r , the control law is reconstructed. (3) In the outer loop of the robust-adaptive controller, design a series of PD controllers for platform references η a , r trajectory tracking. The design process and stability analysis for the composite controller will not be detailed here, and can be referred to our previous work [36].

4.2.2. Robotic Arm Control

Different from the fixed base of conventional industrial robot arms, the aerial platform of the flying robot is a floating base, and its real-time dynamic changes must be considered in the arm controller. On the other hand, due to the large angular motion range and strong coupling of each arm joint, and the arm controller cannot be designed by an approximate linearization model near a specific equilibrium point as the aerial platform controller. A robotic arm feedforward–feedback composite controller considering platform coupling compensation is proposed, which consists of a nonlinear feedforward loop and a linear feedback loop. The purpose of the feedforward loop is to compensate the nonlinear coupling and eliminate the steady-state errors whilst improving the system’s response speed, and that of the feedback loop is to ensure the joint angles closed-loop tracking. The proposed controller decouples the nonlinear inverse dynamics computation from the joint feedback control to reduce the onboard computational burden.
The dynamics model of the arm can be derived from Equation (16) as
M m ξ t q ¨ t + C m ξ t , ξ ˙ t q ˙ t + g m ξ t + M a ξ t ζ ¨ t = τ t
where M m ξ , C m ξ , ξ ˙ , and g m ξ are the submatrices of M ξ , C ξ , ξ ˙ , and g ξ respectively, and M a ξ ζ ¨ denotes the dynamics coupling term of the aerial platform.
Based on Equation (39), the feedforward loop is designed as
u f f t = M m ξ t q ¨ r t + C m ξ t , ξ ˙ t q ˙ r t + g m ξ t + M a ξ t ζ ¨ t
where q ˙ r is the angular velocity desired reference input, and q ¨ r is desired reference input of the acceleration of the joints. ξ and ξ ˙ are the robot’s real-time feedback states, including both the arm joint states and the aerial platform states, and ζ ¨ is the acceleration states of the aerial platform, all of which can be directly obtained from the onboard sensor module.
On this basis, the feedback loop can be simply implemented by PD controller as
u f b t = K P q r t q t + K D q ˙ r t q ˙ t
where K P and K D are the corresponding control parameters.
Combining Equations (40) and (41), the robotic arm controller finally can be synthesized as
u m t = u f f t + u f b t
Since the designed controller does not require complex inverse dynamics computation at each control step, it can perform feedback control with high frequency. Notice that the controller input contains the desired joint angle q r , the joint angular velocity q ˙ r , and the joint angular acceleration q ¨ r to ensure the motion trajectory’s smoothness. For the flying robot in this paper, q r and q ˙ r come from the trajectory optimization controller, while q ¨ r is calculated from the difference of q ˙ r .

4.2.3. Interaction Control

The above motion controller has good tracking and disturbance rejection performance, which makes the closed-loop system exhibit large stiffness toward the external environment. Consequently, it cannot show compliance when subjected to interaction forces. In order to decouple the contact performance from motion performance, an admittance controller is constructed at the top-level layer based on the proposed hierarchical framework, which indirectly performs contact control through Cartesian position control, as illustrated in Figure 6. The proposed control framework achieves compliant contact without losing tracking efficiency and accuracy of the end effector, while avoiding contact state detection and control mode switching in position/force hybrid controller.
Since the relationship between force and position of a system can be described by its admittance characteristics, the ideal contact dynamics between end effector and environment are expressed as a virtual mass–spring–damping system. The ideal admittance contact model can be denoted as
M d p ¨ e , c t p ¨ e , d t + B d p ˙ e , c t p ˙ e , d t + K d p e , c t p e , d t = f e x t t
where p e , d is the end effector’s desired trajectory, p e , c is the end effector’s corresponding compliance trajectory, and Δ p e = p e , c p e , d is the position deviation. M d , B d , and K d are the ideal contact model’s diagonal positive-definite inertia matrix, damping matrix, and stiffness matrix, respectively, which can be adjusted to change the response characteristics between contact force and motion.
Based on the ideal admittance contact model, the following controller can be designed: First, the force sensor on end effector measures the real-time contact force f e x t , and then it is converted into the desired position deviation Δ p e via the contact model by adjusting the equilibrium point of the virtual mass–spring–damping system. Next, considering the high motion efficiency and accuracy of the arm joint compared with the aerial platform, Δ p e is converted into the desired joint angle deviation Δ q r through the Jacobian pseudo inverse matrix J t m , e Φ a , q , which is superposed with the original joint reference q r to obtain the new reference input q r , d = q r + Δ q r to the arm joint controller. Finally, by driving the joint to track q r , d , the compliant response of the system to external force is indirectly implemented through motion control.
This paper focuses on the vertical wall target. Thus, the end effector is only subjected to the force in X I direction, which can be denoted as f e x t , x . Let Δ x e be the component of Δ p e along X I axis, and m d , b d , and k d be the components corresponding to Δ x e of matrices M d , B d , and K d , and then Equation (43) can be simplified as
m d Δ x ¨ e t + b d Δ x ˙ e t + k d Δ x e t = f e x t , x t
Applying Laplace transform to Equation (44), the admittance contact controller is designed as
Δ x e s = 1 m d s 2 + b d s + k d f e x t , x s Δ q r t = J t m , e x Φ a t , q t Δ x e t
where J t m , e x Φ a , q is the component corresponding to Δ x e of J t m , e Φ a , q . The parameters of the controller can be selected according to the desired overdamping behavior. Notice that to avoid the force sensor noise influence on the controller, the measured contact force is filtered by a low-pass filter D s before being fed to the controller.
Since the system’s low-level layer is closed-loop-stable, the contact controller’s stability can be guaranteed as long as the equivalent bandwidth of the closed-loop motion system is greater than that of the contact controller. When the end effector is not in contact with the environment, the proposed controller has no effect ( Δ q r = 0 ) and the end effector tracks p e , d in free space. When contact occurs, the controller quickly adjusts the closed-loop motion system reference to make the end effector compliant to absorb impact and achieve stable contact.

5. Simulation Analyses

Simulation analyses are performed for position tracking and physical contact scenarios, respectively, to verify the effectiveness of the proposed trajectory optimization controller and the admittance contact controller based on the hierarchical framework.

5.1. Position Tracking Scenario

In this scenario, set the desired target position 0.5 m ahead of the flying robot. The end effector responses are shown in Figure 7. The corresponding trajectory references of the motion state variables (the aerial platform’s position and yaw angle and robotic arm’s joint angles) under the proposed trajectory optimization controller and the corresponding tracking responses under the low-level motion controller are illustrated in Figure 8. For comparison, Figure 7 also gives the responses under the CLIK controller and the two-stage controller, which are commonly adopted in studies, as discussed in Section 1. Similarly, Figure 9 and Figure 10 show the trajectory references and responses of the motion state variables with the CLIK controller and the two-stage controller, respectively.
The results indicate that the proposed trajectory optimization controller can accurately track the position of the end effector. The trajectory is smooth without overshoot and the tracking time is about 6 s. Although the attitude change of the aerial platform in forward flight will cause z e of the end effector to deviate from expectation, it can be adjusted immediately through the unified trajectory prediction and optimization of the aerial platform and arm joints. It can be seen from Figure 8 that the platform and arm joints actuate simultaneously in the optimized motion trajectory, where the aerial platform dominates to improve the tracking efficiency, while the robotic arm also undertakes part of motion (joint 2 and joint 3 change by about 17° and 15°, respectively) to prevent the ducted fans being too close to the target, which is consistent with the analysis in Section 3. Furthermore, since the arm has revolute joints, its motion in x e direction will cause coupling motion in z e direction. The proposed NMPC-based strategy can effectively offset the altitude error of the end effector caused by the forward extension of the arm joint by moving the aerial platform along z a direction. Overall, the above analysis shows that the proposed trajectory optimization controller can carry out coordinated planning for the motion of the platform and the arm, balancing various constraints such as the ducted fan wall effect and the arm’s CoM change to perform smooth and accurate tracking of the end effector.
As a comparison, although the CLIK controller’s response time is faster than the time of the NMPC-based controller, it suffers from severe overshoot and oscillation, with a maximum deviation error of 40%. This is because the tracking of motion state variables in the low-level layer of the system requires response time, and the CLIK controller cannot predict the future motion states in the manner of the NMPC-based controller, resulting in an excessive response. Such a response may cause accidental collision of the end effector with the target, which is unacceptable. In addition, due the end effector’s motion coupling in x e and z e , the altitude response under the CLIK controller also oscillates to some extent. Figure 9 shows that the motion of the end effector is almost entirely provided by the aerial platform, and the steady-state variation of the four joint angles of the arm is small, and it only participates in the adjustment during the early movement of the end effector. The reason why the DOFs of the platform exhibit higher motion priority is that the CLIK strategy does not consider the differences between the motion DOFs of the platform and the arm in the trajectory allocation process. The DOFs of the aerial platform can directly generate linear motion, while the DOFs of the arm joints can only generate angular motion, whose equivalent mapping to the end effector’s position is smaller. Moreover, the CLIK strategy does not take into account constraints such as ducted fan wall effect and safety distance limitations. For targets like vertical walls, the transient deviation shown in Figure 7 may have already led to direct collision and damage to the ducted fans in practice.
The two-stage controller performs trajectory planning for the platform and the arm independently: in first stage, the platform flies forward by 0.45 m and then keeps hovering; in second stage, the arm extends by 0.05 m to reach the target. The results indicate that the trajectory of the end effector is not smooth with this controller. When the robotic arm moves, the hovering aerial platform drifts under its disturbance, resulting in a slight overshoot of the end effector. Although the platform can quickly return to its equilibrium position with the composite controller, this situation should still be avoided. In addition, the two-stage controller performs open-loop independent planning for the aerial platform and the robotic arm, and the arm joints cannot compensate for the response deviation of the end effector in real time caused by the platform’s attitude change, which results in a large error in z e . Moreover, in practice, it is difficult for the above offline-based strategy to effectively deal with the time-varying target. Furthermore, Figure 8, Figure 9 and Figure 10 show that although there are significant differences in the solved motion state variable references under different trajectory planning controllers, all responses can achieve good tracking performance, which illustrates the effectiveness of the platform’s low-level motion controllers and the robotic arm in Section 4.

5.2. Physical Contact Scenario

In this scenario, set a vertical wall 0.5 m ahead of the flying robot and let the robot move forward to contact the wall; the contact force and position responses are shown in Figure 11 and Figure 12. To ensure continuous contact of the end effector with the wall, the desired target position is set 2 cm behind the wall. For comparison, the responses without the admittance controller are also illustrated. Accordingly, Figure 13 and Figure 14 show the responses of the motion state variables of the robot with and without the admittance controller, respectively. The white parts in these figures indicate that the end effector has not made contact with the wall, and the blue parts indicate that it has made physical contact.
The results show that the proposed admittance controller based on the hierarchical framework can perform stable and compliant contact of the end effector, while maintaining the desired contact position during contact process. The instantaneous contact force between vertical wall and end effector is about 1.5 N, which then decays rapidly and reaches a stable equilibrium around 0.25 N. As a comparison, the contact process without an admittance controller lacks compliance, and the contact force oscillates continuously with a peak of 2.2 N. Meanwhile, as Figure 14 shows, the responses of the motion state variables of both the aerial platform and the robotic arm deviate from the references and oscillate due to the environmental reaction force. In particular, the joint angles are completely unable to track the references, with a maximum error exceeding 13°, resulting in the end effector deviating from the contact position desired. The maximum response error of z e is close to 0.14 m. The results show the necessity and effectiveness of the admittance controller, as well as the corresponding hierarchical control framework.

6. Experimental Verifications

6.1. Experimental Setup

The actual experimental test scenarios of position tracking and physical contact of the flying robot are illustrated in Figure 15. The OptiTrack motion capture system is set up for three-dimensional positioning of the robot. A flat acrylic plate fixed on an industrial wire mesh fence is adopted as a vertical wall, and its transparency feature can avoid blocking of the cameras of the motion capture system. Figure 16 demonstrates the hardware system of the robot. A ground station is applied to transmit the real-time three-dimensional positioning information of the robot to the onboard main controller, and to remotely communicate and control the robot. The onboard system consists of onboard main controller, aerial platform control system, robotic arm control system, and force sensor system. The onboard main controller is Raspberry Pi 3, which has both low cost and good onboard computing performance. The flight controller of the aerial platform is CUAV V5, integrating high-precision IMU, as well as magnetometer and barometer modules. A ROBOTIS Open CR embedded board is used as the robotic arm controller to drive the joint servos. The servos are Dynamixel XM430-W350, which integrates ARM-based microprocessor to provide various feedback signals, including angle position, velocity, and current (torque), and supports torque control mode based on a high-performance current sensing algorithm. An ATI Nano17 lightweight force sensor is attached to the end effector to measure and feed back the physical contact forces, and the measured signals are amplified, solved, and calibrated by an ATI NETCANOEM board before being sent to the onboard main controller.
The parameters of the proposed trajectory optimization controller are given in Table 3, and the corresponding system constraints are given in Table 4. Notice that the weight of the cost function h 3 is larger than those of the others, which is because this h 3 is denoted by the dimensionless normalized tilting moment coefficient and is not in the same order of magnitude as other cost functions. The admittance contact controller parameters are given in Table 5.

6.2. Experimental Results

6.2.1. Position Tracking Scenario

To verify the effectiveness of the trajectory optimization controller, a four-point position tracking experiment for the flying robot is performed, and the end effector’s responses are shown in Figure 17. Figure 18 provides the corresponding three-dimensional trajectory to illustrate the responses more intuitively. The results under the CLIK controller are also given for comparison. The parameters of the CLIK controller are tuned following the method in [37], which is a widely used criterion. As analyzed in Section 5, the two-stage controller finds it difficult to deal with the time-varying position tracking and is therefore not implemented in actual experiments. Since the DOFs of the arm joints are primarily within the X I Z I plane, trajectory optimization is primarily reflected in the longitudinal and vertical directions, which should be the mainly focus, while the response accuracy of the robot in the lateral direction is primarily determined by the low-level motion controller. The maximum fluctuations of the end effector under both the CLIK controller and the proposed NMPC controller during the position tracking process are illustrated in Table 6. The results show that the proposed NMPC controller has good tracking performance with smoothness and no overshoot, and the maximum fluctuations of the trajectory in the longitudinal and vertical directions are 0.0391 m and 0.0293 m, respectively. The tracking performance of the CLIK controller is relatively poor, especially in the longitudinal direction, where there is a severe overshoot, with a deviation of about 0.1 m and a maximum fluctuation error of 0.1596 m. An overshoot also occurs in the vertical direction under the CLIK controller, with a maximum fluctuation reaching 0.0685 m. Compared to the CLIK controller, the maximum fluctuations with the proposed controller are reduced by 75.5% and 57.2% in the longitudinal and vertical directions, respectively. Figure 17 also shows that the proposed controller and the CLIK controller exhibits similar values performance in the lateral direction, which is consistent with the above analysis.
Table 3. Trajectory optimization controller parameters.
Table 3. Trajectory optimization controller parameters.
ParmValueParmValue
N p 10 N m 2
W 1 diag (4, 4, 4) W s 1 diag (20, 20, 20)
W 2 diag (2, 2) W s 2 diag (2, 2)
W 3 10,000 W s 3 10,000
W 4 diag (1, 1, 1, 1, 1, 1, 1, 1) T s 100 ms
Table 4. System constraints of trajectory optimization.
Table 4. System constraints of trajectory optimization.
ConstraintValueConstraintValue
d W E , min 0.215 m d e , min 0.445 m
q 1 , min , q 1 , max (−pi/3, pi/3) rad q 2 , min , q 2 , max (0, pi) rad
q 3 , min , q 3 , max (−5 pi/6, −pi/6) rad q 4 , min , q 4 , max (−pi/2, pi/2) rad
x ˙ a , min , x ˙ a , max (−1.5, 1.5) m/s y ˙ a , min , y ˙ a , max (−1.5, 1.5) m/s
z ˙ a , min , z ˙ a , max (−1.5, 1.5) m/s ψ ˙ a , min , ψ ˙ a , max (−1.57, 1.57) rad/s
q ˙ j , min , q ˙ j , max (−4.8, 4.8) rad/s x ¨ a , min , x ¨ a , max (−5.6, 5.6) m/s2
y ¨ a , min , y ¨ a , max (−5.6, 5.6) m/s2 z ¨ a , min , z ¨ a , max (−6.0, 4.0) m/s2
ψ ¨ a , min , ψ ¨ a , max (−2.4, 2.4) rad/s2
Table 5. Admittance contact controller parameters.
Table 5. Admittance contact controller parameters.
ParmValueParmValueParmValueParmValue
m d 1 b d 30 k d 1 D s 1 / 0.05 s + 1
Table 6. Maximum fluctuations in position tracking scenario.
Table 6. Maximum fluctuations in position tracking scenario.
ScenarioControllerLongitudinal DirectionVertical Direction
Without windCLIK0.1596 m0.0685 m
NMPC0.0391 m0.0293 m
With windCLIK0.2692 m0.0958 m
NMPC0.0781 m0.0351 m
To further evaluate the effectiveness of the proposed controller in realistic environments, a position tracking experimental test under wind gusts was carried out. The responses of the end effector are shown in Figure 19, and the corresponding three-dimensional trajectory is illustrated in Figure 20. During the test, a fan with a center maximum wind speed of 6 m/s is set in front of the flying robot along the X I direction. The results with the CLIK controller are also provided, and the maximum fluctuations of the end effector are presented in Table 6. The results show that, compared to the situation without wind gusts, the trajectories of the end effector with both the NMPC controller and the CLIK controller exhibit deterioration. The maximum fluctuations with the NMPC controller in the longitudinal and vertical directions are 0.0781 m and 0.0351 m, respectively. However, the controller can still maintain the ability to track and hold the desired position. Correspondingly, the trajectory with the CLIK controller experiences severe oscillations, especially in the longitudinal direction, with a maximum fluctuation of 0.2692 m. This is due to the wind field being mainly concentrated in the X I direction. In this situation, the CLIK controller cannot meet the task requirements. Compared to the CLIK controller, the maximum fluctuations with the proposed controller are reduced by 71.0% and 63.4% in the longitudinal and vertical directions, respectively. Moreover, Figure 21 illustrates the computation time of the proposed algorithm at each sampling instant during the test. It can be seen that the average computation time of the algorithm is 0.0426 s, while the maximum and minimum computation times are 0.0911 s and 0.0218 s, respectively, which can meet the real-time requirements under hardware performance constraints.

6.2.2. Physical Contact Scenario

A flying robot physical contact experiment is performed to verify effectiveness of the admittance controller with the hierarchical control framework, and the contact force and corresponding trajectory response of the end effector are shown in Figure 22, where the white part indicates that the end effector has not made contact with the wall and the blue part indicates that it has made physical contact with the wall. To ensure safety, only the condition with the admittance controller is carried out in the experimental tests. The results show that the admittance controller designed in this paper can perform stable and compliant contact. The instantaneous contact force between the wall and the end effector is about 2 N, which then decays rapidly and oscillates stably in a small range around 1 N. It should be mentioned that, compared with the simulation results, the reason why the contact force does not converge to a constant value is mainly due to the inevitable floating error of the aerial platform in the actual experiments.

7. Conclusions

This paper focuses on the tracking and interaction control of a ducted fan flying robot. First, a ducted fan flying robot with a 4-DOF robotic arm is designed, and the nonlinear kinematic and dynamics models of the robot are established. Second, a NMPC-based trajectory optimization method is proposed, which solves the optimal trajectory allocation of the robot’s redundant motion state variables to achieve the desired three-dimensional position tracking of the end-effector, while satisfying time-varying motion and performance constraints. Third, a unified hierarchical control framework for the robot is proposed to avoid controller switching and performance coupling between the flight and interaction processes, in which the top-level admittance contact controller and the low-level motion controller are designed in detail. Both simulation analyses and actual experimental tests were performed to verify the effectiveness of the controller. The results indicate that the end effector of the robot can track the position smoothly and accurately, with the maximum fluctuation with the proposed method reduced by up to 75.5% without wind and 71.0% with wind, compared to the CLIK method. Moreover, the end effector can also achieve continuous stable contact with the vertical wall target, which lays the foundation for the flying robot practical application. Future work will concentrate on contact force control strategies for the end effector to meet actual industrial task requirements. Furthermore the aerodynamic coupling effects of the flying robot under dynamic motion conditions and complex environments will also be explored to enhance the robots’ applicability to various scenarios. On this basis, more challenging scenarios such as interacting with curved or angled surfaces will be investigated.

Author Contributions

Conceptualization, Y.Z. and B.X.; methodology, Y.Z. and Y.Y.; formal analysis, Y.Z., W.F. and T.X.; resources, S.T. and S.W.; writing—original draft preparation, Y.Z.; writing—review and editing, Y.Y. and S.T.; supervision, Y.Y. and B.X.; funding acquisition, Y.Z., S.T. and T.X. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by National Natural Science Foundation of China under Grant 52202452, in part by China Postdoctoral Science Foundation under Grant 2024M764121, in part by Natural Science Foundation of Chongqing, China under Grant cstc2021jcyj-msxmX0792, and CSTB2025NSCQ-GPX0410, in part by Beijing Nova Program under Grant 20250484911.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding authors.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Meira, G.D.S.; Guedes, J.V.F.; Bias, E.D.S. UAV-Embedded Sensors and Deep Learning for Pathology Identification in Building Façades: A Review. Drones 2024, 8, 341. [Google Scholar] [CrossRef]
  2. Liu, W.; Lyu, S.-K.; Liu, T.; Wu, Y.-T.; Qin, Z. Multi-Target Optimization Strategy for Unmanned Aerial Vehicle Formation in Forest Fire Monitoring Based on Deep Q-Network Algorithm. Drones 2024, 8, 201. [Google Scholar] [CrossRef]
  3. Barakou, S.C.; Tzafestas, C.S.; Valavanis, K.P. A Review of Real-Time Implementable Cooperative Aerial Manipulation Systems. Drones 2024, 8, 196. [Google Scholar] [CrossRef]
  4. Martinez, R.R.; Paul, H.; Shimonomura, K. Aerial Torsional Work Utilizing a Multirotor UAV with Add-on Thrust Vectoring Device. Drones 2023, 7, 551. [Google Scholar] [CrossRef]
  5. Liang, J.; Zhong, H.; Wang, Y.; Chen, Y.; Mao, J.; Wang, W.; Zhang, H. Reference Optimization-Based Compliant Control for Aerial Pipeline Inspection Using a Hexacopter With a Robotic Contact Device. IEEE/ASME Trans. Mechatron. 2024, 29, 4063–4074. [Google Scholar] [CrossRef]
  6. Samadikhoshkho, Z.; Lipsett, M.G. Visual Servoing for Aerial Vegetation Sampling Systems. Drones 2024, 8, 605. [Google Scholar] [CrossRef]
  7. Kalantari, A.; Brinkman, A.; Carpenter, K.; Gildner, M.; Jenkins, J.; Newill-Smith, D.; Seiden, J.; Umali, A.; Mccormick, R. Design, Prototype, and Performance Assessment of an Autonomous Manipulation System for Mars Sample Recovery Helicopter. In Proceedings of the 2024 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Abu Dhabi, United Arab Emirates, 14–18 October 2024; pp. 2229–2236. [Google Scholar]
  8. Ji, M.; Shen, J.; Cao, H.; Zhao, S. Avian-inspired high-precision tracking control for aerial manipulators. Nonlinear Dyn. 2025, 113, 8605–8621. [Google Scholar] [CrossRef]
  9. Qian, Y.; Luo, Y.; Hu, X.; Zeng, Z.; Zhang, Y. Improving the performance of ducted fans for VTOL applications: A review. Sci. China Technol. Sci. 2022, 65, 2521–2541. [Google Scholar] [CrossRef]
  10. Barakou, S.C.; Tzafestas, C.S.; Valavanis, K.P. Control Strategies for Real-Time Aerial Manipulation With Multi-Dof Arms: A Survey. In Proceedings of the 2025 International Conference on Unmanned Aircraft Systems (ICUAS), Charlotte, NC, USA, 14–17 May 2025; pp. 139–146. [Google Scholar]
  11. Ubellacker, S.; Ray, A.; Bern, J.M.; Strader, J.; Carlone, L. High-speed aerial grasping using a soft drone with onboard perception. npj Robot. 2024, 2, 5. [Google Scholar] [CrossRef]
  12. Chen, H.; Quan, F.; Fang, L.; Zhang, S. Aerial Grasping with a Lightweight Manipulator Based on Multi-Objective Optimization and Visual Compensation. Sensors 2019, 19, 4253. [Google Scholar] [CrossRef] [PubMed]
  13. Zhang, G.; He, Y.; Dai, B.; Gu, F.; Yang, L.; Han, J.; Liu, G. Aerial Grasping of an Object in the Strong Wind: Robust Control of an Aerial Manipulator. Appl. Sci. 2019, 9, 2230. [Google Scholar] [CrossRef]
  14. Liu, Y.; Huang, C. DDPG-Based Adaptive Robust Tracking Control for Aerial Manipulators With Decoupling Approach. IEEE Trans. Cybern. 2022, 52, 8258–8271. [Google Scholar] [CrossRef] [PubMed]
  15. Cao, H.; Shen, J.; Liu, C.; Zhu, B.; Zhao, S. Motion Planning for Aerial Pick-and-Place With Geometric Feasibility Constraints. IEEE Trans. Autom. Sci. Eng. 2025, 22, 2577–2594. [Google Scholar] [CrossRef]
  16. Pedrocco, M.; Pasetto, A.; Fanti, G.; Benato, A.; Cocuzza, S. Trajectory Tracking Control of an Aerial Manipulator in the Presence of Disturbances and Model Uncertainties. Appl. Sci. 2024, 14, 2512. [Google Scholar] [CrossRef]
  17. Lee, H.; Kim, H.J. Estimation, Control, and Planning for Autonomous Aerial Transportation. IEEE Trans. Ind. Electron. 2017, 64, 3369–3379. [Google Scholar] [CrossRef]
  18. Dimmig, C.A.; Kobilarov, M. Non-Prehensile Aerial Manipulation using Model-Based Deep Reinforcement Learning. In Proceedings of the 2024 IEEE 20th International Conference on Automation Science and Engineering (CASE), Bari, Italy, 28 August–1 September 2024; pp. 2194–2200. [Google Scholar]
  19. Liu, H.; Guo, P.; Jin, X.; Deng, H.; Xu, K.; Ding, X. An Intelligent Planning Method For The Multi-Rotor Manipulation Robot With Reinforcement Learning. In Proceedings of the 2022 IEEE International Conference on Mechatronics and Automation (ICMA), Guilin, China, 7–10 August 2022; pp. 1028–1033. [Google Scholar]
  20. He, G.; Guo, X.; Tang, L.; Zhang, Y.; Mousaei, M.; Xu, J.; Geng, J.; Scherer, S.; Shi, G. Flying Hand: End-Effector-Centric Framework for Versatile Aerial Manipulation Teleoperation and Policy Learning. arXiv 2025, arXiv:2504.10334. [Google Scholar]
  21. Meng, X.; He, Y.; Han, J.; Song, A. Physical Interaction Oriented Aerial Manipulators: Contact Force Control and Implementation. IEEE Trans. Autom. Sci. Eng. 2025, 22, 4570–4582. [Google Scholar] [CrossRef]
  22. Cuniato, E.; Lawrance, N.; Tognon, M.; Siegwart, R. Power-Based Safety Layer for Aerial Vehicles in Physical Interaction Using Lyapunov Exponents. IEEE Robot. Autom. Lett. 2022, 7, 6774–6781. [Google Scholar] [CrossRef]
  23. Suarez, A.; Heredia, G.; Ollero, A. Physical-Virtual Impedance Control in Ultralightweight and Compliant Dual-Arm Aerial Manipulators. IEEE Robot. Autom. Lett. 2018, 3, 2553–2560. [Google Scholar] [CrossRef]
  24. Zhang, Z.; Chen, Y.; Wu, Y.; He, B.; Miao, Z.; Zhang, H.; Wang, Y. Hybrid Force/Position Control for Switchable Unmanned Aerial Manipulator Between Free Flight and Contact Operation. IEEE Trans. Autom. Sci. Eng. 2024, 21, 4283–4297. [Google Scholar] [CrossRef]
  25. Liang, J.; Wang, Y.; Zhong, H.; Chen, Y.; Li, H.; Mao, J.; Wang, W. Robust Variable Impedance Control for Aerial Compliant Interaction With Stability Guarantee. IEEE Trans. Ind. Inform. 2024, 20, 3351–3360. [Google Scholar] [CrossRef]
  26. Xu, M.; Hu, A.; Wang, H. Image-Based Visual Impedance Force Control for Contact Aerial Manipulation. IEEE Trans. Autom. Sci. Eng. 2023, 20, 518–527. [Google Scholar] [CrossRef]
  27. Khalifa, A.; Fanni, M.; Khalifa, A. Sensorless contact force estimation and robust impedance control for a quadrotor manipulation system. Sci. Rep. 2024, 14, 28772. [Google Scholar] [CrossRef]
  28. Zhang, Y.; Xu, B.; Xiang, C.; Liu, L.; Ai, T. Modelling and controller design of a novel ducted fan unmanned aircraft. Int. J. Robot. Autom. 2021, 36, 448–461. [Google Scholar] [CrossRef]
  29. Forte, F.; Naldi, R.; Macchelli, A.; Marconi, L. Impedance control of an aerial manipulator. In Proceedings of the American Control Conference, Montreal, QC, Canada, 27–29 June 2012; pp. 3839–3844. [Google Scholar]
  30. Quan, Q. Introduction to Multicopter Design and Control; Springer Nature: Singapore, 2017; ISBN 9789811033827. [Google Scholar]
  31. Grüne, L.; Pannek, J. Nonlinear Model Predictive Control; Springer: Cham, Switzerland, 2016. [Google Scholar]
  32. Kondak, K.; Huber, F.; Schwarzbach, M.; Laiacker, M.; Sommer, D.; Bejar, M.; Ollero, A. Aerial manipulation robot composed of an autonomous helicopter and a 7 degrees of freedom industrial manipulator. In Proceedings of the 2014 IEEE International Conference on Robotics and Automation, Hong Kong, China, 31 May–7 June 2014; pp. 2107–2112. [Google Scholar]
  33. Luo, Y.; He, Y.; Qian, Y.; Zhang, Y. Aerodynamic modeling of ducted fans under environmental disturbances. J. Phys. Conf. Ser. 2024, 2707, 12075. [Google Scholar] [CrossRef]
  34. Ai, T.; Xu, B.; Xiang, C.; Fan, W.; Zhang, Y. Modeling of a Novel Coaxial Ducted Fan Aerial Robot Combined with Corner Environment by Using Artificial Neural Network. Sensors 2020, 20, 5805. [Google Scholar] [CrossRef] [PubMed]
  35. Luo, Y.; He, Y.; Xu, B.; Ai, T.; Qian, Y.; Zhang, Y. Numerical simulation and analysis of a ducted-fan drone hovering in confined environments. Adv. Aerodyn. 2024, 6, 18. [Google Scholar] [CrossRef]
  36. Zhang, Y.; Xu, B.; Xiang, C.; Fan, W.; Ai, T. Flight and Interaction Control of an Innovative Ducted Fan Aerial Manipulator. Sensors 2020, 20, 3019. [Google Scholar] [CrossRef] [PubMed]
  37. Siciliano, B.; Sciavicco, L.; Villani, L.; Oriolo, G. Robotics: Modelling, Planning and Control; Springer: London, UK, 2010; ISBN 978-1-84628-641-4. [Google Scholar]
Figure 1. The prototype of the proposed flying robot.
Figure 1. The prototype of the proposed flying robot.
Drones 09 00680 g001
Figure 2. Coordinate system of the flying robot.
Figure 2. Coordinate system of the flying robot.
Drones 09 00680 g002
Figure 3. D-H frame of the robotic arm.
Figure 3. D-H frame of the robotic arm.
Drones 09 00680 g003
Figure 4. The velocity and pressure fields of the ducted fan under wall effect.
Figure 4. The velocity and pressure fields of the ducted fan under wall effect.
Drones 09 00680 g004
Figure 5. The induced tilting moment coefficient of the ducted fan.
Figure 5. The induced tilting moment coefficient of the ducted fan.
Drones 09 00680 g005
Figure 6. Hierarchical control framework.
Figure 6. Hierarchical control framework.
Drones 09 00680 g006
Figure 7. Tracking responses of the end effector.
Figure 7. Tracking responses of the end effector.
Drones 09 00680 g007
Figure 8. Responses of the motion state variables with NMPC-based controller.
Figure 8. Responses of the motion state variables with NMPC-based controller.
Drones 09 00680 g008
Figure 9. Responses of the motion state variables with CLIK controller.
Figure 9. Responses of the motion state variables with CLIK controller.
Drones 09 00680 g009
Figure 10. Responses of the motion state variables with two-stage controller.
Figure 10. Responses of the motion state variables with two-stage controller.
Drones 09 00680 g010
Figure 11. Contact force responses of the end effector.
Figure 11. Contact force responses of the end effector.
Drones 09 00680 g011
Figure 12. Position responses of the end effector.
Figure 12. Position responses of the end effector.
Drones 09 00680 g012
Figure 13. Responses of the motion state variables with admittance contact controller.
Figure 13. Responses of the motion state variables with admittance contact controller.
Drones 09 00680 g013
Figure 14. Responses of the motion state variables without admittance contact controller.
Figure 14. Responses of the motion state variables without admittance contact controller.
Drones 09 00680 g014
Figure 15. Experimental test scenarios.
Figure 15. Experimental test scenarios.
Drones 09 00680 g015
Figure 16. Hardware system of the flying robot.
Figure 16. Hardware system of the flying robot.
Drones 09 00680 g016
Figure 17. Responses in position tracking scenario without wind.
Figure 17. Responses in position tracking scenario without wind.
Drones 09 00680 g017
Figure 18. Three-dimensional trajectory in position tracking scenario without wind.
Figure 18. Three-dimensional trajectory in position tracking scenario without wind.
Drones 09 00680 g018
Figure 19. Responses in position tracking scenario with wind.
Figure 19. Responses in position tracking scenario with wind.
Drones 09 00680 g019
Figure 20. Three-dimensional trajectory in position tracking scenario with wind.
Figure 20. Three-dimensional trajectory in position tracking scenario with wind.
Drones 09 00680 g020
Figure 21. Algorithm computation time in position tracking scenario with wind.
Figure 21. Algorithm computation time in position tracking scenario with wind.
Drones 09 00680 g021
Figure 22. Responses in physical contact scenario.
Figure 22. Responses in physical contact scenario.
Drones 09 00680 g022
Table 1. Key structural parameters of the flying robot.
Table 1. Key structural parameters of the flying robot.
ParmDescriptionValue
m a Mass of aerial platform5.7 kg
I a Inertia matrix of aerial platformdiag (0.314, 0.307, 0.326) kg∙m2
m l 1 Mass of arm link 10.0984 kg
I l 1 Inertia matrix of arm link 1diag (3.454 × 10−5, 3.269 × 10−5, 1.885 × 10−5) kg∙m2
m l 2 Mass of arm link 20.1385 kg
I l 2 Inertia matrix of arm link 2diag (6.035 × 10−5, 3.306 × 10−4, 3.429 × 10−4) kg∙m2
m l 3 Mass of arm link 30.1327 kg
I l 3 Inertia matrix of arm link 3diag (3.065 × 10−5, 2.423 × 10−4, 2.516 × 10−4) kg∙m2
m l 4 Mass of arm link 40.2259 kg
I l 4 Inertia matrix of arm link 4diag (8.087 × 10−5, 9.313 × 10−5, 7.598 × 10−5) kg∙m2
Table 2. D-H parameters of the flying robot.
Table 2. D-H parameters of the flying robot.
Link i a i 1 (m) α i 1 (Rad) d i (m) θ i (Rad)
1000 q 1
20π/20 q 2
30.13000 q 3
40.12400 q 4
EE0.170000
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

Zhang, Y.; Xu, B.; Yu, Y.; Tang, S.; Fan, W.; Wang, S.; Xu, T. NMPC-Based Trajectory Optimization and Hierarchical Control of a Ducted Fan Flying Robot with a Robotic Arm. Drones 2025, 9, 680. https://doi.org/10.3390/drones9100680

AMA Style

Zhang Y, Xu B, Yu Y, Tang S, Fan W, Wang S, Xu T. NMPC-Based Trajectory Optimization and Hierarchical Control of a Ducted Fan Flying Robot with a Robotic Arm. Drones. 2025; 9(10):680. https://doi.org/10.3390/drones9100680

Chicago/Turabian Style

Zhang, Yibo, Bin Xu, Yushu Yu, Shouxing Tang, Wei Fan, Siqi Wang, and Tao Xu. 2025. "NMPC-Based Trajectory Optimization and Hierarchical Control of a Ducted Fan Flying Robot with a Robotic Arm" Drones 9, no. 10: 680. https://doi.org/10.3390/drones9100680

APA Style

Zhang, Y., Xu, B., Yu, Y., Tang, S., Fan, W., Wang, S., & Xu, T. (2025). NMPC-Based Trajectory Optimization and Hierarchical Control of a Ducted Fan Flying Robot with a Robotic Arm. Drones, 9(10), 680. https://doi.org/10.3390/drones9100680

Article Metrics

Back to TopTop