MPU6050基础
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
MPU6050基础
MPU-6050
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)⽀援视频电⼦影相稳定技术与GPS
10、可程式控制的中断(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算法。
该设备可以通过⼀个辅助主我2C总线访
问外部传感器或其它传感器,允许设备收集全套传感器数据。
轴⽅向的灵敏度和极性旋转
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 wait
for 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 detection has 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_DIV 8位⽆符号值,通过该值将陀螺仪输出分频,得到采样频率。
该寄存器指定陀螺仪输出率的分频,⽤来产⽣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 64 –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) */。