The zero drift of the MEMS gyroscope is the main factor that affects the gyroscope's measurement accuracy. First, the drift error of the three-axis MEMS gyroscope is filtered and denoised, and the temperature compensated model is established for the three-axis MEMS gyroscope after denoising. A piecewise linear approximation method is used to establish a temperature compensation model for the MEMS gyroscope X axis, and a polynomial curve fitting method is used to establish a temperature compensation model for the MEMS gyroscope Y axis and Z axis. After the temperature compensation, the three-axis output value of the MEMS gyroscope fluctuates near zero, which indicates that this solution can effectively perform temperature compensation for the MEMS gyroscope.