This has been a busy time developing a telemedicine system based on the. NET Micro framwork System (see: http://space.cnblogs.com/group/topic/41835/), so after nearly a week, Have the energy to continue to study the problem of PWM drive intelligent car.
Previously on the stepper motor and DC motor control is not deep understanding, think only for stepper motor, in order to carry out PWM control, and to purchase the relevant driver board and Stepper motor, only to find that because of the driving plate, the direction of control stepper motor, speed can only through IO control.
Before introducing the specific control code, in order to facilitate a more in-depth understanding of the PWM control of DC motor mechanism, we first rough understanding of the H-Bridge Drive DC motor principle.
(1) The H-Bridge motor drive circuit comprises 4 transistors and one motor;
(2), conduction Q1 and Q4, the current from the Q1 through the motor flow to Q4, the motor clockwise rotation;
(3), conduction Q3 and Q2, the current from the Q3 through the motor to Q2, the motor counterclockwise rotation;
(4), the size of the current determines the speed of the motor, through the PWM duty ratio (electricity flow ratio) to determine the size of the current, thus indirectly control the speed of the motor.
Of course, in order to improve the driving capacity of the three-tier tube will be switched to MOS tube, but the principle is the same. But the actual use of time, using discrete components to make H-bridge is very troublesome, now are used to encapsulate the H-bridge IC chip, such as the comparison of common chips have l293b, l293d, l298n, ta7257p, SN754410 and so on.
We currently choose the four-way DC motor driver, its core chip is l293b chip, each chip integrated two H bridge circuit, can simultaneously control two direct current motor.