Next Article in Journal
Multifeature Image Indexing for Robot Localization in Textureless Environments
Previous Article in Journal
A Time-Efficient Co-Operative Path Planning Model Combined with Task Assignment for Multi-Agent Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

MIMO PID Controller Tuning Method for Quadrotor Based on LQR/LQG Theory

by
Rafael Guardeño
*,
Manuel J. López
and
Víctor M. Sánchez
Escuela Superior de Ingeniería, Universidad de Cádiz, 11519 Puerto Real, Spain
*
Author to whom correspondence should be addressed.
Robotics 2019, 8(2), 36; https://doi.org/10.3390/robotics8020036
Submission received: 15 February 2019 / Revised: 23 April 2019 / Accepted: 25 April 2019 / Published: 1 May 2019

Abstract

:
In this work, a new pre-tuning multivariable PID (Proportional Integral Derivative) controllers method for quadrotors is put forward. A procedure based on LQR/LQG (Linear Quadratic Regulator/Gaussian) theory is proposed for attitude and altitude control, which suposes a considerable simplification of the design problem due to only one pretuning parameter being used. With the aim to analyze the performance and robustness of the proposed method, a non-linear mathematical model of the DJI-F450 quadrotor is employed, where rotors dynamics, together with sensors drift/bias properties and noise characteristics of low-cost commercial sensors typically used in this type of applications are considered. In order to estimate the state vector and compensate bias/drift effects in the measures, a combination of filtering and data fusion algorithms (Kalman filter and Madgwick algorithm for attitude estimation) are proposed and implemented. Performance and robustness analysis of the control system is carried out by employing numerical simulations, which take into account the presence of uncertainty in the plant model and external disturbances. The obtained results show the proposed controller design method for multivariable PID controller is robust with respect to: (a) parametric uncertainty in the plant model, (b) disturbances acting at the plant input, (c) sensors measurement and estimation errors.

1. Introduction

Small unmanned aerial vehicles (SUAV) are used in a great variety of application fields [1,2,3]. In order to achieve the required level of performance, the vehicle must include a proper automatic control system as well as electronics, sensors, communications, and signal processing algorithms. To develop and validate the control system is very useful to count with an accurate mathematical model of the vehicle, sensors and actuators dynamics [4,5,6,7,8,9,10,11,12,13]. The present work uses the model structure exposed in [6,12,14] as a starting point but, as a novel contribution, introduces a nonlinear mathematic model (obtained experimentally) of the rotors used in the DJI F-450 quadrotor (Figure 1), that is used to perform a more detailed and realistic analysis of the control system through numerical simulations.
One crucial concern to allow the indoor operation of a SUAV is the attitude and position estimation, typically based on the use of inertial measurement units (IMU) type MEMS (MicroElectroMechanical Systems) and cameras [6,8,15,16,17,18,19,20,21]. To estimate the attitude, position and velocity state variables of the vehicle from the measurements provided by the sensors, a variety of methods are used, such as Kalman filters (KF) [6,16,22,23], extended Kalman filters (EKF) [21,22,23,24] and complementary filters [4,25] among others.
Several methods have been published to control the fly of SUAV [1,2,5,9,10,11,13,17,26,27,28,29,30,31,32,33,34,35,36,37,38,39], of which [17,30,31,33,35,36,37,38,39] use PID (Proportional Integral Derivative) controllers for attitude, altitude and/or horizontal position. However, as MIMO (Multiple-input Multiple-output) systems, the tuning of PID controllers for multi-rotor vehicles is not an easy issue. On the other hand, authors such as [5,29,30,31,32,33,34,35] use LQR/LQG (Linear Quadratic Regulator/Gaussian) control, since it allows the design of the control system considering the whole coupling of the vehicle. Even so, a deep knowledge of the system is required to tune the weighting matrices [40]. Furthermore, in practice, in order to achieve a controller faster than the classic LQR structure and robust to the errors present in the estimated state vector, some authors [31,35] use a nested control loop that combines PID and LQR controllers, which complicates the design issue. In this context, we propose a new and practical pre-tuning method based on the LQR/LQG theory for PID controllers applied to the altitude and attitude control of multirotor systems, in particular, a quadrotor. The main contribution of this work, with respect to the above techniques, is that this method of pre-tuning obtains the twelve gains of a standard control structure widely used in multirotor systems (four PID controllers: three for the attitude and one for the altitude) through the design of a MIMO LQR/LQG controller using only one pre-tuning parameter, which considerably simplifies the design problem. Therefore, our work is focused on the oriented toward applications, and specifically in the practical issue to develop a systematic method for a multivariable PID controller tuning.
Additionally, the uncertainty affecting the measurements are taken into account through the errors and noise modelling of a LIDAR, an optical flow camera, and a MEMS type MARG (Magnetic, Angular Rate, Gravity) sensor [42,43,44,45]. The attitude of the vehicle is estimated using the sensor fusion algorithm proposed in [46], whereas the altitude and the vertical velocity are estimated by means of a Kalman filter. Thus, this study considers the effects of measurement errors, including the relatively large bias and noise errors inherent to the MEMS sensors technology, and includes all the required estimation and compensation algorithms necessary for implementation in a real system. A horizontal controller is also included to analyze the influence of an external control loop over the proposed modified LQR/LQG. Next, we study the performance and the robustness of the proposed controller design method through numeric simulations, considering a non-linear model of the DJI F-450 quadrotor and the rotors non-linear dynamics obtained experimentally. The influence of uncertainty and bounded perturbations on the robustness of the control system is also tested adding parametric uncertainty and significant external disturbances.
The organization of this paper is as follows: In Section 2, the mathematical model obtained experimentally, which is used to the analysis and evaluation of the control system, is presented, followed by a simplified model used for controller design. In Section 3, the proposed design methodology to obtain the attitude and altitude control laws, as well as the employed state estimation algorithms, are described. In Section 4 address the problem of the estimation and control of the horizontal position. Section 5 provides numeric simulation results. Finally, conclusions are drawn in Section 6.

2. Mathematical Model

To carry out the synthesis and evaluation of the control system two different models of the DJI F-450 quadrotor will be developed. The first is a non-linear model to analyze and evaluate (AEM model) the designed controllers. This model incorporates the effects of the rotors dynamics and measurement errors. The second is a non-linear model for control system design (CDM model). This model includes some simplifications compared with the previous one that will lead to a linear model. The linear model is used to design the controllers and in several estimation algorithms.

2.1. Analysis and Evaluation Model (AEM)

