Inertial Measurement Units experience significant deterioration in the orientation angles when they are in movements containing vertical axis components by removing from their stationary state on the ground. In this study, a new tilt compensation/correction algorithm is proposed for an AHRS-Attitude and Heading Reference System to solve the related problem. The approach, in which acceleration, rotation, and magnetic meter data are used, includes the probabilistic filter and also a magnetometer calibration routine, which is a determining factor in orientation accuracy. The simulation results showed that the algorithm made a significant orientation accuracy improvement in vertical movements less than 90 degrees for test-raw sensor data.