{'fraction_non_alphanumeric': 0.03237328495294251, 'fraction_numerical': 0.01655516498469214, 'mean_word_length': 4.39749082007344, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A sensor-to-sensor model-based change detection approach for quadcopters

This paper addresses the problem of change detection for a quadcopter in the presence of wind disturbances. Different aspects of the quadcopter dynamics and various flight conditions have been investigated. First, the wind is modeled using the Dryden wind model as a sum of a low-frequent and a turbulent part. Since the closed-loop control can compensate for system changes and disturbances and the effect of the wind disturbance is significant, the residuals obtained from a standard simulation model can be misleading. Instead, a sensor-to-sensor submodel of the quadcopter is selected to detect a change in the payload using the Instrumental Variables (IV) cost function. It is shown that the mass variation can be detected using the IV cost function in different flight scenarios.


INTRODUCTION
Autonomous aerial vehicles have gained a lot of attention from commercial entities, researchers, and military in recent years. This is due to the feasibility and maneuverability which make the aerial vehicles useful for several applications in remote, uncertain and hazardous environments (Mahony et al., 2012). However, an unexpected change (fault) in the system can lead to a complete breakdown (failure) (Marzat et al., 2012). To allow the vehicle to continue its mission, it is therefore important to identify these system faults as quickly as possible, which increases the overall system reliability. In general, system reliability can be improved using two options: hardware redundancy and analytical redundancy (Marzat et al., 2012;Isermann, 2006). Hardware redundancy is a classical choice. The idea is that multiple sensors or actuators with the same function are attached to the platforms. Even if this technique is popular in the aerospace industry, it implies an additional cost and increases the weight of the system. Also, some process faults in the system will result in the same behaviors of the sensors and actuators due to the closed-loop control. Hence, there is a need to use the analytical redundancy, i.e., to exploit the mathematical relations between measured and estimated signals, to detect any possible system changes (Zhang and Jiang, 2008). The resulting technique does not require adding any additional components whereas it still offers a possibility of change detection.
A model-based fault detection typically consists of three stages: residual generation, residual evaluation and decision logic (Zhang and Jiang, 2008). The residual generation uses a mathematical model of the system with the control input sent to the actuators and the outputs measured by the sensors to predict the behavior and to compare it with the actual behavior of the system. The residual should be close to zero in fault-free conditions and deviate from zero after a fault has occurred. Multiple residuals can be used where each residual is sensitive to a particular fault. When a residual corresponding to a fault deviates from zero and beyond a threshold, a fault detection test alerts that this fault has happened.
Various fault detection and isolation algorithms have been proposed for quadcopters including extended Kalman filters for sensors (Zhong et al., 2019) and actuators (Amoozgar et al., 2013), a Thau observer (Freddi et al., 2012), a twostage estimation eXogenous Kalman filter (Hasan et al., 2019), and neural networks for sensors (Aboutalebi et al., 2018) and actuators (Abbaspour et al., 2017) and so on. In Zhong et al. (2019) a two-stage extended Kalman filter approach based on a nonlinear model has been proposed to estimate the bias fault, drift fault and oscillatory fault in the Inertial Measurement Unit (IMU) sensors. The actuator faults can be detected, isolated and estimated using a linearized dynamic model of the quadcopter around the trim condition (Hasan and Johansen, 2018).
If the quadcopter performs maneuvers indoors, the environmental factors, such as wind turbulence, have less effect on the maneuvers of the quadcopter. However, quadcopters often carry out the mission in situations where environmental disturbances become dominant. Some efforts have been made to estimate the wind vector (speed and direction) in real-time based on measurement data from on-board sensors only (Neumann and Bartholmai, 2015;Xiang et al., 2016;González-Rocha et al., 2019). In this work, we will consider different flight conditions where the wind has a strong influence on the quadcopter that makes change detection harder. Note that we do not focus on designing a filter to track changes in the quadcopter. The aim is to present a reliable method to detect payload variations, despite significant disturbances and closed-loop control. This payload change can be estimated using an offline method (Ho et al., 2017) where a sensor-to-sensor model was used. Here it is shown that this model is also useful for change detection. A common approach in the literature is to consider a complete nonlinear or linearized model. However, simulations of such models often give large residuals when there are significant process disturbances, which can cause false alarms. Here, the sensor-to-sensor model and an instrumental variables (IV) cost function are used to eliminate the effect of the disturbance whereas a payload variation can be detected.
The remainder of the paper is organized as follows. Section 2 presents the kinematics and kinetics of the quadcopter. State estimation and control design for the quadcopter are given in Section 3. The proposed method for change detection is presented in Section 4. The numerical study in Section 5 shows the performance of the method under different flight conditions. Section 6 contains some conclusions and future work.

QUADCOPTER MODELLING
First, a standard model for a quadcopter derived from Newton-Euler equations is presented (Mahony et al., 2012). The model consists of 12 state variables.

Kinematics
We consider a quadcopter as in Figure 1. The position of the quadcopter in the inertial frame is defined as ξ = [x, y, z] T . The Euler angles are η = [φ , θ , ψ] T where φ , θ and ψ are the roll, pitch and yaw angles, respectively. In the body frame, the bodyfixed velocity vector is defined as V B = [u, v, w] T and the bodyfixed angular velocity as ω = [p, q, r] T .
The rotation matrix R(η) is given by in which S φ = sin φ and C φ = cos φ and describes the relation from the translational velocities in the body-fixed frame V B to those in the inertial frameξ aṡ (2) Further, the transformation matrix T (η) for angular velocities from the inertial to the body-fixed frame is defined aṡ

Kinetics
For each rotor i ∈ [1, 2, 3, 4], the thrust is given by where k is the thrust coefficient. Assuming that all rotors are identical and with fixed pitch, the total thrust from the rotors will be along the vertical direction in the body-fixed frame as Another common assumption is that the quadcopter has a symmetric mechanical structure with four aligned arms. Therefore, the torques around the body-fixed axes τ φ , τ θ and τ ψ are given by where l is the distance from any rotor to the center of mass of the quadcopter and b is the yaw torque coefficient.
By Newton's second law, the total forces acting on the quadcopter are equal to the quadcopter mass times its acceleration where m is the quadcopter mass and g z = [0, 0, g] T is the gravity acceleration vector. T B , F d and F w represent the lift force (6), the drag force and the external force due to wind, respectively.
Based on the symmetric structure assumption of the quadcopter, the drag force is given by More precisely, the coefficient λ 1 in (9) defines the drag forces acting in the x − y plane of the body-fixed frame. The drag force is mainly due to the interaction between the airflow and the propellers (Mahony et al., 2012). Assuming that the chirp speed of the propeller is much larger than the translational speed of the quadcopter as well as the wind speed, the external forces due to the wind can be modeled as Furthermore, the rigid body rotational equation of the quadcopter can be derived as is the damping ratio matrix in the rotation dynamics and the inertial matrix I is diagonal as By rearranging (8) and (11), a 6 degrees of freedom model of a quadcopter is obtained.

Wind model
In the following the wind velocity V w is modeled as the sum of a low frequent V l w and a high frequency turbulent V h w as Preprints of the 21st IFAC World Congress (Virtual) Berlin, Germany, July 12-17, 2020 Figure 2. The overall closed-loop quadcopter system.
The low-frequent V l w here is modeled as a constant whereas the turbulent wind velocity V h w is modeled by the Dryden wind model as the output of a filter acting on white noise, see Beard and McLain (2012) for fixed-wing vehicles and Tran et al. (2015) for rotorcraft vehicles. The Dryden transfer functions are given as where σ u , σ v and σ w are the intensities of the turbulence along the vehicle frame axes; L u , L v and L w are spatial wavelengths and V a is the airspeed of the vehicle in the stationary flight condition. The turbulence intensities and scale lengths for heights of less than 300m can be found using the ESDU data curves (Tran et al., 2015;Howard, 2007).

STABILISATION OF THE QUADCOPTER
This section describes the state estimation and control needed to stabilize the quadcopter.

Position control
Much work has been devoted to control design for quadcopters (Zuo, 2010;Hua et al., 2013). Since the control design is not the main goal of this paper, classical PID controllers are used to stabilize the quadcopter. The control system is designed to consist of two loops: an inner loop and an outer loop. The inner loop is the orientation control while the outer loop is the position control. The overall structure of the system is shown in Figure 2.
For the position control loop, the measured position ξ m of the quadcopter in the inertial frame is obtained using a GPS system as ξ m = ξ when it flies outdoors. The position controllers use the desired position ξ re f and measured position ξ m to compute the desired accelerationsξ The quadcopter is an under-actuated vehicle with only four control variables to control six degrees of freedom. Hence, two degrees of freedom are controlled implicitly using the system dynamics. Using the desired accelerationsẍ d ,ÿ d ,z d as outputs of the position loop, the desired roll and pitch angles as well as the total thrust can be computed as (Zuo, 2010) where ψ d is the desired yaw angle (course angle) obtained from the trajectory generator. The desired angles η re f = [φ d , θ d , ψ d ] T are the reference of the orientation control loop.

Orientation control
The inner control loop in Figure 2 handles the roll, pitch and yaw angles of the quadcopter. Assuming that a magnetometer is used to measure the magnetic field, its measurements in the body-fixed frame relate to the earth magnetic vectorsm y (northsouth) andm z (down-up) in the inertial frame as From this the course angle ψ of the quadcopter can be obtained.
To estimate the roll and pitch angles, the inertial sensors, such as accelerometers measuring accelerations and gyroscopes measuring angular velocities in the body frame can be used. The acceleration measurements are given by (17) where [u Bw , v Bw , w Bw ] T is the wind velocities in the body-fixed frame.
The angular velocity measurements are The accelerometer and gyro measurement noises e a and e ω are assumed to be zero-mean white Gaussian random variables.
Using these measurements, an approach to estimate, for example the roll angle of the quadcopter is to use a complementary filter asφ where H(z) and L(z) = 1 − H(z) are high-and low-pass filters, respectively. Here,φ g is obtained by integrating the roll rate measurements numerically aŝ where p m is the measured roll rate and T is the sampling time.
From (8) and (17), the estimateφ a is obtained bŷ where the estimated body-fixed velocities are obtained bŷ andξ m is the linear velocities obtaining by computing the approximate derivative of the measured position ξ m (Leishman et al., 2014). Hence, the estimated Euler angles η est are obtained.

METHOD FOR CHANGE DETECTION
Since our focus is on detecting payload changes on the quadcopter under the effect of the environmental disturbances, two models can be derived. The first model is a linearized six degrees of freedom model which is commonly used to detect various faults. The second model is a sensor-to-sensor model where only the measurements from the IMU are used.

Six degrees of freedom model
Considering a quadcopter flying around the hovering condition with small Euler angles θ and φ and T z = mg, the rotation matrix (1) can be simplified to and the angular velocity transformation matrix (4) becomes The linearization of the translational model (8) is given as Similarly, the rotational model (11) is linearized as Hence, the simulated position and orientation can be obtained as x s y s z s

Sensor-to-sensor model
Given a linearized model (25) and (26) of the quadcopter, described in the previous section, a state-space submodel can be obtained where p m are q m are the measured roll and pitch rates of the quadcopter, respectively. Hence, the prediction errors of the linearized sensor-to-sensor model are Cost function with forgetting factor An approach to detect a playload change based on the prediction error (29) is to consider the instrumental variables (IV) cost functions as where λ is a forgetting factor and N w is the window length.
,q] for the pitch rate longitudinal acceleration model is created using the simulated signalså x andq generated from the reference to model equations.

