Improve accuracy of orientation sensor calculation