Analysis of Inertial Measurement Accuracy using Complementary Filter for MPU 6050 Sensor

Inertial can be defined as disinclination to motion, action, or change. The inertia of an object is the propensity to remain at rest or if in motion, stays in motion at a steady speed. MPU 6050 is one of the low-cost motion tracking sensors that contain a 3-axis gyroscope and 3-axis accelerometer orientation measurement. It is used to analyse the movement or location of a person in an indoor environment. This research is to analyse the accuracy of the inertial measurement of the MPU 6050 sensor. Next, is to improve the achievable accuracy rate up to 95% using the complementary filter and finally to visualize the results on an IoT platform. This MPU 6050 sensor is beneficial to an emergency responder such as the firefighter’s department. The accurate inertial measurement and location will help to detect the movement and the motion of the firefighter during operation, especially in an indoor environment. The sensor will detect and collects the inertial measurement of an emergency responder and transmit the data wirelessly by using ESP 8266 N ode MCU . Finally, the results can be viewed on an IoT platform. However, the results obtained from the MPU 6050 sensor is not perfectly accurate as there is noise during the measurement. Therefore, a complementary filter is used and analysed in this research. It is expected that the inertial location’s accuracy could be improved by 95% that will provide a precise movement and location of the firefighter during operation.


INTRODUCTION
Localization plays a vital role for a particular organisation. The location's accuracy brings a huge impact, especially to the emergency responders' team. While rescuing operations such as in a building, the movement and the position of the team members could not be easily determined, especially if there is an unexpected accident that occurred. This research focuses on applying the MPU6050 sensor to the emergency responders such as firefighters by providing accurate internal measurement and location in an indoor environment. The word inertial originally comes from inertia.
The inertia of an object is the propensity to remain at rest or if in motion, stays in motion at a steady speed (Svacha.2020). This research focuses on analysing the accuracy of the MPU6050 sensor by using the complementary filter. The inertial measurement unit is applied to measure the accuracy in terms of 3-axis accelerometers and 3-axis gyroscopes (Benzerrouk 2018) (Ogata 2019). When the information needed is completed, it sends all the information wirelessly using the ESP8266 NodeMCU. Finally, an interface of an IoT platform, such as a smartphone or a tablet, is used to view the motion and orientation of the emergency responder.
A three-axis accelerometer and a three-axis gyroscope combined is known as an inertial sensor (Marco 2016). Inertial measurement units (IMU) are the names given to devices that contain these sensors. As demonstrated in Figure 1 and Figure 2, inertial sensors are included in almost every modern device, such as Wii controllers and virtual reality (VR) headsets. The current component of gyroscopes and accelerometers are based on microelectromechanical system (MEMS) technology. MEMS components are compact, light, and low-cost, with low power consumption and quick startup times (Steven 2012 The number of applications for inertial sensors is constantly growing. In general, inertial sensors can offer information about the attitude of any object to which they are rigidly attached (Perlmutter.2012). Furthermore, multiple inertial sensors can also be used to acquire information on the pose of separate connected objects. As a result, inertial sensors can be employed to track human motion as shown in Figure 3. Several effects caused the error for IMU measurement. The gyroscope measures the angular velocity, whereas the accelerometer determines the force. However, many reasons why this is not the case. A steadily changing sensor bias and measurement noise are two explanations that contribute to error inertial measurements (Promrit 2018).
The amount of departure or drift the sensor has from its mean value of the output rate is defined as bias stability (also known as bias instability). Essentially, the bias stability measurement determines how stable a gyroscope and accelerometer bias are over time (Demkowicz 2017). Lower bias instability is advantageous since it leads to fewer errors being measured. The sensor errors in the inertial measurements are illustrated in Figure 4. Based on inertial measurements for 10 seconds of static data, the results can be seen as noise-corrupted and biased. White noise, random angle/velocity noise, flicker noise, angular rate/acceleration random walk, and ramp noise are among the flaws that occur when measuring the IMU's output (Kuxdorf 2019). Audio Video (AV) technique is used to identify which noise terms exist in the IMU data, and the result is shown in Figure 5. The histogram (blue) of the gyroscope measurements from a stationary sensor and a Gaussian fit (red) to the data. Figure 4 illustrates the gyroscope and accelerometer measurements for roughly 10 seconds of stationary data. The gyroscope is only supposed to measure the earth's angular velocity because the IMU is stationary. The gyroscope data, however, are distorted by noise, as shown in Figure 5. This noise appears to be Gaussian in nature (Mikov 2020). The complementary filter gives the best way to combine the accelerometer and the gyroscope information to get precise and responsive pitch/roll/yaw value. This channel is implied to determine one single value by combining two distinctive estimations. Centring on one case conducted by (Fourati 2013), the accelerometer flag produces high recurrence noise, whereas the gyroscope comes about to contain more recurrence noise. These information combination methods apply both low and high pass channels as communicated in Equation. (1): Equation (1) is used to overcomes the delay problem. The primary portion of Equation (1) keeps up a high-frequency reaction, whereas low recurrence commotion is taken care of by the last-mentioned portion. When the gyroscope and accelerometer information is scaled, it is balanced by the equilibrium, then enhanced into the complementary filter. The filter's constant devotion comprises one so that the delivered output is precise and direct measurement. Numerical connection of complementary filter as shown in Equation (2).    The 9V of power supply from the DC battery is connected to ESP8266 NodeMCU. MPU6050 will be activated with a 5V power supply from the VCC pin of ESP8266 NodeMCU and communicates through the I2C protocol. A printed circuit board is developed to provide a stable base for components. The MPU6050 sensor is placed horizontally next to the ESP8266. As for the finishing, the PCB was then put into an enclosure box, as shown in Figure 9. The dynamic analysis comprised tests where the IMUsensor was settled on a straight surface that can pivot 360°. The setup of the tests can be seen in Figure 10. The Goniometer tool is used to measure the accuracy of the X, Y and Z-axis reading. The Sensor was settled in a position that measures yaw, pitch, and roll when revolutions are presented around the circuit board. (2)

RESULTS AND DISCUSSION
This part demonstrates the differences between results before and after applying the Complimentary filter. Figure  11-13 demonstrates the plotted graph of the results on the X-axis, Y-axis, and Z-axis. Once the measurement is obtained, all of the axes degrees of rotation are plotted on the graph, along with the threshold. With these, it is evident that the threshold and the raw value arriving from the MPU6050 sensor before it is filtered have a noticeable difference graph pattern between the threshold (red line) and the measured value of the MPU6050 sensor (black line). Next is to substitute the raw data onto the Complimentary filter to improve the accuracy. The results are shown in Figures 14-16. The red line is for the threshold; meanwhile, the blue line reads the measurement from the MPU6050 sensor. Those three graphs indicate that the pattern of the X, Y and Z-axis results is remarkably similar to the threshold. Thus, the graph's pattern is virtually the same for each axis.

CONCLUSION
The readings from before and after the Complimentary Filter are now combined onto a single graph for a clear overview as shown in Figure 17. As a result, the graph's layout between filtered and threshold was nearly identical, but the graph's raw value pattern has a big difference. Results with a complimentary filter proved the accuracy of approximately ±1.5° rather than with the raw IMU reading from the MPU6050 sensor. This result verifies that both the gyroscope and accelerometer require a filter to ensure the output free of interference and achieve desirable accuracy. Blynk application is used to visualise the accurate data of the MPU6050 sensor in degree. The Blynk application interface after connecting to the MPU6050 sensor via the internet is shown in Figure 18. The Blynk app displays the value for the X-axis, which is red coloured text, the Y-axis, which is yellow coloured text, and the Z-axis, which is blue coloured text. This allows any user to read the axis value using only their smartphone. Finally, the project's objective of analysing the accuracy of the MPU6050 sensor's inertial measurement and improving the achievable accuracy rate to 95% utilising complementary filters was met. The concept was examined with the help of NodeMCU-based IMU. Static and dynamic analyses have been used to test it. The negative numbers indicate that the angle's direction was different (anticlockwise). The acceleration of a moving or vibrating object was recorded by an accelerometer, while a gyroscope monitored the angular rate or orientation because the acceleration values are not constant, the graph for raw value differed significantly from the graph for threshold. A complementary filter was created by combining a high pass filter and a low pass filter. As a result, the gyroscope data should be gathered and merged to build a complementary filter with an achievable accuracy rate of 95%. s, and Z-axis. Once of the axes degrees ph, along with the t that the threshold m the MPU6050 ave a noticeable the threshold (red e MPU6050 sensor mentary Filter Measured value for Measured value for Measured value for raw data onto the the accuracy. The 16. The red line is reading from the MPU6050 sensor. This result verifies that both the gyroscope and accelerometer require a filter to ensure the output free of interference and achieve desirable accuracy. Equation 3 is inserted in the complementary filter to improve the accuracy.

Comparison between Raw vs Filtered output
Raw Threshold Filtered