MPU-6050 Manufacturer, Working Principle, Application and Package

12 March 2024


Ⅰ. Introduction to MPU-6050

Ⅱ. Manufacturer of MPU-6050

Ⅲ. Internal block diagram of MPU-6050

Ⅳ. How does the MPU-6050 work?

Ⅴ. Where is MPU-6050 used?

Ⅵ. Package of MPU-6050

Ⅶ. How to reduce the noise of MPU-6050?

Ⅷ. MPU-6050-based motion trajectory calculation



Ⅰ. Introduction to MPU-6050


MPU-6050 is the world's first integrated 6-axis motion processing component, which integrates a 3-axis gyroscope, 3-axis accelerometer and a scalable digital motion processor (DMP). The purpose of using it is to obtain the inclination angle of the object to be measured (such as a quadcopter, a balancing car) on the x, y, and z axes, that is, the pitch angle, roll angle and yaw angle. We read the six data of the MPU-6050 (three-axis acceleration AD value and three-axis angular velocity AD value) through the I2C interface. After posture fusion processing, the Pitch, Roll, and Yaw angles can be calculated. As a directional reference for measurement values, the definition of the sensor coordinate direction is as shown in the figure below, which follows the principle of the right-handed coordinate system (that is, the right thumb points to the positive direction of the x-axis, the index finger points to the positive direction of the y-axis, and the middle finger points to the positive direction of the z-axis. direction).


48869bfa8d958de4a798f586942c2c19.png


With its dedicated I2C sensor bus, the MPU-6050 is able to receive input directly from an external 3-axis compass, providing a full 9-axis MotionFusion™ output. It eliminates the discrepancy problem between the combined gyroscope and accelerator timeline and significantly reduces packaging space compared to multi-component solutions. When connected to a three-axis magnetometer, the MPU-60X0 is capable of providing full 9-axis motion fusion output to its main I2C or SPI port (note that the SPI port is only available on the MPU-6000).


Alternatives and equivalents:

AIS328DQTR

ICM-20689

MPU-3300

MPU-6000

MPU-6500



Ⅱ. Manufacturer of MPU-6050


The manufacturer of MPU-6050 is TDK. After the two founders of TDK, Dr. Yogoro Kato and Takei Takei, invented ferrite in Tokyo, they founded Tokyo Denkikagaku Kogyo K.K. in 1935. As a global electronics industry brand, TDK has always maintained a dominant position in the fields of electronic raw materials and electronic components. TDK's comprehensive and innovation-driven product portfolio covers passive components such as ceramic capacitors, aluminum electrolytic capacitors, film capacitors, magnetic products, high-frequency components, piezoelectric and protection devices, as well as sensors and sensor systems (such as temperature and pressure, magnetic and MEMS sensors), etc. In addition, TDK also provides power supplies and energy devices, magnetic heads and other products. Its product brands include TDK, EPCOS, InvenSense, Micronas, Tronics and TDK-Lambda.



Ⅲ. Internal block diagram of MPU-6050


c69137341b6b5c356056c8b480d5eca7.png


Among them, SCL and SDA are the IIC interfaces connected to the MCU, and the MCU controls the MPU-6050 through this IIC interface. There is also an IIC interface, namely AUX_CL and AUX_DA. This interface can be used to connect external slave devices, such as magnetic sensors, to form a nine-axis sensor. VLOGIC is the IO port voltage. This pin can support a minimum of 1.8V. We usually connect it directly to VDD. AD0 is the address control pin of the slave IIC interface (connected to the MCU). This pin controls the lowest bit of the IIC address. If it is connected to GND, the IIC address of MPU-6050 is 0x68; if it is connected to VDD, it is 0x69. Please note that the address here does not include the lowest bit of data transmission (the lowest bit is used to represent read and write operations). On the MWbalancedSTC15, AD0 is connected to GND, so the IIC address of the MPU-6050 is 0x68 (excluding the lowest bit).


1. Initialize the IIC interface

MPU-6050 uses IIC to communicate with STC15, so we need to initialize the SDA and SCL data lines connected to MPU-6050 first.


