MPU-6000为全球首例整合性6轴运动处理组件,相较于多组件方案,免除了组合陀螺仪与加速器时之轴间差的问题,减少了大量的包装空间。MPU-6000整合了3轴陀螺仪、3轴加速器,并含可藉由第二个I2C端口连接其他厂牌之加速器、磁力传感器、或其他传感器的数位运动处理(DMP: Digital Motion Processor)硬件加速引擎,由主要I2C端口以单一数据流的形式,向应用端输出完整的9轴融合演算技术
InvenSense的运动处理资料库,可处理运动感测的复杂数据,降低了运动处理运算对操作系统的负荷,并为应用开发提供架构化的API。
MPU-6000的角速度全格感测范围为±250、±500、±1000与±2000°/sec (dps),可准确追緃快速与慢速动作,并且,用户可程式控制的加速器全格感测范围为±2g、±4g±8g与±16g。产品传输可透过最高至400kHz 的I2C或最高达20MHz的SPI。
MPU-6000可在不同电压下工作,VDD供电电压介为2.5V±5%、3.0V±5%或3.3V±5%,逻辑接口VVDIO供电为1.8V± 5%。MPU-6000的包装尺寸4x4x0.9mm(QFN),在业界是性的尺寸。其他的特征包含内建的温度感测器、包含在运作环境中仅有±1%变动的振荡器。应用
运动感测游戏
现实增强
电子稳像(EIS: Electronic Image Stabilization)
光学稳像(OIS: Optical Image Stabilization)
行人导航器
“零触控”手势用户接口
姿势快捷方式
认证市场
智能型手机
平板装置设备
手持型游戏产品
游戏机
3D遥控器
可携式导航设备
特征
1、以数字输出6轴或9轴的旋转矩阵、四元数(quaternion)、欧拉角格式(Euler Angle forma)的融合演算数据。
2、具有131 LSBs/°/sec 敏感度与全格感测范围为±250、±500、±1000与±2000°/sec 的3轴角速度感测器(陀螺仪)。
3、可程式控制,且程式控制范围为±2g、±4g、±8g和±16g的3轴加速器。
4、移除加速器与陀螺仪轴间敏感度,降低设定给予的影响与感测器的飘移。
5、数字运动处理(DMP: Digital Motion Processing)引擎可减少复杂的融合演算数据、感测器同步化、姿势感应等的负荷。
6、运动处理数据库支持Android、Linux与Windows
7、内建之运作时间偏差与磁力感测器校正演算技术,免除了客户须另外进行校正的需求。
8、以数位输出的温度传感器
9、以数位输入的同步引脚(Sync pin)支援视频电子影相稳定技术与GPS10、可程式控制的中断(interrupt)支援姿势识别、摇摄、画面放大缩小、滚动、快速下降中断、high-G中断、零动作感应、触击感应、摇动感应功能。
11、VDD供电电压为2.5V±5%、3.0V±5%、3.3V±5%;VDDIO为1.8V± 5%
12、陀螺仪运作电流:5mA,陀螺仪待命电流:8A;加速器运作电流:8A,加速器省电模式电流:8A@10Hz
13、高达400kHz快速模式的I2C,或最高至20MHz的SPI串行主机接口(serial host interface)
14、内建频率产生器在所有温度范围(full temperature range)仅有±1%频率变化。
15、使用者亲自测试
16、10,000 g 碰撞容忍度
17、为可携式产品量身订作的最小最薄包装(4x4x0.9mm QFN)
18、符合RoHS及环境标准MPU-6000为全球首例整合性6轴运动处理组件,相较于多组件方案,免除了组合陀螺仪与加速器时之轴间差的问题,减少了大量的包装空间。MPU-6000整合了3轴陀螺仪、3轴加速器,并含可藉由第二个I2C端口连接其他厂牌之加速器、磁力传感器、或其他传感器的数位运动处理(DMP: Digital Motion Processor)硬件加速引擎,由主要I2C端口以单一数据流的形式,向应用端输出完整的9轴融合演算技术
InvenSense的运动处理资料库,可处理运动感测的复杂数据,降低了运动处理运算对操作系统的负荷,并为应用开发提供架构化的API。
MPU-6000的角速度全格感测范围为±250、±500、±1000与±2000°/sec (dps),可准确追緃快速与慢速动作,并且,用户可程式控制的加速器全格感测范围为±2g、±4g±8g与±16g。产品传输可透过最高至400kHz 的I2C或最高达20MHz的SPI。
MPU-6000可在不同电压下工作,VDD供电电压介为2.5V±5%、3.0V±5%或3.3V±5%,逻辑接口VVDIO供电为1.8V± 5%。MPU-6000的包装尺寸4x4x0.9mm(QFN),在业界是性的尺寸。其他的特征包含内建的温度感测器、包含在运作环境中仅有±1%变动的振荡器。
MEMS模块功能: 三轴陀螺仪,三轴加速度计
电源电压最小值: 2.5V
电源电压最大值: 3.6V
封装类: QFN
针脚数: 24
陀螺仪范围: ± 250°/s, ± 500°/s, ± 1000°/s, ± 2000°/s
dps是一种角速度单位,Degree Per Second的缩写°/S。
加速度范围: ± 2g, ± 4g, ± 8g, ± 16g
封装: 剪切带
MSL: -
19.2MHz或32.768kHz 可选外部时钟输入频率变化。内部有自带晶振。
DMP从陀螺仪、加速度计以及外接的传感器接收并处理数据,处理结果可以从DMP 的寄存器读出,或通过FIFO缓冲. DMP有权使用MPU的一个外部引脚产生中断。
6050使用I2C,并且总是作为从设备。连接主设备的逻辑电平用VLOGIC引脚设置。I2C 的Slave地址的最低有效位(LSB)用PIN9(AD0)设置。
自检可用来测试传感器的机械和电气结构。对每个测量轴的自检可通过设置控制寄存器ACCEL_CONFIG 和GYRO_CONFIG的相关位来进行。自检启动后,电路会使传感器工作并且产生输出信号。
MPU-6050器件结合了3轴陀螺仪和在同一硅芯片的三轴加速度计,结合机载数字运动处理器™(DMP™),处理复杂的六轴motionfusion算法。该设备可以通过一个辅助主我²C总线访问外部传感器或其它传感器,允许设备收集全套传感器数据。
轴方向的灵敏度和极性旋转
1(CLKIN) Optional external reference clock input. Connect to GND if unused.可选的外部参考时钟输入,不用则连接到GND 2,3, 4, 5, 14,15, 16, 17(NC) Not internally connected. May be used for PCB trace routing.无内部连接。可用于PCB布线。
6(AUX_DA) I 2C master serial data, for connecting to external sensors I~2C主串行数据,用于连接外部传感器
7(AUX_CL) I 2C Master serial clock, for connecting to external sensors I~2C串行主时钟,用于连接外部传感器
8(VLOGIC) Digital I/O supply voltage 数字I / O电源电压
9(AD0) I 2C Slave Address LSB (AD0)I2C从地址的LSB(ADO)
10(REGOUT) Regulator filter capacitor connection调节器的滤波电容器的连接
11(FSYNC) Frame synchronization digital input. Connect to GND if unused.帧同步数字输入。如果不用则连接到GND。带数字输入同步引脚(Sync pin)支持视频电子影相稳定技术与GPS
12(INT) Interrupt digital output (totem pole or open-drain)中断的数字输出(推挽或开漏)可程序控制的中断(interrupt),支持姿势识别、摇摄、画面放大缩小、滚动、快速下降中断、high-G中断、零动作感应、触击感应、摇动感应功能
13(VDD) Power supply voltage and Digital I/O supply voltage电源电压和数字I / O电源电压
18(GND) Power supply ground电源地
19, 21(RESV) Reserved. Do not connect.保留。不连接。
20(CPOUT) Charge pump capacitor connection电荷泵电容连接
22(CLKOUT) System clock output系统时钟输出
23(SCL) I 2C serial clock (SCL)I2C串行时钟(SCL)
24(SDA) I 2C serial data (SDA)I2C串行数据(SDA)Typical Operating Circuit
外部零件材料账单
推荐上电过程:
Power-Up Sequencing先后顺序
1 . VLOGIC amplitude振幅must always be ≤VDD amplitude
2. TVDDR is VDD rise time: Time for VDD to rise from 1 0% to 90% of its final value
3. TVDDR is ≤1 00ms
4. TVLGR is VLOGIC rise time: Time for VLOGIC to rise from 1 0% to 90% of its final value
5. TVLGR is ≤3ms
6. TVLG-VDD is the delay from the start of VDD ramp斜道to the start of VLOGIC rise
7. TVLG-VDD is ≥0
8. VDD and VLOGIC must be monotonic单调的ramps
Block Diagram框图
Note: Pin names in round brackets ( ) apply only to MPU-6000
Pin names in square brackets [ ] apply only to MPU-6050
Bypass旁道,支路. multiplexer多路调制器FSYNC帧同步数字输入。如果未连接到GND。
偏压和LDO部分提供了6050需要的内部支持以及参考电压和参考电流。他的2个输出为VDD(2.1V-3.6V)和VLOGIC逻辑参考电压(1.71V~VDD)
Overview
The MPU-60X0 is comprised of the following key blocks and functions(关键模块和功能)
1. Three-axis MEMS rate gyroscope sensor with 16-bit ADCs and signal conditioning
2. Three-axis MEMS accelerometer sensor with 16-bit ADCs and signal conditioning
3. Digital Motion Processor (DMP) engine
4. Primary I 2C serial communications interfaces
5. Auxiliary I2C serial interface for 3rd party magnetometer & other sensors第三方磁强计和其他传感器
6. Clocking
7. Sensor Data Registers
8. FIFO
9. Interrupts
10. Digital-Output Temperature Sensor
11. Gyroscope & Accelerometer Self-test
12. Bias and LDO
13. Charge Pump
6 Electrical Characteristics
6.1 Gyroscope Specifications
VDD = 2.375V-3.46V, VLOGIC (MPU-6050 only) = 1.8V±5% or VDD, T A = 25°C
6.2 Accelerometer Specifications
VDD = 2.375V-3.46V, VLOGIC (MPU-6050 only) = 1.8V±5% or VDD, T A = 25°C
7.7 Three-Axis MEMS Gyroscope with 16-bit ADCs and Signal Conditioning
The MPU-60X0 consists of three independent vibratory振动的MEMS rate gyroscopes, which detect侦察rotation转动about the X-, Y-, and Z- Axes. When the gyros are rotated about any of the sense axes, the Coriolis 科里奥利(法国数学家)Effect causes a vibration that is detected by a capacitive pickoff这是由一个电容式传感器检测. The resulting signal is amplified, demodulated, and filtered由此产生的信号经放大,解调,滤波to produce a voltage that is proportional比例的to the angular rate角速度. This voltage is digitized数字化using individual on-chip单个芯片16-bit Analog-to-Digital Converters (ADCs) to sample each axis. The full-scale range of the gyro sensors may be digitally programmed to ±250, ±500, ±1000, or ±2000 degrees per second (dps). The ADC sample rate is programmable from 8,000 samples per second, down to 3.9 samples per second ADC的采样率可从每秒8000个样本,到每秒3.9个样本, and user-selectable用户可选择的low-pass filters enable a wide range of cut-off frequencies宽范围的截止频率。.
7.8 Three-Axis MEMS Accelerometer with 16-bit ADCs and Signal Conditioning
The MPU-60X0’s 3-Axis accelerometer uses separate proof masses for each axis. Acceleration
along(prep. 沿着;顺着)a particular axis induces感应, 引起displacement替代on the corresponding对应的proof mass, and capacitive电容性的sensors detect侦查the displacement differentially. The MPU-60X0’s architecture体系结构reduces 减少the accelerometers’ susceptibility 易受影响或损害的状态to fabrication(n.制造)variations变化as well as to thermal温热的drift漂移. When the device is placed on a flat surface, it will measure 0g on the X- and Y-axes and +1 g on the Z-axis. The accelerometers’ scale factor is calibrated at the factory该加速度计标度因数是在工厂校准and is nominally independent of supply voltage的电源电压. Each sensor has a dedicated sigma-delta ADC for providing每个传感器都有一个专门的ADC提供digital outputs. The full scale range of the digital output can be adjusted to ±2g, ±4g, ±8g, or ±16g.
7.9 D igital M otion P rocessor
The embedded Digital Motion Processor嵌入式数字运动处理器(DMP) is located within the MPU-60X0 and offloads卸货computation 计算of motion processing运动处理algorithms运算法则from the host processor主处理机.The DMP acquires data from accelerometers, gyroscopes, and additional 3rd party sensors such as magnetometers (n. 磁力计), and processes the data处理数据. The resulting data can be read from the DMP’s registers, or can be buffered in a FIFO. The DMP has access to one of the MPU’s external pins, which can be used for generating interrupts. The purpose of the DMP is to offload both timing requirements and processing power from the host processor. Typically, motion processing algorithms运算法则should be run at a high rate, often around 200Hz, in order to provide accurate精确的results with low latency低延迟. This is required even if即使the application updates at a much lower rate; for example, a low power user interface低功率的用户界面may update as slowly as 5Hz, but the motion processing should still run at 200Hz. The DMP can be used as a tool in order to minimize power, simplify timing, simplify the software architecture, and save valuable MIPS on the host processor for use in the application.DMP可以作为一个工具,以降低功耗,简化时序,简化软件结构,节省了宝贵的MIPS为在应用程序中使用的主处理器。
7.10 Primary I2C and SPI Serial Communications Interfaces
The MPU-60X0 communicates to a system processor using either a SPI (MPU-6000 only) or an I2C serial interface. The MPU-60X0 always acts as a slave when communicating to the system processor.The LSB of the of the I2C slave address is set by pin 9 (AD0).The logic levels for communications between the MPU-60X0 and its master are as follows:
MPU-6050: The logic level for communications with the master is set by the voltage on VLOGIC
For further information regarding the logic levels of the MPU-6050, please refer to Section 10.
7.11 Auxiliary I2C Serial Interface
The MPU-60X0 has an auxiliary I2C bus for communicating to an off-chip 3-Axis digital output magnetometer片外三轴数字输出磁强计or other sensors. This bus has two operating modes:
I2C Master Mode: The MPU-60X0 acts as a master to any external sensors connected to the
auxiliary I2C bus
2. Pass-Through Mode通过模式: The MPU-60X0 directly connects the primary and auxiliary I2C buses together, allowing the system processor to directly communicate with any external sensors.
Auxiliary I2C Bus Modes of Operation:
1. I2C Master Mode: Allows the MPU-60X0 to directly access the data registers of external digital sensors, such as
a magnetometer. In this mode, the MPU-60X0 directly obtains data from auxiliary sensors, allowing the on-chip DMP to generate形成sensor fusion融合data without intervention介入,干涉from the system applications processor. For example, In I 2C Master mode, the MPU-60X0 can be configured to perform burst reads, returning the following data from a magnetometer:在I2C主模式,该mpu-60x0可以配置成执行突发读取,从磁强计返回以下数据:
X magnetometer data (2 bytes);Y magnetometer data (2 bytes);Z magnetometer data (2 bytes)
The I2C Master can be configured to read up to 24 bytes from up to 4 auxiliary sensors. A fifth sensor
can be configured to work single byte read/write mode.I2C主可以配置为从4辅助传感器读取24个字节。五分之一传感器可以单字节读/写模式。
2. Pass-Through Mode: Allows an external system processor to act as master and directly communicate to the external sensors connected to the auxiliary I2C bus pins (AUX_DA and AUX_CL). In this mode, the auxiliary I 2C bus control logic (3rd party sensor interface block) of the MPU-60X0 is disabled, and the auxiliary I 2C pins AUX_DA and AUX_CL (Pins 6 and 7) are connected to the main I 2C bus (Pins 23 and 24) through analog switches.
Pass-Through Mode is useful for configuring the external sensors, or for keeping the MPU-60X0 in a low-power mode when only the external sensors are used. In Pass-Through Mode the system processor can still access MPU-60X0 data through the I 2C interface.
Auxiliary I2C Bus IO Logic Levels
MPU-6050: The logic level of the auxiliary I2C bus can be programmed to be either VDD or VLOGIC该辅助I2C总线的逻辑电平可编程为VDD或Vlogic
For further information regarding the MPU-6050’s logic levels, please refer to Section 10.2.
7.12 Self-Test
Please refer to the MPU-6000/MPU-6050 Register Map and Register Descriptions document for more details
on self test. Self-test allows for the testing of the mechanical and electrical portions of the sensors. The self-test for each measurement axis can be activated by means of通过the gyroscope and accelerometer self-test registers(registers 13 to 16).When self-test is activated, the electronics cause the sensors to be actuated and produce an output signal.当自检被激活,电子使传感器被驱动并产生一个输出信号。The output signal is used to observe the self-test response.
The self-test response is defined as follows:
Self-test response = Sensor output with self-test enabled – Sensor output without self-test enabled
The self-test response for each accelerometer axis is defined in the accelerometer specification table加速度计规格表(Section 6.2), while that for each gyroscope axis is defined in the gyroscope specification table (Section 6.1). When the value of the self-test response is within the min/max limits of the product specification, the part has passed self test. When the self-test response exceeds the min/max values, the part is deemed to have failed
self-test. Code for operating self test code is included within the MotionApps software provided by InvenSense. 7.13 MPU-60X0 Solution for 9-axis Sensor Fusion融合Using I2C Interface
In the figure below在下面的图中, the system processor is an I 2C master to the MPU-60X0. In addition, the MPU-60X0 is an I2C master to the optional external compass sensor. The MPU-60X0 has limited capabilities能力as an I 2C Master, and depends on the system processor to manage the initial最初的configuration of any auxiliary sensors. The MPU-60X0 has an interface接口bypass旁道,支路multiplexer多路(复用)器, which connects the system processor I 2C bus pins 23 and 24 (SDA and SCL) directly to the auxiliary sensor I 2C bus pins 6 and 7 (AUX_DA and AUX_CL).
Once the auxiliary sensors have been configured by the system processor一旦辅助传感器已由系统的处理器配置配置,the interface bypass multiplexer should be disabled so that the MPU-60X0 auxiliary I 2C master can take control of the sensor I2C bus and gather data from the auxiliary sensors.
For further information regarding I2C master control, please refer to Section 10.
7.15 Internal Clock Generation内部时钟产生
The MPU-60X0 has a flexible灵活的clocking scheme体系, allowing a variety of internal or external clock sources to be used for the internal synchronous同步circuitry电路. This synchronous circuitry includes the signal conditioning信号调理and ADCs, the DMP, and various control circuits and registers.该同步电路包括信号调理和模数转换器,DMP,和各种控制电路和寄存器。An on-chip PLL provides flexibility in the allowable inputs for generating this clock.其时钟可由一个片上的PLL产生。
Allowable internal sources for generating the internal clock are:
1. An internal relaxation oscillator张弛振荡器
2. Any of the X, Y, or Z gyros (MEMS oscillators with a variation of ±1 % over temperature)
Allowable external clocking sources are:
1.3
2.768kHz square wave
2. 19.2MHz square wave
Selection of the source for generating the internal synchronous clock depends on the availability of external sources and the requirements for power consumption消费and clock accuracy精度. These requirements will most likely最有可能vary by mode of operation. For example, in one mode, where the biggest concern is power consumption, the user may wish to operate the Digital Motion Processor of the MPU-60X0 to process accelerometer data, while keeping the gyros off. In this case, the internal relaxation oscillator is a good clock choice. However, in another mode, where the gyros are active, selecting the gyros as the clock source
provides for a more accurate clock source. Clock accuracy is important, since timing errors directly affect the distance and angle calculations performed by the Digital Motion Processor (and by extension, by any processor). There are also start-up conditions to consider. When the MPU-60X0 first starts up, the device uses its
internal clock until programmed to operate from another source. This allows the user, for example, to waitfor the MEMS oscillators to stabilize before they are selected as the clock source.
7.16 Sensor Data Registers
The sensor data registers contain the latest gyro, accelerometer, auxiliary sensor, and temperature measurement 量度data. They are read-only registers, and are accessed via the serial interface. 传感器数据寄存器包含最新
的陀螺仪,加速度计,辅助传感器,和温度测量数据。他们是只读寄存器,并通过串行接口访问。Data
from these registers may be read anytime. However, the interrupt function may be used to determine when new data is available.然而,当新数据可用中断函数可以用于确定。
For a table of interrupt sources please refer to Section 8.
7.17 FIFO
The MPU-60X0 contains a 1024-byte FIFO register that is accessible via经过the Serial Interface. The FIFO(first in, first out)configuration register determines which data is written into the FIFO.mpu-60x0包含一个1024字节的FIFO寄存器,可通过串行接口。先进先出配置寄存器确定哪些数据写入FIFO。Possible choices
include gyro data, accelerometer data, temperature readings, auxiliary sensor readings, and FSYNC input.可能的选择包括陀螺加速度计数据,数据,温度读数,辅助传感器的读数,和FSYNC输入。 A FIFO counter
keeps track of how many bytes of valid data are contained in the FIFO FIFO计数器
跟踪有效数据有多少字节都包含在FIFO。. The FIFO register supports burst reads. The interrupt function may
be used to determine when new data is available.FIFO寄存器支持突发读。当新数据可用中断函数可以用于确定
For further information regarding the FIFO, please refer to the MPU-6000/MPU-6050 Register Map and Register Descriptions document.
7.18 Interrupts
Interrupt functionality is configured via the Interrupt Configuration register.中断功能是通过中断配置寄存器进行配置Items that are configurable include the INT pin configuration, the interrupt latching and clearing method,
and triggers for the interrupt.这是可配置的项目包括INT引脚配置,中断锁存和清除方法,以及中断触发。Items项目that can trigger an interrupt are
(1)Clock generator locked to new reference oscillator (used when switching clock sources);
时钟发生器锁定新的参考振荡器(时钟源切换时使用);
(2)new data is available to be read (from the FIFO and Data registers);
新的数据可以被读取(从FIFO数据寄存器);
(3)accelerometer event interrupts
加速度传感器事件中断;
(4)the MPU-60X0 did not receive an acknowledge from an auxiliary sensor on the secondary第二的I2C bus.
The interrupt status can be read from the Interrupt Status register. 6050没有收到外接传感器的应答信号(辅助I2C总线)。中断状态可以从中断状态寄存器读。
For further information regarding interrupts, please refer to the MPU-60X0 Register Map and Register
Descriptions document.
For information regarding the MPU-60X0’s accelerometer event interrupts, please refer to Section 8.
7.19 Digital-Output Temperature Sensor
An on-chip temperature sensor and ADC are used to measure the MPU-60X0 die temperature.一个片上温度传感器和ADC用于测量mpu-60x0模具温度The readings from the ADC can be read from the FIFO or the Sensor Data registers.来自ADC的读数可以从FIFO或传感器数据寄存器读取。
8.1自由落体中断
通过检测3个轴上的加速度测量值是否在规定的阈值内来判断自由落体运动。对每一次的采样值,如果没达到阈值将会被忽略。一旦达到阈值,即触发自由落体中断。并产生标志位。直到计数器降到0,标志才会被清除。计数器的取值范围在0和规定的阈值之间。
可用FF_THR寄存器设置阈值,精确到1mg 。用FF_DUR寄存器设置持续时间,精确到1ms 。
使用MOT_DETECT_CTRL寄存器可以设施是否用一个无效的采样值使计数器清零,或者以1,2,4的量衰减。
8.2 Motion Interrupt
(运动中断)The MPU-60X0 provides Motion detection侦查; 察觉capability. Accelerometer measurements are passed through a configurable digital high pass filter (DHPF) in order to eliminate bias due to gravity. mpu-
60x0提供运动检测能力。为了消除由于重力偏差,加速度计的测量是通过一个可配置的数字高通滤波器(DHPF)。A qualifying motion sample is one where the high passed sample from any axis has an absolute value exceeding a user programmable threshold. A counter increments for each qualifying sample通过高通滤波器的绝对值超过一个用户可编程的阈值。则被认定是有效的对于每个有效的采样值,计数器加1而对于无效的值,则计数器减1., and decrements for each non qualifying sample. Once the counter reaches a user-programmable counter threshold, a motion interrupt is triggered. The axis and polarity which caused the interrupt to be triggered is flagged in the MOT_DETECT_STATUS register.一旦计数器达到用户可编程计数器阈值,运动中断触发。产生运动中断的轴及其方向在MOT_DETECT_STATUS register读出。Motion detectionhas a configurable acceleration threshold MOT_THR specified in 1 m g increments.运动检测有一个可配置的阈值加速度MOT_THR精确到1ms。The counter threshold MOT_DUR is specified in 1 ms increments. 计数器的MOT_DUR阈值在1毫秒的增量指定。The decrement rate for non-qualifying samples is also configurable. The MOT_DETECT_CTRL register allows the user to specify whether a non-qualifying sample makes the counter reset to zero, or decrement in steps of 1, 2, or 4. 不合格样品的减量率也可配置。MOT_DETECT_CTRL的寄存器允许用户指定是否不合格样品使计数器复位到零,或递减1,2,或4。
The flow chart below explains how the motion interrupt should be used. Please refer to the MPU-6000/MPU 6050 Register Map and Register Descriptions document for descriptions of the registers referenced in the flow chart.
9.2 I2C Interface
I2C is a two-wire interface comprised of the signals serial data (SDA) and serial clock (SCL). In general, the
lines are open-drain and bi-directional I2C是一个双线接口组成的信号的串行数据(SDA)和串行时钟(SCL)。一般来说,这线是开漏双向。. In a generalized I 2C interface implementation, attached devices can be a master or a slave. The master device puts the slave address on the bus, and the slave device with the matching address acknowledges the master.
10.2
The power-on-reset value for AUX_VDDIO is 0.
VLOGIC may be set to be equal to VDD or to another voltage. However, VLOGIC must be ≤ VDD at all
times. When AUX_VDDIO is set to 0 (its power-on-reset value), VLOGIC is the power supply voltage for
both the microprocessor system bus and the auxiliary I2C bus, as shown in the figure of Section 10.3. When
AUX_VDDIO is set to 1, VLOGIC is the power supply voltage for the microprocessor system bus and VDD is
the supply for the auxiliary I2C bus, as shown in the figure of Section 10.4.
Note
2.3rd-party auxiliary device logic levels are referenced to VDD. Setting INT1 and INT2 to open drain configuration provides voltage compatibility when VDD ≠ VLOGIC. When VDD = VLOGIC, INT1 and
INT2 may be set to push-pull outputs, and external pull-up resistors are not needed.第三方辅助设备的逻辑水平参照VDD。当VDD≠Vlogic,设置INT1和INT2到漏极开路配置提供电压兼容。当VDD = Vlogic,INT1和INT2可以设置为推挽输出,而不需要外部上拉电阻。
找出几个重要的寄存器:
1)Register 25 – Sample Rate Divider(SMPRT_DIV)
SMPLRT_DIV8位无符号值,通过该值将陀螺仪输出分频,得到采样频率。该寄存器指定陀螺仪输出率的分频,用来产生MPU-60X0的采样率。传感器寄存器的输出、FIFO输出、DMP采样和运动检测的都是基于该采样率。采样率的计算公式采样率=陀螺仪的输出率/ (1 + SMPLRT_DIV)
当数字低通滤波器没有使能的时候,陀螺仪的输出频率等于8KHZ,反之等于1KHZ。
2)Register 26 – Configuration(CONFIG)
1)EXT_SYNC_SET 3位无符号值,配置帧同步引脚的采样
2)DLPF_CFG 3位无符号值,配置数字低通滤波器
该寄存器为陀螺仪和加速度计配置外部帧同步(FSYNC)引脚采样和数字低通滤波器(DLPF)。通过配置EXT_SYNC_SET,可以对连接到FSYNC引脚的一个外部信号进行采样。FSYNC引脚上的信号变化会被锁存,这样就能捕获到很短的频闪信号。采样结束后,锁存器将复位到当前的FSYNC信号状态。根据下面的表格定义的值,采集到的数据会替换掉数据寄存器中上次接收到的有效数据。
数字低通滤波器是由DLPF_CFG来配置,根据下表中DLPF_CFG的值对加速度传感器和陀螺仪滤波
3)Register 27 –Gyroscope Configuration (GYRO_CONFIG)1)XG_ST 设置此位,X轴陀螺仪进行自我测试。
2)YG_ST 设置此位,Y轴陀螺仪进行自我测试。
3)ZG_ST 设置此位,Z轴陀螺仪进行自我测试。
4)FS_SEL 2位无符号值。选择陀螺仪的量程。
这个寄存器是用来触发陀螺仪自检和配置陀螺仪的满量程范围。陀螺仪自检允许用户测试陀螺仪的机械和电气部分,通过设置该寄存器的 XG_ST、YG_ST和 ZG_ST bits可以激活陀螺仪对应轴的自检。每个轴的检测可以进行或同时进行。
自检的响应 = 打开自检功能时的传感器输出 - 未启用自检功能时传感器的输出
在MPU-6000/MPU-6050数据手册的电气特性表中已经给出了每个轴的范围。当自检的响应值在规定的范围内,就能够通过自检;反之,就不能通过自检。
根据下表,FS_SEL选择陀螺仪输出的量程:
4)Register 28 –Accelerometer Configuration (ACCEL_CONFIG)
1)XA_ST 设置为1时,X轴加速度感应器进行自检。
2)YA_ST 设置为1时,Y轴加速度感应器进行自检。
3)ZA_ST 设置为1时,Z轴加速度感应器进行自检。
4)AFS_SEL 2位无符号值。选择加速度计的量程。
具体细节和上面陀螺仪的相似。
根据下表,AFS_SEL选择加速度传感器输出的量程。
5)Registers 59 to –Accelerometer Measurements(ACCEL_XOUT_H, ACCEL_XOUT_L,
ACCEL_YOUT_H, ACCEL_YOUT_L, ACCEL_ZOUT_H, and ACCEL_ZOUT_L)
1)ACCEL_XOUT 16位2’s补码值。
存储最近的X轴加速度感应器的测量值。
2)ACCEL_YOUT 16位2’s补码值。
存储最近的Y轴加速度感应器的测量值。
3)ACCEL_ZOUT 16位2’s补码值。
存储最近的Z轴加速度感应器的测量值。
这些寄存器存储加速感应器最近的测量值。加速度传感器寄存器,连同温度传感器寄存器、陀螺仪传感器寄存器和外部感应数据寄存器,都由两部分寄存器组成(类似于STM32F10X系列中的影子寄存器):一个内部寄存器,用户不可见。另一个用户可读的寄存器。内部寄存器中数据在采样的时候及时的到更新,仅在串行通信接口不忙碌时,才将内部寄存器中的值复制到用户可读的寄存器中去,避免了直接对感应测量值的突发访问。
在寄存器28中定义了每个16位的加速度测量值的最大范围,对于设置的每个最大范围,都对应一个加速度的灵敏度ACCEL_xOUT,如下面的表中所示:
6)Registers 65 and 66 – Temperature Measurement(TEMP_OUT_H and TEMP_OUT_L)
1)TEMP_OUT 16位有符号值。储的最近温度传感器的测量值。
7)Registers 67 to 72 – Gyroscope Measurements (GYRO_XOUT_H, GYRO_XOUT_L,
GYRO_YOUT_H, GYRO_YOUT_L, GYRO_ZOUT_H, and GYRO_ZOUT_L)
这个和加速度感应器的寄存器相似
对应的灵敏度:
8)Register 107 –Power Management 1 (PWR_MGMT_1)
该寄存器允许用户配置电源模式和时钟源。它还提供了一个复位整个器件的位,和一个关闭温度传感器的位
1)DEVICE_RESET 置1后所有的寄存器复位,随后DEVICE_RESET自动置0.
2)SLEEP 置1后进入睡眠模式
3)CYCLE 当CYCLE被设置为1,且SLEEP没有设置,MPU-60X0进入循环模式,为了从速度传感器中获得采样值,在睡眠模式和正常数据采集模式之间切换,每次获得一个采样数据。在
LP_WAKE_CTRL(108)寄存器中,可以设置唤醒后的采样率和被唤醒的频率。
4)TEMP_DIS 置1后关闭温度传感器
5)CLKSEL 指定设备的时钟源
时钟源的选择:
9)Register 117 –Who Am I(WHO_AM_I)
WHO_AM_I中的内容是MPU-60X0的6位I2C地址。上电复位的第6位到第1位值为:110100。为了让两个MPU-6050能够连接在一个I2C总线上,当AD0引脚逻辑低电平时,设备的地址是b1101000 ,当AD0引脚逻辑高电平时,设备的地址是 b1101001。MPU-6000可以使用SPI和I2C接口,而MPU-6050只能使用
I2C,其中I2C的地址由AD0引脚决定。寄存器共117个,挺多的,下面的是精简常用的,根据具体的要求,适当的添加。
#define SMPLRT_DIV 0x19 //采样率分频,典型值:0x07(125Hz) */
#define CONFIG 0x1A // 低通滤波频率,典型值:0x06(5Hz) */
#define GYRO_CONFIG 0x1B // 陀螺仪自检及测量范围,典型值:0x18(不自检,2000deg/s) */ #define ACCEL_CONFIG 0x1C // 加速计自检、测量范围及高通滤波频率,典型值:0x01(不自检,2G,5Hz) */#define ACCEL_XOUT_H 0x3B // 存储最近的X轴、Y轴、Z轴加速度感应器的测量值 */ #define ACCEL_XOUT_L 0x3C
#define ACCEL_YOUT_H 0x3D
#define ACCEL_YOUT_L 0x3E
#define ACCEL_ZOUT_H 0x3F
#define ACCEL_ZOUT_L 0x40
#define TEMP_OUT_H 0x41 // 存储的最近温度传感器的测量值 */
#define TEMP_OUT_L 0x42
#define GYRO_XOUT_H 0x43 // 存储最近的X轴、Y轴、Z轴陀螺仪感应器的测量值 */ #define GYRO_XOUT_L 0x44
#define GYRO_YOUT_H 0x45
#define GYRO_YOUT_L 0x46
#define GYRO_ZOUT_H 0x47
#define GYRO_ZOUT_L 0x48
#define PWR_MGMT_1 0x6B // 电源管理,典型值:0x00(正常启用) */
#define WHO_AM_I 0x75 //IIC地址寄存器(默认数值0x68,只读) */
1.
2.
本模块采用的是IIC通信方式,所以我们只需要连接四跟线就可以完成电路的连接A4接SDA,A5接SCL, VCC接3v3,GND接GND
MPU6050_raw这个代码是没有添加算法的,所以显示的是只是原始数据!我们可以通过串口监视串口可以看到这样的结果!
仔细观察了一下,这些误差都分布在某个常数的周围,下面就可以通过一个简单的方法对其进行校准。从数据手册中找到刻度系数表,用输出值除以这些刻度系数即可得到以°/s为单位的角速度和以g为单位的加速度输出
#include "Wire.h"
#include "I2Cdev.h"#include "MPU6050.h"
MPU6050 accelgyro;
int16_t ax, ay, az;
int16_t gx, gy, gz;
bool blinkState = false;
void setup() {
Wire.begin();
Serial.begin(38400);
accelgyro.initialize();
}
void loop() {
accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
Serial.print("a/g:\");
Serial.print(ax/16384); Serial.print("\");
Serial.print(ay/16384); Serial.print("\");
Serial.print(az/16384); Serial.print("\");
Serial.print(gx/131); Serial.print("\");
Serial.print(gy/131); Serial.print("\");
Serial.println(gz/131);
blinkState = !blinkState;
}
校准的方法
IMU在水平放置的状态下,Z轴加速度计的输出应该是1g,其余轴的加速度计和陀螺仪的输出均应该为0。对1000个输出值的误差取平均,利用其对输出进行校准.
同时增加将输出值进行换算的算法
观察输出值,可以看到常数误差已经基本被消除了,剩下的都些是较小的随机误差