AN020 Orienttions nd Rottions Introduction The fct tht ccelerometers re sensitive to the grvittionl force on the device llows them to be used to determine the ttitude of the sensor with respect to the reference grvittionl vector. This ttitude determintion is very useful in leveling or gimblling gyroscopes nd mgnetometers for use in compss nd nvigtion instruments; determining tilt for gme controller pplictions; nd determining tilt or rottion for screen rottion of hndheld devices. The method for clculting orienttion or rottion depends on the specific ppliction. In this ppliction note short introduction is given for some of the most common methods. Orienttions There re severl methods for defining the orienttion of n object. All involve describing the direction of reference vector in reference coordinte system. For ccelerometers it is nturl to use the response of the ccelerometer to the sttic grvittionl force s the reference vector, nd in this cse the reference coordinte system is the Erth with the positive z-xis pointed wy from the center of the Erth. The reference vector cn be defined in Crte sense by giving the components of the reference vector long the coordinte xes. If n ccelerometer is not ccelerting, then the three outputs of the ccelerometer give the Crte components directly. Another common method for defining this direction is in terms of direction coes. In this cse the ngles tht the reference vector mkes with the coordinte xis re used. The equtions below define how to determine the direction coes from the ccelerometer outputs. x 2 y 2 z 2 36 Thornwood Dr. Ithc, NY 14850 tel: 607-257-1080 fx:607-257-1146 www.kionix.com - info@kionix.com Pge 1 of 7
In tilt pplictions such s gme controllers you often re only concerned with the ngle tht the device hs tilted wy from the horizontl plne. In this cse the direction es would be used. y z 2 x z 2 Rottions A generl rottion, A, is typiclly defined in terms of set of 3 rottions which cn be represented s the product of successive mtrices. The specifics of the individul rottion mtrices, unfortuntely, re dependent on your field of study. Here we will discuss how of the most common formultions; the x-convention typiclly used in mechnics; nd the xyz-convention (yw, pitch, roll) used in eronutics. X-convention A BCD The x convention used in mechnics the rottion is given by the Euler ngles () where the first ngle,, is rottion bout the z-xis, the second ngle,, is rottion bout the old x-xis, nd the third ngle,, is rottion round the new z- xis. The component rottions re given s the following. 0 B 0 0 0 1 1 0 0 C 0 0 0 D 0 0 0 1 Pge 2 of 7
So A is finlly given s: A 11 12 13 21 23 31 32 33 11 12 13 21 22 23 31 32 33 XYZ-convention The xyz-convention used in eronutics is given by the Euler ngles (rollpitchyw) where the first ngle,, is rottion bout the z-xis, the second ngle,, is rottion bout the y-xis, nd the third ngle,, is rottion round the x-xis. The component rottions re given s the following. 1 0 0 B 0 0 0 C 0 1 0 0 0 D 0 0 0 1 Pge 3 of 7
So A is finlly given s: A 11 12 13 21 23 31 32 33 11 12 13 21 22 23 31 32 33 Both the x convention nd the xyz convention suffer from condition known s gimbl lock. In gimbl lock one of the rottions becomes lrge enough tht 2 rottion xes become coincident nd you lose degree of freedom in your mesurements. As n exmple imgine n irplne working in the xyz convention, (pitch, roll nd yw). If the irplne first pitches up 90 now the roll xis nd the yw xis hve become coincident. A common wy of overcoming this issue is to use quternions. Specificlly for rottions these quternions re sometimes clled Euler prmeters. Quternions Quternions use 4 prmeters to describe rottion in 3 dimensions. Adding fourth prmeter llows for voiding the condition of gimbl lock. A simple wy of looking t this is to first consider coordintes on sphere. Ug 2 prmeters (ltitude nd longitude for exmple) we cn determine the loction on the sphere. However, t the North nd South pole the two prmeters become degenerte. If we dd third prmeter nd define the North pole s (+1,0,0), the South pole s (-1,0,0), nd points on the equtor (0,X,Y). This method cn be extended to 3 dimensionl rottions. The fourth prmeter removes the degenerte rottions given by the Euler ngles. Pge 4 of 7
A quternion cn be described s 4-prmeter vector, e, s follows: e [ e e e e ] 0 1 2 3 e e e e 1 T 0 1 2 3 Sometimes it is helpful to think of the quternion s rottion,, round direction xis defined by the direction coes. The rottion mtrix, A, for unit quternion is given by the following eqution: e2 e3 e1e 2 e0e3 e0e2 e1e 3 e1e 2 e0e3 e1 e3 e2e3 e0e1 e1e 3 e0e2 e0e1 e2e3 e1 e2 1 2 2 1 1 2 A 11 12 13 21 23 31 32 33 1 2 e e 11 2 3 2 e e e e 12 1 2 0 3 2 e e e e 13 0 2 1 3 2 e e e e 21 1 2 0 3 1 2 e e 22 1 3 2 e e e e 23 2 3 0 1 2 e e e e 31 1 3 0 2 2 e e e e 32 0 1 2 3 1 2 e e 33 1 2 Pge 5 of 7
Compring terms from this mtrix with the rottion mtrix in the xyz-convention we cn determine the conversion equtions between quternions nd the xyz-convention. e0 e1 e2 e3 Summry 2 e e e e rctn 1 2 e e rc 2 e e 0 1 2 3 1 2 e e 0 2 1 3 2 e e e e rctn 12 e e 0 3 1 2 2 3 Brief descriptions of orienttion determintion from ccelerometer outputs were presented. Additionlly, common methods for describing rottions were reviewed. Further informtion on the rottions cn be found in most Clssicl Mechnics textbooks. There re lso mny helpful websites with rticles tht go into the methods in more depth. The Kionix Advntge Kionix technology provides for X, Y, nd Z-xis seng on gle, silicon chip. One ccelerometer cn be used to enble vriety of simultneous fetures including, but not limited to: Hrd Disk Drive protection Vibrtion nlysis Tilt screen nvigtion Sports modeling Theft, mn-down, ccident lrm Imge stbility, screen orienttion & scrolling Computer pointer Nvigtion, mpping Gme plying Automtic sleep mode Pge 6 of 7
Theory of Opertion Kionix MEMS liner tri-xis ccelerometers function on the principle of differentil cpcitnce. Accelertion cuses displcement of silicon structure resulting in chnge in cpcitnce. A signl-conditioning CMOS technology ASIC detects nd trnsforms chnges in cpcitnce into n nlog output voltge, which is proportionl to ccelertion. These outputs cn then be sent to micro-controller for integrtion into vrious pplictions. For product summries, specifictions, nd schemtics, plese refer to the Kionix MEMS ccelerometer product sheets t http://www.kionix.com/prmetric/accelerometers. Pge 7 of 7