As it was said previously, the present work uses the model structure exposed in [6,12,14] as a starting point. Figure 2 shows the Earth and Body reference frames. The translation dynamics equations are:
m u ˙ = ( cos ϕ sin θ cos ψ + sin ϕ sin ψ ) T b K d x u | u | m v ˙ = ( cos ϕ sin θ sin ψ sin ϕ cos ψ ) T b K d y v | v | m w ˙ = ( cos ϕ cos θ ) T b K d z w | w | m g T b = T 1 + T 2 + T 3 + T 4
where ( x E , y E , z E ) is the position vector of the vehicle relative to the Earth frame, ( u , v , w ) is the linear velocity ( u = x ˙ E , v = y ˙ E , w = z ˙ E ), and T b is the total thrust force generated by the four rotors relative to the Body reference frame. On the other hand, the rotational dynamics is described by:
I x x p ˙ = ( T 2 T 4 ) l q r ( I z z I y y ) I y y q ˙ = ( T 1 + T 3 ) l p r ( I x x I z z ) I z z r ˙ = N 1 2 + N 2 2 N 3 2 + N 4 2 K P ( I y y I x x ) q p ϕ ˙ = p + q s i n ( ϕ ) t a n ( θ ) + r c o s ( ϕ ) t a n ( θ ) θ ˙ = q c o s ( ϕ ) r s i n ( ϕ ) ψ ˙ = q s i n ( ϕ ) s e c ( θ ) + r c o s ( ϕ ) s e c ( θ )
where ( ϕ , θ , ψ ) represents the attitude using Euler angles, ( p , q , r ) is the angular velocity vector (measured in the Body frame), T i is the thrust force generated by the i rotor (relative to the Body frame), and N i is the rotation frequency of the i rotor (in RPM), for i { 1 , 2 , 3 , 4 } .
Table 1 shows the parameters values of the model (1) and (2), that have been obtained experimentally [47] through laboratory tests with the DJI F-450 quadrotor used in this work.
The inputs of the subsystem composed by the electronic speed controllers (ESC), the brushless motors, and the propellers are the duty-cycles values of the PWM (Pulse Width Modulation) signal applied to each ESC, D i , and its outputs are the thrust forces and torques developed by each rotor. Despite the model structure being based on that proposed by [6,12,14], its parameters have been identified to obtain a trustworthy model of these parts of the DJI F-450 quadrotor. The identification has been carried out applying step and ramp signals to the inputs ( D i ) and recording the rotation frequencies, thrusts, and torques. The following equipment has been used to accomplish the tests: a calibrated SEN-CC-FZ1439 load cell, a QDR1114 optical sensor functioning as a tachometer, an NI USB-6211 acquisition system, and an LPC4088-32 microcontroller development board. Figure 3 shows one of the experimental set-ups. The reference [47] provides further details.
Each group ESC-motor-propeller is modeled as a first-order system with delay, whose dynamics are described by
τ N ˙ ( t ) + N ( t ) = K D ( t τ d )
where τ is the system time constant, τ d is the delay, and K is the stationary gain. The values derived experimentally in the hover equilibrium condition were: τ = 0.038 s, τ d = 0.012 s y K = 82.3 R P M / % .
The experimental relations that link the rotational frequency N (in RPM) with the thrust, T, and the torque, P, developed by each rotor are given by the Equations (4) and (5), respectively.
T = K T 1 N 2 + K T 2 N
P = K P N 2
In order to carry out a realistic analysis and design, the errors and noise levels of conventional commercial sensors employed in these type of systems have been obtained from the manufacturer manuals and introduced in the model. These sensors are a PulsedLight LIDAR-LITE laser range sensor [42], an InvenSense MPU-9250 MARG [43,44], comprising a 3-Axis gyroscope, a 3-Axis accelerometer, and a 3-Axis magnetometer, and a PX4-FLOW optical flow camera [45].

2.2. Control System Design Model (CDM)

To ease the task of designing the controller, we will build a simplified model relative to the one presented in the previous section. The main differences between the two are the following:
  • The CDM model does not take into account the rotor dynamics.
  • The thrust and the torque are linear functions of the PWM signals duty-cycle.
  • The rotational dynamical model assumes relative low angular velocities and small enough Euler angles.
After applying the cited simplifications, the CDM model is defined by the system of non-linear Equations (6). Table 1 shows the parameter values of this model.
p = ϕ ˙ , q = θ ˙ , r = ψ ˙ I x x p ˙ = U ϕ q r ( I z z I y y ) I y y q ˙ = U θ p r ( I x x I z z ) I z z r ˙ = U ψ q p ( I y y I x x ) u = x ˙ E , v = y ˙ E , w = z ˙ E m u ˙ = ( cos ϕ sin θ cos ψ + sin ϕ sin ψ ) U z K d x u | u | m v ˙ = ( cos ϕ sin θ sin ψ sin ϕ cos ψ ) U z K d y v | v | m w ˙ = ( cos ϕ cos θ ) U z K d z w | w | m g
The relations between the components of the U and D vectors (the duty-cycles of the four PWM signals) is defined by [6]:
U ϕ U θ U ψ U z U = 0 K f l 0 K f l K f l 0 K f l 0 K P K P K P K P K f K f K f K f M D 1 D 2 D 3 D 4 D
where D is the vector of duty-cycles, and the components of U are the fictitious control signals U ϕ , U θ , U ψ y U z that allows split control of the attitude ( ϕ , θ , ψ ) and the altitude (z) variables. Thus, we can choose between considering the whole 4 × 4 MIMO problem or one 3 × 3 MIMO attitude problem plus one SISO altitude problem instead. The next section elaborates on the first option.

3. Attitude and Altitude Control System

The main objective of this system is the stabilization (hovering) of the vehicle at a certain altitude. Hovering is a manoeuvre in which the quadrotor is maintained in nearly motionless flight over a reference point at a constant altitude and on a constant heading. In order to control the vehicle, the complexity of the system and the strong coupling that exists between the manipulated variables and the controlled variables have been taken into account. Therefore, a multivariable control approach based on state space has been considered [40,48,49]. As a novel contribution of this work for multivariable PID tuning, it is proposed to use a modified LQR/LQG control law, in which feedback is performed considering the tracking error between the state vector and a setpoint or reference state vector. ISpecifically, for the design of the attitude and altitude controller the following state vector, X , is considered:
X T = ϕ θ ψ z E p q r w
The manipulated variables (MV) vector, U , is composed of the four components U ϕ , U θ , U ψ , and U z given in (6). The process variables (PV) vector, or controlled variables (CV) vector, is given by,
Y T = ϕ θ ψ z E
An equilibrium condition for hovering at an altitude z e q is characterized by,
X e q T = 0 0 0 z e q 0 0 0 0 , U e q T = 0 0 0 U z e q , Y e q T = 0 0 0 z e q
Linearizing the eight non-linear differential equations of the quadrotor model (6) for hover condition, ( X e q , U e q , Y e q ), and considering incremental (or deviation) variables with respect to equilibrium point,
x = X X e q , u = U U e q , y = Y Y e q
the linearized system dynamics is defined by (12).
x ˙ = A x + B u y = C x
In order to add integral action to the controller, the system model is modified including four new state variables corresponding to the integral of the tracking error of the controlled variables, resulting in the following augmented state vector,
x A = x x I
where x ˙ I = r y , and r is the incremental value of the set-point vector, r = Y S P Y S P e q . Therefore, the augmented system matrices are given by,
A a = A 0 C 0 , B a = B 0 , C a = C 0
The conventional LQR control law with integral action (incremental vector value) is given by,
u = K c x + K I x I
and the controller output (CO) vector ( U ) is obtained by,
U = U e q + u
For that, the feedback gain matrices, K c and K I , must be calculated solving the corresponding algebraic Riccati equation (AREc) [40,48,49], which results from the optimization problem of minimizing a cost function given by,
J = 0 x T Q c x + u T R c u d t
where Q c and R c are the named weighting matrices.
With the LQR controller, the linearized closed-loop control system dynamics (which is an approximation of the nonlinear system for a neighborhood of the equilibrium point defined by the hover condition) is given by,
x ˙ x ˙ I = ( A a B a K c a ) A y r x x I + B y r r , K c a = ( K c K I )
A proposal made in this work is to modify the conventional LQR structure given in (15), where the new control law is defined by,
u = K c ( x S P x ) + K I x I
where x S P represents the incremental reference (or set-point) state vector to follow,
x S P T = ϕ S P θ S P ψ S P z S P p S P q S P r S P w S P
The proposed control law (19) gets the same poles for the closed-loop linearized system obtained with (15), but achieves to reduce the time response of the system to set-point changes due to (19) modifies the zeros of the closed-loop system reached with (15).

3.1. Pre-Tuning Method for Attitude and Altitude Controller

