51 single-chip microcomputer PWM DC motor Speed regulation

Source: Internet
Author: User

The principle of PWM voltage regulation and speed regulation for DC motor

The expression of the DC motor Speed N is: n=u-ir/kφ

The speed control method of DC motor can be divided into two types: the excitation control method of regulating excitation flux and the armature control method of regulating armature voltage. The excitation control method at low speed by the limit of magnetic pole saturation, at high speed by reversing sparks and the strength of the commutator structure limit, and the excitation coil inductance is large, the dynamic response is poor, so this control method is used very little. The armature control method is now used in most applications .

The driving of the motor is inseparable from the semiconductor power device. In the control and drive of the armature voltage of DC motor, the use of semiconductor devices can be divided into two ways: linear amplification Drive mode and switch drive mode.

The linear amplification drive is to enable the semiconductor power device to operate in a linear region. The advantages of this method are: the control principle is simple, the output fluctuation is small, the linearity is good, the interference to the neighboring circuit is small, but the power device works in the linear zone because the heat will consume most of the electric power, the efficiency and heat dissipation is serious, so this method is only used for the drive of the Micro Power DC motor. The majority of DC motors adopt switch Drive mode . The switch driving mode is to enable the semiconductor device to operate in the switching state, through the pulse width modulated PWM to control the motor armature voltage, realize the speed regulation.

Duty-ratio α is an important parameter at PWM speed regulation. The following 3 methods can change the duty ratio value.

(1) Fixed width FM method

This approach is to keep the T1 constant, changing only the T2 so that the cycle T (or frequency) changes as well.

(2) FM width adjustment method

This approach is to keep the T2 constant, changing only the T1 so that the cycle T (or frequency) changes as well.

(3) Fixed frequency width adjustment method

This approach is to keep the cycle T (or frequency) constant while changing the T1 and T2.

The first two methods, which change the period (or frequency) of the control pulses at the speed of the control, will cause oscillation when the frequency of the controlled pulses is close to the natural frequency of the system, so these two methods are seldom used. At present, in the control of DC motor, the fixed frequency method is used mainly.

Reversible PWM control system with bipolar drive of DC motor

Bipolar drive refers to a PWM cycle, as the pulse voltage at both ends of the armature is positive or negative alternating.

Bipolar Drive Circuit has two, a kind of called T, it consists of two switch tube, using positive and negative power supply, equivalent to two irreversible control system combination. However, because the switch tube in T-type bipolar drive is subjected to high reverse voltage, it is only used in low-voltage and small-power DC motor Drive.

The other is called an H-type.

H-Type Bipolar Drive

1. Motor control circuit Module

H how the bridge motor drive circuit works:

A : When the single-chip P0.0 foot output high level, and P0.1 foot output low, through the photoelectric coupler is still output to high level, so that the Q4 tube conduction, at this time Q1 is also in the conduction state, but the base of the Q2 tube is forcibly pulled low, Q2 tube in the cut-off state. Due to the low output level of the P0.1 foot of the microcontroller,

Q8 in the cut-off state, and at this time Q7 because of the Q5 cutoff and in the conduction state, so that the motor formed circuit, the motor normal work.

B : Similarly, when the P0.0 pin output is low, and the P0.1 foot output is high, the transistor is in the same state as the above, and the motor is in normal working condition.

C : When the P0.0 feet and P0.1 at the same time high or low, due to Q4 and Q8 and Q3 and Q7 work state, at the same time on or off, so that the motor two broken potential is the same, can not make the motor to form a closed and circuit, the motor does not work, is the so-called design mentioned in the braking state.

As a result of the circuit in the drive power tube emitter each added a small inductor, the purpose is to make the motor driving voltage more stable, to obtain a more smooth driving voltage, thereby increasing the accuracy of the brake action, reduce the motor in the start and stop the moment produced too much voltage on the power tube impact, resulting in power pipe damage. At the same time, it also improves the reliability and accuracy of the braking control of the motor, and does not cause large error in control due to inertia.

