This paper discusses the development of the attitude estimation algorithm for a MEMS based 9-axis motion tracking sensor, which includes a tri-axis accelerometer, a tri-axis gyroscope and a tri-axis magnetometer. The comparison between the Euler angles and the direction cosine matrix (DCM) based approach is presented to illustrate the advantage of DCM. It will be shown that the kinematic model for DCM can be transformed into a linear time-varying state space form, which greatly simplifies the development of the estimation algorithm. Different from the existing estimation algorithms, which incorporate a nonlinear kinematic model and the nonlinear Kalman filter, such as extended Kalman filter (EKF) or unscented Kalman filter (UKF), the nonlinearity in the kinematic model is not the trouble maker anymore. Hence, global convergence can always be guaranteed. Finally, the estimation algorithm is demonstrated by using the real measurement data collected from InvenSenses MPU9250, which is one of the most popular 9-axis motion tracking sensors in the market.