I’m having difficulty calibrating the gyroscope.
Using the serial code file, the sensor outputs a stream of raw data, which confirms that the gyroscope is functioning properly.
However, after starting the calibration, the readings became inaccurate. For example, when I rotated approximately 90° around the positive X-axis, the output showed only about 60°. I’ve applied a low-pass filter (LPF), but I’m not sure if it’s implemented correctly.
it wasnt showing zero while standing still
I should add that the angles you get from this calculation are not Euler angles (by any of the several definitions), and in the case of rotation about more than one axis, you will have difficulty interpreting them. Rotation operations about multiple axes are not independent of each other, in the sense that the order of applying the rotations matters a great deal.
This is why the generally accepted and most widely used method of rate gyro integration is to update the quaternion, from which any desired set of 3D orientation angles can be derived.