Вы находитесь на странице: 1из 5

SECTION 17.3: DC MOTOR INTERFACING AND PWM This section begins with an overview of the basic operation of DC motors.

Then we describe how to interface a DC motor to the 8051. Finally, we se !ssembly and C lang age programs to demonstrate the concept of p lse width mod lation "#$%& and show how to control the speed and direction of a DC motor. DC motors ! direct c rrent "DC& motor is another widely sed device that translates electrical p lses into mechanical movement. 'n the DC motor we have only ( and ) leads. Connecting them to a DC voltage so rce moves the motor in one direction. *y reversing the polarity, the DC motor will move in the opposite direction. +ne can easily e,periment with the DC motor. For e,ample, small fans sed in many motherboards to cool the C#- are r n by DC motors. *y connecting their leads to the ( and ) voltage so rce, the DC motor moves. $hile a stepper motor moves in steps of 1 to 15 degrees, the DC motor moves contin o sly. 'n a stepper motor, if we .now the starting position we can easily co nt the n mber of steps the motor has moved and calc late the final position of the motor. This is not possible in a DC motor. The ma,im m speed of a DC motor is indicated in rpm and is given in the data sheet. The DC motor has two rpms/ no0load and loaded. The man fact rer1s data sheet gives the no0load rpm. The no0load rpm can be from a few tho sand to tens of tho sands. The rpm is red ced when moving a load and it decreases as the load is increased. For e,ample, a drill t rning a screw has a m ch lower rpm speed than when it is in the no0load sit ation. DC motors also have voltage and c rrent ratings. The nominal voltage is the voltage for that motor nder normal conditions, and can be from 1 to 1502, depending on the motor. !s we increase the voltage, the rpm goes p. The c rrent rating is the c rrent cons mption when the nominal voltage is applied with no load, and can be from 35m! to a few amps. !s the load increases, the rpm is decreased, nless the c rrent or voltage provided to the motor is increased, which in t rn increases the tor4 e. $ith a fi,ed voltage, as the load increases, the c rrent "power& cons mption of a DC motor is increased. 'f we overload the motor it will stall, and that can damage the motor d e to the heat generated by high c rrent cons mption. Table 17-9: Selected DC Motor Characteristics rvvww.Jameco.com) Unidire tion Contro! Fig re 15016 shows the DC motor rotation for cloc.wise "C$& and co ntercloc.wise "CC$& rotations. 7ee Table 1508 for selected DC motors. Fig re 17-1!. DC Motor "otatio# $%erma#e#t Mag#et Field) "idire tion#! ontro! $ith the help of relays or some specially designed chips we can change the direction of the DC motor rotation. Fig res 15019 thro gh 15015 show the basic concepts of :0 *ridge control of DC motors. Fig re 17-1&. '-(ridge Motor Co#)ig ratio# Fig re 15019 shows the connection of an :0*ridge sing simple switches. !ll the switches are open, which does not allow the motor to t rn.