2. Reset MPU-6050

This step restores all registers inside the MPU-6050 to their default values, which is achieved by writing 1 to bit7 of the power management register 1 (0x6B). After reset, the power management register 1 will be restored to the default value (0x40), and this register must subsequently be set to 0x00 to wake up the MPU-6050 and put it into normal working state.


3. Set the full-scale range of the angular velocity sensor (gyro) and acceleration sensor

In this step, we set the full-scale range (FSR) of the two sensors through the gyroscope configuration register (0X1B) and the acceleration sensor configuration register (0X1C) respectively. Typically, we set the full-scale range of the gyroscope to ±2000dps and the full-scale range of the accelerometer to ±2g.


4. Set other parameters

Here, we also need to configure the following parameters: turn off interrupts, disable the AUX I2C interface, disable FIFO, set the gyroscope sampling rate, and configure the digital low-pass filter (DLPF). Since we do not use interrupts to read data in this chapter, the interrupt function needs to be turned off. At the same time, since we are not using the AUX I2C interface to connect other external sensors, we also need to close this interface. These functions can be controlled through the interrupt enable register (0x38) and user control register (0x6A). MPU-6050 can use FIFO to store sensor data, but we have not used it in this chapter, so all FIFO channels need to be closed. This can be controlled through the FIFO enable register (0x23). By default, the value of this register is 0 (that is, FIFO is disabled), so we can use the default value directly. The sampling rate of the gyroscope is controlled by the sampling rate divider register (0x19). Normally, we set this sampling rate to 50. The configuration of the digital low-pass filter (DLPF) is completed through the configuration register (0x1A). Generally speaking, we will set DLPF to half the bandwidth to balance data accuracy and response speed.


5. Configure the system clock source and enable the angular velocity sensor and acceleration sensor

The setting of the system clock source depends on the power management register 1 (0x6B), where the lowest three bits of this register determine the selection of the clock source. By default, these three bits are set to 0, which means the system uses the internal 8MHz RC oscillator as the clock source. However, in order to improve the clock accuracy, we often set it to 1 and select the x-axis gyroscope PLL as the clock source. In addition, enabling the angular velocity sensor and acceleration sensor is also an important step in the initialization process. Both operations are implemented through power management register 2 (0x6C). Simply set the corresponding bit to 0 to activate the corresponding sensor. After completing the above steps, the MPU-6050 can enter normal working status. Those registers that are not specially set will adopt the default values preset by the system.



Ⅳ. How does the MPU-6050 work?


1. Gyro sensor

The sensor is equipped with a gyro inside, which will always remain parallel to the initial direction due to the gyroscopic effect. Therefore, we can calculate the direction and angle of rotation by detecting the deviation of the gyro from the initial direction.


2. Accelerometer sensor

An accelerometer sensor is a device that can measure acceleration and it works based on the principle of piezoelectric effect. During acceleration, the sensor measures the inertial force applied to the mass block and then calculates the acceleration value using Newton's second law.


3. Digital motion processor (DMP)

The DMP is a data processing module in the MPU6050 chip that has a built-in Kalman filtering algorithm for acquiring data from the gyroscope and accelerometer sensors and processing the output quaternions. This feature greatly reduces the workload of the peripheral microprocessor and avoids the tedious filtering and data fusion process.


Notes:

Quaternions: Quaternions are simple supercomplex numbers. Complex numbers are composed of real numbers plus the imaginary unit i, where i^2 = -1.



Ⅴ. Where is MPU-6050 used?


• Toys

• Handset and portable gaming

• Motion-based game controllers

• BlurFree™ technology (for video/still image stabilization)

• AirSign™ technology (for security/authentication)

• InstantGesture™ iG™ gesture recognition

• Wearable sensors for health, fitness and sports

• Motion-enabled game and application framework

• MotionCommand™ technology (for gesture short-cuts)

• Location based services, points of interest, and dead reckoning

• 3D remote controls for Internet connected DTVs and set top boxes, 3D mice

