#### Abstract

In this note, the problem of tracking random references and rejecting random perturbations in a quadrotor, both generated by an auxiliary system named exosystem, is solved by extending the deterministic tracking problem to the area of stochastic processes. Besides, it is considered that only a part of the state vector of the quadrotor is available through measurements. As a consequence, the state vector of the plant must be estimated in order to close the control loop. On this basis, a controller to track random references and to reject random perturbations is developed by combining a Kalman filter to estimate the references and perturbations of an exosystem and an observer to estimate the states of a quadrotor. Besides, to obtain a more practical controller, the analysis is carried out in discrete time. Numerical simulations are used in a quadrotor to confirm the validity and effectiveness of the proposed control.

#### 1. Introduction

In the control field, the problem of imposing random references on some outputs of unmanned aerial vehicles is a very recurrent problem. This is because such scenarios appear in many disciplines of science and technology, and among them, aeronautics is one of those areas. Besides, the study of a quadrotor is gaining great interest because of their wide range of applications and low cost [1]. For instance, the chaotic approach [2–4], the chaotic attractors [5–7], the adaptive technique [8–10], the sliding mode strategy [11–13], the robust technique [14–16], the learning strategy [17–19], and the structure method [20, 21] are used for the tracking of quadrotors. As can be expected, the bibliography related to the control of quadrotors is vast and it goes on and on.

In other orders of ideas, the tracking theory is a well-posed frame of work providing the tools to ensure asymptotic stability while references are tracked and perturbations are rejected. Roughly speaking, the solution for the tracking problem is provided by a control vector achieving two goals: (1) the asymptotic stabilization of the equilibrium of the quadrotor and (2) the tracking of random references and the rejecting of random perturbations, both produced by an auxiliary system named exosystem [22].

For the linear problem, the solution has been presented by [23]. There, the author showed that the existence of the desired control coincides with the existence of the solution of some simultaneous equations, which can be represented in a matrix form and they are named Francis equations. Afterward, the nonlinear tracking problem was analyzed and it was concluded that the linear result is a particular case of the nonlinear problem. However, some nonlinear partial differential equations need to be solved in order to obtain the nonlinear control. Unfortunately, in many cases, the solution of such nonlinear partial differential equations is very difficult to obtain [22]. Thus, the avoiding of such nonlinear partial differential equations has been also studied. For instance, Takagi-Sugeno fuzzy systems and neural networks have been successfully used to extrapolate the linear control to the nonlinear field, without involving nonlinear partial differential equations [24].

On the other hand, most of the references and perturbations in nature are not perfectly harmonic. For instance, the flight of butterflies, the behavior of the heart, brain, human march, among others, include a little bit of randomness, to say the least. To estimate these kinds of references and perturbations, the Kalman filter [25] has been and still is a very good alternative. In this sense, in [26], the Kalman filter is used for the quadrotors parameters identification, and in [27, 28], the Kalman filter is used for the quadrotors states estimation.

With all this in mind, the problem to be studied in current work can be stated as the problem of ensuring that the output of a quadrotor behaves as an external random perturbation while the stability property is maintained. Roughly speaking, the main contribution of this paper is the extension of the deterministic references tracking and deterministic perturbations rejection to the stochastic field, by assuming that the generator of references and perturbations is subject to random uncertainties.

Besides, in order to make the problem more realistic, it is assumed that only a part of the state is available. The novelty of the proposed approach is the combination of the Kalman filtering and the regulation theory to solve the references tracking and perturbations rejection; this problem cannot be solved by the Kalman filter or the regulation theory by themselves. In this sense, the desired controller must achieve two goals which are very similar to those considered in the tracking problem: (1) to stabilize the quadrotor around an operation point when the exosystem is affecting it and (2) to minimize the tracking error when the quadrotor is influenced by external perturbations. On the basis of the observer and Kalman filter, some random references will be imposed on the quadrotor, while some random perturbations are rejected as well.

The rest of the work is arranged in the following way: Brief reminders of the tracking and Kalman filter are given in Section 2. Besides, the numerical model of the quadrotor and the definition of the problem are also included there. Section 3 is devoted to obtaining the main results. The numerical simulations of a quadrotor are analyzed in Section 4, while some conclusions are given in Section 5.

