In this paper we will study an algorithm designed by Madgwick which is commonly used to determine the orientation of a quadcopter. The algorithm uses a group of accelerometers, gyroscopes and magnetometers integrated in what is called an IMU as input. Some differences have been found between the results obtained by the original paper and the implementation done by the author. Therefore, a thorough study has been made, finding a miscalculation in the equations. The results show a relative average error in the orientation of 1,44 ppm.