In this paper, the trajectory planning of the sinusoidal square curve function acceleration and deceleration algorithm for a three-degree-of-freedom permanent magnet spherical motor is studied. Firstly, the forward and inverse kinematics model is established for the spherical motor. The forward and inverse solutions are solved by the kinematic equation, and the singularity analysis of the Euler angle is carried out. Secondly, the square curve of the sinusoidal function is theoretically analyzed, and finally the digital simulation analysis is carried out. The results show that the acceleration and deceleration algorithm has excellent characteristics in angular displacement, angular velocity, angular angular velocity and angular jerk.