#### 2. Problem Setup

In this section, the control problem is defined. But before that, the control, the Kalman filter, and the quadrotor are briefly introduced.

##### 2.1. The Control for Deterministic Plants

Let the plant bewhere is the state of the plant, is the control input, is the output, and is the solution of the exosystem:

With as the references to be tracked and as the perturbations to be rejected, system (1) and (2) corresponds to the regulation problem in continuous time, where (1) is the plant to be regulated, while (2) is an auxiliary system used to model the references/perturbations signals.

Clearly, it is possible to construct a block diagonal matrix , such that each block on the diagonal describes the behavior of the references or perturbations to be generated by (2). So, and can be viewed as output matrices for such an exosystem.

The tracking error is , and the control must achieve

In [22, 23], it has been shown that the control which solves the control problem iswhere the steady-state is invariant through , where and solve the Francis equations, defined as

Notice that equations (5) are a set of simultaneous equations with unknowns. These equations can be readily solved. These equations can be solved analytically or with the help of numerical tools, in general, when . The following theorem summarizes the previous analysis.

Theorem 1. *Assuming that the exosystem is given by (2) and H1: There exists a matrix which stabilizes the pair ( , ) and H2: There exists a solution for Francis equations (5) given by and , then, the tracking problem described by (1) and (2) can be solved by (4).*

*Proof. *Consider as the steady-state error. Now, its first-order derivative isAt this point, it is easy to obtainFrom (7), it is clear that is zeroed as if (1) is Hurwitz (Assumption ), and (2) , which coincides with (5). Observe that (5) involves equations with unknowns.

But, the tracking error is rewritten asThe missing equations are obtained. Notice that (8) coincides with (5), in steady-state, i.e., when . To conclude, notice that if , then equation (5) may have a unique solution; if , then an infinite of solutions may exist. And, if , then (5) may not have solution, in general [23].

##### 2.2. Kalman Filter (KF)

The Kalman filter is an iterative process based on the least square method, which is able to estimate the states of a plant in an optimal way [25].

Consider the following discrete-time plant:where, as usual, the discrete time is represented by , and , , and are the state, input, and output vectors, respectively. The dynamic noise is with normal distribution, zero mean, and variance , while the measurement noise is with normal distribution, zero mean, and variance . It is important to mention that matrices , , , , and are obtained by linearizing the discrete-time quadrotor plant around a suitable operation point. On this basis, the Kalman filter (KF) is defined bywhere and are the estimations for the state and error variance at iteration , respectively, while and are the predictions for state and variance at iteration , respectively. And, and are the updated estimations, through the Kalman gain , for state and error variance at iteration , respectively [25].

Evidently, the Kalman filter can be extended to the nonlinear domain by linearizing the quadrotor plant at every discrete instant and by applying the previous equations iteratively. Such a result is known as the extended Kalman filter (EKF).

##### 2.3. The Mathematical Model of the Quadrotor

The proposed controller will be tested on a quadrotor with sufficiently complex behavior; the quadrotor can be considered as an aerial robot. The free-body diagram of the quadrotor is given in Figure 1, while its mathematical model is [29]

With , ,

Withwhere is chosen,

is the continuous time. The frequencies of rotors 1, 2, 3, and 4, which are in fact the effective controls, are described by , , , and , respectively, and they are given in radians per second. The states , , and are given in meters and they describe the linear movements along the Earth fixed axes , , and , respectively. On the other hand, states , , and are given in radians representing angular movements around the body-fixed axes , , and , respectively. And, the even states can be easily identified as the velocities of abovementioned states.

The value of the parameters are as follows [29]: is the thrust coefficient, is the drag coefficient, is measured from the quadrotor's center to the rotors' middle point, is the mass of the quadrotor, is the gravity constant, is the rotors' momentum, and , , and are the momentum respect to , , and , respectively. With these values, the quadrotor can be maintained in hovering when , where are the static controls needed to keep the quadrotor in a static floating position.

