如何利用加计计算角度(FreeScale_AccToAngle)

更新时间:2023-06-04 13:39:21 阅读: 评论:0

© Freescale Semiconductor, Inc., 2007. All rights rerved.
AN3461
Rev 2, 06/2007
Freescale Semiconductor  Application Note
Tilt Sensing Using Linear Accelerometers
by: Kimberly Tuck
Accelerometer Systems and Applications Engineering  Tempe, AZ
INTRODUCTION
This application note explains the importance of
understanding how to acquire a reliable and accurate tilt reading for accelerometer applications by comparing the advantages and disadvantages of various tilt measurement techniques. Accelerometers ud for tilt nsing require high resolution to meet the demands of many new emerging applications s
uch as tilt enabled computer mou/pointers, motion enabled video game solutions and PDA-cell phone/ mp3 player screen navigation.
The overall benefit of the accelerometer for tilting
applications ud in PDAs for screen navigations is a new method to view, scroll, lect and move with a minimum
number of buttons required. This concept affords a PDA with a larger screen area for viewing. Navigation through menus is made easier with the ability to make lections bad on tilt. The choices are highlighted and then can be lected either by using a physical “execute” button on the PDA or by using click or double click tap detection of the accelerometer. The ur can make lections in a menu driven environment this way. Also the accelerometer can also be ud to n the tilt of the PDA to change from landscape to portrait using gravity to change the screen orientation for viewing.前怕狼后怕虎
Interactive video games are becoming increasingly
popular. Accelerometers are ud to detect the tilting motions of the joystick for the game.This has created games where the ur can feel more immerd in the game.
Tilt is a static measurement. The force of gravity is ud as an input to determine the orientation of an object calculating the degree of tilt.The accelerometer will experience
acceleration in the range from -1g to +1g through 180° of tilt.
1g = - 9.8 m/s 2
0G OFFSET CALIBRATION
Accuracy and repeatability is a general concern for nearly all accelerometer applications. The accuracy of the tilt measurement can be improved by using a 0g-offt
calibration technique to compensate for offt errors. Refer to Freescale application note AN3447, “Implementing Auto-Zero
Calibration Technique for Accelerometers.” Even though the offt is trimmed, offt can shift due to packaging stress, aging and external mechanical stress due to mounting and orientation.This results in offt calibration error. It is important to implement a 0g calibration routine for the accelerometer to compensate for the 0g offt.
MEASUREMENT TECHNIQUES
包包怎么做This ction discuss the different ways to implement tilt comparing different ways to measure the corresponding angle from the acceleration output.
Measuring Tilt using One Axis
In the ca of a dual-axis accelerometer (XY) mounted perpendicular to gravity the tilt algorithm is limited to one axis of nsitivity. As shown in Figure 1 the accelerometer is tilted along the X-axis. The Y-axis remains at 0g output throughout the full rotation of the X-axis in this ca.
If one axis (X-axis) is ud to calculate the tilted angle of the accelerometer the following trigonometry relationship is ud:
Where: V OUTx  is the voltage output from the X-axis of the accelerometer, V OFF is the offt voltage, and S is the nsitivity of the accelerometer.
The acceleration output on the X-axis due to gravity is equal to the following:
V OUTX V OFF S θ
sin ×+=A X V OUTX V OFF –S
-----------------------------------=
AN3461Sensors
In order to solve for the angle of tilt the equation becomes the following:短发怎么扎好看
Figure 2.  Accelerometer Output (g's) Tilting from -90
° to
+90° with a One Axis Measurement This graph shows the output in g’s of the accelerometer as it tilts from -90° to +90°. Notice that the tilt nsitivity diminishes between -90° and -45° and between +45° to  +90°. This resolution problem between the values makes this method of calculating the angle of tilt inaccurate when the accelerometer output is near the +1g or -1g range. A dual-axis accelerometer horizontally mounted would be limited by this method of calculating tilt and would not be accurate over a 360° rotation. It would only be uful for angle measurements between -45° to +45° of tilt.
Another disadvantage of the single axis measurement tilt technique is that it is impossible to know the difference
between two tilt angles that result in the same nsor output. The output is a sine function, so for example it would be impossible to know from a 0.5g output reading if the accelerometer was tilted 30° or 150° by looking at the accelerometer output. One would have to be aware of the correct orientation of the accelerometer and have a n for the quadrant of tilt. This disadvantage is overcome by using a two axis measurement tilt technique and is explained in the next ction.
Measuring Tilt using a Two Axis Solution
The resolution problems and tilt orientation difficulties can be addresd by mounting the accelerometer vertically so that the Y-axis is parallel to gravity, or by using a tri-axis
苹果的种子accelerometer using at least 2 of the 3 axis. Using more than one axis to calculate tilt produces a more accurate solution.
Two Axes for Measuring Tilt
Figure 4.  Sine Function of the X Output and Cosine
Function of the Y Output The graph above shows that when using a two axis solution the component due to gravity on the X-axis follows the sine
function while the component due to gravity acting on the  Y-axis follows the cosine function. Notice that the tilt nsitivity (slope of the line) in the X-direction is at its maximum while the Y-nsitivity is at its minimum and visa versa. Therefore the maximum tilt nsitivity can be maintained if both the X and the Y outputs are combined.
Table 1 displays 360° of tilt with the acceleration output of the X component and Y components due to gravity. Also the change in gravity with the change in angle is analyzed through the full rotation for both components. The two nsitivities are combined which results in a constant output of 17.45mg/°.
θ1
–sin
A X ()
=
AN3461
Sensors
Basic Trigonometry
The acceleration in the X-axis in Table 1 is calculated by the following equation:
The acceleration on the Y-axis is calculated with:
If the combination of the X acceleration and the Y acceleration is ud:
The tilt nsitivity equation mg/° was calculated by taking the difference between the acceleration output between
1 degree at that point. For example, the tilt nsitivity at 15° is calculated by the following:
The Y-axis is 90° from the X-axis and therefore it makes n that the Y-axis experiences a 1g acceleration while the
蓝色的爱X-axis experiences a 0g acceleration. The combined
acceleration is always 1g.
The nsor is most responsive to changes in tilt when the nsitive axis is perpendicular to the force of gravity. When perpendicular to the force of gravity the accelerometer
experiences approximately 17.45mg per degree tilt. It is least responsive when the nsitive axis is parallel to the force of gravity in the +1g or -1g orientation, with a responsiveness of only 0.15mg per degree of tilt. This is clearly displayed in Figure 6 where the absolute value of the tilt nsitivity was taken. As the X-axis is at its minimum tilt nsitivity the Y-axis is at its maximum tilt nsitivity. By combining the X and  Y-axis solving for the tilt angle using arctan (A X /A Y ), a constant tilt nsitivity
of 17.45mg can be maintained through a 360° rotation.
Figure 6.  Tilt Sensitivity versus Tilt Angle
Table 1. Tilt using the X and Y-axis
Angle (°)
A X  (g’s)dg/dDeg A X  TS X (mg/°)A Y  (g’s)dg/dDeg A Y TS Y (mg/°)sqrt(TS X ^2+TS Y ^2) (mg)
sqrt(A X ^2+A Y
^2
) (g)00.00017.452  1.000-0.15217.45  1.00300.50015.0380.866-8.85817.45  1.00600.8668.5940.500-15.19017.45  1.0090  1.000-0.1520.000-17.45217.45  1.001200.866-8.858-0.500-15.03817.45  1.001500.500-15.190-0.866-8.59417.45  1.001800.000-17.452-1.0000.15217.45  1.00210-0.500-15.038-0.8668.85817.45  1.00240-0.866-8.594-0.50015.19017.45  1.00270-1.0000.1520.00017.45217.45  1.00300-0.8668.8580.50015.03817.45  1.00330
-0.500
15.190
0.866
8.594
17.45
1.00
A X θ
sin =A Y θ
cos =A X
A Y
------θtan =16()sin 15()sin –16.818
=A A X 2A Y 2
+1g
=
=
AN3461Sensors
Quadrant Orientation
It is important to know the sign of the X and Y accelerations to determine the quadrant of tilt that is applicable becau the outputs from the first and third quadrant will be the same and the outputs from the cond and fourth quadrant will also be the same. For example tan (45) = 1 and tan (225) = 1. When taking the arctan of a positive value the tilt angle is in either the first or third quadrant. Knowing the sign of A X  and A Y  will determine exactly which quadrant. When taking the arctan of a negative value the tilt angle is in either the cond or fourth quadrant. Knowing the sign of A X  and A Y  will determine exactly which quadrant the accelerometer is tilting through.
梦遗的原因If in Quadrant 1 = arctan (A X /A Y )If in Quadrant 2 = arctan (A X /A Y ) + 180If in Quadrant 3 = arctan (A X /A Y ) + 180If in Quadrant 4 = arctan (A X /A Y ) + 360
Measuring Tilt using a Three Axis Solution
In order to define the angles of the accelerometer in three dimensions the pitch, roll and theta are nd using all three outputs of the accelerometer. Pitch (ρ) is defined as the angle of the X-axis relative to ground. Roll (ϕ) is defined as the angle of the Y-axis relative to the ground. Theta (θ) is the angle of the Z axis relative to gravity.
背肌
Now the acceleration due to gravity on the X-axis,  Y-axis and Z-axis are combined. The resultant sum of the accelerations from the three axes is equal to 1g when the accelerometer is static.
A/D Converter Resolution Limitations
Discrete values are ud when the signal is digitized and
therefore the resolution is limited by the number of bits in the A/D converter. Table 2 displays the 8-bit A/D converter values for the X and Z-axis assuming an ideal rotation about the y axis.
The 3.3V supply voltage is divided by 255 (28-1) steps from the A/D converter. This value is divided
by the nsitivity of 0.8V/g to solve for the acceleration due to gravity at each step.
Therefore each increasing bit will account for an additional 16.176mg.
From Table 2 it can be en that a single axis solution will produce a decreasing resolution as the device is tilted from 0° to 90°, but a two axis solution will produce a fairly steady resolution throughout the entire tilt range.
The angle calculation bad on acceleration of a single axis is the following:
The resolution goes from 0.927 degrees to 9.332, which is unacceptable for a tilt application.The resolution gets increasingly wor through the tilt.
The angle calculation bad on acceleration of two axes is the following:
The resolution is between 0.748° - 1.317° throughout the entire tilt range. Again this shows the improved accuracy of using two axes to calculate tilt. Figure 6 displays the comparison of the two methods using the 8-bit A/D converter.
NOTE:The same analysis applies for angles from 91° to
360° in the other three quadrants.Using a 10-bit A/D converter the 3.3V supply voltage is divided by 1023 (210-1) steps from the A/D converter. This value is then divided by the nsitivity of 0.8V/g to solve for the acceleration due to gravity at each step.
Using a 10-bit A/D converter with a 2 axis solution the resolution is between 0.171 and 0.327 throughout the tilt range, while the 1 axis solution resolution starts out at 0.231 at 0° and increas to 5.147 as it approaches 90°. A higher resolution is achievable with a bigger A/D converter. The
ρarc A
X
A Y
2A Z
2+-----------------------⎝⎠
⎜⎟⎛⎞tan =φarc A
Y
A X
2A Z
2+-----------------------⎝⎠
⎜⎟⎛⎞tan =θarc A X 2A Y 2
程咬金王者荣耀+A Z --------------------⎝⎠
⎜⎟⎛⎞
tan =X A Y A Z ++1g
=3.3V 2550.8mV l g
×---------------------------------------16.176mg
=θ1–A X ()
sin =θ1–tan A X A Z ------⎝⎠
⎛⎞=3.3V 10230.8mV l g
×------------------------------------------  4.032mg =
AN3461
Sensors
comparison using the 10-bit A/D converter is shown in Figure 10.
Figure 9.  Tilt Resolution for a One or Two axis Tilt
Algorithm Using an 8-Bit A/D Converter
Figure 10.  Tilt Resolution for a One or Two Axis Tilt
Algorithm Using a 10-Bit A/D Converter
Table 2. A/D converter values for A X  and A Z  for tilt from 0° to 90°
A/D A X Ax- g's A/D A Z Az-g's Angle 1-Axis Angle 2-Axes Resolution 1-Axis Resolution 2=Axis 1280.0000190  1.00290.00000.00000.92690.92401290.0162190  1.00290.92690.92400.92690.92401300.0324190  1.0029  1.8540  1.84760.92710.92361310.0485190  1.0029  2.7816  2.77020.92760.92261320.0647190  1.0029  3.7
100  3.69140.92830.92121330.0809190  1.0029  4.6393  4.61060.92930.91931340.0971190  1.0029  5.5698  5.52750.93050.91691350.11321890.9868  6.5018  6.54630.9320  1.01881360.12941890.98687.43567.47160.93380.92531370.14561890.98688.37138.39290.93570.92141380.16181890.98689.30939.30990.93800.91701390.17791890.986810.249910.22220.94050.91221400.19411890.986811.193211.12920.94330.90701410.21031880.970612.139612.22510.9464  1.09591420.22651880.970613.089413.13400.94980.90891430.24261880.970614.042814.03620.95350.90221440.25881880.970615.000314.93140.95740.89521450.27501870.954415.962016.07360.9617  1.14221460.29121870.954416.928416.96610.96640.89261470.30741870.954417.899817.85030.97140.88421480.32351870.954418.876518.72580.97670.87551490.33971860.938219.859019.90370.9825  1.17801500.35591860.938220.847520.77230.98860.86851510.37211850.922121.842621.97450.9951  1.20231520.38821850.922122.844722.8337  1.00210.85911530.40441850.922123.854323.6821  1.00950.84841540.42061840.905924.871724.9048  1.0175  1.22271550.43681840.905925.897625.7407  1.02590.83591560.45291830.889726.932526.9802  1.0349  1.2395157
0.4691
183
0.8897
27.9770
27.8015
1.0445
0.8212

本文发布于:2023-06-04 13:39:21,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/985804.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:苹果   梦遗   程咬金   种子   原因
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图