The aim of a pre-tuning procedure is to determine Q c and R c weighting matrices in (17) for which a suitable solution is obtained. For that, diagonal weighting matrices have been chosen,
Q c = d i a g ( q ϕ , q θ , q ψ , q z , q p , q q , q q , q r , q I ϕ , q I θ , q I ψ , q I z )
R c = diag ( ρ ϕ , ρ θ , ρ ψ , ρ z )
Taking into account experimental (computer simulations) observations of the closed-loop system, and physical meaning of the relative values used in the elements of the weighting matrices, the following relations are proposed as a starting point:
q θ = q ϕ , q ψ = q ϕ / 7 , q z = q ϕ / 35
q p = q ϕ / 70 , q q = q p , q r = q p / 5 , q w = q p
q I ϕ = q p / 2 , q I θ = q I ϕ , q I ψ = q I ϕ / 5 , q I z = q I ϕ
ρ ϕ = q ϕ / 4 , ρ θ = ρ ϕ , ρ ψ = ρ ϕ / 3 , ρ z = ρ ϕ / 30
in this way, for a given q ϕ parameter value, the rest of the weighting parameters are calculated for the pre-tuning controller. In practice, due to non-linear dynamics and parameter uncertainty, it is necessary to make a fine-tuning to achieve adequate performance and robustness properties, which is made experimentally in an iterative way.
In order to analyze the properties of the proposed controller, an illustrative example is shown below, where the following tuning parameters have been adjusted experimentally,
Q c = diag ( 350 , 350 , 50 , 10 , 4 , 5 , 1 , 4 , 3 , 3 , 1 , 4 )
R c = diag ( 88 , 88 , 32 , 3 )
With these weighting matrices, the following state feedback matrices, K c and K i , are obtained,
K c = 2.9394 0.0000 0.0000 0.0000 0.3174 0.0000 0.0000 0.0000 0.0000 2.9408 0.0000 0.0000 0.0000 0.3401 0.0000 0.0000 0.0000 0.0000 0.5024 0.0000 0.0000 0.0000 0.1542 0.0000 0.0000 0.0000 0.0000 2.7333 0.0000 0.0000 0.0000 2.8867
K I = 0.1846 0.0000 0.0000 0.0000 0.0000 0.1846 0.0000 0.0000 0.0000 0.0000 0.0079 0.0000 0.0000 0.0000 0.0000 1.2247
In order to analyze the effect of the modified LQR control law, in Figure 4 we show a comparison between the time response of the linearized system employing the conventional control law (15) and the proposed control law (19) in this paper. In both cases the initial state vector x i T ( 0 ) = ( 0.1 , 0.3 , π , 1 , 0 , 0 , 0 , 0 ) , is expressed in the International System of Units. As can be seen, the control law (19) achieves a significantly faster time response.
The proposed controller can be interpreted as a multivariable PID controller for a MIMO (4 × 4) system, taking into account that the K c matrix can be expressed as
K c = [ K P K D ] K P = 2.9394 0.0000 0.0000 0.0000 0.0000 2.9408 0.0000 0.0000 0.0000 0.0000 0.5024 0.0000 0.0000 0.0000 0.0000 2.7333 , K D = 0.3174 0.0000 0.0000 0.0000 0.0000 0.3401 0.0000 0.0000 0.0000 0.0000 0.1542 0.0000 0.0000 0.0000 0.0000 2.8867
where the respective K P , K D (29) and K I (30) matrices are practically diagonal matrices, and therefore they can be approximated by
K P = K P ϕ 0 0 0 0 K P θ 0 0 0 0 K P ψ 0 0 0 0 K P z , K I = K I ϕ 0 0 0 0 K I θ 0 0 0 0 K I ψ 0 0 0 0 K I z , K D = K D ϕ 0 0 0 0 K D θ 0 0 0 0 K D ψ 0 0 0 0 K D z
With these approximations, the PID control laws (using Laplace transform domain) for the components of the controller out vector are given by,
u ϕ ( s ) = K P ϕ e ϕ ( s ) + K I ϕ s e ϕ ( s ) + s K D ϕ e ϕ ( s ) u θ ( s ) = K P θ e θ ( s ) + K I θ s e θ ( s ) + s K D θ e θ ( s ) u ψ ( s ) = K P ψ e ψ ( s ) + K I ψ s e ψ ( s ) + s K D ψ e ψ ( s ) u z ( s ) = K P z e z ( s ) + K I z s e z ( s ) + s K D z e z ( s )
where e ϕ , e θ , e ψ , and e z are the respective tracking error signals for the controlled variables, ϕ , θ , ψ and z E . Figure 5 shows block diagrams with the conventional LQR and the modified LQR control law proposed in ths work.
Once the controller output vector U has been calculated, the duty cycle vector, D for the PWM signals applied to motors are obtained taking into account Equation (7),
D = M 1 U
In order to implement the proposed algorithm, all state variables are needed for feedback. For that, and taking into account the characteristics of the system to control, low-cost commercial sensors characteristics are used in computer simulations based on data sheets given by manufacturers. A MARG (Magnetic, Angular Rate, and Gravity) sensors system (MPU-9250 model, with 3-axes accelerometer, rate-gyro, and magnetometer) is used for attitude and orientation measurements ([43,44]). A LIDAR (Light Detection and Ranging) is used for altitude measurement [42]. Due to bias/drift effects acting on measurements given by inertial sensors, compensation algorithms must be considered as described in the next section.

3.2. Attitude Estimation

In order to achieve proper control of the system, it is very important to have accurate enough attitude measurements. The references [50,51] compare the performance of three sensor fusion algorithms that use the MARG measurements for attitude estimation. These are an extended Kalman filter (EFK), the non-linear complementary filter (NLCF) described in [25], and the error optimization algorithm detailed in [46] based on the gradient descent method (MHV). Table 2 shows the relative computation times on a typical embedded system as well as the RMS errors for the three algorithms. This work uses the MHV algorithm since it has a good compromise between computation cost and estimation errors.
In each sample interval, the MHV algorithm proceeds first finding the best alignment between the gravity and Earth magnetic vectors and those measured by the accelerometer and the magnetometer, respectively. To get that optimal alignment of these two pairs of vectors despite the presence of measurement errors the MHV algorithm uses the gradient descent method. The output of this stage is a quaternion ( E B q ˙ w , t ) presenting the rate of change of the attitude. This quaternion is then combined with the obtained from the angular velocity measured by the gyroscope ( E B q ˙ w , t ) to calculate a better estimation (Figure 6) using
E B q ˙ e s t , t = E B q ˙ w , t β E B q ^ ˙ e , t ,
where β is an adjustable weighting factor representing the gyroscope measurement error expressed as the magnitude of a quaternion derivative. The algorithm also copes with the effects of magnetic disturbances and the bias present in the gyroscope.
The angular velocity vector (p, q, r) is supposed to be taken directly from the gyroscope output and, for simulation purposes, is degraded with the noise levels stated in the datasheet [43].

3.3. Estimation of Linear Velocity and Position in Axis z E

The sensor LIDAR-LITE [42] gives a measurement from the quadrotor to ground, which can be used for estimating the vertical velocity and position. For that, taking into account the model given in (6), only the equations corresponding to z ˙ E and w ˙ are considered, and it is supposed that ϕ and θ take values next to zero (which is a good approximation for hover manoeuvre); with what turns out Equation (36).
w ˙ = 1 m ( U z K d z w | w | ) g z ˙ E = w
If (36) is linearized for hover condition ( w e q = 0 , z e q = 0 , U z e q ), a linear Kalman filter (KBF) can be used for w , z E estimation. Covariance matrices, ( Q o , R o ) must be adjusted to obtain a satisfactory KBF. For that, an experimental iterative procedure has been applied, obtaining the following matrices, where R o takes into account the noise measurement gives by [42],
Q o = 200 0 0 0.001 , R o = 0.05
The stationary observer gain matrix, K o , can be obtained solving the corresponding observer algebraic Riccati equation (AREo) [40,48,49]. In this way, results in an LQG controller, and the complete attitude-altitude controller is a combination of LQR (for attitude control) and LQG controller (for altitude control), called, in this work, LQR/LQG. A block diagram with the complete structure of the control system is shown in Figure 7.

4. Horizontal Position Controller

Although the purpose of this article is to design a control system for the attitude and altitude (AAC) of a quadrotor, a horizontal position control (HPC) loop is included below in order to test the complete system when the attitude set-point is generated by an additional control loop whose objective is to control the position with respect to the horizontal plane. For that two scalars (SISO) PID controllers are used. The tuning of these PIDs are out of the objectives of this paper, and they are only used for testing the AAC integrated with an external control loop. As it is shown in Figure 7, the PID controllers for HPC generate as control signals the set-points for ϕ S P and θ S P for the AAC. The output magnitudes of the set-points generate by the PIDs of the HPC are limited to avoid unnecessary pitch and roll angles, as it is shown in Figure 7. The blocks indicated as Filters correspond to first order low-pass filters used for smoothing the set-point changes sent to the controllers.
Equation (38) shows the control laws generated by the PIDs with filter to derivative action, employing the Laplace transform notation. Controllers parameters have been obtained experimentally, and are given in Table 3 (the negative sign is due to the sign criteria used for ϕ and y B , see Figure 2).
S P ϕ ( s ) = K P e y B ( s ) + K I s e y B ( s ) + K D s τ f D s + 1 e y B ( s ) S P θ ( s ) = K P e x B ( s ) + K I s e x B ( s ) + K D s τ f D s + 1 e x B ( s )
where e x B and e y B are the error components of the horizontal position vector ( e H ) which are referenced to the body-axis reference system.
The horizontal positioning error can be referenced with respect to the body-axes reference system, e H ( e x B , e y B ), as well as to the Earth-axes reference system, e H ( e x E , e y E ). For small values of ϕ and θ angles, the relation between the horizontal coordinates is given by,
e x B e y B = cos ( ψ ) sin ( ψ ) sin ( ψ ) cos ( ψ ) e x E e y E

