Model-based Method: Kalman Filter

1. Fault Information

An essential application for RflyMAD is to construct fault diagnosis methods. Here we take a simple fault type as an example to diagnose. Detailed information about this fault could be seen in the following table.

Fault TypeStart TimeDurationFault ParameterFlight Status
Motor(1)106s30s0.6Hover
Motor(4)116s5s0.8Hover
Motor(3)126s60s0.5Hover

Note: motor(i) means the ith motor of multicopter has a fault.

From the table, we could know that the multicopter is hovering while the faults are injected. Start time means when the fault is injected during the whole flight process. The data used in this sample is an HIL simulation data, and mainly message topics are in ULog data that can be accessed from here.

2. Simplified Dynamic Model Construction

In this sample, the fault parameter could also be called the loss factor, for it represents the failure degree of a motor. Define the loss factor as ηi[0,1],i=1,2,3,4, which represents the total number of propulsors as four. If a propulsor's loss factor is ηi, the thrust of the ith propulsor on the multicopter is only equal to (1ηi)×100% of thrust in the normal working state. Define the thrust of the ith propulsor as fi, we could write loss factor and thrust in the forms of vector and matrix as

f=[f1 f2 f3 f4]T,Γf=diag(f1,f2,f3,f4),η=[η1 η2 η3 η4]T,Γη=diag(η1,η2,η3,η4).

In order to detect the fault by using the RflyMAD dataset, we need to find the relationship between the loss factor and the states of quadrotors. Considering the multicopter is hovering when the faults occur, we could neglect aerodynamic damping and make a small angle assumption to build a simplified function to describe the movement of the quadrotor as 1 2

z¨=TmgJxϕ¨=τxJyθ¨=τyJzψ¨=τz

where (x,y,z) and (ϕ,θ,ψ) are the position and attitude of the quadrotor, (Jx,Jy,Jz) are the moment of inertia. T is the total force and (τx,τy,τz) is torque generated by propellors. m is the mass of the quadrotor. So the linear approximate state equation of the quadrotor aircraft system at low speed and small angle is

x˙=Ax+B(ufg)u=Ax+B(Bffg)

where BfR4×4 is the control efficiency matrix 3, specific expressions of the state vector and other parameters are

x=[zϕθψz˙ϕ˙θ˙ψ˙]TR8,uf=[Tτxτyτz]TR4,g=[mg000]TR4,A=[04×4I404×404×4]R8×8,B=[04×4Jf1]R8×4,Jf=diag(m,Jx,Jy,Jz)R4×4.

Taking the loss factor into consideration, we could change the control input like

u=Bf(IΓη)fg=BffgBfΓηf=u0BfΓfη

Thus, expand the loss factor η into the state vector to form a new state vector x~ and discretize the state function. We could get the final function used for state estimation as

x~˙k+1=[I4I4ΔtΔt22M04×4I4ΔtM04×404×4I4]x~k+[Δt22Jf1ΔtJf104×4]u0,y=[I8×808×4]x~k,M=Jf1BfΓf

Above final function is able to estimate the size of the loss factor by Kalman Filter (KF). Δt in the above final function is the sampling time in discretization. From the above function and state vector x~, it is easy to find that the information about position (x,y,z), attitude angle (ϕ,θ,ψ), attitude angle rate (ϕ˙,θ˙,ψ˙) and motor throttle σ of multicopter is in need. In our RflyMAD dataset, it could be get from the ULog data by using the toolkit we developed and introduced in Dataset. The detailed information about the data in shown in the following table.

SymbolSource File in ULogUsage
σactuator_outputs_0.csvInput parameter of ESC
(x,y,z)vehicle_local_position_0.csvObservation vector of KF
(ϕ,θ,ψ)vehicle_attitude_0.csvObservation vector of KF
(ϕ˙,θ˙,ψ˙)sensor_combined_0.csvObservation vector of KF

Note: Other information like physical parameters of the multicopter is shown in OpenHA-Models or documents in our RflyMAD dataset.

3. Experimental results

With the Kalman Filter and detailed information from RflyMAD dataset, the estimated results are shown in the following figure. Compared with the actual fault information, we could find that the estimation result is accurate.

The above steps show how to use RflyMAD dataset in the process of fault diagnosis, and users can apply their own methods with more message topics in our RflyMAD dataset to get a better results!


1 Xu, R., & Ozguner, U. (2006, December). Sliding mode control of a quadrotor helicopter. In Proceedings of the 45th IEEE Conference on Decision and Control (pp. 4957-4962). IEEE.
2 Amoozgar, M. H., Chamseddine, A., & Zhang, Y. (2013). Experimental test of a two-stage Kalman filter for actuator fault detection and diagnosis of an unmanned quadrotor helicopter. Journal of Intelligent & Robotic Systems, 70, 107-117.
3 Du, G. X., & Sun, L. (2018, July). Loss of effectiveness information observability analysis for multicopters. In 2018 3rd International Conference on Advanced Robotics and Mechatronics (ICARM) (pp. 572-576). IEEE.