Microcontroller Based Dc Motor Control

DOI : 10.17577/IJERTV1IS3099

Download Full-Text PDF Cite this Publication

Text Only Version

Microcontroller Based Dc Motor Control

Microcontroller Based Dc Motor Control

*NIIST,Bhopal,M.P.**NCET,Agra.U.P.***VCE,Hyderabad,A.P.

Clockwise rotation anticlockwise rotation

Direction control of a DC motor is very simple; just reverse the polarity, means every DC motor has two terminals out. When we apply DC voltage with proper current to a motor, it

rotates in a particular direction but when we reverse the connection of voltage between two terminals, motor rotates in another direction.

IC AT89C52 is a low-power, high-performance, 8-bit microcontroller with 8 kB of Flash programmable and erasable read-only memory (EPEROM),256 bytes of RAM,32 input/output (I/O)lines, three 16-bit timers/counters, a six-vector two-level interrupt architecture, a full-duplex serial port, on-chip oscillator and clock circuitry. AT89C52 is designed with static logic for operation down to zero frequency and supports two software- selectable power-saving modes. The idle mode stops the CPU while allowing the RAM, timers/counters, serial port and interrupt system to continue functioning.

The power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next hardware reset is activated. At the heart of the speed controller system is microcontroller AT89C52 which creates (using timer 0) pulses of varying width for pulse-width modulation and controls the motor speed.

  1. Microcontroller provides us only digital logic (1 or o).

  2. We cant provide polarity from microcontroller.

  3. We cant connect motors to Controller as mostly motors runs on voltage higher that

+5V, and motors demands high current (depends),this can be remove by use of a H Bridge here a IC L293d is used, its a dual half H bridge IC.

L293D is a dual H-Bridge motor driver, so with one IC can interface two DC motors which can be controlled in both clockwise and counter clockwise direction. L293D has output current of 600mA and peak output current of 1.2A per channel. Moreover for protection of circuit from back EMF output diodes are included within the IC. The output supply (VCC2) has a wide range from 4.5V to 36V, which has made L293D a best choice for DC motor driver.

Vs,12v Vss, 5v DC MOTOR

When it comes to speed, weight, size, cost, DC motors are always preferred over stepper motor.DC motor when interfaced with a microcontroller, can control the speed of motor, can control the direction of rotation, can also do encoding of the rotation made by DC motor i.e. keeping track of how many turns are made by your motors etc. DC motors are no less than a stepper motor.

The L293D is an H-Bridge type driver. It can easily control 2 DC motors or 1 bipolar stepper motor bidirectional. Peak output per channel is 2A. With a continuous current of 1A per channel, Great chip for driving little DC motors

.The name "H-Bridge" is derived from the actual

shape of the switching circuit which controls the motion of the motor. It is also known as "Full Bridge". Basically there are four switching elements in the H-Bridge as shown in the figure

below.

2

IN1 8, 16 OUT1

IN2 OUT2

IN3 OUT3

IN4 OUT4

1

EN1

EN2

(high side left) (hi gh side ri ght)

GND GND GND GND

(l ow side left) Motor (l ow side ri ght)

L293D

A

B

Description

0

0

motor stops

0

1

motor runs anticlockwise

1

0

motor runs clockwise

1

1

motor stops or break

TRUTH TABLE

H-BRIDGE

(Current flow from hi gh side left to l ow side ri ght )

In the above Figure there are four switching elements named as "High side left", "High side right", "Low side right", "Low side left". When these switches are turned on in pairs motor changes its direction accordingly. Like, if switch on High side left and Low side right then motor rotate in forward direction, as current flows

from Power supply through the motor coil goes to ground via switch low side right. Similarly, when switch on low side left and high side right, the current flows in opposite direction and motor rotates in backward direction. This is the basic working of H-Bridge. A truth table according to the switching of H-Bridge explained above is as follows

Truth Table

High

Left

High

Right

Low

Left

Low

Right

Description

On

Off

Off

On

Motor runs

clockwise

Off

On

On

Off

Motor runs

anti-clockwise

On

On

Off

Off

Motor stops or

decelerates

Off

Off

On

On

Motor stops or

decelerates

H-bridge can be made with the help of transistors as well as MOSFETs; the only thing is the power handling capacity of the circuit. If motors are needed to run with high current then lot of dissipation is there. So heat sinks are needed to cool the circuit.

By varying supply voltage, and pulse width modulation technique. First system is not convenient especially in digital systems. It requires anolog circuit .so second system is very convenient for digital systems because all controls is made using digital signal.

Pulse width modulation is about the switching speed and pulse width (duty cycle). The duty cycle is defined as percentage of digital high to digital low plus digital high pulse width. during a PWM period, i.e, the duty cycle is the ratio of signal Ton/T, where T is the period of

The PWM signals are produced by the microcontroller itself. An advantage of using the microcontroller to generate the PWM signal for us is that once it has been set up correctly the PWM signal will continue to be generated automatically in the background. There is no need to write any complicated interrupt routine or other timing code. The good thing is that by simply changing the comparator value, the duty cycle of the PWM can alter. All of the PWM facilities are provided by the internal Timers of the microcontroller.

Thus these PWM signals are applied to the enable pin of the L293D motor driver. The duty cycle of square wave output from microcontroller is varied to provide a varying DC output. To run a motor by half of its rated speed, we have to send 50% duty cycle square wave at the enable pin effectively, and hence we will get 50% on time, but due to high

frequency and inertia, motor will seem to run continuously.

Whenever any switch is pressed, the duty cycle of PWM varies. The software then calculates the appropriate values for TH0 and TL0 for on and off time of the output, which are copied in TH0 and TL0 on timer interrupts. In above circuit, timer-0 of the microcontroller is used for generating PWM pulses, which is clocked using a 12MHzcrystal oscillator. The base frequency is kept constant at 1 kHz and the duty cycle of this wave is varied to change the analog level at output pin P1.1 of the microcontroller. Thi is the basic Concept behind the speed and direction control of a DC motor.

With this very basic concept of direction and speed control we can move the motor clockwise and anticlockwise as a result lift can move in forward and backward direction and we can vary the speed of a dc motor.

In real time functioning In Embedded system

Space vector modulating signal

www.wikipedia.com www.scribd.com www.globusz.com

IEEE Expo 2011-Internal Elevator and Escalator Expo

Microchip PICC Tutorial. Spackling Tutorial.

Arm Cartox-A Series-High performance for open operating system.

OLX Classified.

Electronics for you ( Oct. 2004) http://www.atmel.com http://www.electronics4u.com http://www.transenergic.co.au

Microprocessors And Interfacing( Programming & Hardware)-Douglas V.Hall

Vedam Subrahmanayam- Power Electronics.

Alberto Sangiovanni-vincentalli, IEEE microelectron,. (May 2003)8-18 .

Chris Herring,IEEE microelectron(Nov 2000)45-51

.

Todd D Morton,Embedded microelectronics, (Prantice Hall Inc. New Delhi India), 2001.

Mayke Predco, Handbook of Microcontroller (McGraw Hill, USA), 1999.

Maizidi Ali, Mekinly Rolin D & Carsey Denny , Microcontroller & Embedded System, Pearson Education, 2nd Edition.

Mazidi Jarice & Maizidi Gillirp, Advanced Microcontroller Application,Pearson Education, 2nd Edition.

Leave a Reply