In this paper, a fuzzy PID controller is designed to control the ultrasonic motor for its nonlinear and time-varying characteristics during operation, and a gravitational search algorithm is used to optimize the parameters of the fuzzy PID controller to improve the performance of the system. To address the problem that the gravitational search algorithm is prone to fall into premature maturity, this paper adds a mutation operation to the gravitational search algorithm to improve the diversity of the population and enhance the global search capability of the algorithm. The simulation results show that the improved gravitational search algorithm improves the phenomenon that the gravitational search algorithm is prone to prematureness and improves the global search capability and convergence performance of the algorithm. Meanwhile, the dynamic and steady-state performance of the ultrasonic motor system is significantly improved by the fuzzy PID controller based on the improved gravitational search algorithm compared with the fuzzy PID controller.