MPU6050 application details

The MPU6050 gyroscope is used in the recent project, and I have never touched it before. Although it is easy to find the code you need online. Some functions are implemented. However, I still don't know much about the working principle of the gyroscope. Its code also needs to be analyzed, and I2C communication and related registers should also be familiar. I see that the Internet is mostly implemented on the Arduino development board, so how to implement it on the C51 microcontroller board, or how to implement it on the S5PV210? With these questions, the development of MPU6050 started.

1. Model

I took a look at the model  GY-521 MPU6050 module three-dimensional angle sensor 6DOF three-axis accelerometer electronic gyroscope


The latest chip manual and register map and description can be downloaded from the official website, see: MPU6050 official website


2. Check the chip manual

(1) Product introduction

The MPU-60X0 is the world's first integrated 6-axis MotionTracking device. It integrates a 3-axis MEMS gyroscope, a 3-axis MEMS accelerometer, and an extensible digital motion processor DMP (DigitalMotion Processor), which can be connected to a third-party digital sensor, such as a magnetometer, via the I2C interface. After expansion, it can output a 9-axis signal through its I2C or SPI interface (SPI interface is only available on MPU-6000). The MPU-60X0 can also connect non-inertial digital sensors, such as pressure sensors, through its I2C interface.
The MPU-60X0 uses three 16-bit ADCs for the gyroscope and accelerometer respectively, and converts the analog quantity measured by it into a digital quantity that can be output. In order to accurately track fast and slow motion, the measurement range of the sensor is user-controllable, the measurement range of the gyroscope is ±250, ±500, ±1000, ±2000°/second (dps), the measurement range of the accelerometer is ±2, ±4, ±8, ±16g.
An on-chip 1024-byte FIFO helps reduce system power consumption. Communication with all device registers uses 400kHz I2C interface or 1MHz SPI interface (SPI is only available for MPU-6000).  For applications requiring high-speed transfer, 20MHz SPI can be used for register read and interrupt. In addition, a temperature sensor and oscillator with only ±1% variation under operating conditions are embedded on the chip. The chip size is 4×4×0.9mm, and it adopts QFN package (leadless square package), which can withstand the impact of up to 10000g, and has a programmable low-pass filter.
Regarding power supply,  MPU-60X0 can support VDD range of 2.5V±5%, 3.0V±5%, or 3.3V±5% . In addition, the MPU-6050 has a VLOGIC pin that provides logic levels for the I2C output. VLOGIC voltage can take 1.8±5% or VDD.

(2) Product Features

Digital output 6-axis or 9-axis rotation matrix, quaternion (quaternion), Euler angle format (EulerAngleforma) fusion calculation data.
3-axis angular velocity sensor (gyroscope) with 131 LSBs/°/sec sensitivity and full-frame sensing ranges of ±250, ±500, ±1000 and ±2000°/sec.
Programmable 3-axis accelerator with program control ranges of ±2g, ±4g, ±8g and ±16g.
Removed sensitivity between accelerometer and gyroscope axes, reducing the effect of settings and sensor drift.
Digital Motion Processing (DMP: DigitalMotion Processing) engine can reduce the load of complex fusion calculation data, sensor synchronization, posture sensing, etc. The motion processing database supports Android, Linux and Windows built-in operating time offset and magnetic sensor calibration calculation technology, eliminating the need for customers to perform additional calibration.
Temperature sensor
with digital output Supports video electronic image stabilization technology and GPS programmable interrupt with digital input Syncpin
Support gesture recognition, panning, zoom in and out, scrolling, fast descent high-G interrupt, zero motion sensing, touch sensing, shaking sensing functions.
VDD supply voltage is 2.5V±5%, 3.0V±5%, 3.3V±5%; VDDIO is 1.8V±5%
Gyro operating current: 5mA, Gyro standby current: 5uA; Accelerator operating current: 500uA, accelerator Power saving mode current: 40uA@10Hz
up to 400kHz fast mode I2C, or up to 20MHz SPI serial host interface (serial hostinterface) The
built-in oscillator has only ±1% frequency variation over the operating temperature range. Optional external clock input 32.768kHz or 19.2MHz

(3) Instructions for use

《1》Pin output and signal description



"2" typical usage


《3》所需电容规格



需要了解的小知识点:

电容的基本单位是F(法拉),其它单位还有:毫法(mF)、微法(uF)、纳法(nF)、皮法(pF)。
由于单位F 的容量太大,所以我们看到的一般都是μF、nF、pF的单位。
换算:1F=1000000μF,1μF=1000nF=1000000pF

