I want to know how can i detect 360 rotation when sensor is s not on 0 degree and is at different angel such as 50 degrees it does not completes 360 degree rotation and i have to change code again and again to meet with conditions . do u have any idea to auto correct sensor by itself .
[/quote]
please tell how can i check the offset e.g. 50 deg when you start your program. Then on rotation you'll need 50 to 360 and 360 to 50 for full 360 rotation. So what you want is know what start postion the sensor was in and measure relative rotation instead of absolute.
Are you trying to calibrate the rotation angle when the sensor is off by some factor then? I still not sure what the problem is - perhaps you could explain what you do and the positions and readings you are getting that are in error?
can u make a code which can 50 deg when you start your program. Then on rotation you'll need 50 to 360 and 360 to 50 for full 360 rotation. So what you want is know what start postion the sensor was in and measure relative rotation instead of absolute. Because i think we are not getting anywhere . and also the code i had posted it not doing what i wanted it should calculate euler angel and report 360 degree rotation . thanks for listening
no , i am not trying to calibrate the rotation angle when the sensor is off . i am just asking how can i detect rotation . forget the readings , is it possible to save first reading of sensor and then find it if the sensor completes 360 rotation . can it be done ?
The MPU-6050 is useless as an absolute orientation sensor, because it has no yaw reference and will always drift.
However, in the short term you can integrate the rate gyro outputs, and use that to detect a reasonably fast 360 degree rotation about an axis.This code does that, but first the gyro should be calibrated to remove the zero offset.