Horizontal Position Estimation

The horizontal position estimation of the quadrotor derives from a CMOS optical flow camera model PX4FLOW [45] pointing down. This camera computes a displacement vector utilizing the correlation between successive images, so its output is expressed in pixels units and not in real units. To compute the truth velocity is necessary to take into account the focal length of the camera lens as well as the distance from the camera to the floor, or altitude, that is already available from the LIDAR, as is shown in Equation (40). Also, the horizontal velocity has to be rotated (41) taking into account the ψ angle estimated previously to refer it to the Earth frame. Then, the horizontal velocity is integrated to get the final horizontal position in that frame ( x E , y E ).
v x B v y B = v x v y z f
where z is the distance to the floor and f is the focal distance of the camera lens. The manufacturer states that the average error in the camera output is zero, so the position measurement drift should be negligible.
v x E v y E = cos ( ψ ) sin ( ψ ) sin ( ψ ) cos ( ψ ) v x B v y B

5. Results

This section presents the results obtained, in a realistic simulation scenario, when analyzing the LQR/LQG controller modified for the attitude and the altitude proposed in this paper. For this purpose, an analysis of the performance of this control system is carried out by applying it to the AEM model of the quadrotor. The non-linear AEM model, (1) and (2), also takes into account: rotor dynamics (3), measurement errors [42,43,44,45], the effect of estimation algorithms (MHV and KBF) and the effect of adding an external control loop for the horizontal position (38) of the quadrotor. This framework is illustrated in Figure 7, which shows the interaction between measurements provided by sensors, estimation algorithms, and controllers. It should be mentioned that in all the simulations presented the numerical integration method of Runge-Kutta of fourth order with an integration step of 0.1 ms has been used. The estimation (MHV and Kalman filter) and control algorithms are executed at a frequency of 400 Hz in simple arithmetic precision. The discretization of the controllers and the Kalman filter is carried out using the Euler backward method, and β = 0.01 is used in the MHV algorithm for fusion of sensor data. To conclude, a robustness analysis of the attitude and altitude control system to parametric uncertainty and to different types of external disturbances has been realized.
Before the attitude and altitude control performances are analysed, the MARG MPU-9250 sensor modelling is shown in Figure 8. As can be seen, all measurements are affected by noise and bias levels according to the values indicated by the manufacturer [43]. In addition, in the case of accelerometers, the measurement provided ( a x m ) is affected by both gravity ( a x g ) and the linear accelerations experienced by the quadrotor ( a x l ). This consideration has a negative effect on the estimation of the attitude made by the MHV algorithm, which can be seen in Figure 9. As a comparison, this figure also shows the result of integrating the angular velocities provided by the MARG directly to estimate the attitude. This integration diverges with time due to the bias effect present in the measured angular velocities ( p m , q m , r m ). On the other hand, the Kalman Filter for altitude and linear velocity w gets to estimate these state variables accurately, see Figure 10. This is in part due to the quality of the measurements provided by the sensor Lidar-Lite [42]. Once the estimated/measured state vector is presented, it can be pointed out that the most negative effect is present in the attitude estimation; the attitude controller must be robust to the coupling presented between the estimate of the angles ( ϕ , θ ) and the linear accelerations experienced by the quadrotor.
Using the state vector used for the attitude and altitude controller feedback presented here, the results obtained when applying this controller to the AEM mathematical model are shown. In Figure 11 it can be seen how the modified LQR/LQG control shows that the system follows the setpoints requested for ( ϕ , θ , ψ , z) adequately, despite measurement errors (Figure 8), estimation errors (Figure 9 and Figure 10) and uncertainty in the AEM model with respect to the linear design model. It should be noted that for both attitude and altitude, the error between the estimated variable and the requested setpoint is quite small ( ± 0.2 degrees for ϕ e s t and θ e s t ). Therefore, if sensors and/or estimation algorithms of superior performance are available, the following of setpoints carried out by this controller would have a considerable improvement margin. The duty cycles (D) generated by the modified LQR/LQG controller to get the above tracking are shown in Figure 12.
On the other hand, most high-level applications of SUAV systems require the vehicle to be able to track position commands in space or maintain static positions. Therefore, it is necessary to validate the attitude and altitude controller proposed in this paper by adding an external control loop (38) for the horizontal position of the system. As shown in Figure 13, the closed-loop system resultant gets a satisfactory tracking of the setpoints demanded by the positions ( x E , y E , z E ). Even with the estimation errors committed by the MHV algorithm (due to the linear accelerations experienced by the system), the modified LQR/LQG control successfully follows the setpoints rapidly ( ϕ s p and θ s p ) demanded by the horizontal position controller. Furthermore, the proposed control structure is valid for tracking complex trajectories. Figure 14 shows the position in the quadrotor space when tracking ascending circular paths. It can be seen that despite the coupling of the system and the errors present in the estimates and measurements, the results obtained can be considered satisfactory in terms of stabilization and setpoint tracking, although they can be improved by fine-tuning the controllers.

5.1. Robustness Analysis

In order to study the robustness of the modified LQR/LQG structure proposed in this work, for the pre-tuning of PID controllers applied to quadrotor systems, an analysis of attitude and altitude control is performed by adding: parametric uncertainty to the system inertia (which will determine the system response speed) and parametric uncertainty to the gain of the SISO model identified for the rotors. On the other hand, the robustness of the modified LQR/LQG control by exposing the quadrotor system to significant external disturbances (torques and forces) is also studied. Furthermore, in both cases, all measurement/estimation errors presented in the previous section are considered.

5.1.1. Parametric Uncertainty Robustness Analysis

In this analysis, the nominal inertia moments ( I n o m ) of the AEM model (Analysis and Evaluation Model, see Table 1) have been multiplied by a factor, I = I n o m ( 1 + Δ I ) , which takes into account the level of uncertainty. The study focuses on this parameter because I x and I y are the ones that determine the fastest dynamics of the quadrotor and, therefore, those that affect in greater measure to the system when determining the performance of the attitude control. The study of the added uncertainty in the mass of the system has not been carried out, since this can be known with sufficient precision and does not vary with time. As result of the study, Table 4 shows the values obtained when calculating the IAE (Integrated Absolute Error) of all controlled variables (x, y, z, ϕ , θ , ψ ) in function of the uncertainty added to the inertia moments ( I a d d = Δ I × 100 % ). In addition, it records the IAu (Integrated Absolute) of the incremental variable u, which is defined as the sum of the incremental duty cycles (d) with respect to the equilibrium condition ( D eq ). All the simulations carried out to obtain the values listed in Table 4 are reproductions of the one shown in Figure 13 and, moreover, the time interval used for its computation is equal to the sampling time ( T m = 2.5 ms). As visual support to the above, Figure 15 shows the variation of the IAE attitude-altitude indicators and the IAu control effort indicator.
As can be seen, the low variation of the indicators for uncertainty levels close to the nominal value ([−17.5, 17.5]%) shows that the modified LQR/LQG controller, together with the horizontal position controller, presents robust behaviour to the uncertainty added to this parameter. Furthermore, the control system achieves to stabilize the system with acceptable stationary error values ( ± 0.5 ° for attitude and ± 0.04 m for position) in an uncertainty range of [−19.5, 80]%, see Figure 16. Secondly, it should be noted that the magnitude of the IAE indicators decreases considerably if these are calculated with respect to the estimated variables, see Table 5. This supports the previously mentioned, the results obtained when applying the control structure proposed in this work to the AEM model have a considerable margin of improvement if the quality of the measures/estimates is increased.
To conclude, Figure 17 shows the results obtained by adding a parametric uncertainty to: the inertia moments ( I a d d = 10 % ) and the gains of the SISO models identified for the rotors, Δ K R = ( 4 , 6 , 3.2 , 2.9 ) % . As can be seen, the modified LQR/LQG controller and the position controller follow the setpoints demanded in an acceptable way, although they present an increase in overshoot and tracking error than the one obtained in Figure 13 (under the absence of added parametric uncertainty). The negative value chosen for the uncertainty added to the moments of inertia has been fixed to obtain an unfavourable situation. Since, as shown by the indicators in Table 4 and Table 5 and in Figure 15, lower inertia moments make the system faster and, therefore, if the control system is not adjusted, its performance decreases.