The advantages of the bridge are simple in principle, easy to control, low power consumption with strong load capacity, high precision braking and low price. In the control signal of the driving circuit, the photoelectric isolation technology is used to reduce the interference of the H-bridge motor driving circuit to the single-chip microcomputer, and the isolation of analog circuit and digital circuit is realized. In the combination of single-chip microcomputer, through PWM to adjust the pulse width of the method, to achieve a simple drive motor speed, through the configuration of the keyboard can modify the parameters of the body, can make the motor to adapt to a variety of different working conditions, and realize the purpose of intelligent control. Thanks to the PWM technique, the process of completing the basic requirements has been made easy.

The power tube used in the circuit is a middle power tube, wherein the driving power tube is designed as a flexible replacement mode, which can adjust the model of the power tube without changing the circuit to meet the requirements of the circuit control according to the need of the actual driving circuit.

2. Software module section

In the aspect of speed control, it can be achieved by changing the voltage on both sides of the motor, which can be continuous change (plus DC voltage) or intermittent change (plus pulse voltage). For the sake of simplicity, we adopt a pulse-width regulation, and the change in pulse width can be achieved by hardware or software.

The hardware implementation of the scheme is to adjust the charge-discharge time by changing the RC parameters in the oscillation circuit. If the hardware circuit to achieve, in terms of stability can not be guaranteed.

The method of three-software is to achieve PWM pulse width modulation by setting high-level and low-level holding time.

In comparison, the software adjusts the quantization index to be higher, the adjustment is more reliable, more convenient, more accurate. As a result, scenario two is often considered at design time.

The pulse frequency also has the influence to the motor turn, the pulse frequency is high continuity good, but with the load ability is poor, the frequency low is opposite. The experimental results show that the pulse frequency is the best in 15━20hz . In this design, 20HZ is used to design.

The Pulse speed regulation is essentially the adjustment of the average power on both ends of the motor, and it is calculated that the speed of the motor is proportional to the pulse width.

The software programming consideration is to set the pulse width of this variable. The output control signal of the p0.0,p0.1 produces a 20HZ adjustable pulse-width square wave.

The following is the experimental procedure of 51 single-chip microcomputer

#include < Reg51.h > #include < intrins.h >sbit K1 =p1^4;                    Increase the key sbit K2 =p1^5;                Reduce the key sbit P00 =p0^1;sbit BEEP =p3^7;   buzzer unsigned char pwm=0xe7; Assigns the initial value void Beep (); void delayms (unsigned char ms); void delay (unsigned char t);/****************************************    /void Main () {p1=0xff;    tmod=0x21;             Th0=0xff;            50us delay constant Tl0=0xce;            Frequency regulation TH1=PWM;     Pulse width regulation tl1=0;     Ea=1;     Et0=1;        Et1=1;   Tr0=1;           while (1) {do{if (pwm!=0xff) {pwm++;d elayms (10);}         else Beep ();     } while (k1==0);           do{if (pwm!=0xce) {pwm--;d elayms (10);}          else Beep ();   } while (k2==0);    }}void Timer0 () interrupt 1{tr1=0;    Th0=0xff;    Tl0=0xce;    TH1=PWM;    Tr1=1;      p00=0;    Start output}void timer1 () interrupt 3{tr1=0;     P00=1; End Output}/*********************Buzzer Sub-Program/*********************************************************/void      Beep () {unsigned char i;          for (i=0; i<100; i++) {delay (100); beep=!                BEEP;                            BEEP} beep=1;  Turn off the buzzer delayms (100); }/*********************************************************///Delay subroutine/******************************************* /void delay (unsigned char t) {while (t--);} /*********************************************************///Delay subroutine/********************************************    /void delayms (unsigned char ms) {unsigned char i;     while (ms--) {for (i = 0; i <; i++); }}/*********************************************************/

  

51 single-chip microcomputer PWM DC motor Speed regulation

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.