RESULTS
All simulations have been performed using an ARDrone model and an autopilot in Matlab/Simulink. The simulations were 120 seconds long with a sampling time of 0.005 s. The quadcopter parameters are given in Table 1.

Simulation setup
In this simulation study, the aim is to study the possibility to detect a change in the payload of the quadcopter under different flight conditions. From the hovering position, the quadcopter follows a square 8 × 8 m with a constant altitude of z = 8 m. To excite the quadcopter for detection purposes, a speed profile is also added to the square-shaped path along the x − y axes as v x = v y = 0.5 sin(2.51t) cos(3.14t) + 0.5 sin(3.14t) cos(4.19t) + 0.5 sin(4.19t) cos(6.28t) Since the quadcopter is flying at low altitude and in light turbulence, we use the following Dryden gust model parameters h = 8, L u = 65.8567, L v = 19.2356, L w = 2.8, σ u = 1.1006, σ v = 0.6576, σ w = 0.4168 and the deterministic wind components occur only in x − y directions as V l wx = 1 and V l wy = −1. Figure 4 shows an example of the wind speed profiles.
There are two flight scenarios: the first scenario is to keep the course angle constant (ψ = 0) and the second flight scenario is to change the quadcopter heading angle by 90 • at some occasions, see Figure 5. In both scenarios, the total mass of the quadcopter increases linearly from m = 0.5 kg for t ≤ 40 s to m = 1 kg for t ≥ 42 s.
The forgetting factor of the IV cost function (30) is chosen as λ = 0.999 and the window length is N w = 500. These factors   are tunable to cope with the separation between disturbances and changes.

