I. Introduction
State estimation is required for unmanned aerial vehicle (UAV) feedback control, such estimates could be for translational and rotational movements [1], as well as position of the UAV [2]. On-board sensor readings are fed to the flight controller to generate UAV state estimates. State estimation is required due to uncertainties in sensor measurements arising from factors such as atmospheric disturbances, vibrations noise, inaccuracy of coordinate transformations, and missing measurements [1], [3]. Sometimes there are signal obstructions for sensors such as the GPS receiver, such as in tunnels and buildings, which hinders the functionality of the sensor due to loss of signal. Real-time response of UAV and robotics systems must be ensured despite all the sensor setbacks [4]–[6]. Multi-state sensors can be used to augment one another [2] to compensate for signal loss by one sensor. For example, the attitude and heading reference system may combine gyroscope, accelerometer, magnetometer, GPS, and pressure sensors for UAV localisation. State estimates have to be availed at relatively high frequency for UAV control. Lower update frequencies of some sensors, such as the GPS, which typically has an update frequency of 4 Hz, can be compensated for by using Kalman filtering techniques. Kalman filtering can also be used to correct gyroscopic drift. Other methods to compensate for gyro drift involves modeling the gyroscope random drift and then offsetting the gyroscope reading by the predicted drift, this is known as model compensation [7], [8]. Most stabilisation platforms use accelerometer and gyroscope sensors for tilt angle measurements. This paper focuses on improving readings from gyroscope and accelerometer sensors for quadrotor stabilisation. Accelerometer readings are prone to high-frequency noise while gyroscope readings are affected by a drift error due to integral calculation over a long time [9], [10]. Various compensation methods for gyro drift have been studied in the literature. Gyro drift was modeled for the prediction of the micro electro-mechanical systems (MEMS) gyro drift [11]. The wavelet threshold denoising algorithm was used to separate drift error and white noise. Improved Elman neural network was established to promote gyro drift model accuracy [11]. The predicted gyro drift was used to compensate for gyroscope drift error. Random gyro drift was also modeled using Adaptive Kalman filter in [12] to compensate for gyro drift. In [13] empirical mode decomposition (EMD) algorithm was used to decompose the gyros drift signal, threshold denoising and a clustering algorithm was used to extract the desired gyro signal without drift, and ensemble-ELM (extreme learning machine) algorithm to predict and compensate the drift. An algorithm combining the Singer model and an adaptive Kalman filter based on Allan variance (gyroscope measurement white noise) was used to compensate for gyro drift. The feasibility of the algorithm was verified via simulation. Kalman filters were employed in [14] to remove noise from accelerometer and gyroscope readings respectively. However the actual implementation was not specified. Moreover the coefficients of the process noise covariance matrices, and , for the gyroscope and accelerometer models are not given. It is also not specified what process noise was considered for the noise covariance. The filters were applied separately to each of the sensors. The gyro drift error was compensated for using zero velocity compensation (ZVC) algorithm. The algorithm uses the mean of the static gyro data and the moving mean of the data. If the moving mean is less than zero, the velocity is added with the static mean and if the moving mean is higher than zero, the static mean is subtracted from the velocity. The selection of drift error compensation techniques depends on the application under consideration and the implementation platform. This paper implements a complementary Kalman filter using an accelerometer and a gyroscope to correct gyro drift. A process model is used to derive Kalman filter state matrix. The paper also derives the measurement noise and process noise covariance matrices based on the statistical characteristics of the accelerometer and gyroscope sensor readings as well as the influence due to rotor vibrations. It also implements a PID controller for quadcopter roll and pitch control using angle estimates from the Kalman filter as feedback.