没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
高通滤波数据和瞬态 使用MMA8451、2、3Q进行检测 作者:金伯利塔克应用工程师 1.0简介 来自传感器的加速度读数耦合了静态和动态加速度。许多基于倾斜的应用程序,如方向检测、滚动和基于倾斜的游戏应用程序,使用加速计只分析重力引起的静态加速度变化。这些函数在经过低通滤波后通常是最好的,因为高频数据被认为是噪声。加速度计必须分析动态加速度的功能有很多。诸如敲击、轻击、震动和步进计数等功能是基于对加速度变化的分析,而不考虑静态加速度。这些函数解释加速度阈值变化和运动方向。移除静态组件后,解释动态加速度数据更简单。 MMA8451、2、3Q内置高通滤波器。在MMA8451,2Q中,输出数据可以通过高通滤波器,消除偏移(DC)和低频(远低于截止)。注意,MMA8453Q不具备从高通滤波器读取数据的能力。高通滤波器截止频率可以由用户设置为四个不同的频率,这取决于输出数据速率(ODR)和过采样模式。更高的截止频率确保了直流数据或移动较慢的数据将被过滤掉,只允许更高的频率通过。MMA8451、2、3Q包含一个嵌入式瞬态函数,该函数分析高通滤波数据,允许用户使用添加的去噪计数器设置预设阈值,以确保事件在设置的持续时间内发生。阈值表示要超过的加速度变化。这个嵌入的函数可以被路由到一个中断管脚来检测不同轴上的震动,并显示震动的方向。
资源推荐
资源详情
资源评论
© 2010, 2011 Freescale Semiconductor, Inc. All rights reserved.
Document Number: AN4071
Rev 1, 10/2011
Freescale Semiconductor
Application Note
High-Pass Filtered Data and Transient
Detection Using the MMA8451, 2, 3Q
by:
Kimberly Tuck
Applications Engineer
1.0 Introduction
The acceleration readings from the sensor couple both
static and dynamic accelerations. Many tilt based applications
such as orientation detection, scrolling and tilt based gaming
apps use the accelerometer analyzing the change in static
acceleration due to gravity only. These functions are often
best when they’ve been low-pass filtered because the high-
frequency data is considered noise. There are many functions
where the accelerometer must analyze the dynamic
acceleration. Functions such as taps, flicks, shakes and step
counting are based on the analysis of the change in the
acceleration with no regard for the static acceleration. These
functions interpret the acceleration threshold change and
direction of motion. It is simpler to interpret the dynamic
acceleration data when the static component has been
removed.
The MMA8451, 2, 3Q has a built-in high-pass filter. In the
MMA8451, 2Q the output data can go through the high-pass
filter, eliminating the offset (DC) and low frequencies (well
below the cutoff). Note that the MMA8453Q does not have the
capability to read out data from the high-pass filter. The high-
pass filter cutoff frequency can be set by the user to four
different frequencies which are dependent on the Output Data
Rate (ODR) and the oversampling mode. A higher cutoff
frequency ensures the DC data or slower moving data will be
filtered out, allowing only the higher frequencies to pass. The
MMA8451, 2, 3Q contain an embedded transient function
which analyzes the high-pass filtered data allowing the user to
set a preset threshold with an added debounce counter to
ensure the event happens for a set duration. The threshold
represents a change in acceleration to be exceeded. This
embedded function can be routed to an interrupt pin to detect
jolts on different axes and will display the direction of the jolt.
TABLE OF CONTENTS
1.0 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
1.1 Key Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
1.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.0 MMA8451, 2, 3Q Consumer 3-axis Accelerometer 3 by 3 by 1 mm . . . . .2
2.1 Output Data, Sample Rates and Dynamic Ranges of all Three Products . . .3
2.1.1 MMA8451Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
2.1.2 MMA8452Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
2.1.3 MMA8453Q Note: No HPF Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
3.0 Comparison of Motion Detection and Transient Detection . . . . . . . . . . . 3
3.1 Use Case 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
3.2 Use Case 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
4.0 Transient Settings and Interpretation of the Data . . . . . . . . . . . . . . . . . .5
4.1 High-Pass Filter Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
5.0 Using the HPF Data to Write Algorithms such as Directional Shake . . . 7
6.0 Configuring the Embedded Transient Detection . . . . . . . . . . . . . . . . . . .9
6.1 Register 0x1D:TRANSIENT_CFG Transient Configuration Register . . . . . . .9
6.2 Register 0x1F: TRANSIENT_THS Transient Threshold Register . . . . . . . . 10
6.3 Register 0x20: TRANSIENT_COUNT Transient Debounce Register . . . . . . 10
6.4 Register 0x1E:TRANSIENT_SRC Transient Source Register . . . . . . . . . . . 11
6.5 Configuring the Transient Detection to an Interrupt Pin. . . . . . . . . . . . . . . . . 11
6.6 Reading the System Interrupt Status Source Register . . . . . . . . . . . . . . . . .11
7.0 Details for Configuring the MMA8451, 2, 3Q for Transient Detection .12
Table 11.Registers of Importance for Setting up the Transient Detection and Using
the HPF
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.1 Example Steps for Configuring Transient Detection . . . . . . . . . . . . . . . . . . . 13
1.1 Key Words
Accelerometer, Static Acceleration, Image Stabilization, High-
Pass Filter (HPF), Transient, HPF Data, 3-Axis
Accelerometer, Embedded Motion Detection, Embedded
Transient Detection, Vibration, Shake, Directional Shake,
Displacement, Velocity, Sensor, Interrupt, DBCNTM Bit, Jolt
AN4071
Sensors
2 Freescale Semiconductor, Inc.
1.2 Summary
A. The high-pass filter is used to eliminate the static acceleration when the HPF_OUT bit is set.
B. Different cutoff frequencies from the high-pass filter affect the output data and the embedded functions using the
high-pass filter.
C. The high-pass filtered data is useful for writing algorithms which require an analysis of the change in acceleration
and simplifies the data analysis by eliminating the static acceleration.
D. The transient function is interrupt driven and saves on current consumption and unnecessary processing because
the logic is internal to the sensor.
E. An algorithm for directional shake can be reliably detected by analyzing the (high-pass filter) data.
F. The high-pass filter data can be used for image stability applications, compensating for the jitter of the user’s hands
and/or from the environment.
G. The transient function can be used to detect a change in acceleration that exceeds a set threshold. This is slightly
different than the motion detection function.
H. The transient threshold and debounce counter can be changed in either standby or active mode to allow for
adjustments after the part has transitioned from wake to sleep mode.
I. Note the MMA8453Q does not have the option for high-pass filtered data, although it does contain the transient
function and the tap function uses the high-pass filter.
2.0 MMA8451, 2, 3Q Consumer 3-axis Accelerometer 3 by 3 by 1 mm
The MMA8451, 2, 3Q has a selectable dynamic range of ±2g, ±4g, ±8g. The device has 8 different output data rates, selectable
high-pass filter cutoff frequencies, and high-pass filtered data. The available resolution of the data and the embedded features is
dependant on the specific device.
Note: The MMA8450Q has a different memory map and has a slightly different pinout configuration.
Figure 1. MMA8451, 2, 3Q Consumer 3-axis Accelerometer 3 by 3 by 1 mm
1
2
3
4
59
10
11
12
13
141516
876
NC
VDD
NC
VDDIO
BYP
NC
SCL
GND
NC
GND
INT1
GND
INT2
SA0
NC
SDA
MMA845xQ
16-Pin QFN
(Top View)
AN4071
Sensors
Freescale Semiconductor, Inc. 3
2.1 Output Data, Sample Rates and Dynamic Ranges of all Three Products
2.1.1 MMA8451Q
1. 14-bit data
2g (4096 counts/g = 0.25 mg/LSB) 4g (2048 counts/g = 0.5 mg/LSB) 8g (1024 counts/g = 1 mg/LSB)
2. 8-bit data
2g (64 counts/g = 15.6 mg/LSB) 4g (32 counts/g = 31.25 mg/LSB) 8g (16 counts/g = 62.5 mg/LSB)
3. Embedded 32 sample FIFO (MMA8451Q)
2.1.2 MMA8452Q
1. 12-bit data
2g (1024 counts/g = 1 mg/LSB) 4g (512 counts/g = 2 mg/LSB) 8g (256 counts/g = 3.9 mg/LSB)
2. 8-bit data
2g (64 counts/g = 15.6 mg/LSB) 4g (32 counts/g = 31.25 mg/LSB) 8g (16 counts/g = 62.5 mg/LSB)
2.1.3 MMA8453Q Note: No HPF Data
1. 10-bit data
2g (256 counts/g = 3.9 mg/LSB) 4g (128 counts/g = 7.8 mg/LSB) 8g (64 counts/g = 15.6 mg/LSB)
2. 8-bit data
2g (64 counts/g = 15.6 mg/LSB) 4g (32 counts/g = 31.25 mg/LSB) 8g (16 counts/g = 62.5 mg/LSB)
3.0 Comparison of Motion Detection and Transient Detection
The transient function (with HPF enabled) is different from the motion detection embedded function in MMA8451, 2, 3Q. Refer
to Freescale application note AN4070 for details on the motion detection. The intended use of these functions is different.
A. The embedded motion function triggers an interrupt when any of the enabled axes has exceeded a set acceleration
threshold.
• Motion detection is useful when the device may be tilted in an orie
ntation and the interest is to know if the
acceleration in one axis has crossed a specified threshold amount measured from 0g.The motion detection
analyzes change in threshold considering both static and dynamic acceleration.
B. The transient detection embedded function compares whether any o
f the enabled axes has exceeded a set change
in acceleration disregarding the static acceleration. The data that is compared to the threshold to be exceeded is
high-pass filtered data.
• Transient detection is useful wh
en the device may be tilted in an orientation (i.e., there is some non-zero reading
on one or more of X, Y and Z) and the interest is more on the dynamic acceleration crossing a specified threshold
amount in a short amount of time (frequency being the reciprocal of time) regardless of what the current value is.
Example
If a change in acceleration of 0.5g in any axe
s was the target for an application, then it would be challenging to use the em-
bedded motion detection function for detecting this change. The reason for this can be better understood with an example:
Assume that the device was oriented such that X = 0.24g, Y = 0.44g and Z = 0.82g; it would be challenging to detect a 0.5g
change in acceleration in any of the axes using the motion detect function since the new readings have to be outside the range
X = -0.26g to 0.74g, Y = -0.06g to 0.94g and Z = 0.32g to 1.32g. Because only a single threshold setting can be chosen for each
axes when using the motion detect embedded function and because of the need to detect acceleration outside a range, it would,
therefore, be seen as impossible to choose a threshold that would detect a 0.5 change in acceleration for any of the axes.
3.1 Use Case 1
Use Case 1 Transient: Unknown Orientation with Specific Acceleration Change for Detection
A use case example for transient detection may be when the device
containing the accelerometer is in an environment of an
unknown orientation or changing orientation and a small amplitude, but quick disturbance must be detected, e.g., when the de-
vice is accelerating through 0g to +1g to -1g and a subtle impact force (change in acceleration of 0.5g) is used as an indication
to wake the device or as a motion signature of an event. The accelerometer reading combines the gravity and the linear
acceleration reading. It is much simpler to decouple the two by eliminating the effect of gravity. Using the example above, assume
that the device was oriented such that at given time T, X = 0.24g, Y = 0.44g and Z = 0.82g. If transient detection is enabled on
all
3 axes with a threshold of 0.5g and an ODR of 100 Hz, any time that X goes outside of the range -0.26g to 0.74g within
T + 10 ms,
a transient detect interrupt would be generated. Eliminating the static acceleration on the device simplifies the condi-
tion to focus on the change in acceleration only, since the orientation is of no consequence in this situation. Figure 2 demonstrates
that the sensor detects both the static and the dynamic acceleration. Decoupling the static from the dynamic acceleration can
simplify the analysis.
剩余13页未读,继续阅读
资源评论
terrans1998
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功