Smart Car PWM control DC Motor

Source: Internet
Author: User

Smart Car PWM control DC Motor

In the automotive industry, we must not only control the operation of automobiles through the CAN bus, but also need a DC motor to control the speed of the automobile in the intelligent remote control automobile market: we can use PWM wave at ordinary times, hardware changes voltage and other methods to change the voltage value at both ends of the vehicle motor, and then adjust the motor speed.
PWM wave is used to control the motor speed. PWM is the pulse width modulation, that is, the pulse waveform with variable duty cycle. by controlling the conduction and shutdown of Semiconductor power devices, the output end obtains some pulses with the same amplitude and different width. These pulses are used to replace the sine wave or other required waveforms. Then, according to this characteristic, the width of a pulse is modulated according to certain rules to change the output voltage of the circuit or the output frequency.
We change the voltage through the characteristics of PWM wave to control the motor speed.
When we control the motor, we also need to use the H-bridge circuit to achieve the positive and Inverse Function of the motor: the H-bridge driving circuit is 4 vertical legs consisting of four transistors H, the motor is the horizontal bar in H, such as 1:


Figure 1: H-Bridge Circuit


The H-bridge motor drive circuit consists of four transistor and one motor. To run the motor, it is necessary to turn on a pair of transistor on the diagonal line. Depending on the conduction of different transistor pairs, the current may flow from left to right or from right to left to control the motor's steering.
To run the motor, a pair of transistor on the diagonal line must be turned on. For example, as shown in figure 2, when Q1 and Q4 tubes are turned on, the current passes through the motor from left to right through Q1 from the positive pole of the power supply, and then returns to the negative pole through q4. As shown by the current arrow in the figure, the current in the flow direction rotates clockwise. When the transistor Q1 and Q4 are turned on, the current will flow from left to right through the motor to drive the motor in a specific direction (the arrow around the motor indicates clockwise ).


Figure 2 clockwise rotation of H-bridge circuit drive motor


As shown in figure 3, the current flows from right to left over the motor when the second pair of transistors Q2 and Q3 are turned on. When the transistor Q2 and Q3 are turned on, the current will flow through the motor from the right to the left, so that the drive motor rotates in the other direction (the arrow around the motor indicates a counterclockwise direction ).


Figure 3 clockwise rotation of the H-bridge drive motor


Then we can control the positive and inverse of the motor through the PWM wave. When driving the motor, it is very important to ensure that the transistor on the two sides of the H Bridge does not turn on at the same time. If the transistor Q1 and Q2 are on at the same time, the current will pass through the two transistors from the positive pole and directly return to the negative pole. At this time, there is no load except the transistor in the electrical circuit, so the current on the circuit may reach the maximum value (this current is only limited by the power supply performance), or even burned out the transistor. Based on the above reasons, the hardware circuit is usually used in the actual drive circuit to conveniently control the toot switch. We can also control the rotation of the motor by using the dead zone generated by the software, in actual use, it is very troublesome to use discrete components to create the H Bridge. 4:


Figure 4: PWM Wave Control Motor Rotation


But we can reduce the complexity of the circuit through the s3c2440a provided by Samsung, we can achieve the PWM we need by setting the PWM timer of the CPU-S3C2440A, then, the dead zone generator is used to avoid the occurrence of the motor dead zone. 5:


Figure 5 dead zone Generator

The relationship between touto and ntout0 is that the bandwidth is the same, and the phase is the opposite. Then, we use the dead zone generator to make their level conversion time different, so as to achieve our goal of avoiding the dead zone.
Code:
Void time0_int_test (void)
{
U32 val = (pclk/250)/8-1;
& Lt; span style = & quot; color: RGB (51, 51, 51); font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-Height: 24px; text-align: justify; & quot; & gt; rt1_0 & amp; = ~ (0xff
For more information, visit QQ: 2825915309 .. Tel: 18336308250

Smart Car PWM control DC Motor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.