电容规格:Ceramic, X7R, 0.1μF ±10%, 2V  是什么意思呢?

参看:全系列电容规格书

Ceramic

陶瓷介质

X7R

温度系数/特性:工作温度范围 -55℃~125℃ (军工级)

    元器件级别主要是指其工作温度范围,如下:
    商业级:0℃~+70℃
    工业级:-40℃~+85℃
    汽车级:-40℃~125℃
    军品级:-55℃~+125℃

0.1μF ±10%

0.1μF 容量,容差是±10%

2V

额定电压,以此也可以选择电容尺寸

三、电路图



到此,硬件部分看完了!!


/////////////////////////////////////////////////////////////////////

上面简单的介绍了 MPU6050,里面有好多概念不明白,3轴、6轴、9轴、加速度计、磁力针、DMP等等。

都是什么玩意。。。啊!!这道题我不会做,太难了!

带着这些问题,继续看芯片手册。

一、概述

MPU-60X0由以下几个关键块和功能组成:

1、带有16位ADC和信号调理的三轴MEMS速率陀螺仪传感器
2、具有16位ADC和信号调理的三轴MEMS加速度传感器
3、数字运动处理器(DMP)引擎
4、主I2C和SPI(仅MPU-6000)串行通信接口
5、用于第三方磁力计和其他传感器的辅助I2C串行接口
6、时钟
7、传感器数据寄存器
8、FIFO
9、中断
10、数字输出温度传感器
11、陀螺仪和加速度计自检
12、偏见和LDO
13、充电泵

其系统结构图:


接下来就一一的开始看。

二、带有16位ADC和信号调理的三轴MEMS陀螺仪

MPU-60X0由三个独立的振动MEMS速率陀螺仪组成,可检测旋转角度X轴,Y轴和Z轴。 当陀螺仪围绕任何感应轴旋转时,科里奥利效应就会产生电容式传感器检测到的振动。 所得到的信号被放大,解调和滤波产生与角速度成比例的电压。 该电压使用单独的片内数字化16位模数转换器(ADC)对每个轴进行采样。 陀螺仪传感器可以全面范围的被数字编程为每秒±250,±500,±1000或±2000度(dps)。 ADC样本速率可以从每秒8,000个采样点编程到每秒3.9个采样点,并且可由用户选择低通滤波器可实现广泛的截止频率。

三、具有16位ADC和信号调理的三轴MEMS加速度计

MPU-60X0的3轴加速度计为每个轴使用单独的检测质量。 加速沿着一条特定轴在相应的检测质量上引起位移,并且电容式传感器检测到该位移位移有差别。 MPU-60X0的架构降低了加速度计的敏感度制造变化以及热漂移。 当设备放置在平坦的表面上时,将进行测量在X和Y轴上为 0g,在Z轴上为+ 1g。 加速度计的比例因子在工厂进行校准并且在名义上与电源电压无关。 每个传感器都有一个专用的sigma-delta ADC来提供数字输出。 数字输出的满量程范围可以调整到±2g,±4g,±8g或±16g。

四、数字运动处理器(DMP)

嵌入式数字运动处理器(DMP)位于MPU-60X0内部,可从主机处理器中卸载运动处理算法的运算。 DMP从加速度计,陀螺仪以及其他第三方传感器(如磁力计)获取数据,并处理数据。结果数据可以从DMP的寄存器中读取,或者可以在FIFO中缓冲。 DMP可以访问其中的一个MPU的外部引脚,可用于产生中断。
DMP的目的是卸载主机处理器的时序要求和处理能力。通常,运动处理算法应该以高速运行,通常在200Hz左右,以提供低延迟的精确结果。即使应用程序以更低的速率更新,这也是必需的。例如,一个低功率的用户界面可能会以5Hz的速度更新,但运动处理仍然应该以200Hz运行。 DMP可以作为一种工具使用,以最大限度地降低功耗,简化定时,简化软件架构,并在主机处理器上节省宝贵的MIPS,以便在应用中使用。

五、主要 I2C 和 SPI 串行通信接口

MPU-60X0使用 SPI(仅MPU-6000) I2C 串行通信至系统处理器接口。 与系统处理器通信时,MPU-60X0始终充当从属设备 LSB的 I2C 从地址的地址由引脚9(AD0)设置(一般接地)。
MPU-60X0与其主机之间的通信逻辑电平如下:
    MPU-6000:与主机通信的逻辑电平由VDD上的电压设置
    MPU-6050:与主机通信的逻辑电平由VLOGIC上的电压设置

