Project Report On Speed Control of DC Motor by Using PWM Technique
Project Report On Speed Control of DC Motor by Using PWM Technique
BACHELOR OF TECHNOLOGY
IN
BY
D.RAMAKRISHNA (07221A0234)
Under the esteemed guidance of
Professor
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING BONAM VENKATA CHALAMAYYA ENGINEERING COLLEGE (Approved by AICTE, New Delhi, affiliated to J.N.T.U.K, Accredited by NBA) ODALAREVU-533210
CERTIFICATE
This is to certify that this project entitled SPEED CONTROL OF DC MOTOR BY USING PWM TECHNIQUE is the bonified work done and submitted by
D.RAMA KRISHNA
JAVAHARLAL
requirement for the award of B. Tech in Electrical and Electronics Engineering of NEHRU TECHNOLOGY
Project Guide
Prof.
J.V.G.RAMA
Professor& HOD
Professor& HOD
EXTERNAL EXAMINER
ACKNOWLEDGEMENT
First and foremost we sincerely salute our estimated institution BONAM VENKATA CHALAMAYYA ENGINEERING COLLEGE for giving this golden opportunity for fulfilling our warm dreams of becoming engineers. We wish to express to our heartfelt gratitude and thanks to our guide and H.O.D. Sri J.V.G.RAMA RAO, Professor of E.E.E department for his valuable suggestions and indebted help to complete our project in time successfully. We thank our honorable principal Sri Dr .D.S.V .PRASAD for his kind co-operation and for providing the department facilities like the computer lab and internet. We are thankful to our academics director B.V.C Engineering College Dr.G.M.V.Prasad, for providing appropriate environment required for the project. We are much thankful to our staff for their valuable suggestions and lab technicians for their co-operation.
PROJECT ASSOCIATES..
D.RAMA KRISHNA,
ABSTRACT
The project reveals the digital closed loop control system for speed control of DC motor using PWM technique. In present days the power semiconductor devices have completely revolutionized the control of drives especially in the area of control usage of thyristors igbts power MOsFET etc., was increased The digital circuit can be interfaced to microcontroller. So that the speed can be controlled by Microcontroller there by making speed control of DC motor even more easily. Pwm technique to the digital circuit drives the component correspondingly speed will change . The project basically consists of micro controller MCS 51 series 89c52 and motor driver, thermal sensor, comparator, key pad,16X2 dot matrix LCD display and rotation feedback sensor (optical encoder). The program is written in micro controller to take the input values from the user, then rotates the motor by placing 50% duty cycle pulse on the motor. The motor is rotated at X RPM speed, can be detected by using feedback sensor and micro controller. If the speed is above the specified speed then the micro controller continuously reduces the duty cycle till the speed comes to a predetermined level. If the detected speed is less than the pre determined speed then the micro controller continuously increases the duty cycle till the determined level. The micro controller keeps on tracking the determined speed by varying duty cycle in a closed loop control system.
INDEX
INTRODUCTION 1. DC MOTOR 1.1 introduction to speed control 1.2 classification of dc motor 1.3 speed control of dc motor 1.4 speed control of dc shunt motor 1.4.1 Flux control method 1.4.2 armature/rheostat control method 1.4.3 Voltage control method 1.5 motor applications 1.5.1 Shunt motor 1.5.2 series motor 1.5.3 Compound motor 2. SWITCHING DEVICES & PWM TECHNIQUE 2.1 power semiconductor devices classification 2.2 diode 2.3 thyristors 2.4 bipolar junction transistor 2.5 power Mosfet 2.6 pwm technique 2.6.1. Introduction 2.6.2. Principle 2.6.3. Methods 3. COMPONENTS DESCRIPTION 3.1 introduction 3.2 power supply 3.3 voltage regulator 3.4 positive voltage regulator 3.5 switches 3.6 motor and motor drives 3.7 optical encoder 3.8 89c52 microcontroller 3.9 on chip oscillator 3.10 liquid crystal display 4. BLOCK DIAGRAM AND CIRCUIT DIAGRAM 4.1 block diagram 4.2 Circuit diagram 4.3 explanation 5. CIRCUIT OVERVIEW 7. RESULT AND CONCLUSION
B.V.C Engineering College, Odalarevu.
1 4 5 5 7 8 8 9 12 13 13 14 14 16 17 17 19 20 21 22 22 25 27 30 31 32 32 34 35 37 40 41 51 53 57 58 59 60 62 63
5
8. ANNEXURE 9. REFERENCES
64 70
INTRODUCTION
INTRODUCTION
Todays industries are increasingly demanding process automation in all sectors. Automation results into better quality, increased production an reduced costs. The variable speed drives, which can control the speed of A.C/D.C motors, are indispensable controlling elements in automation systems. Depending on the applications, some of them are fixed speed and some of the variable speed drives. The variable speed drives, till a couple of decades back, had various limitations, such as poor efficiencies, larger space, lower speeds, etc., However, the advent power electronic devices such as power MOSFETs, IGBTs etc., and also with the introduction of micro -controllers with many features on the same silicon wafer, transformed the scene completely and today we have variable speed drive systems which are not only in the smaller in size but also very efficient, highly reliable and meeting all the stringent demands of various industries of modern era. Direct currents (DC) motors have been used in variable speed drives for a long time. The versatile characteristics of dc motors can provide high starting torques which is required for traction drives. Control over a wide speed range, both below and above the rated speed can be very easily achieved. The methods of speed control are simpler and less expensive than those of alternating current motors. There are different techniques available for the speed control of DC motors. The phase control method is widely adopted, but has certain limitations mainly it generates harmonics on the power line and it also has got p .f when operated lower speeds. The second method is pwm technique, which has got better advantages over the phase control. In the proposed project, a 5 H.P DC motors circuitry is designed, and developed using pulse with modulation (PWM).The pulse width modulation can be achieved in several ways. In the present project, the PWM generation is done using micro- controller.
Speed control of DC motor by using PWM technique In order to have better speed regulation, it is required to have a feedback from the motor. The feedback can be taken either by using a tachogenerator or an optical encoder or the back EMF itself can be used .In present project, we implemented the feedback by using the EMF of the armature as the feedback signal. The project proposed is a real time working project, and this can be further improvised by using the other safety features, such as field current, air gap magnetic flux, armature current, etc.,
1. DC MOTOR
1. DC MOTOR
1.1 INTRODUCTION TO SPEED CONTROL:
Speed control means intentional change of drive speed to a value required for performing the specific work process. This concept of speed control or adjustment should not be taken to include the natural change in speed which occurs due to change in the load on the shaft. Any given piece of industrial equipment may have its speed change or Adjusted mechanically by means of stepped pulleys, sets of change gears, variable speed friction clutch mechanism and other mechanical devices. Historically it is proved to be the first step in transition from non adjustable speed to adjustable speed drive. The electrical speed control has many economical as well as engineering advantages over mechanical speed control The nature of the speed control requirement for an industrial drive depends upon its type. Some drives may require continues variation of speed for the whole of the range from zero to full speed or over a portion of this range , while the others may require two or more fixed speeds
10
Shunt field
Series field
11
N= K (
=K (V-Ia Ra / ) Where V=supply voltage (volts) Ia = armature current (amps) Ra=armature resistance (ohms) =flux per pole (Weber) ( )
This equation gives two methods of effective speed changes.i.e. a) The variation of field excitation, if this causes in the flux per pole and is known as the field control.
b)
12
so that rheostat is small in size. This method therefore very efficient in non-interpolar machines the speed can be increased by this method in the ratio 2:1 any further weakening of flux adversely affect the communication And hence puts a limit to the maximum speed obtainable with this method in machines fitted with interlopes in ratio of maximum to minimum speeds of 6:1 is fairly common. The connection diagram for this type of speed control is shown in figure below.
Field rheostat
13
armaturein
Speed,N
Ristence in armature
Armature current, Ia
Fig 1.3
This method is used when speeds below the no load speed are required. As the supply voltage is normally constant, the voltage across the armature is varied by inserting a variable rheostat or controller resistance in series with the armature circuit as shown in fig. as controller resistance is increased, potential difference across the armature
14
Speed control of DC motor by using PWM technique is decreased, thereby decreasing the armature speed. For a load of constant torque, speed is approximately proportional to the potential difference. Across the armature current characteristics in fig. in seen that greater the resistance In the armature circuit, greater is the fall in speed Let Ia1 Ia2 N1, N2 = V = = Armature current in the first case = Armature current in the second case corresponding speeds Supply voltage
Then N1 (v-Ia1Ra )Eb1 Let some controller resistance of value R be added to the armature circuit resistance so that its value becomes (R+Ra) = Rt Then N2 (V-Ia2 Rt) Eb2 N2/N1=Eb2/Eb1 Considering no load speed, we have N/N0 (I-(Ia Rt)/ (V-Ia0 Ra) Neglecting Iao Ra w.r.t.toV, we get N=No (I-(Ia Rt)/ V
15
Speed, N
No
Ia
Im
Fig.1.4
It is seen that for a given resistance Rt the speed is a linear function of armature current Ia as shown in fig. The load current for which the speed would be zero is found by putting N=0 in above relation 0 = N0 ((I-Ia Rt)/V) Or Ia = V/Rt This maximum current and is known as stalling current. This method is very wasteful, expensive and unsuitable for rapidly changing loads because for a given value of Rt, speed will change with load. A more stable operation can be obtained by using a diverter across the armature in addition to armature control resistance.
16
Speed control of DC motor by using PWM technique Now, the changes in armature current will not be so effective in changing the potential difference across the armature. The connection diagram for this type of speed control arrangement is shown in fig.
Series resistence
Motor
B) WARD-LEONARD SYSTEM:
This system is used where an unusually wide (upto 10:1) and very sensitive speed control is required as for colliery winders , electric excavators and the main drives in steel mills and blooming in paper mills.
B.V.C Engineering College, Odalarevu. 17
Speed control of DC motor by using PWM technique The field of the motor (M1) whose speed control is permanently connected across the DC supply lines. The other motor M2 is directly connected to Generator G. The output voltage of G is directly is fed to the main motor M1. The voltage of generator can be varied from zero to upto its maximum value by means of field regulator. By reversing the direction of the field current of G by means of the reversing switch which RS, generated voltage can be reversed and hence the direction of rotation of M1. It should be remembered that motor set always runs in the same direction. A modification of the word Leonard system is known as word Leonard -linger system which uses a smaller motor generator set with The addition of a flywheel whose function is to reduce fluctuations in the Power demand from the supply circuit . The chief advantage of system is its overall efficiency especially at right loads. It has the outstanding merit of giving wide speed Control from maximum in one direction through zero to the maximum in the opposite direction and of giving a smooth acceleration.
Speed control of DC motor by using PWM technique motors can be employ. But this motor cant complete with constant speed squirrel cage induction motor, because the latter cheaper, rugged and requires less maintenance. When constant speed service at low speeds is required, the comparison is usually between synchronous motors and dc shunt motors. It is because the construction of high performance poly phase induction motor with large number of poles is difficult. However, for adjustable speed service at low operating speed, dc shunt motor is a preferred choice When the driven load requires a wide range of speed control (both below base speed and above base speed), a dc shunt motor is employed, e.g. .in latches etc.
Speed control of DC motor by using PWM technique A compound motor with weak series field has its characteristics approaching that of a shunt motor. Weak series field causes more drooping speed torque characteristics than with an ordinary shunt motors. Such compound motors with steeper characteristics, are used where load fluctuates between wide limits intermittently.
20
21
2 Terminal devices
3 Terminal devices
PN Diode
Schotkey diode
Power MOSFET
JFET
Thyristor
IGBT
BJT
Fig.2.1. Classification of Switching Devices Todays power semiconductor devices are almost exclusively based on silicon material and can be classified as follows: Diode Thyristor or silicon-controlled rectifier (SCR) Bipolar junction transistor (BJT) Power MOSFET
2.2 DIODE:
Power diodes provide uncontrolled rectification of power and are used in applications such as electroplating, anodizing, battery charging, welding, power supplies (dc and ac), and variable frequency drives. They are also used in feedback and the freewheeling functions of converters and snubbers. Shows the diode symbol and its voltampere characteristics. In the forward biased condition, the diode can be represented by a
B.V.C Engineering College, Odalarevu. 22
Speed control of DC motor by using PWM technique junction offset drop and a series-equivalent resistance that gives a positive slope in the VI characteristics. The typical forward conduction drop is 1.0 V. This drop will cause conduction loss, and the device must be cooled by the appropriate heat sink to limit the junction temperature. In the reverse-biased condition, a small leakage current flows due to minority carriers, which gradually increase with voltage. If the reverse voltage exceeds a threshold value, called the breakdown voltage, the device goes through avalanche breakdown, which is when reverse current becomes large and the diode is destroyed by heating due to large power dissipation in the junction.
23
2.3 THYRISTORS:
Thyristors or silicon-controlled rectifiers (SCRs) have been the traditional workhorses for bulk power conversion and control in industry. The modern era of solidstate power electronics started due to the introduction of this device in the late 1950s. Basically, it is a trigger into conduction device that can be turned on by positive gate current pulse but once the device is on, a negative gate pulse cannot turn it off. The device turn on process is very fast and turn off process is slow because the minority carriers are to be cleared from the inner junctions by recovery and recombination processes Commercial thyristors can be classified as phase control and inverter types. The thyristors have been widely used in dc and ac drives, lighting, heating and welding control.
24
25
Fig.2.4. Two stage Darlington transistor with bypass diode 2.5 POWER MOSFETS:
Unlike the devices discussed so far, a power MOSFET (metal-oxide semiconductor field effect transistor) is a unipolar, majority carrier, zero junctions, voltage-controlled device. (a) shows the symbol of an N-type MOSFET and (b) shows its volt-ampere characteristics. If the gate voltage is positive and beyond a threshold value, an N-type conducting channel will be induced that will permit current flow by majority carrier (electrons) between the drain and the source. Although the gate impedance is extremely high at steady state, the effective gate-source capacitance will demand a pulse current during turn-on and turn-off. The device has asymmetric voltage-blocking capability, and has an integral body diode, as shown, which can carry full current in the reverse direction. The diode is characterized by slow recovery and is often bypassed by an external fast-recovery diode in high-frequency applications.
26
27
28
Speed control of DC motor by using PWM technique pure gain).The linear model of the PWM amplifier is based on the average voltage being equal to the integral of the voltage waveform. Thus VS * Ton = Veq * T Where VS = the supply voltage (+12 volts) Ton = Pulse duration Veq = the average or equivalent voltage seen by the motor T = Switching period (1/f) The recommended switching frequency is 300Hz. The switching frequency (1/T), is determined by the motor and amplifier characteristics. The control variable is the duty cycle which is Ton / T. The duty cycle must be recalculated at each sampling time. The voltage that the motor sees is thus Veq, which is equal to the duty cycle times the supply voltage.
2.6.2 Principle
Pulse width modulation control works by switching the power supplied to the motor on and off very rapidly. The DC voltage is converted to a square wave signal, alternating between fully on (nearly 12v) and zero, giving the motor a series of power kicks. Pulse width modulation technique (PWM) is a technique for speed control which can overcome the problem of poor starting performance of a motor. PWM for motor speed control works in a very similar way. Instead of supplying a varying voltage to a motor, it is supplied with a fixed voltage value (such as 12v) which starts it spinning immediately. The voltage is then removed and the motor coasts. By continuing this voltage on/off cycle with a varying duty cycle, the motor speed can be controlled. The wave forms in the below figure to explain the way in which this method of control operates. In each case the signal has maximum and minimum voltages of 12v and 0v.
30
Speed control of DC motor by using PWM technique In wave form, the signal has a mark space ratio of 1:1.with the signal at 12v for 50% of the time, the average voltage is 6v, so the motor runs at half its maximum speed. In wave form, the signal has mark space ratio of 3:1.which means that the output is at 12v for 75% of the time. This clearly gives an average output voltage of 9v, so the motor runs at 3/ 4 of its maximum speed. In wave form, the signal has mark space ratio is 1:3, giving an output signal that is 12v for just 25% o the time. The average output voltage of this signal is just 3v, so the motor runs at 1/4 of its maximum speed.
By varying the mark space ratio of the signal over the full range, it is possible to obtain any desired average output voltage from 0v to12v .The motor will work perfectly well, provided that the frequency of the pulsed signal is set correctly, a suitable frequency being 30Hz.setting the frequency too low gives jerky operation. and setting it too high might increase the motors impedance.
31
2.6.3 METHODS
The pwm signals can be generated in a number of ways. there are several methods: analogue method digital method discrete IC On board micro controller
The simplest way to generate a PWM signal is the intersective method, which requires only a saw tooth or a triangle wave form (easily generated using a simple oscillator) and a comparator. When the value of the reference signal is more than the modulation wave form, the PWM signal is in the high state, otherwise it is in the low state. Digital Method: The digital method involves incrementing a counter, an comparing the counter value with a pre-loaded register value, or value set by an ADC. Thy normally us a
B.V.C Engineering College, Odalarevu. 32
Speed control of DC motor by using PWM technique counter that increments periodically and is reset at the end very period of the PWM. When the counter value is more than the reference value, the PWM output changes state from high to low. PWM generator chips: There are several Ics available which converts a DC level into a PWM output. many of these are designed for use in switch mo power supplies .unfortunately, the devices designed for switch mode power supplies not to allow the mark-space ratio to alter over the entire 0 100% range. many limit the maximum to 90% which is effectively limiting the power you can send to the motors. devices designed as pulse generators should allow the whole range to be used.
Onboard micro controller: A micro controller on the robot, this may be able to generate the wave form, although if you have a more than a couple of motors, this may be too much of load on the micro controllers resources. So if you have chosen to use an on board micro controller, then as part of you selection process, include whether it has PWM outputs .if it has this can greatly simplify the process of generating signals.
33
3. COMPONENTS DESCRIPTION
34
3. COMPONENTS DESCRIPTION
3.1 INTRODUCTION:
The main aim of the dc motor speed control using pwm is after power on the power supply generates +5v dc ,+12v dc ,the logic section works on +5v dc and the motor and motor driven sections are working on +12v dc .the explanations of the power supply is given in the power supply module. After power on the micro controller generates oscillations at the rate of 11.05912Mhz.frequency sine wave i.e. internally converted into square wave with the help of internal oscillator. The oscillator section is given bellowing the oscillator module The reset logic generates the reset signal are applied at the rxd pin of the micro controller. The exploitation of the reset logic is given below. After reset he micro controller starts executing program on the memory location program area 0000h.initially the micro controller initializes the LCD display connected to the port0, port2.7, port2.6, port2.5. Sub sequentially the mc displays the set speed i.e. required Speed to rotate the information must be feeded through 3 switches connected to the port1; the 3 switches are ment for increment decrement, set. After set speed is entered the micro controller drives the motor via motor driver tip122 transistor connected to the port if the port pin is 1 the transistor enters in to the saturation region then the motor start rotating at the rate of specified speed the speed is decided by the duty cycle. initially we are rotating at the rate of 50% duty cycle i.e. 50% on time and 50% off time .The rotation of the motor is detected by the an optical encoder that includes u-shaped octo coupler and sensor with holes the octo coupler generates a square wave corresponding to the no. of ports located on the disk and motor speed.
35
2200F/25v 100F/25v
36
Speed control of DC motor by using PWM technique A diode can be used as rectifier. There are various types of diodes. However, semiconductor diodes are very popularly used as rectifiers. A semiconductor diode is a solid-state device consisting of two elements is being an electron emitter or cathode, the other an electron collector or anode. Since electrons in a semiconductor diode can flow in one direction only-form emitter to collector-the diode provides the unilateral conduction necessary for rectification. The rectified Output is filtered for smoothening the DC, for this purpose capacitor is used in the filter circuit. The filter capacitors are usually connected in parallel with the rectifier output and the load. The AC can pass through a capacitor but DC cannot, the ripples are thus limited and the output becomes smoothed. When the voltage across the capacitor plates tends to rise, it stores up energy back into voltage and current. Thus, the fluctuation in the output voltage is reduced considerable.
advantage of this type of regulator is, it is easy to use and minimize the number of external components. The following are the features voltage regulators: a) Output current in excess of 1.5A for 78 and 78L series
B.V.C Engineering College, Odalarevu. 37
Speed control of DC motor by using PWM technique b) Internal thermal overload protection c) No external components required d) Output transistor sage area protection e) Internal short circuit current limit.
38
Speed control of DC motor by using PWM technique Direct replacements for Fairchild microA7800 series
Regulator
39
3.5 SWITCHES:
The three switches are connected to p1.1,p1.2,p1.3, of micro controller when switch is open the port maintains logic high When the switch is depressed maintains high the logic 0.these 3 switches are pulled to Vcc via 10k resistor the type of switch press to on . In electronics, a switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another. The most familiar form of switch is a manually operated electro mechanical device with one or more sets of electrical contacts. Each set of contacts can be in one of two states: either 'closed' meaning the contacts are touching and electricity can flow between them, or 'open', meaning the contacts are separated and no conducting. Since the advent of digital logic in the 1950s, the term has spread to a variety of digital active devices such as transistors and logic gates whose function is to change their output state between two logic levels or connect different signal lines, and even computers, network switches, whose function is to provide connections between different port sin a computer network The term 'switched' is also applied tell communication networks, and signifies a network that is providing dedicated circuits for communication between end nodes, such as the network. The common feature of all these usages is they refer to devices that control a binary state: they are either on or off, closed or open, connected or not connected.
40
Fig.3.2.. switches
When the wattage being switched is sufficiently large, the electron flow across opening switch contacts is sufficient to ionize the air molecules across the tiny gap between the contacts as the switch is opened, forming a also known as an electric arc. The plasma is of low resistance and is able to sustain power flow, even with the separation distance between the switch contacts steadily increasing. The plasma is also very hot and is capable of eroding the metal surfaces of the switch contacts. Where the voltage is sufficiently high, an arc can also form as the switch is closed and the contacts approach. If the voltage potential is sufficient to exceed the of the air separating the contacts, an arc forms which is sustained until the switch closes completely and the switch surfaces make contact. In either case, the standard method for minimizing arc formation.
41
Speed control of DC motor by using PWM technique Preventing contact damage is to use a fast-moving switch mechanism, typically using a spring-operated tipping-point mechanism to assure quick motion of switch contacts, regardless of the speed at which the switch control is operated by the user. Movement of the switch control lever applies tension to a spring until a tipping point is reached, and the contacts suddenly snap open or closed as the spring tension is released. As the wattage being switched increases, other methods are used to minimize or prevent arc formation. Plasma is hot and will rise due air currents. The arc can be quenched with a series of nonconductive blades spanning the distance between switch contacts, and as the arc raises its length increases as it forms ridges rising into the spaces between the blades, until the arc is too long to stay sustained and is extinguished. Extremely large switches enclose the switch contacts in something other than air to increase the resistance against arc formation, such switch contacts in a vacuum, or immersion of the switch contacts in mineral oil.
42
Speed control of DC motor by using PWM technique Volts, and when it is open it sees 0 Volts. If the switch is open for the same amount of time as it is closed, the motor will see an average of 6 Volts, and will run more slowly accordingly. As the amount of time that the voltage is on increases compared with the amount of time that it is off, the average speed of the motor increases. This on-off switching is performed by power MOSFET. A MOSFET (Metal-Oxide-Semiconductor Field Effect Transistor) is a device that can turn very large currents on and off under the control of a low signal level voltage. For more detailed information, see the dedicated chapter on MOSFET) The time that it takes a motor to speed up and slow down under switching conditions is dependent on the inertia of the rotor (basically how heavy it is), and how much friction and load torque there is. The graph below shows the speed of a motor that is being turned on and off fairly slowly:
44
45
46
3.8.2 DESCRIPTION
The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with 8K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C52 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications
47
3.8.7 FEATURES:
Compatible with MCS-51 Products.
B.V.C Engineering College, Odalarevu. 48
Speed control of DC motor by using PWM technique 8K Bytes of In-System Reprogrammable Flash Memory. Endurance: 1,000 Write/Erase Cycles. Fully Static Operation: 0 Hz to 24 MHz Three-level Program Memory Lock. 256 x 8-Bit Internal RAM. 32 Programmable I/O Lines. Three 16-bit Timer/Counters. Eight Interrupt Sources. Programmable Serial Channel. Low Power Idle and Power Down Modes
49
PIN DIAGRAM:
50
Speed control of DC motor by using PWM technique functioning. The Power down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.
Fig.3.6.Architecture of 89C52
51
Port 0:
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull-ups are required during program verification.
Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes during Flash programming and program verification. Alternate functions of port 1
52
Port 2:
Port 2 is an 8-bit bidirectional I/O port with internal pull ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX A,@DPTR). In this application it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX A, @RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.
Port 3:
Port 3 is an 8-bit bidirectional I/O port with internal pull ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull ups. Port 3 also serves the functions of various special features of the AT89C52 as listed below:
53
3.8.9 RST:
RST means RESET; 89C52 uses an active high reset pin. It must go high for two machine cycles. The simple RC circuit used here will supply voltage (Vcc) to reset pin until capacitance begins to charge. At a threshold of about 2.5V, reset input reaches a low level and system begin to run.
Fig.3.7.Reset Connection
B.V.C Engineering College, Odalarevu. 54
ALE/PROG:
Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.
PSEN:
Program Store Enable is the read strobe to external program memory. When the AT89C52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at OOOOH up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to Vcc for internal program executions. This pin also receives the 12-volt programming enable voltage (Vpp) during Flash programming, for parts that require 12-volt Vpp. XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit
55
Speed control of DC motor by using PWM technique XTAL2: Output from the inverting oscillator amplifier. T2: External count input to Timer/Counter 2, Clock out. T2EX: Counter 2 capture/reload trigger & direction control.
Fig.3.8.On-Chip Oscillators
B.V.C Engineering College, Odalarevu. 56
A & B Registers:
The 89C52 contains 34 general-purpose, working, registers. Two of these, registers A and B, hold results of many instructions, particularly math and logical operations, of the 89C52 CPU. The other 32 are arranged as part of internal RAM in four banks, B0-B3, of eight registers. The A register is also used for all data transfers between the 89C52 and any external memory. The B register is used for with the A register for multiplication and division operations.
57
Speed control of DC motor by using PWM technique The 89C52 has four math flags that respond automatically to the outcomes of math operations and three general-purpose user flags that can be set to 1 or cleared to 0 by the programmer as desired. The math flags include Carry (C), Auxiliary Carry (AC), Overflow (OV), and Parity (P). User flags are named F0, GF0 and GF1; they are generalpurpose flags that may be used by the programmer
Speed control of DC motor by using PWM technique those within the range of that pixel. In a typical RGB display, the color filter is integrated into the upper glass colored microscopically to render each individual pixel red, green or blue. The areas in between the colored pixel filter areas are printed black to increase contrast. After a beam of light passes through the color filter, it passes through yet another polarizer to sharpen the image and eliminate glare. The image is then available for viewing.
3.10.2 Features:
Interface with either 4-bit or 8-bit microprocessor. Display data RAM Character generator ROM Accessed by the microprocessor. Numerous instructions Clear Display, Cursor Home, Display ON/OFF, Curser ON/OFF, Blink Character, Cursor Shift, Display Shift. Built-in reset circuit is triggered at power ON. -matrix character patterns. Character generator RAM -matrix patterns. Display data RAM and character generator RAM may be
59
Fig.3.9. LCD
Speed control of DC motor by using PWM technique In the above table Vcc and Vss are supply pins and VEE (Pin no.3) is used for controlling LCD contrast. Pin No.4 is Rs pin for selecting the register, there are two very important registers are there inside the LCD. The RS pin is used for their selection as follows. If RS=0, the instruction command code register is selected, allowing the user to send data to be displayed on the LCD. R/W is a read or writes Pin, which allows the user to write information to the LCD or read information from it. R/W=1 when reading R/W=0 when writing. The LCD to latch information presented to its data pins uses the enable (E) pin. The 8-bit data pins, D0-D7, are used to send information to the LCD or read the contents of the LCDs internal registers. To display letters and numbers, we must send ASCII codes for the letters A-Z, and number 0 -9 to these pins while making RS=1.
61
62
63
VCC
C3 10/16v
R1 8.2K RN2=103 R3 RESISTOR VAR VCC C4 104pf U3 1A 2A 3A 4A 5A 6A 7A 8A 9A 10A 11A 12A 13A 14A 15A 16A 16/2 LCD
1 2 3 4 5 6 7 8 9
VCC
+12V
1K U6 1 'U' opto 2 6 5 4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 18 20 40 31 39 38 37 36 35 34 33 32 30 29 28 27 26 25 24 23 22 21
1 2 3 4 5 6
J2A
P1.0/T2 VCC P1.1/T2-EX EA/VPP P1.2 P1.3 P0.0/AD0 P1.4 P0.1/AD1 P1.5 P0.2/AD2 P1.6 P0.3/AD3 P1.7 P0.4/AD4 P0.5/AD5 RST P0.6/AD6 P0.7/AD7 P3.0/RXD P3.1/TXD ALE/PROG P3.2/INT0 PSEN P3.3/INT1 P3.4/T0 P2.7/A15 P3.5/T1 P2.6/A14 P3.6/WR P2.5/A13 P3.7/RD P2.4/A12 P2.3/A11 XTAL1 P2.2/A10 XTAL2 P2.1/A9 GND P2.0/A8 AT89C52
64
4.3 EXPLANATION:
Pulse-width modulation (PWM) or duty-cycle variation methods are commonly used in speed control of DC motors. The duty cycle is defined as the percentage of digital high to digital low plus digital high pulse-width during a PWM period .Fig . 1 shows the 5V pulses with 0%through 50% duty cycle .The average DC voltage value for0% duty cycle is zero; with 25% duty cycle the average value is 1.25V (25%of 5V). With 50% duty cycle the average value is 2.5V, and if the duty cycle is 75%, the average voltage is 3.75Vand so on. The maximum duty cycle can be 100%, which is equivalent to a DC waveform. Thus by varying the pulse-width, we can vary the average voltage across a DC motor and hence its speed .The circuit of a simple speed controller for a mini DC motor, such as that used in tape recorders and toys, is shown in Fig. 2.Here N1 inverting Schmitt trigger is configured as an a stable but variable duty cycle . Although the total in-circuit resistance of VR1 during a complete cycle is100 kilo-ohms, the part used during positive and negative periods of each cycle can be varied by changing the position of its wiper contactor obtain variable pulse-width. Schmitt gate N2 simply acts as a buffer/driver to drive transistor T1 during positive in recursion sat its base. Thus the average amplitude of DC drive pulses or the speed of motor M is proportional to the setting of the wiper position of VR1portmeter. Capacitor C2 serves as a Fig. 1: 5V pulses with 0% through50% duty cycle storage capacitor to provide stable voltage to the circuit. Thus, by varyingVR1 the duty cycle can be changed from 0% to100% and the speed of the motor from stopped condition to full speed in an even and continuous way. The diodes effectively provide different timing resistor values during charging and discharging of timing capacitor C1.The pulse or rest period is approximately given by the following equation: Pulse or Rest period 0.4 x C1(Farad) x VR1 (ohm) seconds .
65
Speed control of DC motor by using PWM technique Here, use the in-circuit value of VR1 during pulse or rest period as applicable .The frequency will remain constant is given by the equation: Frequency 2.466/(VR1.C1) 250Hz (for VR1=100 kilo-ohms and C1=0.1F)The recommended value of in-circuit resistance should be greater than50 kilo-ohms but less than 2 mega ohms ,while the capacitor value should be greater than 100 Pf.
66
5. CIRCUIT OVERVIEW:
67
5.RESULT CONCLUSION
68
5.2 CONCLUSION:
The dc motor speed is controlled by using power electronic converter circuit. The PWM technique is used to control the speed of dc motor the speed sensor is used to detect the speed and closed loop control systems is used for pulse circuit. The speed pulse train will be based on required input speed. this circuit is useful to operate the dc motors at required speed.The circuit response time is too low. Hence high reliability can be achieved. The designed circuit was tested for various speed inputs satisfactorily.
69
ANNEXURE
70
Microcontroller program:
ORG 0 LJMP START ORG 0050; THIS IS SPEED CONTROL PROGRAM DT:20-03-2007 LCD PVPSIT ; P2.5 = ENABLE; p2.6 = READ/WRITE; P2.7 = REG INS=0 /DATA=1; P1.4 =MOTOR; P1.5 =MOTOR; 50H = DISP LOCATION ADD; 51H = SPEED ON TIME; 52H = SPEED OFF TIME; 53H = SPEED SET VAL; 54H = SPEED READ VAL START: CLR P1.4
71
JB P1.1,UXD LCALL DEL1 JB P1.1,YXZ MOV 56H,#01H UXD: LCALL LCDINI XX1: LCALL SEC MOV DPTR, #03C0H LCALL TLINE MOV DPTR, #03D0H LCALL BLINE LCALL SSEC MOV DPTR, #03E0H LCALL TLINE MOV DPTR, #03F0H LCALL BLINE LCALL SSEC
B.V.C Engineering College, Odalarevu. 72
MOV 50H,#8BH MOV 51H,#7FH MOV 52H,#80H MOV 55H,#00H MOV 53H,#7FH LCALL SDI LCALL SEC MMRR: MOV R0,#00H Y1: LCALL DEL1 JB P1.1,Y1 LCALL INCR MOV 50H,#8BH CLR A MOV A,53H MOV 55H,A LCALL SDIS
B.V.C Engineering College, Odalarevu. 73
LCALL SEC U1: JB P1.2,U\ LCALL DEL1 JB P1.2,U1 LCALL DECR MOV 50H,#8BH CLR A MOV A,53H MOV 55H,A LCALL SDIS LCALL SEC U2: JB P1.3,Y1 LCALL DEL1 JB P1.3,U2 TY1: JB P1.3,TY1 LCALL DEL1
B.V.C Engineering College, Odalarevu. 74
75
REFERENCES: 1.Gopal K Dubey Fundamentals of Electric Drives Narosa Publishing House New Delhi, 1989. 2.Muhammad H. Rashid, Power Electronics Circuits, Devices, and Applications, Prentice Hall, 3rd edition, 2003. 3. Kumara MKSC, Dayananda PRD, Gunatillaka MDPR, Jayawickrama SS, PC based speed controlling of a dc motor, A fmal year report University of Moratuwa Illiniaus USA, 2001102. 4. J Nicolai and T Castagnet , A Flexible Micro controller Based Chopper Driving a Permanent Magnet DC Motor, The European Power Electronics Application. 1993 5. A Khoei Kh. Hadidi, MicroProcessor Based Closed- Loop Speed Control System for DC Motor Using Power MOSFET, 3rd IEEE international conference on Electronics, Circuits and Systems( 1996) vol.2, pp.1247-1250. 6. Peter Spasov, Microcontroller Technology: The 68HC11 Prentice Hall, 5th edition, 2004. 7. Pulse width modulator module (PWMM), ATmega8L data shee 8. LCD interfacing, the microcontroller and embedded systems by Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rolin D. Mckinlay. 9. LCD interfacing with Microcontrollers Tutorial Index, http://www.8051projects.net/lcd-Interfacing/ Recent Advances in Circuits, Systems, Signal and Telecommunications
76