I've been researching online to understand how to get gyroscope data from the MPU-6050 which is probably one of the most popular IMU's out there. But i am confused over the reason why the gyroscope drifts, as i found two sources which give different reasons...
"Because we can't take a perfectly continuous integral, we have to take the sum of a finite number of samples taken at a constant interval Ts. Ts is called the sampling period. Of course this approximation will introduce errors. When gyrosocope data changes faster than the sampling frequency, we will not detect it, and the integral approximation will be incorrect. This error is called drift, as it increases in time."
So, this source claims that the drift is due to the non-ideal sampling frequency when using a microcontroller like Arduino to sample the output of the gyro.
"In order to get rotation (angle) from a gyroscope, which senses angular velocity, you need to perform a single integration.
f ≡ frequency
∫cos(2π×ft)) = (1/(2π×f)) × sin(2π×ft)
But be aware that integration turns noise into drift. As we see above, the integration gets a 1/f outside, meaning that high frequency (f) noise disappears with integration, i.e. a noise of frequency will drop by a factor of a 100, but a very low frequency will be amplified, meaning the gyroscope will drift over time."
And this source claims that integration itself gives the reciprocal of frequency which would cause this drift, and that's without even going to the digital sampling.
So, which one is correct? Or maybe none of them??