5.1.2. External Disturbance Robustness Analysis

In this section, the robustness to significant external disturbances of the modified LQR/LQG control proposed in this paper is studied. First, a scenario in which the AEM model is subjected to external torques that increase until a constant value is established, adding to these torques a stochastic component (simulating a continuous wind). Furthermore, in the same scenario, a significant increase in weight is applied to the quadrotor (one-third of its weight) in order to simulate a manoeuvre in which the quadrotor system would elevate a load outdoors for then transport it. The results obtained when carrying out the hover manoeuvre in this scenario are presented in Figure 18.
As shown in the figure above, external disturbances are successfully rejected by the attitude and altitude controller, although the rejection time could be improved if fine-tuning to the integral action of the controllers is carried out. It should be added that the stochastic component of the disturbances increases the oscillation in the controlled variables. Especially in the angles ϕ and θ , although in this scenario this oscillation can be considered admissible, since it is bounded between [ 0.5 , 0.5 ] degrees. The duty cycles generated by the modified LQR/LQG control system and the applied external disturbances are shown in Figure 19.
Finally, another scenario in which the quadrotor system is exposed to occasional external disturbances (of significant magnitude) while performing the hover manoeuvre is considered. This scenario can occur in obstacle avoidance and path planning missions, in which SUAV systems are often used. Specifically, the external torques and forces to which the AEM model is exposed could be the result of punctual collisions with different obstacles, as a result of a fault in the avoidance system, see Figure 20 and Figure 21. In addition, in order to create an unfavorable scenario, an uncertainty of I a d d = 10 % has been added to the inertia moments of the AEM model and an uncertainty Δ K R = ( 2.5 , 2 , 2.3 , 2.2 ) % is also added to the gains of the SISO models identified for the rotors.
In this last scenario, the magnitude of the external punctual torques makes that the system deviates considerably (25 and 22.5 degrees in the angles ϕ and θ , respectively) from the equilibrium position hover, for which the modified LQR/LQG control has been designed. Moreover, the punctual torque on the z B axis causes an undesired turn of 45 degrees on the ψ angle. However, the attitude control system is able to correct the effect of these punctual disturbances (shown in Figure 21) and return the system to its equilibrium point (hover). It should be added that the altitude control also achieves to reject the force maintained for 16 s on the z E axis. To reject this set of disturbances, the controller generates the duty cycles for the PWM signals shown in Figure 21. Therefore, the robustness of the modified LQR/LQG controller has been checked under the presence of significant punctual disturbances and added parametric uncertainty.

5.2. First Pre-Tuning Tests on the Real System

In order to validate the pre-tuning method proposed in this work, the initial results obtained when implementing the set of algorithms presented in the real quadrotor DJI F-450 are shown. Note that it is not the object of this work to compare the proposed method with alternative methods; this will be studied in future works. In this section, we only want to show the validity of the proposed method through its implementation in a real system. The results obtained can be improved by fine-tuning. With the limitations of these real tests established, it should be added that the embedded system has been implemented on the PCB whose schematic with the main parts is shown in Figure 22.
Figure 23 shows the behaviour of the multirotor for setpoint changes in altitude (where z s p and z e s t denote setpoint and estimated variable, respectively). An acceptable average tracking error is obtained for a pre-tuning stage, and the maximum transient error is limited to ± 0.07 m.
Figure 24 shows the attitude ( ϕ , θ , ψ ) of the quadrotor during takeoff (where the subindex S P and e s t denote setpoint and estimated variable, respectively). As it can be seen, the modified LQR controller needs a few seconds to get that the quadrotor follows the attitude setpoints demanded. After this transitory, the system follows the demanded setpoints with a tracking error bounded between ± 2 degrees. These results are less favorable than those obtained with the simulated model but could be improved by fine-tuning the controller. This is due to the fact that there will always be differences between the real system and the simulation. These differences are mainly due to the uncertainty in the model used for design, as well as possible disturbances acting on the system. Finally, [52] presents a video in which the real quadrotor system is affected by significant external disturbances. As can be seen in this video, the pre-tuning method proposed in this work obtains a robust attitude and altitude controller to significant external disturbances.

6. Conclusions

A method for pre-tuning a multivariable PID controller for a quadrotor attitude and altitude control has been proposed, which is based on LQR/LQG theory, using a modified structure of the LQR, where the state feedback algorithm employs the tracking error vector instead of the state vector. The proposed method uses only one pre-tuning parameter, which easily facilitates the controller design. Realistic computer simulations have been carried out using a nonlinear mathematical model of the DJI-F450 quadrotor, considering parametric uncertainty and external disturbances acting at the plant input. Madgwick’s algorithm and a Kalman filter have been used for data fusion and estimating state variables using data from MARG, LIDAR, and optical flow camera, which have been simulated using data sheets provided by manufactures. Simulation results show that the proposed method design gives MIMO PID controllers which are robust in the face of uncertainties and external disturbances acting at plant input.

Author Contributions

