| Two-wheeled self-balancing vehicle has been widely studied for its advantages of simple operation,energy conservation and environmental protection,flexible movement.The system of two-wheel balancing vehicle is a nonlinear unstable system,which is similar to inverted pendulum.In this paper,a system of two-wheel balancing vehicle based on genetic PD control was designed.And I proposed the PD control algorithm based on genetic algorithm to complete the balance and motion control of the vehicle.It provides reference value for practical engineering application.Firstly in this thesis,I drew the schematic diagram and PCB of hardware circuit system.The hardware circuit system includes the main control circuit,the inertial sensor circuit,and the voltage switching circuit,etc.A complete hardware platform was built for the two-wheel self-balancing vehicle system from the selection of components to the welding and testing of the hardware circuit board.The main control chip used a K60 series chip of The Freescale.Because of the internal integrated kernel of cortex-M4,it has powerful capabilities of data processing.The mathematical modeling of the two-wheel self-balancing vehicle system was carried out.To analyze how to realize the self-balance and motion control of the vehicle.The real-time angle of inclination of the body of the vehicle is an important parameter indicator for its balance.The data of angle was collected by accelerometers and gyroscopes.Then I dealed with the collected data by complementary filtering and Kalman filtering and contrasted the filtering effect after using Matlab to simulate.The angle value after filtering was used an important parameter to adjust the vehicle’s balance and movement.At last,I built a mathematical model of a two-wheeled balancing vehicle system,to analyze how to achieve the self-balancing and motion control.This paper presented the design of PD controller based on genetic algorithm.I analyzed the advantages of genetic algorithms in principle and introduced the design ideas and steps based on genetic algorithm PD controller.I also compared with the traditional PID control method through simulation.The result showed that genetic PD control has faster response speed and better dynamic performance.The reliability and practicability of the algorithm were verified. |