The discrete-time approximation for equation (11) can be derived by means of the Euler discretization method [25]:where is the sampling time and it is sufficiently small such that the main features of the continuous-time system are preserved, while the controllability property is not affected. Thus,

Consequently, the discrete-time approximation for (11) iswith as in (12), with .

On the other hand, in order to produce the random references and random perturbations, the following stochastic exosystem is considered:where for this case , , , and , while the dynamic and measurement noises are characterized by their standard deviations and , respectively, such that and . Equation (18) is the Euler discretization of the nonlinear model of the quadrotor, and equation (19) is the stochastic exosystem generating the references to be tracked and the perturbations to be rejected. In the following section, the dimensions of and are clarified.

##### 2.4. The Problem of Tracking Random References in the Presence of Random Perturbations

In this work, it is supposed that only six from the twelve states of the quadrotor are available for measurement, namely, , , , , , and ; i.e., only the linear and angular displacements in the axes , , , , , and are available. To overcome this problem, a full-state observer will be considered during the stabilization of the quadrotor.

Under such conditions, one random reference will be imposed on , another on , and the last one on . Besides, a random perturbation will affect .

Both the references and perturbations are generated by a set of equations similar to (9) and (19):

For the definition of structure of the exosystem, it is important to mention that the references and perturbations to be imposed on , are pseudoperiodic with frequency of , the reference to be imposed on is random with zero mean, and the perturbations affecting the state are also pseudo periodic of . Therefore, by considering the dimensions of system (11), one way of generating such references and perturbations is through (20) with matrices , , and , where , , , and , the other terms of have a value of , , the other terms of have a value of , , and the other terms of have a value of . At this point, the perturbations can be defined as .

Thus, as mentioned before, in order to track the random references and to reject the random perturbations, they will be estimated online by means of a Kalman filter. In the following section, the structure of the matrices involved in the estimation of the references and perturbations is thoroughly analyzed.

#### 3. Main Result

To estimate the random references and random perturbations by means of the Kalman filter, it must be recalled that both matrices and can be viewed as output matrices for the exosystem, and because of their dimension, they can be used to construct an overall output matrix for the exosystem, namely, , with .

With this in mind, and by considering the expressions for the exosystem, i.e., (20), the estimation problem for the references and perturbations can be solved by a Kalman iterative process like the one defined through equations (9) and (10), where , , and , for all .

On the other hand, an observer capable of estimating the full state of a plant from the available outputs when it is subject to random perturbations must be designed. So, for system (21), a quasi-solution for the observability problem is given next.

Theorem 2. *Consider a plant in the form of*

is considered as the vector of available output and as the set of output where the references are to be imposed. As before, , , , , and as the solution of the exosystem

are considered as the vector of references to be tracked. Then, the state can be taken to a neighborhood around its equilibrium if the pair (, ) is stabilizable, the pair (, ) is detectable, and there exists an estimation for perturbation . Moreover, the quasi-stabilizer is given by the dynamic system:where is the state of the observer.

*Proof. *Let the observer for (21) be (23) and with as in (22) for both (21) and (23). Thus can be written aswhere . Thus, by continuity, if the system (21) is detectable and if is sufficiently small, then gain exists because could be disregarded. Besides, if (21) is stabilizable the gain also exists and both state vectors and tend to a neighborhood around the equilibrium by means of (22).

Notice that, previously, it has been supposed that can be estimated by the Kalman filter.

Now, the regulation problem presented in Section 2.1 must be extended to the field of the discrete-time systems, but considering that the states and output of the exosystem are influenced by noise. To this end, consider the discrete-time plant (21) and the exosystem (20).

Thus, by mimicking the procedure in Section 2.1, the tracking error is given by , and the tracking problem for discrete time is solved by a control vector such thatAs above, it will be considered that the tracking problem for discrete-time plants is solved bywhere is the observed state of the plant, is the Kalman estimation for , the manifold of steady-state is , and the steady-state input is , with and as the solution ofAt this point, the following result naturally arises.

