A Hybrid Control Approach for the Swing Free Transportation of a Double Pendulum with a Quadrotor

: In this article, a control strategy approach is proposed for a system consisting of a quadrotor transporting a double pendulum. In our case, we attempt to achieve a swing free transportation of the pendulum, while the quadrotor closely follows a speciﬁc trajectory. This dynamic system is highly nonlinear, therefore, the fulﬁllment of this complex task represents a demanding challenge. Moreover, achieving dampening of the double pendulum oscillations while following a precise trajectory are conﬂicting goals. We apply a proportional derivative (PD) and a model predictive control (MPC) controllers for this task. Transportation of a multiple pendulum with an aerial robot is a step forward in the state of art towards the study of the transportation of loads with complex dynamics. We provide the modeling of the quadrotor and the double pendulum. For MPC we deﬁne the cost function that has to be minimized to achieve optimal control. We report encouraging positive results on a simulated environmentcomparing the performance of our MPC-PD control circuit against a PD-PD conﬁguration, achieving a three fold reduction of the double pendulum maximum swinging angle.


Introduction
The research community has studied different approaches for the aerial transportation of payloads task and since the 70s. Specifically, towed cable systems have been analyzed in various applications like payload delivery, kites, aerial refueling systems, brick transportation, and rescue missions. The enhancements of these tasks would permit a wider spectrum of possibilities for unmanned aerial vehicles (quadrotors), including transportation of bigger and different types of objects, inspection and maintenance of elements and surfaces, and emergency services related applications.
In recent years, there has been extensive interest in developing solutions for delivering a payload by connecting it to a multirrotor quadrotor with cables [1][2][3][4]. In these approaches the payload is often considered to be a particle mass at the end of the cable. We call this suspended load, which is also known as slung load. Despite the different alternative quadrotors considered in the literature to transport such payload, in this article we will focus on quadrotors. Quadrotors deployment of cable-suspended payloads can save time and energy, comparing to other methods, and thus, this configuration provides potential benefits that may extend the application possibilities of these aerial systems [5]. However, its passive dynamics affect the performance of the quadrotor, by the introduction of a new set of inputs, such as tensions and residual vibrations. Quadrotors are a nonlinear, unstable and underactuated system, and coupled dynamics with the attached payload adds an extra complexity and alters the performance of precise positioning and path-following, and thus it is required a careful control design in order to cope with them. The problem is far from being solved [6,7].
Research on payload stabilization suspended by a cable started decades ago, when dealing with the control of cranes whose payload was modeled by a lumped-mass [8]. This model is simple, but it captures the complex dynamics of payload motion. Classic equations of applied mechanics were used to model a suspended load in cranes [9], and later extended in [10]. Nowadays, the stabilization of the slung load is pursued through the minimization of the particle mass swing, which enables the reduction of the vibrations and sudden shock in the quadrotor dynamic system. It is known that the transportation speed and the removal of the payload oscillations are contradictory control goals [11], therefore, the fulfillment of both objectives represents a challenging task for control engineering.
First research works on payload transportation by quadrotors appeared in the late 1990s [12,13]. Early attempts involved quasi-static motions to position and orient a suspended load [1]. Since then, the most common dynamic modeling is the lift vector of a payload to be fixed along the z-direction in the frame fixed to be quadrotor body, so that quadrotors can only generate their translational motion by tilting the body frame by the propellers in a certain direction. Usually, for these systems a cascade control configuration is used, where an outer-loop controller is in charge of the translational control and then, an inner loop is used to obtain the tilt angle calculated by the outer loop. For instance, [14] use a Model Predictive Controller (MPC) strategy and linear-quadratic regulator (LQR) control for slung load operations in hover and aggressive maneuvers, while [15] use the swinging load angles as an error input for a proportional derivative (PD) controller that corrects the translational controller during paths and maneuvers.
An alternative way to deal with the dynamics of the suspended load is to incorporate it directly into the quadrotor control dynamics. In [16], the authors present a multi-rotor with a hybrid system, interchangeable between a taut or a flexible cable. Depending on the maneuvers to be done and obstacles found, the quadrotor control switches between the two configurations thanks to a mixed-integer quadratic programming. In [17], the authors use a Hamiltonian approach for the control of the nonlinear system, where the swinging oscillations are controlled by an interconnection and damping assignment-passivity based control. Geometric control is utilized in [18] in the model of cable decomposed in a series of linear linked pieces. Adaptive control and slung load pose estimation for small size quadrotors has been also introduced [19].
In the last years, artificial neural network (ANN) based algorithms are being tested for the control of quadrotors, despite their limitations in size, weight, power consumption, and response to the changing environments and flying conditions, which require a continuous retraining process of the ANN architecture [20], even more so in payload transportation applications. Besides the application of deep learning for quadrotors artificial vision navigation systems [21], classical control strategies have been proposed, like MPC for the elimination of the overshoot at load release time [22], or a reinforcement learning strategy based on the minimization of the payload oscillations for an automated cargo delivery [23].
Conventional PD controllers have proven to be an efficient solution for inner control loop in payload transportation task by quadrotors, due to their simplicity, robustness and good results [6,19,[24][25][26]. Adaptive PID controller can be employed for coping with wind disturbances and main external forces that affect the performance of the system [5,25]. On the other hand, the MPC is designed to solve an optimization problem by defining and minimizing an objective function which is related to both the optimal state and control inputs. Although the interest towards this configuration gained the attention of researchers in recent years [27][28][29], they still did not solve completely all the problems or explore the possibilities related to it.
The state of the art in transportation of slung loads with quadrotors can be broadly classified into two categories [4]: (a) Feedback control for tracking desired payload trajectories [17,18]. (b) Trajectory planning for a quadrotor with a slung load [30][31][32][33]. This paper follows the second approach. As in most of the prior works, the following dynamic simplifications were made without losing precision in the results: (1) The aerodynamic effects of the quadrotor and the payload are neglected. (2) The dynamics and perturbations of the payload are considered completely decoupled from quadrotors, considering that the the payload motion is bounded [33]. (3) The cable model is taut and non-elastic. (4) We consider the 2D plane XZ for the modeling of the double pendulum [34,35]. These assumptions are considered to be realistic enough for the dynamic modeling of the quadrotor + slung load system, except when the quadrotor enters aggressive maneuvers [36]. According to [37], the discretization of the pendulum in two mass particles and massless and taut links represents a valid approach for the current study purpose, and it requires lower computational cost and offers very similar results. Moreover, the usage of the pendulum mathematical model as the DLO physical model widens the research possibilities, as it permits an easier dynamic calculus of taking off and landing, which is not a fully studied field [7]. Very recent works deal with the control of the transportation by an quadrotor of a payload modeled as a double pendulum [38][39][40].
The contributions of this paper are as follows: We present a control configuration with a PD controller embedded in a MPC controller to transport a double pendulum swinging free and smoothly. The double pendulum is a highly nonlinear and unstable multi-body solid. The PD controller is used for quadrotor attitude control while the MPC pursues the precise translational control that tries to minimize the oscillations of the payload. The considerations of the shocks of the two mass particles represent a big challenge for the motion control of the quadrotor. The control strategy is validated in a parabolic ascending trajectory of the quadrotor, comparing the proposed MPC-PD controller against a PD-PD controller that tackles quadrotor path tracking, but not pendulum swing minimization.
The article is structured as follows: The dynamic modeling of the quadrotor and the pendulum is described in Section 2. In Section 3, the control strategy developed in this work is detailed. The experiment and results to test the efficiency of this approach are reported in Section 4. Finally, conclusions are presented in Section 5. Figure 1 shows a schematic model of the quadrotor transporting a double pendulum. In this system, the suspended load system consists of two mass particles m 1 and m 2 connected by massless straight-line links of length l 1 and l 2 which support forces only along the link, and it is suspended from a single point in the center of the quadrotor. The double pendulum links describe angles θ 1 and θ 2 in the plane XZ. In next subsections, the dynamic modeling of the quadrotor and the double pendulum are going to be described.

Double Pendulum System
The highly nonlinear dynamics of double pendulums are still of interest to scientists [41]. Transportation of a payload by a hook attached to the quadrotor corresponds to this double pendulum paradigm, where the hook is the first mass and the payload the second [40]. Figure 1 shows the experimental setup, where the bars of the pendulum are assumed massless. The equations describing the coordinates of the double driven pendulum masses are given in Equation (1), where x 0 and z 0 represent the quadrotor instantaneous position, and the rest of coordinates refer to the absolute position of every punctual mass. In order to simplify computation, in this paper we will work in 2D, i.e., over the X − Z plane: A computer algebra program was used to infer the equations forθ 1 andθ 2 in terms of θ 1 ,θ 2 = f θ 1 , θ 2 ,θ 1 ,θ 2 . The resulting equations are omitted due to its big size. The dynamics of the double pendulum are summarized in Figure 2, where T 1 and T 2 are the tension of the first and second link, respectively. Thus, the tension affecting the quadrotor is T 1 . Applying fundamental results of Applied Mechanics, we can deduce the dynamic equations expressed in the horizontal and vertical coordinates given by Equation (2): Again, with the help of an algebraic manipulation program, we derive the equations for T 1 and T 2 , which we omit here for reasons of space. We can consider the quadro-tor+slung load system as an quadrotor with bounded disturbances. Specifically, we take into account the Z and X projections of T 1 , namely T 1X and T 1Z , for use in the following subsection.

Quadrotor Dynamics
The governing equations of the lift and torques generated by the propellers are as follows: where U 2 , U 3 and U 4 are the roll, pitch and yaw torques, respectively, and Ω 2 i is the squared speed of the i-th propeller, and U 1 is the total thrust of the quadrotor. The parameter b and d are the thrust and drag coefficients, respectively.
Angles φ, θ, and ψ represent the Euler angles referring the Earth inertial frame with respect to the body-fixed frame of quadrotor (φ, θ and ψ represent the rotation along axis X, Y and Z, respectively). Equation (4) provides necessary modifications for angular and linear accelerations (considering that ψ,ψ = 0). I XX , I YY , I ZZ are the inertia moments around the X, Y and Z axis, and m is the mass of the quadrotor. Finally, T 1Z , and T 1X are the T 1 components in X and Z directions.
The integration of Equation (4) is calculated with the Euler method. Though the numerical integration procedure can be critical for highly nonlinear systems, such as chaotic systems [42], our system is smooth enough to allow for this computationally cheaper approach. Considering that the control horizon of MPC control for the quadrotor application is 1s, we have found in the recent literature that Euler provides a good balance of numerical precision and stability, and quick response for real time applications [43,44].

Linearization and Discretization of the Model
The system nonlinear model must be linearized around the equilibrium/hover conditions in order to to solve the equations that provide the optimal parameter values of the linear controllers. For simplification, we keep constant ψ = 0. Using the Linear Time Invariant discretization model, we can assume that the quadrotor and double pendulum dynamics can be simplified. We can calculate the first order Taylor series around the equilibrium point (x eq , u eq ) of the nonlinear dynamics of the quadrotor obtaining [45] the following equation: where the x k ,u k and y k vectors are the state space, input and output vectors, respectively, defined as follows: The linearization is developed around an equilibrium point at which the quadrotor and the slung load system can hover on a specific position (x, y, z). Thus, f = mg + (m 1 + m 2 )g, where m 1 and m 2 is the mass of the pendulum particles as shown in Figure 1. We have that the equilibrium conditions translate into: and the equilibrium vectors result in:

MPC-PD Control Configuration
The control configuration we use in the quadrotor and double pendulum system is shown in Figure 3. For generalization purposes, variables that are not used in the actual experiment are also included, such as Y axis or ψ angle. For reproducibility purposes we have published our code in (http://www.ehu.eus/ccwintco/uploads/3/36/MPC-doublependulum.zip, accessed on 7 June 2021).

•
The PD controller computes the quadrotor torques and lift in Equation (4 where e(t) is the difference between the desired value of each degree of freedom (denoted by subindex d) and the actual value in each discrete moment. K P and K D are the gain of the proportional and derivative terms, respectively. • The MPC block is in charge of computing the desired attitude angles minimizing the payload swing (z d , φ d , θ d and ψ d ). MPC is a class of advanced process control methods [46] which computes the optimal control parameters of the system in finite window of time, denoted the control horizon, and then applies the first step in this control horizon. The process goes on moving the control horizon one step ahead. The algorithm minimizes a cost function, consisting of the error between the output and desired tracking state, subjected to some constraints. Our MPC controller is designed over a discrete-time state space linear time-invariant (LTI) system, the linearization of the double pendulum dynamic system described in Section 2.3. We apply a Kalmann filter for the prediction of the states in the control horizon, thus we have a Robust MPC, that has shown promising results in highly nonlinear quadrotor related applications [47,48]. Our cost function will be the minimization of the difference between the quadrotor position and the desired trajectory and the minimization of the control inputs, thus resulting in Equation (13): where the control horizon is denoted by N. The terminal state and its desired state are denoted by x N and x * N . P m is the weighting matrix for the motor states. Finally, the reference state is denoted by x * i . The minimization function is subjected to the linearized dynamics of the double pendulum and the quadrotor: with state and control constraints: The system matrices A ∈ R 8×8 , B∈ R 8×3 and C ∈ R 6×8 , and are not reproduced here due to their large size. The control input constraints are defined as follows Finally, Q ∈ R 8×8 and R ∈ R 3×3 are the weighting matrices and their values are set as follows: Q = diag[( 50 50 100 100 1 1 10 10)],

Robust MPC Using Kalmann Filter for State Prediction
A Kalmann filter is used for the prediction of the system state within the control horizont in MPC. It is included in the MPC block in the control configuration of Figure 3. A Kalmann filter is an optimal estimator which 'filters' noisy/uncertain measurements obtained from a system governed by noisy LTI dynamics, such as described in Section 2.3. The Kalmann filter assumes that the process and measurement noise have a normal distribution with zero mean. It consists of two phases: a time update step given in Equation (21) x and a measurement update step (Equation (22)).
The tuning parameters in a Kalmann filter are matrices Q and R, which model the uncertainty in the measurements. The inclusion of a state estimator of Kalmann filter, adds to the simplicity of our MPC an extra layer of robustness [46,49,50] that has shown its efficiency in quadrotor related applications [51,52].

PD-PD Configuration
This PD-PD configuration will just count with the ability of path planning and will dispense with pendulum swing rejection. Therefore, this control configuration uses not linearized dynamic equations, described in Section 2. In this case, we get an outer PD in order to calculate the desired angles of the quadrotor, and next, the inner PD loop computes the necessary torques for the quadrotor as in the MPC-PD controller described above. The complete control circuit is shown in Figure 4. The equations to calculate the desired angles are specified in Equations (23) and (24). In Equation (24), x, z refer to the real position of the quadrotor, while x d , z d are the desired position in the assigned trajectory. Their derivatives are obtained by the numerical integration of them. The values of proportional and derivative terms will be detailed in the experiment.
This control configuration is the benchmark that we will use in our experiment to compare against the results of the proposed MPC-PD controller.

Experimental Setting
A computational experiment based on accurate simulations of the system has been carried out in order to test the efficiency and validity of the model. We compare our MPC-PD control proposal with PD-PD control configuration. The simulation experiment was carried out using a discretization of the time variable and all the simulations cover a time of 32 s, including the transient state of the experiment. The time increment used to compute simulation steps is 0.01 s. Experiments have been coded in house in Matlab. The MPC control horizon is 1 s and the selected integration step is 0.1 s. This is, the control horizon consists of 10 steps.
Dynamic parameters of the quadrotor are assumed as in Table 1. Initial angles of the drone are set to 0. Inner-loop PD controller parameters are computed as described in [53]. For experiments in this paper are set as follows: K P = 130 and K D = 39, which are the same for MPC-PD and PD-PD control configuration. In the case of PD-PD control configuration, K P1 and K D1 values are set to 0.25 and 1.6, respectively. Thrust of the drone is limited by hardware to 20 N. Drone starting coordinates in the XZ plane are (0, 0).
The control efficiency to follow a path and adjust correctly the quadrotor parameters for the minimization of the double pendulum swing is going to be tested. A parabolic path was planned for the quadrotor to follow. The quadrotor is carrying a double pendulum and both systems are joined by an ideal punctual link. Table 2 gives the parameter setting of the double pendulum. The equation of the parabolic path is z = 2x − 0.066 · x 2 . This parabolic path introduces tangential inertial forces affecting the double pendulum that are not considered in [40]. Double pendulum dynamics during take-off maneuvers from the ground is not considered. Initial values of the pendulum θ 1 and θ 2 are set to 0.

Results
The visual comparison between planned path and the path actually followed by the simulated quadrotor and double pendulum are shown in Figures 5 and 6 for the MPC-PD and the benchmarking PD-PD control systems, respectively. As can be seen, the MPC-PD system achieves highly precise path-following, while the path followed by the PD-PD control system is quite irregular. Figure 7 shows the swing angle of the bottom pendulum mass, θ 2 , along the time of the path achieved by the MPC-PD control system. The maximum value is θ 2 = 0.23 rads. Figure 8 shows the evolution in time of θ 2 under the PD-PD control system. Its maximum value is θ 2 = 0.61 rads. Thus, we achieve a three fold reduction of the double pendulum swinging in the simulated trajectory conditions.
Due to the lack of performance of PD-PD control configuration, in the following we focus on the MPC-PD controller. Figure 9 plots the variation in time of the vertical tension of the first component of the double pendulum, that is, T 1Z , which represents the tension of the cable attached to the quadrotor and supporting the combined weight of the two particle masses, m 1 and m 2 . Finally, Figure 10 plots the orientation of the quadrotor θ along the simulation time. As we can see, it falls within the maximum and minimum limits defined in Section 3. The quadrotor adopts a changing pitch angle orientation, so that it can compensate the swing of the double pendulum, converging to a stationary hover attitude at the end of the experiment.

Conclusions
A system composed of a quadrotor and a double pendulum is a highly nonlinear dynamical system which represents a big challenge to achieve a smooth and precise control performance. The proposed MPC-PC control configuration approach aims to dampen the swing of the double pendulum by the precise and smooth control of the drone orientation. Transporting the pendulum with the least possible oscillations, we can avoid large perturbations affecting the quadrotor and the aggressive increase or decrease of the horizontal and vertical positions of the loads relative to the quadrotor.
The experiment reported in this article validates the proposed control approach for the transportation of a driven double pendulum. Including a comparison against a PD-PD control system configuration. The MPC-PD proposal achieves a three fold reduction of the double pendulum swinging angle. The experiment proved that the quadrotor under MPC-PD control is capable of following the assigned path, despite the variability of T 1Z and T 1X . The navigation control is robust enough to stick close to the parabolic planned trajectory ( Figure 5). We considered that the most easily perturbable pendulum mass was m 2 , and thus, in Figure 7 we can see that the maximum oscillation has a maximum of about 0.23 rads, and rapidly converges to 0. This stability of the driven double pendulum can also be observed in Figure 9, where T 1Z is plotted. As each pendulum mass weights 0.3 kg, we see that the vertical component of tension of the cable attached to the drone holds 6N along the whole trajectory, which means that T 1X force is almost null and therefore, it encourages the navigation stability of the drone along the path. Therefore, the design of the MPC described in Section 3 proves to be capable of achieving both the swing-free trajectory and the precise navigation along the planned path. Finally, in Figure 10, we can see that the quadrotor manages the double pendulum swing rejection by some compensations in the heading angle, θ. Since we start with the pendulum masses vertically alienated, i.e., θ 1 = θ 2 = 0, the beginning of the advance of the quadrotor forces the pendulum swing backwards due to inertia, which is compensated by the quadrotor by reducing its heading angle till it overcomes the transient starting regime and thus, making the two pendulum masses swing slowly forward.
In the recent bibliography suggested by the reviewers, we found a quite recent work dealing with the control of a double pendulum transportation, while trying to amortiguate the double pendulum swing [38][39][40]. Specifically, they use classical PID controllers to handle this problem. Contrary to our proposed MPC-PD approach, PIDs can neither include system constraints, nor they can benefit from the robustness of Kalmann filtering. Experimental results in [38][39][40] are quite interesting and we plan future work in order to reproduce their with our MPC-PD control approach. Further work would be directed to test the adaptive behaviour in aggressive maneuvers and include interactions with physical walls for the payload, such as collisions or taking offs.

Conflicts of Interest:
The authors declare no conflict of interest.