Abstract:At present, domestic leveling machines have many shortcomings, such as low leveling accuracy, weak anti-interference ability, and long dynamic response time. In order to solve these problems, attitude control algorithms for leveling machine is studied through comparing the performance of PID and fuzzy controllers. Then, an attitude control algorithm based on the fuzzy PID algorithm for leveling machine is developed. In Matlab/Simulink environment, appropriate membership functions, fuzzy inference and defuzzification methods are adjusted based on a mechanical model. A fuzzy rule set acquiring desirable control effect is elaborately designed. The algorithm is implemented with an STM32F407 microprocessor as the controller. Attitude control experiments are carried out on a leveling machine experimental platform. Experimental results show that the fuzzy PID control algorithm can achieve good performance against external disturbance. Control precision and response speed are greatly improved compared with the conventional PID. Our approach has great potential in agriculture and construction industry.