R.G. was responsible for designing and simulating the controllers and estimation algorithms, studying them and writing most of the work. M.J.L. and V.M.S. actively contributed throughout the modelling of the quadrotor system and the design of the algorithms, reviewed all the work done and wrote part of the document. Furthermore, M.J.L. and V.M.S. proposed the control problems to solve using the proposed pre-tuning technique and the attitude estimation algorithm applied.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Valavanis, K.; Vachtsevanos, G.J. Handbook of Unmanned Aerial Vehicles, 1st ed.; Springer: Dordrecht, The Netherlands, 2015; ISBN 978-90-481-9706-4. [Google Scholar]
  2. Lozano, R. Unmanned Aerial Vehicles: Embedded Control, 1st ed.; Wiley-ISTE: Hoboken, NJ, USA, 2010; ISBN 1848211279. [Google Scholar]
  3. Nonami, K.; Kendoul, F.; Suzuki, S.; Wang, W.; Nakazawa, D. Autonomous Flying Robots: Unmanned Aerial Vehicles and Micro Aerial Vehicles, 1st ed.; Springer: Tokyo, Japan, 2010; ISBN 978-4-431-53855-4. [Google Scholar]
  4. Mahony, R.; Kumar, V.; Corke, P. Multirotor Aerial Vehicles. IEEE Robot. Autom. Mag. 2012, 19, 20–32. [Google Scholar] [CrossRef]
  5. Peña, M.; Vivas, C.E.; Rodriguez, C. Modelamiento Dinámico y control LQR de un Quadrotor. AVANCES Investig. Ing. 2010, 13, 71–86. [Google Scholar] [CrossRef]
  6. Li, J.; Li, Y. Dynamic Analysis and PID Control for a Quadrotor. In Proceedings of the IEEE International Conference on Mechatronics and Automation, Beijing, China, 7–10 August 2011; pp. 573–578. [Google Scholar]
  7. Xiong, J.; Zheng, E. Optimal Kalman Filter for state estimation of a quadrotor UAV. Opt. Int. J. Light Electron. Opt. 2015, 126, 2862–2868. [Google Scholar] [CrossRef]
  8. Fernando, H.C.T.E.; De Silva, A.T.A.; De Zoysa, M.D.C.; Dilshan, K.A.D.C.; Munasinghe, S.R. Modelling, Simulation and Implementation of a Quadrotor UAV. In Proceedings of the IEEE 8th International Conference on Industrial and Information Systems, Peradeniya, Sri Lanka, 17–20 December 2013; pp. 207–212. [Google Scholar]
  9. Lozano, Y.; Gutiérrez, O. Design and Control of a Four-Rotary-Wing Aircraft. IEEE Lat. Am. Trans. 2016, 14, 4433–4438. [Google Scholar] [CrossRef]
  10. Castillo, P.; Lozano, R.; Dzul, A. Stabilization of a Mini Rotorcraft with Four Rotors. Experimental implementation of linear and nonlinear control laws. IEEE Control Syst. Mag. 2005, 25, 45–55. [Google Scholar] [CrossRef]
  11. Xiong, J.; Zheng, E. Position and attitude tracking control for a quadrotor UAV. ISA Trans. 2014, 53, 725–731. [Google Scholar] [CrossRef] [PubMed]
  12. Rubio, J.D.J.; Cruz, J.H.P.; Zamudio, Z.; Salinas, A.J. Comparison of Two Quadrotor Dynamic Models. IEEE Lat. Am. Trans. 2014, 12, 531–537. [Google Scholar] [CrossRef]
  13. Reinoso, M.; Minchala, L.I.; Ortiz, J.P.; Astudillo, D.; Verdugo, D. Trajectory tracking of a quadrotor using sliding mode control. IEEE Lat. Am. Trans. 2016, 14, 2157–2166. [Google Scholar] [CrossRef]
  14. Gómez, M.; Pérez, M.; Puentes, C. MÉCANICA DEL VUELO, 2nd ed.; Ibergarceta Publicaciones S.L.: Madrid, Spain, 2012; ISBN 978-84-15452-01-0. [Google Scholar]
  15. Altug, E.; Ostrowski, J.P.; Mahony, R. Control of a Quadrotor Helicopter Using Visual Feedback. In Proceedings of the 2002 IEEE International Conference on Robotics and Automation, Washington, DC, USA, 11–15 May 2002; pp. 72–77. [Google Scholar]
  16. Azfar, A.Z.; Hazry, D. A Simple Approach on Implementing IMU Sensor Fusion in PID Controller for Stabilizing Quadrotor Flight Control. In Proceedings of the IEEE 7th International Colloquium on Signal Processing and Its Applications, Penang, Malaysia, 4–6 March 2011; pp. 28–32. [Google Scholar]
  17. Lee, K.U.; Kim, H.S.; Park, J.B.; Choi, Y.H. Hovering Control of a Quadrotor. In Proceedings of the International Conference on Control, Automation and Systems, JeJu Island, Korea, 17–21 October 2012; pp. 162–167. [Google Scholar]
  18. Zhih, C.C.; Kumar, S.; Ragavan, V.; Shanmugavel, M. Development of a Simple, Low-cost Autopilot System for Multi-rotor UAVs. In Proceedings of the IEEE Recent Advances in Intelligent Computational Systems, Trivandrum, India, 10–12 December 2015; pp. 285–289. [Google Scholar]
  19. Tang, Y.; Li, Y.; Ma, T. Design, Implementation and Control of a Small-scale UAV Quadrotor. In Proceedings of the World Congress on Intelligent Control and Automation, Shenyang, China, 29 June–4 July 2014; Volume 183, pp. 2364–2369. [Google Scholar]
  20. Burri, M.; Dätwiler, M.; Achtelik, M.W.; Siegwart, R. Robust State Estimation for Micro Aerial Vehicles Based on System Dynamics. In Proceedings of the IEEE International Conference on Robotics and Automation, Seattle, WA, USA, 26–30 May 2015; pp. 5278–5283. [Google Scholar]
  21. Oh, K.; Ahn, H. Extended Kalman Filter with Multi-frequency Reference Data for Quadrotor Navigation. In Proceedings of the International Conference on Control, Automation and Systems, Busan, Korea, 13–16 October 2015; pp. 201–206. [Google Scholar]
  22. Kong, X.; Li, J.; Yu, H.; Wu, W. Robust Kalman Filtering for Attitude Estimation Using Low-cost MEMS-based Sensors. In Proceedings of the IEEE Chinese Guidance, Navigation and Control Conference, Yantai, China, 8–10 August 2014; pp. 2779–2783. [Google Scholar]
  23. Gasior, P.; Bondyra, A.; Gardecki, S.; Giernacki, W. Robust estimation algorithm of altitude and vertical velocity for multirotor UAVs. In Proceedings of the 21st International Conference on Methods and Models in Automation and Robotics, Miedzyzdroje, Poland, 29 August–1 September 2016; pp. 714–719. [Google Scholar]
  24. Abeywardena, D.; Kodagoda, S.; Dissanayake, G.; Munasinghe, R. Improved State Estimation in Quadrotor MAVs. IEEE Robot. Autom. Mag. 2013, 20, 32–39. [Google Scholar] [CrossRef]
  25. Mahony, R.; Hamel, T.; Pflimlin, J. Nonlinear Complementary Filters on the Special Orthogonal Group. IEEE Trans. Autom. Control 2008, 53, 1203–1218. [Google Scholar] [CrossRef]
  26. Almeshal, A.M.; Alenezi, M.R. A Vision-Based Neural Network Controller for the Autonomous Landing of a Quadrotor on Moving Targets. Robotics 2018, 7, 15. [Google Scholar] [CrossRef]
  27. Raffo, G.V.; Ortega, M.G.; Rubio, F.R. An integral predictive/nonlinear H control structure for a quadrotor helicopter. Automatica 2010, 46, 29–39. [Google Scholar] [CrossRef]
  28. Lee, K.; Choi, Y.; Park, J. Inverse Optimal Design for Position Control of a Quadrotor. Appl. Sci. 2017, 7, 907. [Google Scholar] [CrossRef]
  29. Mukhopadhyay, S. PID equivalent of optimal regulator. Electron. Lett. 1978, 14, 821–822. [Google Scholar] [CrossRef]
  30. Argentim, L.M.; Rezende, W.C.; Santos, P.E.; Aguiar, R.A. PID, LQR and LQR-PID on a Quadcopter Platform. In Proceedings of the International Conference on Informatics, Electronics and Vision, Dhaka, Bangladesh, 17–18 May 2012; pp. 1–6. [Google Scholar]
  31. Salim, N.D.; Derawi, D.; Shah Abdullah, S.; Mazlan, S.A.; ZamZuri, H. PID plus LQR Attitude Control for Hexarotor MAV in Indoor Environments. In Proceedings of the IEEE International Conference on Industrial Technology, Busan, Korea, 26 February–1 March 2014; pp. 85–90. [Google Scholar]
  32. Reyes-valeria, E.; Enriquez-caldera, R.; Camacho-lara, S.; Guichard, J. LQR Control for a Quadrotor using Unit Quaternions: Modeling and Simulation. In Proceedings of the 23rd International Conference on Electronics, Communications and Computing, Cholula, Mexico, 11–13 March 2013; pp. 172–178. [Google Scholar]
  33. Khatoon, S.; Gupta, D.; Das, L.K. PID and LQR Control for a Quadrotor: Modeling and Simulation. In Proceedings of the International Conference on Advances in Computing, Communications and Informatics, New Delhi, India, 24–27 September 2014; pp. 796–802. [Google Scholar]
  34. Belkheiri, M.; Rabhi, A.; Hajjaji, A.E.L.; Pégard, C.P. Different Linearization Control Techniques for a Quadrotor System. In Proceedings of the CCCA12, Marseilles, France, 6–8 December 2012; pp. 1–6. [Google Scholar]
  35. Yu, B.; Zhang, Y.; Qu, Y. Fault Tolerant Control Using PID Structured Optimal Technique Against Actuator Faults in a Quadrotor UAV. In Proceedings of the International Conference on Unmanned Aircraft Systems, Orlando, FL, USA, 27–30 May 2014; pp. 167–174. [Google Scholar]
  36. González-Vázquez, S.; Moreno-Valenzuela, J. A new nonlinear PI/PID controller for quadrotor posture regulation. In Proceedings of the 2010 Electronics, Robotics and Automotive Mechanics Conference (CERMA), Morelos, Mexico, 28 September–1 October 2010; pp. 642–647. [Google Scholar]
  37. Alcan, G.; Unel, M. Robust hovering control of a quadrotor using acceleration feedback. In Proceedings of the 2017 International Conference on Unmanned Aircraft Systems (ICUAS), Miami, FL, USA, 13–16 June 2017; pp. 1455–1462. [Google Scholar]
  38. Moreno-Valenzuela, J.; Perez-Alcocer, R.; Guerrero-Medina, M.; Dzul, A. Nonlinear PID-Type Controller for Quadrotor Trajectory Tracking. IEEE/ASME Trans. Mechatron. 2018, 23, 2436–2447. [Google Scholar] [CrossRef]
  39. Dong, J.; He, B. Novel fuzzy PID-type iterative learning control for quadrotor UAV. Sensors 2019, 19, 24. [Google Scholar] [CrossRef] [PubMed]
  40. Ogata, K. Ingeniería de Control Modernaê, 5th ed.; PEARSON EDUCACIÓN S.A.: Madrid, Spain, 2010; ISBN 9788483226605. [Google Scholar]
  41. DJI. Available online: www.dji.com (accessed on 4 May 2015).
  42. PulsedLight. LIDAR-Lite Operating Manual; Rev 1.0; PulsedLight: Bend, OR, USA, 2 December 2014. [Google Scholar]
  43. InvenSense. MPU-9250 Product Specification; Rev 1.0; InvenSense: Sunnyvale, CA, USA, 17 January 2014. [Google Scholar]
  44. InvenSense. Register Map and Descriptions; Rev 1.4; InvenSense: Sunnyvale, CA, USA, 9 September 2013. [Google Scholar]
  45. Honegger, D.; Meier, L.; Tanskanen, P.; Pollefeys, M. An Open Source and Open Hardware Embedded Metric Optical Flow CMOS Camera for Indoor and Outdoor Applications. In Proceedings of the IEEE International Conference on Robotics and Automation, Karlsruhe, Germany, 6–10 May 2013; pp. 1736–1741. [Google Scholar]
  46. Madgwick, S.O.H.; Harrison, A.J.L.; Vaidyanathan, R. Estimation of IMU and MARG orientation using a gradient descent algorithm. In Proceedings of the 2011 IEEE International Conference on Rehabilitation Robotics, Zurich, Switzerland, 29 June–1 July 2011; pp. 1–7. [Google Scholar]
  47. Guardeño, R. Modelado, Simulación, Diseño y Construcción del Sistema de Control de un Quadrotor; Universidad de Cádiz: Cádiz, Spain, 2016. [Google Scholar]
  48. Skogestad, S.; Postlethwaite, I. Multivariable Feedbaack Control, Analysis and Design, 2nd ed.; John Wiley and Sons: New York, USA, 2005; ISBN 0-470-01168-8. [Google Scholar]
  49. Rubio, F.R.; López, M.J. Control Adaptativo y Robusto, 1st ed.; Universidad de Sevilla: Sevilla, Spain, 1996; ISBN 84-472-0319-0. [Google Scholar]
  50. Alam, F.; Zhaihe, Z.; Jiajia, H. A Comparative Analysis of Orientation Estimation Filters using MEMS based IMU. In Proceedings of the International Conference on Research in Science, Engineering and Technology, Dubai, UAE, 21–22 March 2014; pp. 86–91. [Google Scholar]
  51. Cavallo, A.; Cirillo, A.; Cirillo, P.; De Maria, G.; Falco, P.; Natale, C.; Pirozzi, S. Experimental comparison of sensor fusion algorithms for attitude estimation. In IFAC Proceedings Volumes (IFAC-PapersOnline); IFAC: Cape Town, South Africa, 2014; Volume 19, pp. 7585–7591. [Google Scholar]
  52. Guardeño, R.; López, M.J.; Sánchez, V.M. Available online: https://youtu.be/rRv-dkYR6Ro (accessed on 22 December 2018).
