The traditional solving algorithms for human attitude face problems like poor stability and low accuracy. To overcome these problems, this paper puts forward a novel human attitude solving algorithm based on fuzzy proportional-integral-derivative (PID) controller and complementary filter, which integrates the data collected by accelerometer, magnetometer and gyro. Through complementary filtering, the error of the gyro was corrected with the aid of accelerometer and magnetometer. Based on the traditional proportional-integral (PI) controller, the fuzzy control was introduced to adjust the parameters in real time, and the differential control (D) was added to improve the dynamic performance of the system, creating a fuzzy PID controller. Then, the fuzzy PID controller was adopted to control the complementary filtering, and the quaternion updating method was employed to compute the human attitude. To verify its effectiveness, our algorithm was compared with the traditional PI filtering algorithm through static and dynamic experiments, using an MPU9150 nine-axis motion tracking device and the MATLAB on the upper computer. The experimental results show that our algorithm achieved stable and accurate output of attitude angles. The research findings are of great application potential in rehabilitation therapy, virtual reality (VR) and human-computer interaction (HCI).