• TouchAnywhere™ technology (for “no touch” UI application control/navigation)



Ⅵ. Package of MPU-6050


c8eb7deb39113d33d167b5f81b79a209.png



Ⅶ. How to reduce the noise of MPU-6050?


We can take the following ways to reduce the noise of MPU-6050:


1. Use calibrated sensors: Calibrating the accelerometer and gyroscope of the MPU-6050 can eliminate the bias and error of the sensors themselves, thus reducing the effect of noise. The calibration process usually consists of two stages: static calibration and motion calibration.


2. Hardware filtering process: Adding filter capacitors to the power line of MPU-6050 can reduce the impact of power supply noise on the sensor. Meanwhile, during PCB layout, we should try to keep MPU-6050 away from potential sources of interference, such as high-frequency signal lines and high-power components.


3. Software filtering processing: After collecting the raw data from MPU-6050, we can add a software filtering link to pre-process the initial data to eliminate noise-induced interference. Commonly used software filtering methods include mean filtering, median filtering, Kalman filtering and so on.


4. Use internal low-pass filter: MPU-6050 has an internal integrated digital low-pass filter, which can be used to reduce high-frequency noise by setting its cutoff frequency. Specifically, we can set the cutoff frequency of the digital filter by modifying the CONFIG register of the MPU-6050 to eliminate the high-frequency noise caused by A/D sampling.



Ⅷ. MPU-6050-based motion trajectory calculation


The MPU-6050 is a six-axis accelerometer and gyroscope sensor that can be used to measure the motion and attitude of objects. The motion trajectory calculation based on MPU-6050 can be realized by the following steps:


The first step is to read the sensor data. We need to read the accelerometer and gyroscope data from the MPU-6050 sensors using appropriate drivers and library functions. These data are usually output in a digital format, so some conversion and calibration work is required to convert them to actual measurements in physical units.


The second step is to calculate the acceleration. First, we need to process the data from the accelerometer to derive the acceleration of the object in each axis. Subsequently, in order to calculate the velocity and displacement of the object in each axis, we need to integrate the acceleration data. Numerical integration techniques, such as Euler's method or the Lunger-Kutta method, are often used in this process to ensure the accuracy of the displacement calculations.


The third step is to calculate the angular velocity. Using gyroscope data, the angular velocity of the object in each axis can be calculated. Again, this data needs to be calibrated and converted to obtain the angular velocity in actual physical units.


The fourth step is to calculate the rotation. By integrating the angular velocity data, the angle of rotation of the object in each axis can be calculated. This can be done using numerical integration techniques such as Euler's method or the Longe-Kutta method to calculate the angle.


The fifth step is to merge the data. We combine the data from accelerometers and gyroscopes to obtain complete attitude and position information of the object. This can be done using algorithms such as quaternion-based attitude solver or Euler angle solver.


The sixth step is to visualize the results. We convert the computed object motion trajectory into a set of points in a 3D coordinate system and display it using appropriate visualization tools for a more intuitive understanding of the object's motion trajectory and attitude changes.




Frequently Asked Questions


1. How accurate is MPU6050?


The acquired results showed sufficient accuracy of less than 1 % and reliability, assuring the proper dimensioning of the elevator shaft and the high standards of the lift industry.


2. How to read data from MPU6050?


To read the internal MPU6050 registers, the master sends a start condition, followed by the I2C slave address and a write bit, and then the register address that is going to be read.


3. Where is MPU6050 used?


In wearable health-tracking, fitness-tracking devices. In drones and quadcopters, MPU6050 is used for position control. Used in controlling Robotic Arm. Hand gesture control devices.


4. Is MPU6050 an IMU?


The MPU6050 IMU Sensor block reads data from the MPU-6050 sensor that is connected to the hardware. The block outputs acceleration, angular rate, and temperature along the axes of the sensor.


5. What is the processing of MPU6050?


This is the MPU6050's onboard processor that combines the data coming from the accelerometer and gyroscope. The DMP is the key to using the the MPU6050 and is explained in detail later. As with all microprocessors the DMP needs firmware in order to run.