Detect dormancy.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Detect dormancy.

982 次查看
alexandergoldin
Contributor III

How may I detect dormancy by using MMA8451Q?

The problem is due to regular vertical 1G acceleration, but the body is not always "right" oriented.

So in common case I always have certain non zero values on all 3 axes, even when the body does not move.

标签 (1)
5 回复数

822 次查看
JackITB
NXP Employee
NXP Employee

I Alexander,

As a matter of fact, the computation of measured Acceleration vector magnitude (Vx^2 + Vy^2 + Vz^2) is implemented in our FXLS8471Q accelerometer device. This feature is named "Acceleration Vector-Magnitude" detection, see description in datasheet §8.9.
You can program detection threshold and the device will raise an interrupt whenever it is reached. You can only have one threshold but this may still be enough to detect dormancy (you cannot stay in free fall condition forever).

There could also be another way to overcome this limitation by feeding the x/y/z reference values registers that will be subtracted to the measured vector prior to the magnitude computation.

At last, FXLS8471Q pinout is pretty close to MMA8451Q so you may want to give it a try.

Regards,     Jacques.

822 次查看
alexandergoldin
Contributor III

Mille mercis, Jacques

822 次查看
alexandergoldin
Contributor III

One improvement - we may exclude heave square root, by referencing to R^2

                     (1 - 2*eps)  <   R^2   <  (1 + 2*eps)

822 次查看
alexandergoldin
Contributor III

The strait forward solution is to compare resulting acceleration (i.e. geometrical sum over all of axes) to the 1G

Let

         Vx, Vy and Vz are proper values of axes X, Y and Z accordingly.

Thus

         R^2 = Vx^2 + Vy^2 + Vz^2 , where R is resulting acceleration

Now if

          (1 - eps) <  |R|  < (1 + eps), where eps is a tolerance,

then we may conclude our body does not experience additional acceleration.

The problem is heavy calculation:

        R = sqrt( Vx*Vx + Vy*Vy + Vz*Vz )

        - 3 multiplication

        - 1 square root

822 次查看
alexandergoldin
Contributor III

One improvement - we may exclude heave square root, by referencing to R^2

                     (1 - 2*eps)  <   R^2   <  (1 + 2*eps)