Download User Manual

Transcript
3. Detecting Free-fall
Start
Read accelerations X, Y, and Z
Calculate total acceleration A
A = sqrt{x^2+y^2+z^2}
Compare A to the freefall threshold
Depending on the application, 0.3g to 0.5g is
usually a reliable threshold.
Is A greater
than threshold?
No
Yes
Freefall
Not Freefall
FREEFALL = 0.3 g // Threshold under which the object is
// considered to be in free-fall
IN_FREEFALL = false // Stores whether or not the device is
// falling
while running
(ACCX, ACCY, ACCZ) = sensor.allreadings
TOTAL_ACC = square_root(ACCX ^ 2 + ACCY ^ 2 + ACCZ ^ 2)
if TOTAL_ACC < FREEFALL then
IN_FREEFALL = true
else
IN_FREEFALL = false
end if
end while
Page 20