Theorem 3. *Considering the tracking problem defined by (20) and (21), and assuming H1: There exists a matrix K which stabilizes ( A, B), H2: There exists a matrix , such that the pair (A, C) is detectable, and H3: There exists a solution for Francis equation (26) given by and , then, the tracking problem for the discrete-time system defined by (20) and (21) is solved by (25).*

*Proof. *Let the steady-state error be . Thus,By the definition of and by substituting (26) in (27), one getsFrom (28), it is obvious that dissipates when (1) matrices and have their eigenvalues inside the unit circle [30] (Assumptions and ), and (2) , which coincides with (26). As in Theorem 1, by considering the tracking error in steady-state, the missing equations are obtained fromIn steady-state it coincides with (26). As above, this analysis entirely relies on the fact that the Kalman estimation is sufficiently close to . The rest of the proof follows the same path as in Theorem 1.

*Remark 1. *Theorems 1 and 2 correspond to results in continuous time and discrete time, where no uncertainties were considered. However, Theorem 3 states the conditions under which that regulation problem can be solved, even if the exosystem is subject to uncertainties.

*Remark 2. *The proposed approach entirely relies on the estimation of the Kalman filter. For that reason, the proposed exosystem complies with the requirements established by the Kalman theory, and must be known. Future works may be oriented to estimate the elements of when such matrix is unknown, but that problem exceeds the scope of the present work.

The control scheme is graphically described in the block diagram of Figure 2.

#### 4. Numerical Simulations

Please refer to Appendix where a detailed description of the matrices considered to construct the control is given.

The numerical simulations are carried out considering a linearization of (17) around the origin, because the ground effect is not considered in the mathematical model. Consequently, the observer (23) is construct from the matrices , , , and , and has been computed by considering the set of desired eigenvalues:

The control (26) is formed from the matrix . has been computed by the dlqr algorithm with , and with as the identity matrix of dimension , and the solution for (27) is given by and , , , and are given in Section 2.4.

*Remark 3. *The design of the controller has been performed on the linear model of the quadrotor, although the results presented correspond to the response of the nonlinear system under the action of the designed controller.

With all of the basis stated in previous sections, the results are given next.

*Example 1. *Minimum randomness with the proposed method.

At first, the simulations are carried out with very small randomness in order to validate the approach in the quasi-deterministic case. As mentioned before , , while the dynamic and measurement noises are characterized by their standard deviations and , respectively, such that and . The results are given in Figures 2 to 6.

So, for this example, the standard deviation values are and . The initial conditions for the nonlinear model of the quadrotor (18) are , while the initial state for the observer is , where and are random numbers with zero mean and standard deviation . On the other hand, the references and perturbations are generated by the exosystem (19) with initial conditions , while the initial state for the Kalman filter is , where are random numbers with zero mean and standard deviation . Under these conditions, the obtained results are depicted from Figures 3 to 7.

In Figure 3 are shown the tracking outputs against the corresponding reference. It can be observed how the proposed controller achieves the desired goals. Besides, in the same figure, the available outputs are depicted also. Figure 4 might be more helpful to determine the efficacy of the controller by showing the tracking errors under the mentioned conditions. Please, note that the oscillations presented in such a figure are due to the fact that a controller is applied to a quadrotor. In other words, persistent oscillations can be reduced or even eliminated by means of a nonlinear controller; however, such analysis exceeds the scope of the present work.

The estimation of the references and the perturbations can be viewed in Figure 5. From there, it can be concluded that the estimates provided by the Kalman filter are acceptable, at least in this case.

Thus, the 3D behavior of the quadrotor is shown in Figure 6 and the rotors’ frequencies appear in Figure 7. It is worth mentioning that the frequencies of the rotors remain positive, all of them. This is an important feature of the quadrotor that must be kept all the time because the rotors of such system rotate in one and only one direction.

Notice also that the frequencies of the rotors are not the same. This is due to the fact that the quadrotor is describing circles during its operation.

*Example 2. *Stochastic problem with the structure method.

Now, a more interesting case is simulated with bigger values for and ; i.e., the randomness of the problem is now notably increased. In this case and . The rest of the parameters remain as those considered in Example 1. The results are given in Figures 8 to 9.