Fig re 17-1*. '-(ridge Motor Cloc+wise Co#)ig ratio# Fig re 15015 shows the switch config ration for t rning the motor in one direction. $hen switches 1 and 9 are closed, c rrent is allowed to pass thro gh the motor. Fig re 17-1,. '-(ridge Motor Co #tercloc+wise Co#)ig ratio# Fig re 1501; shows the switch config ration for t rning the motor in the opposite direction from the config ration of Fig re 15015. $hen switches 3 and 6 are closed, c rrent is allowed to pass thro gh the motor. Fig re 17-17. '-(ridge i# a# -#valid Co#)ig ratio# Fig re 15015 shows an invalid config ration. C rrent flows directly to gro nd, creating a short circ it. The same effect occ rs when switches 1 and 6 are closed or switches 3 and 9 are closed. Table 17-1. shows some o) the logic co#)ig ratio#s )or the '-(ridge desig#. :0*ridge control can be created sing relays, transistors, or a single 1C sol tion s ch as the <386. $hen sing relays and transistors, yo m st ens re that invalid config rations do not occ r. !ltho gh we do not show the relay control of an :0*ridge, =,ample 1505 shows a simple program to operate a basic :0*ridge. /0am1le 17-* ! switch is connected to pin #3.5. -sing a sim lator, write a program to monitor the stat s of 7$ and perform the following/ 1. 'f 7$ > 0, the DC motor moves cloc.wise. 3. 'f 7$ > 1, the DC motor moves co ntercloc.wise.

Fig re 17-12. (idirectio#al Motor Co#trol 3si#g a# 459! Chi1 Fig re 15018 shows the connection of the <386 to an 8051. *e aware that the <386 will generate heat d ring operation. For s stained operation of the motor, se a heat sin.. =,ample 150; shows control of the <386. /0am1le 17-, Fig re 15018 shows the connection of an <386. !dd a switch to pin #3.5. $rite a program to monitor the stat s of 7$ and perform the following/ 1. 'f 7$ > 0, the DC motor moves cloc.wise.

3. 'f 7$ > 1, the DC motor moves co ntercloc.wise. P$!se %idt& mod$!#tion 'PWM( The speed of the motor depends on three factors/ "a& load, "b& voltage, and "c& c rrent. For a given fi,ed load we can maintain a steady speed by sing a method called pulse width modulation "#$%&. *y changing "mod lating& the width of the p lse applied to the DC motor we can increase or decrease the amo nt of power provided to the motor, thereby increasing or decreasing the motor speed. ?otice that, altho gh the voltage has a fi,ed amplit de, it has a variable d ty cycle. That means the wider the p lse, the higher the speed. #$% is so widely sed in DC motor control that some microcontrollers come with the #$% circ itry embedded in the chip. 'n s ch microcontrollers all we have to do is load the proper registers with the val es of the high and low portions of the desired p lse, and the rest is ta.en care by the microcontroller. This allows the microcontroller to do other things. For microcontrollers witho t #$% circ itry, we m st create the vario s d ty cycle p lses sing software, which prevents the microcontroller from doing other things. The ability to control the speed of the DC motor sing #$% is one reason that DC motors are preferable over !C motors. !C motor speed is dictated by the !C fre4 ency of the voltage applied to the motor and the fre4 ency is generally fi,ed. !s a res lt, we cannot control the speed of the !C motor when the load is increased. !s was shown earlier, @@e can also change the DC motor1s direction and tor4 e. 7ee Fig re 15018 for #$% comparisons. Fig re 17-19. % lse 6idth Mod latio# Com1ariso# DC motor ontro! %it& o)toiso!#tor !s we disc ssed in the first section of this chapter, the optoisolator is indispensable in many motor control applications. Fig res 15030 and 15031 show the connections to a simple DC motor sing a bipolar and a %+7F=T transistor. ?otice that the 8051 is protected from =%' created by motor br shes by sing an optoisolator and a separate power s pply. Fig res 15030 and 15031 show optoisolators for control of single directional motor control, and the same principle sho ld be sed for most motor applications. 7eparating the power s pplies of the motor and logic will red ce the posi0bility of damage to the control circ ity. Fig re 17-5.. DC Motor Co##ectio# si#g a Darli#gto# Tra#sistor Fig re 15030 shows the connection of a bipolar transistor to a motor. #rotection of the control circ it is provided by the optoisolator. The motor and 8051 se separate power s pplies. The separation of power s pplies also allows the se of high0voltage motors. ?otice that we se a deco pling capacitor across the motorA this helps red ce the =%' created by the motor. The motor is switched on by clearing bit #l.+. Fig re 17-51. DC Motor Co##ectio# si#g a M7SF/T Tra#sistor Fig re 15031 shows the connection of a %+7F=T transistor. The optoisolator protects the 8051 from =%'. The Bener diode is re4 ired for the transistor to red ce gate voltage below the rated ma,im m val e.

/0am1le 1505 Cefer to the fig re in this e,ample. $rite a program to monitor the stat s of the switch and perform the following/ 1. 'f #3.5 > 1, the DC motor moves with 35D d ty cycle p lse. 3. 'f #3.5 > 0, the DC motor moves with 50D d ty cycle p lse. DC motor ontro! #nd PWM $sin* C =,amples 1508 thro gh 15010 show the 8051 C version of the earlier programs controlling the DC motor. /0am1le 17-2 Cefer to Fig re 15018 for connection of the motor. ! switch is connected to pin #3.5. $rite a C program to monitor the stat s of 7$ and perform the following/ 1. 'f 7$ > 0, the DC motor moves cloc.wise. 3. 'f 7$ > 1, the DC motor moves co ntercloc.wise. Sol tio#:

/0am1le 17-9 Cefer to the fig re in this e,ample. $rite a C program to monitor the stat s of 7$ and perform the following/ 1. 'f 7$ > 0, the DC motor moves with 50D d ty cycle p lse. 3. 'f 7$ > 1, the DC motor moves with 35D d ty cycle p lse.

/0am1le 17-1. Cefer to Fig re 15030 for connection to the motor. Two switches are connected to pins #3.0 and #3.1. $rite a C program to monitor the stat s of both switches and perform the following/ 7$3"#3.5& 7$1"#3.;& 0 0 DC motor moves slowly "35D d ty cycle&. 1. 1 DC motor moves moderately "50D d ty cycle&. 3. 0 DC motor moves fast "55D d ty cycle&. 1 1 DC motor moves very fast "100D d ty cycle&.

Sol tio#: SUMMAR+ This chapter contin ed showing how to interface the 8051 with real0world devices. Devices covered in this chapter were the relay, optoisolator, stepper motor, and DC motor. First, the basic operation of relays and optoisolators was defined, along with .ey terms sed in describing and controlling their operations. Then the 8051 was interfaced with a stepper motor. The stepper motor was then controlled via an optoisolator sing 8051 !ssembly and C programming lang ages. Finally, the 8051 was interfaced with DC motors. ! typical DC motor will ta.e electronic p lses and convert them to mechanical motion. This chapter showed how to interface the 8051 with a DC motor. Then, simple !ssembly and C programs were written to show the concept of #$%. Control systems that re4 ire motors m st be eval ated for the type of motor needed. For e,ample, yo wo ld not want to se a stepper in a high0velocity application nor a DC motor for a low0speed, high0 tor4 e sit ation. The stepper motor is ideal in an open0loop positional system and a DC motor is better for a high0speed conveyer belt application. DC motors can be modified to operate in a closed0loop system by adding a shaft encoder, then sing a microcontroller to monitor the e,act position and velocity of the motor.

Вам также может понравиться