六、辅助I2C串行接口

MPU-60X0 具有一个辅助 I2C 总线,用于与片外3轴数字输出磁力计进行通信或其他传感器。 

两种工作模式:

I2C Master Mode,此时MPU-60X0作为主设备与外接传感器通信; 

Pass-Through Mode, 此时仅用作连接, 允许MPU和外接传感器同时和芯片通信。

因为我没有用到磁力针,这部分不详讲。


到此就搞清楚了:

GY-521MPU6050 是三维角度传感器,为全球首例集成六轴传感器的运动处理组件。

这里的六轴,代表的是它内置了一个三轴 MEMS 陀螺仪、一个三轴 MEMS 加速度计,一个数字运动处理引擎(DMP)。它还有用于第三方的数字传感器接口的辅助 I2C 串行接口,比如当辅助 I2C 串行接口连接到一个三轴磁力计MPU6050 能提供一个完整的九轴融合输出到其主 I2C 端口。 


下图标明了传感器的参考坐标系( XYZ组成右手系)以及 3个测量轴和旋转方向。

旋转的正向可用右手螺旋定则判断

        

七、内部时钟生成

MPU-60X0具有灵活的时钟方案,允许多种内部或外部时钟源用于内部同步电路。这个同步电路包括信号调理和
ADC,DMP以及各种控制电路和寄存器。片内PLL提供了灵活性允许输入产生这个时钟。
产生内部时钟的允许的内部源是:
    内部张弛振荡器
    任何X,Y或Z陀螺(在整个温度范围内变化±1%的MEMS振荡器)
允许的外部时钟源是:
    32.768kHz方波
    19.2MHz方波

生成内部同步时钟源的选择取决于外部的可用性来源以及对功耗和时钟精度的要求。这些要求将是最多的可能因操作模式而异。例如,在一种模式中,最关心的是电量消耗,用户可能希望操作MPU-60X0的数字运动处理器进行处理加速计数据,同时保持陀螺仪关闭。在这种情况下,内部张弛振荡器是一个好时钟选择。但是,在另一种陀螺仪激活的模式下,选择陀螺仪作为时钟源提供更精确的时钟源。时钟精度非常重要,因为时序误差直接影响数字运动处理器(以及任何处理器的扩展)执行的距离和角度计算。还有启动条件要考虑。当MPU-60X0首次启动时,设备使用其内部时钟,直到编程从另一个来源操作。这允许用户例如等待使MEMS振荡器在被选为时钟源之前稳定下来。

八、传感器数据寄存器

传感器数据寄存器包含最新的陀螺仪,加速度计,辅助传感器和温度测量数据。 它们是只读寄存器,可通过串行接口访问。 这些寄存器的数据可以随时读取。 但是,可以使用中断函数来确定新数据何时可用。

九、FIFO

MPU-60X0包含一个可通过串行接口访问的1024字节FIFO寄存器 FIFO配置寄存器决定哪个数据写入FIFO。 可能的选择包括陀螺仪数据,加速计数据,温度读数,辅助传感器读数和 FSYNC 输入。 FIFO 计数器跟踪 FIFO 中包含的有效数据字节数。 FIFO寄存器支持突发读取。 中断功能可用于确定新数据何时可用。

十、中断

中断功能通过中断配置寄存器进行配置。 可配置的项目包括INT引脚配置,中断锁存和清除方法以及中断触发器。 可触发中断的项目有:

(1)时钟发生器锁定到新的参考振荡器(用于切换时钟源); 

(2)可以读取新数据(来自FIFO和数据寄存器); 

(3)加速度计事件中断; 

(4)MPU-60X0 没有收到辅助传感器的确认I2C总线。 

中断状态可以从中断状态寄存器读取。

十一、数字输出温度传感器

片上温度传感器和ADC用于测量MPU-60X0芯片温度。 ADC的读数可以从FIFO或传感器数据寄存器读取

十二、偏压和LDO

偏压和LDO部分产生MPU-60X0所需的内部电源和参考电压和电流。 其两个输入是一个2.375至3.46V的未调整VDD和一个1.71V至VDD(仅MPU-6050)的VLOGIC逻辑参考电源电压。 在REGOUT,LDO输出被一个电容旁路。

十三、电荷泵

板载电荷泵产生MEMS振荡器所需的高电压。 其输出在CPOUT旁边被一个电容旁路。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325372265&siteId=291194637