The simulation considers the same situation presented in the previous example, but the structure method of [20, 21] is used in which the Kalman estimating is omitted and it is assumed that the structure method is sufficient to describe both the references and the perturbation even when they are, in fact, random. The results are given in Figures 8 and 9. Notice now that the references are much more complex due to the random nature of the exosystem provoked by the values of and .

In this case, the boundedness of the tracking errors can not be ensured, which totally justifies the use of the proposed method of the next example.

*Example 3. *Stochastic problem with the proposed method.

This numerical experiment considers the same situation presented in Example 2; i.e., and . However, in this case the Kalman estimation is considered. The rest of the parameters remain as those considered in Example 1. The results are given in Figures 10 to 14.

In Figure 10 are depicted the tracking outputs against their respective references. The tracking errors are shown in Figure 11. Observe how, in this case, the errors are smaller than those obtained in Example 2.

The performance of the Kalman filter can be assessed through the results given in Figure 12. From there, one can conclude that the estimations of the references and the perturbation are acceptable again despite the randomness introduced in the exosystem, corroborating in this way, that the main issue of the tracking problem, in this case, is the nature of the linear control.

Finally, the 3D behavior of the quadrotor is shown in Figure 13 and the rotors' frequencies appear in Figure 14. Observe that the random reference is changing so abruptly that the quadrotor is unable to track it exactly because of its own physical restrictions. However, the quadrotor is kept in a neighborhood around the reference, meaning that the tracking errors are bounded. Again, the frequencies are all positives, which implies that the controller is imposing normal behavior in the rotors. Obviously, the strange behavior of the quadrotor is due to complex response of the rotors.

Comparison of Examples 1–3:

Finally, the mean squared error (MSE) between the tracking states of the quadrotor and the corresponding states of the exosystem for Examples 1–3 is depicted in Table 1.

Clearly, the inclusion of the Kalman filter for estimating the states of the stochastic exosystem drastically reduces the MSEs. Therefore, its use cannot be neglected when the reference or perturbation is not fully known.

*Remark 4. *Example 3 should be compared with Example 2 because the same big noises with standard deviation values of and are used in Examples 2 and 3; the difference of this comparison is that the Kalman estimating is omitted in Example 2, while the Kalman estimating is used in Example 3. Example 1 should not be compared with Examples 2 and 3 because small noises with standard deviation values of and are used in Example 1, and the Kalman estimating is omitted in Example 1.

#### 5. Conclusion

On the basis of the observer and Kalman filter, an approach to track random references while random perturbations are rejected has been proposed. The control scheme analyzed in this work can be viewed as an extension of the deterministic tracking problem to the area of stochastic processes. It has been shown that the estimation of the references and perturbation makes a great difference because, in general, the controller is constructed on the basis that the same matrices need to solve the deterministic case. The validity of the approach has been illustrated by several numerical simulations considering the mathematical model of a quadrotor. In the future work, for the case where the quadrotor includes random dynamics, then the observer will be substituted for an unscented Kalman filter, an extended Kalman filter, or another estimator as the James-Stein filter.

#### Appendix

The terms of the matrix are , , , , , , , and the other terms of have a value of .

The terms of the matrix are , , , , , , , and the other terms of have a value of .

The terms of the matrix are , the rest of the terms of C are equal to zero.

The terms of the matrix are , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , .

The terms of the matrix are , , , , , , , , , , , , , .

The terms of the matrix are , , , , , , , , , , , , , , , , , , , , and the other terms of have a value of .

The terms of the matrix are , , , , , , , , , and the other terms of have a value of .

#### Data Availability

The simulation data used to support this research are available from the third author upon request to the e-mail: [email protected].

#### Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

#### Acknowledgments

The authors thank the Instituto Politécnico Nacional, Secretaría de Investigación y Posgrado, Comisión de Operación y Fomento de Actividades Académicas, and Consejo Nacional de Ciencia y Tecnología, for their support. This research was financed by the Instituto Politécnico Nacional, Secretaría de Investigación y Posgrado, Comisión de Operación y Fomento de Actividades Académicas, and Consejo Nacional de Ciencia y Tecnología.