MEMS Gyroscope Based On MPU-6050 Sensor and ATmega328 Microcontroller
MEMS Gyroscope Based On MPU-6050 Sensor and ATmega328 Microcontroller
Abstract—This paper provides a reliable practical systems, including optical elements such as a fast-steering
implementation of the MEMS gyroscope on the base of MPU- mirror, whose performance is poor in open loop control mode.
6050 universal triaxial inertial measuring unit with a gyroscope
sensor and accelerometer and the microcontroller ATmega328. Proposed in work [3] improvement of double step
Presented interconnection of functional modules on the base of algorithm is to shorten the settling time and improve its quasi-
I2C protocol has allowed to improve the calibration process and static working bandwidth. Mostly all approaches to improve
make a zero offset for all orthogonal sensors in gyroscope that gyroscope parameters are in sensor design, materials and
in return reduce the additive measurement error. Analysis of integration on optical signal to provide a stable
electromechanical properties of universal gyroscope has shown communication link [4].
different properties of vibrating systems. Sensitive elements
signal processing common with developed error model, that The purpose of this paper is to offer a low-cost gyroscope
includes nonlinearity of sensors characteristics, has allowed to system with a maximum efficiency and maximum accuracy of
reduce the total measurement error of MEMS gyroscope up to angular displacement measurement on the base of MPU-6050
1%. sensor.
𝑚 𝑐 𝑘𝑥 𝐹 2𝑚𝛺 (1)
Since the driving mode response is typically much larger
than the sensing mode response, the Coriolis force 2𝑚𝛺
becomes insignificant, and equation (1) can be expressed as
follows:
𝑚 𝑐 𝑘𝑥 𝐹 (2) Fig.3. The mechanical part of an MPU6050 [8]
TT3.39.2
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:21:23 UTC from IEEE Xplore. Restrictions apply.
2024 IEEE 7th International Conference on Smart Technologies in Power Engineering and Electronics (STEE-2024)
TT3.39.3
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:21:23 UTC from IEEE Xplore. Restrictions apply.
2024 IEEE 7th International Conference on Smart Technologies in Power Engineering and Electronics (STEE-2024)
transmitted. A low to high voltage shift on the SDA line nowhere connected (or connected to GND) - the address of the
following a low to high voltage transition on the SCL line, sensor on the i2c bus will be 0x68, if it is plugged into the
with the SCL line staying high, is the stop condition. power (VCC) – the address will be 0.x69 [1].
IV. EXPERIMENTAL SETUP AND GYROSCOPE DESIGN
The Arduino Nano board acts as the hardware bandage of
the ATmega328 microcontroller as it is shown in Figures 6.1-
6.3:
TT3.39.4
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:21:23 UTC from IEEE Xplore. Restrictions apply.
2024 IEEE 7th International Conference on Smart Technologies in Power Engineering and Electronics (STEE-2024)
- Data is printed as: acelX acelY acelZ giroX giroY giroZ For the evaluation of calibration procedure, it is necessary
to analyze the experimental results to find sensitivity S and
The MPU6050 can be used to extract meaningful data in offset O.
two different methods. One method is to compute the new Solution of equations (1)-(2) for calculation the amplitude
orientation by reading the raw sensor data values, just as it was of sensitive elements oscillations 𝐴 𝑡 after time 𝑡 of
did during the calibration procedure. Extraction of data from rotation (acceleration) is follow:
the MPU's onboard Digital Motion Processor (DMP) is the ∙
second approach. 𝐴 𝑡 2 𝑒 (7)
There are multiple translations that must be performed in
order to obtain the pitch angle from the raw sensor data. were 𝛾 – an attenuation coefficient, 𝛺 – angular frequency of
The angular velocity—the rate at which the angular forced oscillations, 𝛺 – minimal measured angular
position changes over time—is provided by the velocity, 𝐴 – displacement along X-axis, 𝑣 – natural angular
gyroscope. frequency of oscillator.
Consequently, in order to obtain the angle position,
V. EXPERIMENTAL RESULTS
it must be integrated across time.
You must use the IMU offsets to convert readings During the test the following four parameters were
from the body frame to the inertial frame before analyzed:
performing any computations. Minimal measurement errors
The raw IMU sensor readings must be converted to Accumulation of poxibba
degrees. Maximum rotation bits
Processing that would typically need to be done on the Artifacts during measurement
CPU is offloaded to the DMP. It keeps an internal buffer full The measurement of a slow (1,43 rad/s) rotation for each
of information from the accelerometer and gyro that it uses to three dimentions is presented in Figure 10.
calculate orientation. The FiFo buffer structure of the DMP is
shown in Figure 9.
TT3.39.5
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:21:23 UTC from IEEE Xplore. Restrictions apply.
2024 IEEE 7th International Conference on Smart Technologies in Power Engineering and Electronics (STEE-2024)
where T is the surrounding temperature, 𝑘 – Boltsman accuracy up to 0,1° using an autocorrelation function as
constant, 𝛺⬚ and 𝑚 are the frequency and mass at resonance, follow:
and 𝑄 is the quality factor. ∙ ∙
𝐴 𝑡 2 𝑒 𝑑𝑡 (10)
The experimental results of sensitive elements oscillations
are presented in Figures 11.1-11.3. were 𝜏 is a shift time, 𝑡 is a time oscillation under 3dB level,
𝜎 is a dispersion of oscillations.
For usual opperation, the angle value can only be used
with an accuarasy up to 1° since the sensor is noisy enough,
and measured values less than 1° are very unstable.
VI. CONCLUSIONS
In this paper a new calibration method of the MPU-6050
gyroscope is presented. Under the control of ATmega328
microcontroller it became possible to avoid the offset errors
before measurement starts. Fast communication and data
analysis is realized using I2C protocol.
The firmware of the microcontroller, the calibration of the
Fig.11.1. X-axis swing sensor shows its semi liner measurement parameters.
The presented gyroscope device is assembled of minimum
components and show minimum error of 2°, maximum angle
of inclination of 180°.
Research of MPU-6050 gyroscope dynamic parameters
have shown different thermomechanical properties and noise
signals of triaxial sensors. To improve the accuracy of
gyroscope measurement it is shown that the error model can
be improved by using the experimental data of sensor
research. Excluding the nonlinearity of Y and Z gyroscope
sensors common with presented calibration it is possible to
minimize the measurement error up to 0,1°.
REFERENCES
Fig.11.2. Y-axis swing [1] S. A. R. Bukhari, M. M. Saleem, A. Hamza and S. A. Bazaz, "A Novel
Design of High Resolution MEMS Gyroscope Using Mode-
Localization in Weakly Coupled Resonators," in IEEE Access, vol. 9,
pp. 157597-157608, 2021, doi: 10.1109/ACCESS.2021.3123152.
[2] D. Lei, T. Wang, D. Cao and J. Fei, "Adaptive Dynamic Surface
Control of MEMS Gyroscope Sensor Using Fuzzy Compensator," in
IEEE Access, vol. 4, pp. 4148-4154, 2016, doi:
10.1109/ACCESS.2016.2596538.
[3] Y. Zihao, W. Lihao, W. Yang, Z. Yonggui, L. Yichen and W. Zhenyu,
"Control of a MEMS Fast Steering Mirror With Improved Quasi-Static
Performance," in IEEE Access, vol. 11, pp. 95307-95314, 2023, doi:
10.1109/ACCESS.2023.3311139.
[4] S. Jeon and H. Toshiyoshi, ‘‘MEMS tracking mirror system for a
bidirectional free-space optical link,’’ Appl. Opt., vol. 56, no. 24, pp.
6720–6727, 2017.
[5] Data Sheet “MPU-6000 and MPU-6050 Product Specification
Revision 3.4” pp. 7-31.
Fig.11.3. Z-axis swing [6] Data Sheet and Schematics “Arduino Nano V3.3”, 2011, 57p.
[7] Weqas A. G, Ian H. Ilyas M. and Kristoffer McKee “A Review of
From Figures 11.1-11.3 and expression (9) it is clear that MEMS Vibrating Gyroscopes and Their Reliability Issues in Harsh
all three sensors in triaxial accelerometer have different Environments” Licensee MDPI 2022, pp. 1-12.
[8] Leens F “An Introduction To I2C And SPI Protocols” IEEE
electromechanical properties, resonant frequencies, quality Instrumentation & Measurement Magazine. vol 12. pp. 8-12.
factors and different noise. It also explains the different [9] S. Kim and M. Kim, "Rotation Representations and Their
measurement errors in Figure 10. Conversions," in IEEE Access, vol. 11, pp. 6682-6699, 2023, doi:
On the base of equations (1-3) and (9) and developed 10.1109/ACCESS.2023.3237864.
[10] R. Perelló-Roig, J. Verd, S. Bota, and J. Segura, “Thermomechanical
calibration method it is required additional signal processing noise characterization in fully monolithic CMOS-MEMS resonators”
from all gyroscope sensors sententiously. It allows to get Sensors, vol. 18, no. 9, p. 3124, Sep. 2018, doi: 10.3390/s18093124.
TT3.39.6
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:21:23 UTC from IEEE Xplore. Restrictions apply.