I am transferring about 19 variables from Arduino to MATLAB, and when I add extra variables my roll and pitch values start to increase exponentially. And now they won't stop increasing. For example my GY521 is not moving, yet my roll is 0 5 14 25 and after about 10 seconds 178. I have tried an extra delay and am using the complimentary filter.
Assuming that your code is correct, the drift is probably due to the gyro offsets, which need to be measured and subtracted from later measurements.
The offsets are temperature dependent, so this fix is temporary and of limited use.
Otherwise, please read and follow the instructions in the "How to get the best out of the forum" post, linked at the head of every forum category.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.