Figure 1. Real system modelled in the present work, [41].
Figure 1. Real system modelled in the present work, [41].
Robotics 08 00036 g001
Figure 2. Earth (E) and Body (B) reference frames.
Figure 2. Earth (E) and Body (B) reference frames.
Robotics 08 00036 g002
Figure 3. Experimental setup to characterize the motor thrust.
Figure 3. Experimental setup to characterize the motor thrust.
Robotics 08 00036 g003
Figure 4. Comparative of closed-loop systems obtained with control laws (15) and (19).
Figure 4. Comparative of closed-loop systems obtained with control laws (15) and (19).
Robotics 08 00036 g004
Figure 5. (a) Control Law LQR (15). (b) Control Law modified LQR (19).
Figure 5. (a) Control Law LQR (15). (b) Control Law modified LQR (19).
Robotics 08 00036 g005
Figure 6. Block diagram of the MHV sensor fusion algorithm.
Figure 6. Block diagram of the MHV sensor fusion algorithm.
Robotics 08 00036 g006
Figure 7. Complete control system diagram for attitude, altitude and horizontal position. Blocks with LQR M reference the modified LQR (19).
Figure 7. Complete control system diagram for attitude, altitude and horizontal position. Blocks with LQR M reference the modified LQR (19).
Robotics 08 00036 g007
Figure 8. Modelling of the measurements provided by the MARG MPU-9250 on body-axes ( B ) when it is fixed to the quadrotor system.
Figure 8. Modelling of the measurements provided by the MARG MPU-9250 on body-axes ( B ) when it is fixed to the quadrotor system.
Robotics 08 00036 g008
Figure 9. Attitude of the quadrotor system versus the attitude estimated by the MHV algorithm and the attitude obtained by integrating the measured angular velocities directly.
Figure 9. Attitude of the quadrotor system versus the attitude estimated by the MHV algorithm and the attitude obtained by integrating the measured angular velocities directly.
Robotics 08 00036 g009
Figure 10. Estimation of the altitude and the velocity w of the system versus the real variables and z m .
Figure 10. Estimation of the altitude and the velocity w of the system versus the real variables and z m .
Robotics 08 00036 g010
Figure 11. ϕ , θ , ψ and z of the closed-loop system, estimates and setpoints.
Figure 11. ϕ , θ , ψ and z of the closed-loop system, estimates and setpoints.
Robotics 08 00036 g011
Figure 12. Duty cycles of the PWM signals for the four rotors, attitude controller and altitude.
Figure 12. Duty cycles of the PWM signals for the four rotors, attitude controller and altitude.
Robotics 08 00036 g012
Figure 13. AEM model when applying the control and estimation structure shown in Figure 7.
Figure 13. AEM model when applying the control and estimation structure shown in Figure 7.
Robotics 08 00036 g013
Figure 14. AEM model of the quadrotor following circular ascending paths.
Figure 14. AEM model of the quadrotor following circular ascending paths.
Robotics 08 00036 g014
Figure 15. Variation of the performance indices of the controlled attitude-altitude I E A (real vs. estimated) and variation of the control effort I A u , all of them in function of I a d d .
Figure 15. Variation of the performance indices of the controlled attitude-altitude I E A (real vs. estimated) and variation of the control effort I A u , all of them in function of I a d d .
Robotics 08 00036 g015
Figure 16. Errors obtained in the controlled variables of the system by applying different values from I a d d to the AEM model by applying the control and estimation structure shown in Figure 7.
Figure 16. Errors obtained in the controlled variables of the system by applying different values from I a d d to the AEM model by applying the control and estimation structure shown in Figure 7.
Robotics 08 00036 g016
Figure 17. AEM model with I a d d = 10 % and Δ K R = ( 4 , 6 , 3.2 , 2.9 ) T % when applying the control and estimation structure shown in Figure 7.
Figure 17. AEM model with I a d d = 10 % and Δ K R = ( 4 , 6 , 3.2 , 2.9 ) T % when applying the control and estimation structure shown in Figure 7.
Robotics 08 00036 g017
Figure 18. AEM model of the quadrotor carrying out manoeuvre hover while it is exposed to the set of external disturbances shown in Figure 19.
Figure 18. AEM model of the quadrotor carrying out manoeuvre hover while it is exposed to the set of external disturbances shown in Figure 19.
Robotics 08 00036 g018
Figure 19. External disturbances that affect to the AEM model and duty cycles generated by the modified Linear Quadratic Regulator/Gaussian (LQR/LQG) control to reject them.
Figure 19. External disturbances that affect to the AEM model and duty cycles generated by the modified Linear Quadratic Regulator/Gaussian (LQR/LQG) control to reject them.
Robotics 08 00036 g019
Figure 20. AEM model of the quadrotor with added parametric uncertainty carrying out manoeuvre hover while it is exposed to the set of external punctual disturbances shown in Figure 21.
Figure 20. AEM model of the quadrotor with added parametric uncertainty carrying out manoeuvre hover while it is exposed to the set of external punctual disturbances shown in Figure 21.
Robotics 08 00036 g020
Figure 21. External punctual disturbances that affect to the AEM model and duty cycles generated by the modified LQR/LQG control to reject them.
Figure 21. External punctual disturbances that affect to the AEM model and duty cycles generated by the modified LQR/LQG control to reject them.
Robotics 08 00036 g021
Figure 22. (a) Real system used in tests. (b) Main parts of the PCB (Printed Circuit Board): (1) Connections with external sensors, (2) flight unit PCBs, (3) Barometer, (4) MARG, (5) GPS, (6) Microcontroller, (7) LEDs and buzzer, (8) Rotor connections, (9) Power supply. The radius of the PCB is 6.75 cm.
Figure 22. (a) Real system used in tests. (b) Main parts of the PCB (Printed Circuit Board): (1) Connections with external sensors, (2) flight unit PCBs, (3) Barometer, (4) MARG, (5) GPS, (6) Microcontroller, (7) LEDs and buzzer, (8) Rotor connections, (9) Power supply. The radius of the PCB is 6.75 cm.
Robotics 08 00036 g022
Figure 23. Height of the real quadrotor in closed-loop (modified LQG controller).
Figure 23. Height of the real quadrotor in closed-loop (modified LQG controller).
Robotics 08 00036 g023
Figure 24. Attitude of the real quadrotor in closed-loop (modified LQR + MHV).
Figure 24. Attitude of the real quadrotor in closed-loop (modified LQR + MHV).
Robotics 08 00036 g024
Table 1. Model parameters of the DJI F-450 quadrotor used for analysis and evaluation.
Table 1. Model parameters of the DJI F-450 quadrotor used for analysis and evaluation.
SimbolDescriptionValue
K d x Aerodynamic drag coefficient using a reference area perpendicular to x axis0.01212 Kg/m
K d y Aerodynamic drag coefficient using a reference area perpendicular to y axis0.01212 Kg/m
K d z Aerodynamic drag coefficient using a reference area perpendicular to z axis0.0648 Kg/m
K T 1 Thrust—RPM quadratic relation 1.0155 × 10 7 N/RPM2
K T 2 Thrust—RPM gain 1.0327 × 10 4 N/RPM
K P Torque—RPM quadratic relation 3.46 × 10 8 N m/RPM2
K f Thrust—Duty cycle gain0.0667 N/%
lDistance from the center of one motor to the center of gravity of the system0.235 m
mSystem mass1.250 Kg
I x x Moment of inertia about x axis0.0094 Kg m2
I y y Moment of inertia about y axis0.01 Kg m2
I z z Moment of inertia about z axis0.0187 Kg m2
gGravitational acceleration9.81 m/s2
Table 2. RMSE (Root Mean Square Error) in dynamic conditions and compute time of the three attitude estimation algorithms considered, [51].
Table 2. RMSE (Root Mean Square Error) in dynamic conditions and compute time of the three attitude estimation algorithms considered, [51].
ParameterEKFMHVNLCF
RMSE Roll [ ]4.714.855.07
RMSE Pitch [ ]1.912.652.89
RMSE Yaw [ ]5.195.135.67
Compute time [ms]2.70.150.11
Table 3. Coefficients of the position controller.
Table 3. Coefficients of the position controller.
K P K I K D τ f D [ s ]
S P ϕ −0.050−0.0025−0.081
S P θ 0.0500.00250.081
Table 4. Performance indicators of controlled variables ( I A E ) and control effort ( I A u ) in function of parametric uncertainty added to inertia moments ( I a d d ).
Table 4. Performance indicators of controlled variables ( I A E ) and control effort ( I A u ) in function of parametric uncertainty added to inertia moments ( I a d d ).
I add [ % ] I A E X I A E Y I A E Z I A E ϕ I A E θ I A E ψ I A u
80.01.07861.24545.610315.299015.229029.3750257.5400
75.01.04081.13955.609914.172012.741027.7470248.1000
62.51.06481.05325.608313.062010.76826.3290237.8200
50.01.11731.04065.607112.76209.936625.3390233.3900
37.51.13841.03415.606412.57709.410524.5050231.0600
25.01.14181.02775.606212.44809.078323.6990229.8900
17.51.14431.02615.606112.40108.952923.2200229.6400
15.01.14551.02615.606012.39108.924123.0640229.6500
12.51.14671.02635.606012.38608.903822.9140229.7400
10.01.14771.02665.606012.38708.890522.7650229.9000
7.51.14941.02685.606012.39708.885422.6150230.1600
5.01.15151.02725.606012.41108.891722.4660230.5500
2.51.15321.02735.605912.43208.909222.3200231.1000
01.15521.02715.605912.45408.937522.1670231.8700
−2.51.15711.02665.605912.47208.990122.0250232.8800
−5.01.15881.02625.605912.48909.071921.9010234.2100
−7.51.16091.02735.606012.52009.194521.7840235.9800
−10.01.16431.02955.606012.58309.356021.6470238.4800
−12.51.16651.03395.606012.69909.575521.5120242.5300
−15.01.17251.04845.605912.925010.026021.3830251.5600
−17.51.19471.08005.606214.074010.863021.4570272.8800
−18.51.21491.09285.608517.576011.171021.7040316.6300
−19.51.19201.13325.604318.492011.749023.4380331.3600
Table 5. Performance indicators of the estimated controlled variables ( I A E ) in function of the parametric uncertainty added to inertia moments ( I a d d ).
Table 5. Performance indicators of the estimated controlled variables ( I A E ) in function of the parametric uncertainty added to inertia moments ( I a d d ).
I a d d [ % ] I A E X e s t I A E Y e s t I A E Z e s t I A E ϕ e s t I A E θ e s t I A E ψ e s t
80.01.05401.15165.949710.933014.223013.5330
75.01.03621.10355.94949.267511.226013.1880
62.51.04601.08325.94766.64367.938912.3290
50.01.05671.07895.94585.34446.299111.4950
37.51.07091.07795.94484.62905.278710.6320
25.01.07931.07435.94434.25014.67329.7469
17.51.08491.07385.94414.09474.44479.2150
15.01.08711.07415.94414.05364.38709.0385
12.51.08951.07465.94404.01854.34108.8624
10.01.09191.07515.94403.99114.30648.6862
7.51.09411.07545.94403.97744.28208.5101
5.01.09621.07595.94403.97624.27248.3350
2.51.09821.07655.94393.98654.28068.1609
01.09951.07715.94404.01204.30687.9877
−2.51.10071.07775.94404.05134.36387.8161
−5.01.10261.07865.94404.10674.46287.6468
−7.51.10551.08065.94404.19404.62237.4801
−10.01.10901.08245.94404.37634.83597.3095
−12.51.11341.08515.94424.77885.13547.1386
−15.01.11841.09275.94415.53965.73546.9640
−17.51.13981.10835.94457.52106.82056.8099
−18.51.18001.12045.947012.38007.24956.7940
−19.51.20781.20355.943112.82408.02316.8986

Share and Cite

MDPI and ACS Style

Guardeño, R.; López, M.J.; Sánchez, V.M. MIMO PID Controller Tuning Method for Quadrotor Based on LQR/LQG Theory. Robotics 2019, 8, 36. https://doi.org/10.3390/robotics8020036

AMA Style

Guardeño R, López MJ, Sánchez VM. MIMO PID Controller Tuning Method for Quadrotor Based on LQR/LQG Theory. Robotics. 2019; 8(2):36. https://doi.org/10.3390/robotics8020036

Chicago/Turabian Style

Guardeño, Rafael, Manuel J. López, and Víctor M. Sánchez. 2019. "MIMO PID Controller Tuning Method for Quadrotor Based on LQR/LQG Theory" Robotics 8, no. 2: 36. https://doi.org/10.3390/robotics8020036

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop