Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between gyro and accelerometer

According to apple documentation , the accelerometer measures acceleration along the axis, and gyro measure the rotation rate around the axis .

In reality , things are very strange .

When using the accelerometer function:

- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration

it seems that the gyro and accelerometer are working together . When fast moving along the x axis, i get values bigger then 1 like 1.5-2 ,which is ok cause i get acceleration. but when rotating the iphone AROUND its x axis, the values also changing between 0-1, for example , if i hold it and the value is 0.3 ,and the i rotate it a little bit, i see 0.6, if i rotate more its 0.8. but this is a behavior of a gyro , because when velocity is 0 (i stop the rotation) i should see acceleration -0 and not 0.6 . it seems to show me the gyro angle position .

Whats happen here anyway ? the values should be 0, till i move it fast ALONG the axis not around it .

I couldnt find any answer and it seems that many people dont really understand that .

like image 941
Curnelious Avatar asked Jun 06 '26 22:06

Curnelious


2 Answers

Before All we must agree on terms:

In my opinion APPLE is wrong when it calls acceleration the values you get from sensor. Acceleration in the second derivative of translation, so d(dx)/d(dt), so when an iphone is steady, should be zero. in my opinion these values are simply angles. See apple samples, the use a "2nd order filter" to get acceleration.. "2nd" order filter means 2nd derivate, if I remember correctly what I studied.

Hope this can help.

like image 76
ingconti Avatar answered Jun 10 '26 18:06

ingconti


The accelerometer reports the difference between the acceleration that the device is experiencing and that with it would be experiencing were it in freefall. So if the accelerometer is returning a zero vector then the only force acting on the phone is gravity (ie, you've dropped it). Normally it'll be some other value. If the phone is at rest on a table, it'll reveal the direction of gravity relative to the phone. The accelerometer is therefore most often used to figure out which way is down - so that the UI can rotate, and in games so that you can do things like use the device as a steering wheel.

The gyroscope can observe the rate at which the device is rotating. The CoreMotion library can automatically integrate that to get current angles.

Devices with a gyroscope also have a three-axis accelerometer (in addition to the traditional one) that measures acceleration individually along three axes.

like image 41
Tommy Avatar answered Jun 10 '26 17:06

Tommy