Change detection results
From Figure 6, the wind disturbances and the changes in the course angle have strong impacts on the estimation of the Euler angles in both flight scenarios when the linear model (25) - (27) is used. The reason is that there is a coupling between roll, pitch and yaw dynamics in (11). Moreover, due to the effect of wind, using (27) directly gives a biased position of the quadcopter. Figure 7 shows the residuals computed directly from the measured and simulated signals p, q, a x and a y obtained from the   6 DOF nonlinear model. Again, the mass change at t = 40 s cannot be detected since its effect on the residual can be mixed up with the wind.
The residuals r 1 and r 2 from (29) are shown in Figure 8 for two scenarios: with and without a change in the course angle. The mass is assumed to be changed from m = 0.5 kg for Figure 9. The criterion IV cost function J IV 1 (upper subplot) and J IV 2 (lower subplot) under the effect of the wind and without/with a change of the course angle.
t ≤ 40 s to m = 1 kg for t ≥ 42 s but this is difficult to detect since the closed-loop control and disturbances hide the effect of system changes. A better approach to detect the mass change is to consider the IV cost functions (30), computed using the parameter vectors ϑ x and ϑ y with m = 0.5 kg. In Figure 9, both IV cost functions J IV 1,2 show a increase after t = 40 s due to a change in the mass. It is obvious that the IV cost function is not as sensitive to the wind and the course angle changes.

CONCLUSION
In this paper, different versions of the quadcopter models have been investigated for detecting changes in mass under different flight scenarios. Since some model residuals can be misleading due to closed-loop control hiding system changes or to the effects of disturbances, an IV cost function approach is proposed based on a sensor-to-sensor linearized submodel of the quadcopter.
It is shown in simulations that a payload change can be detected using the IV cost function approach whereas the effects of the mass variation in residuals obtained from a more complete six DOF model can be mixed up with the wind.
Future work will involve integrating sensor and actuator faults in the approach and testing the payload variations in outdoor experiments.