final report electric motor

Upload: prateek0291

Post on 09-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 Final Report Electric Motor

    1/45

    A

    Major Project Report

    On

    Microcontroller Based Elevator System

    Submitted in partial fulfillment of the requirement for the award of the

    Degree of Bachelor of Technology

    in

    Electronics and Communication Engineering

    Submitted By:- Guided By:-Prateek Nepalia Er.Yogendra Aboti

    Rahul Vyas Er. Giriraj Vyas

    Pranay Thanvi

    BE(Final Year) ECE

    DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

    MARWAR ENGINEERING COLLEGE AND RESEARCH CENTRE

    JODHPUR(RAJASTHAN)

    RAJASTHAN TECHNICAL UNIVERSITY,KOTA(RAJASTHAN)

    2010-2011

  • 8/8/2019 Final Report Electric Motor

    2/45

    ACKNOWLEDGEMENT

    A Research owes its success from commencement to completion to people

    involved with researcher at various stages. We acknowledge with due courtesy our

    regards to all the persons and sources consulted during the development of thisproject and preparation of this project. We are grateful from the core of our heart to

    our guide Er. Giriraj Vyas for his valuable time, help and motivation which kept us

    going to the fulfillment of this project.

    Also, it gives us immense pleasure to express our profound gratitude and

    thankfulness to Er.Yogendra Aboti to help us to facilitate us with his experience,

    guidance and instructions to accomplish this project successfully.

    Finally, we also acknowledge the entire development of Electronics andCommunication for their constructive criticism, support and cooperation, which

    has helped us to give our level best

    Group Members

    Prateek Nepalia

    Rahul Vyas

    Pranay Thanvi

  • 8/8/2019 Final Report Electric Motor

    3/45

    CERTIFICATE

    This is to certify that the work which is being presented in the Major Report

    entitled Microcontroller Based Elevator System submitted by Prateek Nepalia,

    Rahul Vyas and Pranay Thanvi of B.Tech 8th

    semester (Final Year) of Electronicsand Communication Engineering in partial fulfillment for the award of degree of

    Bachelor of Engineering is being a record of students work carried out by them

    under my supervision and guidance.

    Project Incharge Project Guide

    Er. Yogendra Aboti Er.Giriraj Vyas

    Senior Lecturer Lecturer

    Deptt. of ECE Deptt. of ECE

    MECRC,Jodhpur MECRC,Jodhpur

    Date:-

    Place:- Jodhpur

  • 8/8/2019 Final Report Electric Motor

    4/45

    PREFACE

    As per the curriculum of RAJASTHAN TECHNICAL UNIVERSITY IV Year

    Bachelors Degree in Technology,we completed our major project entitled

    Microcontroller Based Elevator System.This is our Project which contains a detailed description of the Microcontroller

    used in Elevators. While Completing this project we gained lot about the

    .. which is completely new and challenging field for a student of

    electronics.

    The major sources of material for preparing this report to e-books and other

    internet tutorials. This Project report is initiated by providing a general

    introduction to the project and the components and fundamentals implemented to

    develop the same. After that a detailed view of the remote control circuit and the

    hardware developed follows.

  • 8/8/2019 Final Report Electric Motor

    5/45

  • 8/8/2019 Final Report Electric Motor

    6/45

    9 Appendix- coding

    10 References and Bibliography

    CHAPTER-1

    INTRODUCTION

    1.1 Electric Motor

  • 8/8/2019 Final Report Electric Motor

    7/45

    An electric motor uses electrical energy to produce mechanical energy, very typically through

    the interaction of magnetic fields and current-carrying conductors. The reverse process,

    producing electrical energy from mechanical energy, is accomplished by a generatorordynamo.

    Many types of electric motors can be run as generators, and vice versa. For example a

    starter/generator for a gas turbine orTraction motors used on vehicles often perform both tasks.

    Electric motors are found in applications as diverse as industrial fans, blowers and pumps,

    machine tools, household appliances, power tools, and disk drives. They may be powered by

    direct current (e.g., a battery powered portable device or motor vehicle), or by alternating current

    from a central electrical distribution grid. The smallest motors may be found in electric

    wristwatches. Medium-size motors of highly standardized dimensions and characteristics provide

    convenient mechanical power for industrial uses. The very largest electric motors are used for

    propulsion of large ships, and for such purposes as pipeline compressors, with ratings in the

    millions of watts. Electric motors may be classified by the source of electric power, by their

    internal construction, by their application, or by the type of motion they give.

    The brushed Dc motor generates torque directly from Dc power supplied to the motor by using

    internal commutation, stationary permanent magnets and rotating electrical magnets. It works on

    the principle of Lorentz force , which states that any current carrying conductor placed within an

    external magnetic field experiences a torque or force known as Lorentz force. Advantages of a

    brushed DC motor include low initial cost ,high reliability and simple control of motor speed.

    1.2 The Principle

    The conversion of electrical energy into mechanical energy by electromagnetic means was

    demonstrated by the British scientist Michael Faraday in 1821. A free-hanging wire was dippedinto a pool ofmercury, on which a permanent magnet was placed. When a current was passed

    through the wire, the wire rotated around the magnet, showing that the current gave rise to a

    circular magnetic field around the wire.

    http://en.wikipedia.org/wiki/Electrical_energyhttp://en.wikipedia.org/wiki/Mechanical_energyhttp://en.wikipedia.org/wiki/Magnetic_fieldshttp://en.wikipedia.org/wiki/Electrical_conductorhttp://en.wikipedia.org/wiki/Electrical_generatorhttp://en.wikipedia.org/wiki/Dynamohttp://en.wikipedia.org/wiki/Gas_turbinehttp://en.wikipedia.org/wiki/Traction_motorhttp://en.wikipedia.org/wiki/Power_toolshttp://en.wikipedia.org/wiki/Hard_drivehttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Battery_(electric)http://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Electrical_gridhttp://en.wikipedia.org/wiki/Electric_watchhttp://en.wikipedia.org/wiki/Electric_watchhttp://en.wikipedia.org/wiki/Watt_(unit)http://en.wikipedia.org/wiki/Electromagnetismhttp://en.wikipedia.org/wiki/Michael_Faradayhttp://en.wikipedia.org/wiki/Mercury_(element)http://en.wikipedia.org/wiki/Current_(electricity)http://en.wikipedia.org/wiki/Electrical_energyhttp://en.wikipedia.org/wiki/Mechanical_energyhttp://en.wikipedia.org/wiki/Magnetic_fieldshttp://en.wikipedia.org/wiki/Electrical_conductorhttp://en.wikipedia.org/wiki/Electrical_generatorhttp://en.wikipedia.org/wiki/Dynamohttp://en.wikipedia.org/wiki/Gas_turbinehttp://en.wikipedia.org/wiki/Traction_motorhttp://en.wikipedia.org/wiki/Power_toolshttp://en.wikipedia.org/wiki/Hard_drivehttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Battery_(electric)http://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Electrical_gridhttp://en.wikipedia.org/wiki/Electric_watchhttp://en.wikipedia.org/wiki/Electric_watchhttp://en.wikipedia.org/wiki/Watt_(unit)http://en.wikipedia.org/wiki/Electromagnetismhttp://en.wikipedia.org/wiki/Michael_Faradayhttp://en.wikipedia.org/wiki/Mercury_(element)http://en.wikipedia.org/wiki/Current_(electricity)
  • 8/8/2019 Final Report Electric Motor

    8/45

  • 8/8/2019 Final Report Electric Motor

    9/45

    1.3 Comparison of DC Motor

    Type Advantages Disadvantages Typical

    Application

    Typical Drive

    AC Induction

    (Shaded Pole)

    Least expensive

    Long life

    high power

    Rotation slips

    from frequency

    Low starting

    torque

    Fans Uni/Poly-phase

    AC

    AC Induction

    (split-phasecapacitor)

    High power

    high startingtorque

    Rotation slips

    from frequency

    Appliances Uni/Poly-phase

    AC

    Universal motor High starting

    torque, compact,

    high speed

    Maintenance

    (brushes)

    Medium lifespan

    Drill, blender,

    vacuum cleaner,

    insulation

    blowers

    Uni-phase AC or

    Direct DC

    AC Synchronous Rotation in-sync

    with freq

    long-life

    (alternator)

    More expensive Industrial motors

    Clocks

    Audio turntables

    tape drives

    Uni/Poly-phase

    AC

    Stepper DC Precisionpositioning

    High holding

    torque

    High initial costRequires a

    controller

    Positioning in printers and

    floppy drives

    DC

    Brushless DC Long lifespan

    low maintenance

    High efficiency

    High initial cost

    Requires a

    controller

    Hard drives

    CD/DVD players

    electric vehicles

    DC

    Brushed DC Low initial cost

    Simple speed

    control

    Maintenance

    (brushes)

    Medium lifespan

    Treadmill

    exercisers

    automotive

    motors (seats,

    blowers,

    windows)

    DC

    Pancake DC Compact design

    Simple speed

    control

    Medium cost

    Medium lifespan

    Office Equip

    Fans/Pumps

    Direct DC or

    PWM

    http://en.wikipedia.org/wiki/Shaded-pole_motorhttp://en.wikipedia.org/wiki/Shaded-pole_motorhttp://en.wikipedia.org/wiki/AC_induction_motorhttp://en.wikipedia.org/wiki/AC_induction_motorhttp://en.wikipedia.org/wiki/AC_induction_motorhttp://en.wikipedia.org/wiki/Electric_motor#Universal_motorshttp://en.wikipedia.org/wiki/Synchronous_motorhttp://en.wikipedia.org/wiki/Stepper_motorhttp://en.wikipedia.org/wiki/Brushless_DC_electric_motorhttp://en.wikipedia.org/wiki/Brushed_DC_electric_motorhttp://en.wikipedia.org/wiki/Electric_motor#Printed_Armature_or_Pancake_DC_Motorshttp://en.wikipedia.org/wiki/PWMhttp://en.wikipedia.org/wiki/Shaded-pole_motorhttp://en.wikipedia.org/wiki/Shaded-pole_motorhttp://en.wikipedia.org/wiki/AC_induction_motorhttp://en.wikipedia.org/wiki/AC_induction_motorhttp://en.wikipedia.org/wiki/AC_induction_motorhttp://en.wikipedia.org/wiki/Electric_motor#Universal_motorshttp://en.wikipedia.org/wiki/Synchronous_motorhttp://en.wikipedia.org/wiki/Stepper_motorhttp://en.wikipedia.org/wiki/Brushless_DC_electric_motorhttp://en.wikipedia.org/wiki/Brushed_DC_electric_motorhttp://en.wikipedia.org/wiki/Electric_motor#Printed_Armature_or_Pancake_DC_Motorshttp://en.wikipedia.org/wiki/PWM
  • 8/8/2019 Final Report Electric Motor

    10/45

  • 8/8/2019 Final Report Electric Motor

    11/45

    You can see that the average speed is around 150, although it varies quite a bit. If the supply

    voltage is switched fast enough, it wont have time to change speed much, and the speed will be

    quite steady. This is the principle of switch mode speed control. Thus the speed is set by PWM

    Pulse Width Modulation.

    2.3 PWM Speed Control

    By controlling analog circuits digitally, system costs and power consumption can be drastically

    reduced. Whats more , many microcontrollers and DSPs already include on-chip PWM

    controllers , making implementation easy.

    In a nutshell, PWM is a way of digitally encoding analog signal levels. Through the use of high

    resolution counters , the duty cycle of a square wave is modulated to encode a specific analog

    signal level. The PWM signal is either fully on or fully off. The voltage or current source is

    supplied to the analog load by means of a repeating series of on and off pulses. The on-off time

    during within DC supply is applied to the load, and the off-time is period during which that

    supply is switched off. Given a sufficient bandwidth , any analog value can be encoded with

    PWM.

    One of the advantages of PWM is that the signal remains digital all the way from the processor

    to the controlled system; no digital-to analog conversion is necessary. By keeping the signal

    digital, noise effects are minimized. Noise can only affect a digital signal if it is strong enough to

    change a logic-1 to a logic-0 or vice versa.

    To control the speed of a d.c. motor we need a variable voltage d.c. power source. However if

    you take a 12V motor and switch on the power to ot, the motor will start to speed up: motors do

    not respond so it will take small time to reach full speed. If we switch the power off sometime

    before the motor reaches full speed, then the motor will start to slow down.If we switch the

  • 8/8/2019 Final Report Electric Motor

    12/45

    power on and off quickly enough , the motor will run at some speed part way between zero and

    full speed. This is exactly what a PWM Controller does: it switches the motor on in a series of

    pulses. To control the motor speed it varies the width of the pulses hence Pulse Width

    Modulation.

    To perform the same function as described above in software requires that the software has

    digital representation of the speed of each wheel, and can finely control the width of the PWM

    signal sent to a wheel .To get the speed of each wheel , an optical encoder must be used as in the

    analogue method, but the output of t must be sent to the microcontroller. This is achieved using a

    counter, clocked by the speed controller , which the microcontroller can read and can clear. At

    regular intervals, the microcontroller must read the counter then clear it. The interval depends on

    the maximum speed of the robot , the diameter of the wheel ,the number of slots in the speed

    encoders disc and the number of bits of the counter.

    2.4 Inverted Pulse Width ModulationThe fast Pulse Width Modulation or fast PWM mode (WGM21:0=3) provides a high frequency

    PWM waveform generation option. The fast PWM differs from the other PWM option by its

    single slope operation. The counter counts from BOTTOM to MAX then restarts from

    BOTTOM. In non-inverting compare output mode, the output compare (OC2) is cleared on the

    compare match between TCNT2 and OCR@ and set at BOTTOM. In inverting Compare Output

    mode, the output is set on compare match and cleared at BOTTOM. Due to the single-slope

    operation, the operating frequency of the fast PWM mode can be twice as high as the phase

    correct PWM mode well that uses dual-slope operation. This high frequency makes the PWM

    mode well suited for power regulation, and DAC applications. High frequency allow physicallysmall size external components (coils, Capacitors), and therefore reduces total system cost. In

    fact PWM mode, the counter is incremented until the counter value matches the MAX value .The

    counter is then cleared at the following timer clock cycle .The TCNT2 value is in the timing

    diagram shown as a histogram for illustrating the single slope operation .The diagram includes

    non-inverted and inverted PWM outputs. The small horizontal line marks on the TCNT2 slopes

    represent compare matches between OCR2 and TCNT2 The Timer/Counter Overflow Flag

    (TOv2) is set each time the counter reaches MAX.If the interrupt is enabled handler routine can

    be used updating the compare value.

    In fast PWM mode, the compare unit allows generation of PWM waveforms on the CO pin.Setting the COM2:0 bits to 2 will produce a non inverted PWM and an inverted PWM output

    can be generated by setting the COM21:0to 3 .The actual OC2 value will only be visible on the

    port pin if the data direction for the port is set asoutput.The PWM waveform is generated by

    setting (or clearing) the OC2 Register at the compare match between OCR2 and TCNT, and (or

    setting) the OC2 Register at the timer clock cycle the counter (changes from MAX to BOTTO).

  • 8/8/2019 Final Report Electric Motor

    13/45

    The extreme value for the OCR2 Register represent special cases when generating a PWM

    waveform output in the fast PWM mode. If the OCR2 is set equal to BOTTOM, the output will

    be a narrow spike for each MAX+1 timer clock cycle. Setting the ORC2 equal to MAX will

    result in a constantly high or low output (depending on the polarity of the output set by the

    COM21:0 bits.)

    A Frequency (with 50% duty cycle) waveform output in fast PWM mode can be achieved by

    setting OC2 o toggle its logical level on each compare match (COM21:0=1). The waveform

    generated will have maximum frequency of foc2 = fclk_I/O/2 when OVR2 is set to zero.This

    feature is similar to the OC2 toggle in CTC mode, expect the double buffer feature of the output

    compare unit is enable in the fast PWM mode.

  • 8/8/2019 Final Report Electric Motor

    14/45

    CHAPTER-3

    BASIC CIRCUIT COMPONENT

    3.1 Capacitor

    A capacitor (formerly known as condenser) is a passiveelectronic component consisting of a

    pair ofconductors separated by a dielectric (insulator). When a potential difference (voltage)

    exists across the conductors, an electric field is present in the dielectric. This field stores energy

    and produces a mechanical force between the conductors. The effect is greatest when there is a

    narrow separation between large areas of conductor, hence capacitor conductors are often called

    plates.

    An ideal capacitor is characterized by a single constant value, capacitance, which is measured in

    farads. This is the ratio of the electric charge on each conductor to the potential difference

    between them. In practice, the dielectric between the plates passes a small amount of leakage

    current. The conductors and leads introduce an equivalent series resistance and the dielectric has

    an electric field strength limit resulting in a breakdown voltage.

    Capacitors are widely used in electronic circuits to block direct current while allowing

    alternating current to pass, to filter out interference, to smooth the output ofpower supplies, and

    for many other purposes. They are used in resonant circuits in radio frequency equipment to

    select particularfrequencies from a signal with many frequencies.

    A capacitor consists of two conductors separated by a non-conductive region.[8]

    The non-conductive substance is called the dielectric medium, although this may also mean a vacuum or a

    semiconductordepletion region chemically identical to the conductors. A capacitor is assumed to

    be self-contained and isolated, with no net electric charge and no influence from an external

    electric field. The conductors thus contain equal and opposite charges on their facing surfaces, [9]

    and the dielectric contains an electric field. The capacitor is a reasonably general model for

    electric fields within electric circuits.

    An ideal capacitor is wholly characterized by a constant capacitance C, defined as the ratio of

    charge Q on each conductor to the voltage Vbetween them

    Sometimes charge buildup affects the mechanics of the capacitor, causing the capacitance to

    vary. In this case, capacitance is defined in terms of incremental changes:

    http://en.wikipedia.org/wiki/Passivity_(engineering)http://en.wikipedia.org/wiki/Electronic_componenthttp://en.wikipedia.org/wiki/Electrical_conductorhttp://en.wikipedia.org/wiki/Dielectrichttp://en.wikipedia.org/wiki/Potential_differencehttp://en.wikipedia.org/wiki/Electric_fieldhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Capacitancehttp://en.wikipedia.org/wiki/Faradhttp://en.wikipedia.org/wiki/Electric_chargehttp://en.wikipedia.org/wiki/Leakage_(electronics)http://en.wikipedia.org/wiki/Leakage_(electronics)http://en.wikipedia.org/wiki/Lead_(electronics)http://en.wikipedia.org/wiki/Equivalent_series_resistancehttp://en.wikipedia.org/wiki/Breakdown_voltagehttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/LC_circuithttp://en.wikipedia.org/wiki/Frequencyhttp://en.wikipedia.org/wiki/Conductorhttp://en.wikipedia.org/wiki/Capacitor#cite_note-Ulaby_p168-7http://en.wikipedia.org/wiki/Dielectric_mediumhttp://en.wikipedia.org/wiki/Vacuumhttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Depletion_regionhttp://en.wikipedia.org/wiki/Electric_chargehttp://en.wikipedia.org/wiki/Capacitor#cite_note-Ulaby_p157-8http://en.wikipedia.org/wiki/Passivity_(engineering)http://en.wikipedia.org/wiki/Electronic_componenthttp://en.wikipedia.org/wiki/Electrical_conductorhttp://en.wikipedia.org/wiki/Dielectrichttp://en.wikipedia.org/wiki/Potential_differencehttp://en.wikipedia.org/wiki/Electric_fieldhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Capacitancehttp://en.wikipedia.org/wiki/Faradhttp://en.wikipedia.org/wiki/Electric_chargehttp://en.wikipedia.org/wiki/Leakage_(electronics)http://en.wikipedia.org/wiki/Leakage_(electronics)http://en.wikipedia.org/wiki/Lead_(electronics)http://en.wikipedia.org/wiki/Equivalent_series_resistancehttp://en.wikipedia.org/wiki/Breakdown_voltagehttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/LC_circuithttp://en.wikipedia.org/wiki/Frequencyhttp://en.wikipedia.org/wiki/Conductorhttp://en.wikipedia.org/wiki/Capacitor#cite_note-Ulaby_p168-7http://en.wikipedia.org/wiki/Dielectric_mediumhttp://en.wikipedia.org/wiki/Vacuumhttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Depletion_regionhttp://en.wikipedia.org/wiki/Electric_chargehttp://en.wikipedia.org/wiki/Capacitor#cite_note-Ulaby_p157-8
  • 8/8/2019 Final Report Electric Motor

    15/45

    In SI units, a capacitance of one farad means that one coulomb of charge on each conductor

    causes a voltage of one volt across the device.[10]

    3.1.1 Energy storage

    Work must be done by an external influence to move charge between the conductors in a

    capacitor. When the external influence is removed, the charge separation persists and energy is

    stored in the electric field. If charge is later allowed to return to its equilibriumposition, the

    energy is released. The work done in establishing the electric field, and hence the amount of

    energy stored, is given by:

    [11]

    3.1.2 Current-voltage relation

    The current i(t) through a component in an electric circuit is defined as the rate of flow of the

    charge q(t) that has passed through it. Physical charges cannot pass through the dielectric layer of

    a capacitor, but rather build up in equal and opposite quantities on the electrodes: as each

    electron accumulates on the negative plate, one leaves the positive plate. Thus the accumulated

    charge on the electrodes is equal to the integral of the current, as well as being proportional to

    the voltage (as discussed above). As with any antiderivative, a constant of integration is added to

    represent the initial voltage v (t0). This is the integral form of the capacitor equation,[12]

    .

    Taking the derivative of this, and multiplying by C, yields the derivative form,[13]

    .

    The dualof the capacitor is the inductor, which stores energy in the magnetic field rather than the

    electric field. Its current-voltage relation is obtained by exchanging current and voltage in the

    capacitor equations and replacing Cwith the inductanceL.

    http://en.wikipedia.org/wiki/SIhttp://en.wikipedia.org/wiki/Faradhttp://en.wikipedia.org/wiki/Coulombhttp://en.wikipedia.org/wiki/Coulombhttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Capacitor#cite_note-Ulaby_p169-9http://en.wikipedia.org/wiki/Work_(thermodynamics)http://en.wikipedia.org/wiki/Equilibriumhttp://en.wikipedia.org/wiki/Equilibriumhttp://en.wikipedia.org/wiki/Capacitor#cite_note-10http://en.wikipedia.org/wiki/Integralhttp://en.wikipedia.org/wiki/Antiderivativehttp://en.wikipedia.org/wiki/Antiderivativehttp://en.wikipedia.org/wiki/Constant_of_integrationhttp://en.wikipedia.org/wiki/Capacitor#cite_note-Dorf_p263-11http://en.wikipedia.org/wiki/Capacitor#cite_note-Dorf_p260-12http://en.wikipedia.org/wiki/Duality_(electrical_circuits)http://en.wikipedia.org/wiki/Duality_(electrical_circuits)http://en.wikipedia.org/wiki/Inductorhttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/SIhttp://en.wikipedia.org/wiki/Faradhttp://en.wikipedia.org/wiki/Coulombhttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Capacitor#cite_note-Ulaby_p169-9http://en.wikipedia.org/wiki/Work_(thermodynamics)http://en.wikipedia.org/wiki/Equilibriumhttp://en.wikipedia.org/wiki/Capacitor#cite_note-10http://en.wikipedia.org/wiki/Integralhttp://en.wikipedia.org/wiki/Antiderivativehttp://en.wikipedia.org/wiki/Constant_of_integrationhttp://en.wikipedia.org/wiki/Capacitor#cite_note-Dorf_p263-11http://en.wikipedia.org/wiki/Capacitor#cite_note-Dorf_p260-12http://en.wikipedia.org/wiki/Duality_(electrical_circuits)http://en.wikipedia.org/wiki/Inductorhttp://en.wikipedia.org/wiki/Magnetic_field
  • 8/8/2019 Final Report Electric Motor

    16/45

    3.1.3 DC circuits

    A simple resistor-capacitor circuit demonstrates charging of a capacitor.

    A series circuit containing only a resistor, a capacitor, a switch and a constant DC source of

    voltage V0 is known as a charging circuit.[14] If the capacitor is initially uncharged while the

    switch is open, and the switch is closed at t= 0, it follows from Kirchhoff's voltage lawthat

    Taking the derivative and multiplying by C, gives afirst-order differential equation,

    At t= 0, the voltage across the capacitor is zero and the voltage across the resistor is V0. The

    initial current is then i (0) =V0 /R. With this assumption, the differential equation yields

    where 0 = RC is the time constant of the system.

    http://en.wikipedia.org/wiki/Resistorhttp://en.wikipedia.org/wiki/Resistorhttp://en.wikipedia.org/wiki/Capacitor#cite_note-ChargingCircuit-13http://en.wikipedia.org/wiki/Kirchhoff's_voltage_lawhttp://en.wikipedia.org/wiki/Kirchhoff's_voltage_lawhttp://en.wikipedia.org/wiki/First-order_differential_equationhttp://en.wikipedia.org/wiki/First-order_differential_equationhttp://en.wikipedia.org/wiki/Time_constanthttp://en.wikipedia.org/wiki/File:RC_switch.svghttp://en.wikipedia.org/wiki/Resistorhttp://en.wikipedia.org/wiki/Capacitor#cite_note-ChargingCircuit-13http://en.wikipedia.org/wiki/Kirchhoff's_voltage_lawhttp://en.wikipedia.org/wiki/First-order_differential_equationhttp://en.wikipedia.org/wiki/Time_constant
  • 8/8/2019 Final Report Electric Motor

    17/45

    As the capacitor reaches equilibrium with the source voltage, the voltage across the resistor and

    the current through the entire circuit decay exponentially. The case ofdischarging a charged

    capacitor likewise demonstrates exponential decay, but with the initial capacitor voltage

    replacing V0 and the final voltage being zero.

    3.1.4 AC circuits

    Impedance, the vector sum of reactance and resistance, describes the phase difference and the

    ratio of amplitudes between sinusoidally varying voltage and sinusoidally varying current at a

    given frequency. Fourier analysis allows any signal to be constructed from a spectrum of

    frequencies, whence the circuit's reaction to the various frequencies may be found. The reactance

    and impedance of a capacitor are respectively

    wherej is the imaginary unit and is the angular velocity of the sinusoidal signal. The - j phase

    indicates that the AC voltage V = Z I lags the AC current by 90: the positive current phase

    corresponds to increasing voltage as the capacitor charges; zero current corresponds to

    instantaneous constant voltage, etc.

    Note that impedance decreases with increasing capacitance and increasing frequency. This

    implies that a higher-frequency signal or a larger capacitor results in a lower voltage amplitude

    per current amplitudean AC "short circuit" orAC coupling. Conversely, for very low

    frequencies, the reactance will be high, so that a capacitor is nearly an open circuit in AC

    analysisthose frequencies have been "filtered out".

    3.1.5 Capacitor types

    Practical capacitors are available commercially in many different forms. The type of internal

    dielectric, the structure of the plates and the device packaging all strongly affect the

    characteristics of the capacitor, and its applications.

    3.1.6 Dielectric materials

    Most types of capacitor include a dielectric spacer, which increases their capacitance. These

    dielectrics are most often insulators. However, low capacitance devices are available with a

    http://en.wikipedia.org/wiki/Exponential_decayhttp://en.wikipedia.org/wiki/Electrical_impedancehttp://en.wikipedia.org/wiki/Electrical_reactancehttp://en.wikipedia.org/wiki/Electrical_resistancehttp://en.wikipedia.org/wiki/Electrical_resistancehttp://en.wikipedia.org/wiki/Fourier_analysishttp://en.wikipedia.org/wiki/Spectrumhttp://en.wikipedia.org/wiki/Imaginary_unithttp://en.wikipedia.org/wiki/Angular_velocityhttp://en.wikipedia.org/wiki/AC_couplinghttp://en.wikipedia.org/wiki/AC_couplinghttp://en.wikipedia.org/wiki/Exponential_decayhttp://en.wikipedia.org/wiki/Electrical_impedancehttp://en.wikipedia.org/wiki/Electrical_reactancehttp://en.wikipedia.org/wiki/Electrical_resistancehttp://en.wikipedia.org/wiki/Fourier_analysishttp://en.wikipedia.org/wiki/Spectrumhttp://en.wikipedia.org/wiki/Imaginary_unithttp://en.wikipedia.org/wiki/Angular_velocityhttp://en.wikipedia.org/wiki/AC_coupling
  • 8/8/2019 Final Report Electric Motor

    18/45

    vacuum between their plates, which allows extremely high voltage operation and low losses.

    Variable capacitors with their plates open to the atmosphere were commonly used in radio tuning

    circuits. Later designs use polymer foil dielectric between the moving and stationary plates, with

    no significant air space between them.

    In order to maximize the charge that a capacitor can hold, the dialectric material needs to have as

    high apermittivity as possible, while also having as high abreakdown voltage as possible.

    Several solid dielectrics are available, includingpaper,plastic,glass,mica and ceramic materials.

    Paper was used extensively in older devices and offers relatively high voltage performance.

    However, it is susceptible to water absorption, and has been largely replaced by plastic film

    capacitors. Plastics offer better stability and aging performance, which makes them useful in

    timer circuits, although they may be limited to low operating temperatures and frequencies.

    Ceramic capacitors are generally small, cheap and useful for high frequency applications,

    although their capacitance varies strongly with voltage and they age poorly. They are broadly

    categorized as class 1 dielectrics, which have predictable variation of capacitance with

    temperature orclass 2 dielectrics, which can operate at higher voltage. Glass and mica capacitors

    are extremely reliable, stable and tolerant to high temperatures and voltages, but are too

    expensive for most mainstream applications. Electrolytic capacitors and super capacitors are

    used to store small and larger amounts of energy, respectively, ceramic capacitors are often used

    in resonators, and parasitic capacitance occurs in circuits wherever the simple conductor-

    insulator-conductor structure is formed unintentionally by the configuration of the circuit layout.

    Fig. 3.1.6 Capacitors

    Capacitor materials. From left: multilayer ceramic, ceramic disc, multilayer polyester film,

    tubular ceramic, polystyrene, metalized polyester film, aluminum electrolytic. Major scale

    divisions are in centimeters.

    http://en.wikipedia.org/wiki/Variable_capacitorhttp://en.wikipedia.org/wiki/Permittivityhttp://en.wikipedia.org/wiki/Breakdown_voltagehttp://en.wikipedia.org/wiki/Paperhttp://en.wikipedia.org/wiki/Plastichttp://en.wikipedia.org/wiki/Glasshttp://en.wikipedia.org/wiki/Micahttp://en.wikipedia.org/wiki/Ceramichttp://en.wikipedia.org/wiki/Operating_temperaturehttp://en.wikipedia.org/wiki/EIA_Class_1_dielectrichttp://en.wikipedia.org/wiki/EIA_Class_2_dielectrichttp://en.wikipedia.org/wiki/Supercapacitorhttp://en.wikipedia.org/wiki/Ceramic_capacitorhttp://en.wikipedia.org/wiki/LC_circuithttp://en.wikipedia.org/wiki/Parasitic_capacitancehttp://en.wikipedia.org/wiki/File:Condensators.JPGhttp://en.wikipedia.org/wiki/Variable_capacitorhttp://en.wikipedia.org/wiki/Permittivityhttp://en.wikipedia.org/wiki/Breakdown_voltagehttp://en.wikipedia.org/wiki/Paperhttp://en.wikipedia.org/wiki/Plastichttp://en.wikipedia.org/wiki/Glasshttp://en.wikipedia.org/wiki/Micahttp://en.wikipedia.org/wiki/Ceramichttp://en.wikipedia.org/wiki/Operating_temperaturehttp://en.wikipedia.org/wiki/EIA_Class_1_dielectrichttp://en.wikipedia.org/wiki/EIA_Class_2_dielectrichttp://en.wikipedia.org/wiki/Supercapacitorhttp://en.wikipedia.org/wiki/Ceramic_capacitorhttp://en.wikipedia.org/wiki/LC_circuithttp://en.wikipedia.org/wiki/Parasitic_capacitance
  • 8/8/2019 Final Report Electric Motor

    19/45

  • 8/8/2019 Final Report Electric Motor

    20/45

    Resistors can be integrated into hybrid andprinted circuits, as well as integrated circuits. Size,

    and position of leads (or terminals) are relevant to equipment designers; resistors must be

    physically large enough not to overheat when dissipating their power.

    Fig.3.2 Resistors

    3.2.1 Resistor marking

    Most axial resistors use a pattern of colored stripes to indicate resistance. Surface-mount resistors

    are marked numerically, if they are big enough to permit marking; more-recent small sizes are

    impractical to mark. Cases are usually tan, brown, blue, or green, though other colors areoccasionally found such as dark red or dark gray.

    Early 20th century resistors, essentially uninsulated, were dipped in paint to cover their entire

    body for color coding. A second color of paint was applied to one end of the element, and a color

    dot (or band) in the middle provided the third digit. The rule was "body, tip, dot", providing two

    significant digits for value and the decimal multiplier, in that sequence. Default tolerance was

    20%. Closer-tolerance resistors had silver (10%) or gold-colored (5%) paint on the other end.

    3.2.2 Four-band resistors

    Four-band identification is the most commonly used color-coding scheme on resistors. It consists

    of four colored bands that are painted around the body of the resistor. The first two bands encode

    the first two significant digits of the resistance value, the third is a power-of-ten multiplier or

    number-of-zeroes, and the fourth is the tolerance accuracy, or acceptable error, of the value. The

    first three bands are equally spaced along the resistor; the spacing to the fourth band is wider.

    http://en.wikipedia.org/wiki/Hybrid_circuithttp://en.wikipedia.org/wiki/Printed_circuit_boardhttp://en.wikipedia.org/wiki/Integrated_circuitshttp://en.wikipedia.org/wiki/Surface-mounthttp://en.wikipedia.org/wiki/Engineering_tolerancehttp://en.wikipedia.org/wiki/Hybrid_circuithttp://en.wikipedia.org/wiki/Printed_circuit_boardhttp://en.wikipedia.org/wiki/Integrated_circuitshttp://en.wikipedia.org/wiki/Surface-mounthttp://en.wikipedia.org/wiki/Engineering_tolerance
  • 8/8/2019 Final Report Electric Motor

    21/45

    Sometimes a fifth band identifies the thermal coefficient, but this must be distinguished from the

    true 5-color system, with 3 significant digits.

    For example, green-blue-yellow-red is 56104 = 560 k 2%. An easier description can be as

    followed: the first band, green, has a value of 5 and the second band, blue, has a value of 6, and

    is counted as 56. The third band, yellow, has a value of 104, which adds four 0's to the end,

    creating 560,000 at 2% tolerance accuracy. 560,000 changes to 560 k 2% (as a kilo- is

    103).

    3.3 Voltage Regulator IC 7805

    The voltage regulators employ built-in the current limiting, thermal shutdown and safe operating

    area protection which makes them virtually immune to damage from output overload.7805 is a

    three terminal positive voltage regulator.With adequate heat sinking , it can deliver an excess of

    0.5 A output current. Typical application would include local(on-card)regulators which can

    eliminated the noise and degraded performance associated with single point regulation.

    7805 Regulator come from the 78xx family of self-contained fixed linear voltage regulator

    integrated circuit.The 78xx family is a very popular choice for many electronic circuits which

    require a regulated power supply, due to their ease of use and relative cheapness.When

    specifying individual ICs within this family , the xx is replaced with two digit number , which

    indicate the output voltage the particular device is designed to provide (for example, the 7805

    voltage regulator has a 5 volt output, while the 7812 produce the 12 volts).The 78xx line are

    positive voltage regulator, meaning that they are designed to produce a voltage that is positive

    relative to a common ground.There is a related line of 79xx device which are complementarynegative voltage regulators.78xx and 79xx ICs can be used in combination to provide supply

    voltage in the same circuit if necessary.

    Fig. 3.3 Voltage Regulator IC 7805

  • 8/8/2019 Final Report Electric Motor

    22/45

    7805 ICs have three terminal and are most commonly found in the TO220 from factors although

    smaller surface mount and larger TO3 package are also available from some manufactures.These

    device typically support an input voltage which can be anywhere couple of volts over the

    intended output voltage, up to a maximum of 35 or 40 volts,and can typically provide upto

    around 1 or 1.5 amps of currents(through smaller or larger package may have a lower or higher

    current rating).

    3.4 Terminal Box

    An enclosure which includes, mounts, and protects one or more terminals or terminal boards; it

    may include a cover and such accessories as mounting hardware, brackets, locks, and conduit

    fittings. Terminal Box(2 Pin) is used here to connect the 12V supply (battery/battery eliminator)

    to provide to the circuit.

    3.5 Power Switch

    Power switch used here is a push to ON PCB mount switch to switch ON and OFF

    the power supply for microcontroller.

    3.6 Reset Switch

    Reset Switch is used to reset the microcontroller switch. It is a PCB mount switch.

    3.7 Liquid Crystal Display

    A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light

    modulating properties ofliquid crystals (LCs). LCs do not emit light directly.

    They are used in a wide range of applications including: computer monitors, television,

    instrument panels, aircraft cockpit displays, signage, etc. They are common in consumer devices

    such as video players, gaming devices, clocks, watches, calculators, and telephones. LCDs have

    displaced cathode ray tube(CRT) displays in most applications. They are usually more compact,

    lightweight, portable, and less expensive. They are available in a wider range of screen sizes than

    CRT and otherflat panel displays.

    LCDs are more energy efficient and offer safer disposal than CRTs. Its low electrical power

    consumption enables it to be used in battery-powered electronic equipment. It is an

    electronically-modulated optical device made up of any number ofpixels filled with liquid

    crystals and arrayed in front of a light source (backlight) orreflectorto produce images in colour

    or monochrome. The earliest discovery leading to the development of LCD technology, the

    http://en.wikipedia.org/wiki/Electronic_visual_displayhttp://en.wikipedia.org/wiki/Liquid_Crystalshttp://en.wikipedia.org/wiki/Computer_monitorhttp://en.wikipedia.org/wiki/Televisionhttp://en.wikipedia.org/wiki/Flight_instrumentshttp://en.wikipedia.org/wiki/Signagehttp://en.wikipedia.org/wiki/Clockhttp://en.wikipedia.org/wiki/Calculatorhttp://en.wikipedia.org/wiki/Telephonehttp://en.wikipedia.org/wiki/Cathode_ray_tubehttp://en.wikipedia.org/wiki/Flat_panelhttp://en.wikipedia.org/wiki/Battery_(electricity)http://en.wikipedia.org/wiki/Electronicshttp://en.wikipedia.org/wiki/Electro-optic_modulatorhttp://en.wikipedia.org/wiki/Pixelhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Light#Light_sourceshttp://en.wikipedia.org/wiki/Backlighthttp://en.wikipedia.org/wiki/Reflector_(photography)http://en.wikipedia.org/wiki/Monochromehttp://en.wikipedia.org/wiki/Electronic_visual_displayhttp://en.wikipedia.org/wiki/Liquid_Crystalshttp://en.wikipedia.org/wiki/Computer_monitorhttp://en.wikipedia.org/wiki/Televisionhttp://en.wikipedia.org/wiki/Flight_instrumentshttp://en.wikipedia.org/wiki/Signagehttp://en.wikipedia.org/wiki/Clockhttp://en.wikipedia.org/wiki/Calculatorhttp://en.wikipedia.org/wiki/Telephonehttp://en.wikipedia.org/wiki/Cathode_ray_tubehttp://en.wikipedia.org/wiki/Flat_panelhttp://en.wikipedia.org/wiki/Battery_(electricity)http://en.wikipedia.org/wiki/Electronicshttp://en.wikipedia.org/wiki/Electro-optic_modulatorhttp://en.wikipedia.org/wiki/Pixelhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Liquid_crystalhttp://en.wikipedia.org/wiki/Light#Light_sourceshttp://en.wikipedia.org/wiki/Backlighthttp://en.wikipedia.org/wiki/Reflector_(photography)http://en.wikipedia.org/wiki/Monochrome
  • 8/8/2019 Final Report Electric Motor

    23/45

    discovery of liquid crystals, dates from 1888. By 2008, worldwide sales of televisions with LCD

    screens had surpassed the sale of CRT units.

    Fig 3.3 LCD

    LCDs with a small number of segments, such as those used in digital watches and pocket

    calculators, have individual electrical contacts for each segment. An external dedicated circuit

    supplies an electric charge to control each segment. This display structure is unwieldy for more

    than a few display elements.

    Small monochrome displays such as those found in personal organizers, or older laptop screens

    have a passive-matrix structure employing super-twisted nematic (STN) or double-layer STN

    (DSTN) technologythe latter of which addresses a colour-shifting problem with the formerand colour-STN (CSTN)wherein colour is added by using an internal filter. Each row or

    column of the display has a single electrical circuit. The pixels are addressed one at a time by

    row and column addresses. This type of display is called passive-matrix addressedbecause the

    pixel must retain its state between refreshes without the benefit of a steady electrical charge. As

    the number of pixels (and, correspondingly, columns and rows) increases, this type of display

    becomes less feasible. Very slow response times and poorcontrast are typical of passive-matrix

    addressed LCDs.

    High-resolution color displays such as modern LCD computer monitors and televisions use an

    active matrix structure. A matrix ofthin-film transistors (TFTs) is added to the polarizing andcolor filters. Each pixel has its own dedicated transistor, allowing each column line to access one

    pixel. When a row line is activated, all of the column lines are connected to a row of pixels and

    the correct voltage is driven onto all of the column lines. The row line is then deactivated and the

    next row line is activated. All of the row lines are activated in sequence during a refresh

    operation. Active-matrix addressed displays look "brighter" and "sharper" than passive-matrix

    http://en.wikipedia.org/wiki/Digital_watchhttp://en.wikipedia.org/wiki/Pocket_calculatorhttp://en.wikipedia.org/wiki/Pocket_calculatorhttp://en.wikipedia.org/wiki/Electronic_circuithttp://en.wikipedia.org/wiki/Laptophttp://en.wikipedia.org/wiki/Super-twisted_nematic_displayhttp://en.wikipedia.org/wiki/Response_time_(technology)http://en.wikipedia.org/wiki/Display_contrasthttp://en.wikipedia.org/wiki/Display_resolutionhttp://en.wikipedia.org/wiki/Computer_displayhttp://en.wikipedia.org/wiki/Televisionshttp://en.wikipedia.org/wiki/Active-matrix_liquid_crystal_displayhttp://en.wikipedia.org/wiki/Thin-film_transistorhttp://en.wikipedia.org/wiki/Transistorhttp://en.wikipedia.org/wiki/Refresh_ratehttp://en.wikipedia.org/wiki/Digital_watchhttp://en.wikipedia.org/wiki/Pocket_calculatorhttp://en.wikipedia.org/wiki/Pocket_calculatorhttp://en.wikipedia.org/wiki/Electronic_circuithttp://en.wikipedia.org/wiki/Laptophttp://en.wikipedia.org/wiki/Super-twisted_nematic_displayhttp://en.wikipedia.org/wiki/Response_time_(technology)http://en.wikipedia.org/wiki/Display_contrasthttp://en.wikipedia.org/wiki/Display_resolutionhttp://en.wikipedia.org/wiki/Computer_displayhttp://en.wikipedia.org/wiki/Televisionshttp://en.wikipedia.org/wiki/Active-matrix_liquid_crystal_displayhttp://en.wikipedia.org/wiki/Thin-film_transistorhttp://en.wikipedia.org/wiki/Transistorhttp://en.wikipedia.org/wiki/Refresh_rate
  • 8/8/2019 Final Report Electric Motor

    24/45

    addressed displays of the same size, and generally have quicker response times, producing much

    better images.

    3.7.1 LCD Connector

    The 16 pin male header at left top is standard HD44780LCD module compatible connector.Just

    fix any standard HD44780LCD module to control it through AVR.The connections to the

    microcontroller and LCD are as below

    a) RS-PB.0.

    b) RW-PB.1

    c) EN-PB.3

    d) D0-PB.4

    e) D1-PB.5

    f) D2-PB.6

    g) D3-PB.7

    h) Brightness control potentiometer is also provided to adjust brightness of LCD.

    i) Module

    j) Remove the LCD to use there pins as normal I/O pins.

    3.8. Motor Driver IC L293D

    Motor Drivers

    a) Motor Driver is using L293D integrated IC.

    b) Two L293D motor driver can control upto 4 DC motors ot 2 Stepper motors.

    c) Motor Output connectors are at the right side of the board.

    d) Two DC motors can also be controlled by PWM of AVR or at full speed by PWM1 and

    PWM2 selection jumpers.

    e) Put jumpers PWM1 and PWM2 in rightside two pins to avoid speed control and achieve

    maximum speed.

    f) Put jumper PWM1 and PWM2 in left side ywo pins for speed control through

    OC1A(PD5) and OC1B(PD4).g) If PWM is not used PD4 and PD 5 can be used as normal I/O pins.

    h) Motor1 can be controlled by PC0 and PC1 if speed control is activated by.

    i) PWM1 jumper then speed can be controlled by OC1A pin.

    j) Motor2 can be controlled by PC2 and PC3 if speed control is activated by.

    k) PWM2 jumper then speed can be controlled by OC1B pin.

    l) Motor3 can be controlled by PC4 and PC5.

  • 8/8/2019 Final Report Electric Motor

    25/45

    m) Motor4 can be control by PC6 and PC7.

    Fig.3.8 Motor Driver IC L293D

    3.9 Microcontroller (AT mega 32)

    The AVR core combines a rich instruction set with 32 general purpose working registers. All the

    32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two

    independent registers to be accessed in one single instruction executed in one clock cycle. The

    resulting architecture is more code efficient while achieving throughputs up to ten times faster

    than conventional CISC microcontrollers. The ATmega32 provides the following features: 32K

    bytes of In-System Programmable Flash Program memory with Read-While-Write capabilities,

    1024 bytes EEPROM, 2K byte SRAM, 32 general purpose I/O lines, 32 general purpose working

    registers, a JTAG interface for Boundary scan, On-chip Debugging support and programming,three flexible Timer/Counters with compare modes, Internal and External Interrupts, a serial

    programmable USART, a byte oriented Two-wire Serial Interface, an 8-channel, 10-bit ADC

    with optional differential input stage with programmable gain (TQFP package only), a

    programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and six software

    selectable power saving modes. The Idle mode stops the CPU while allowing the USART, Two-

    wire interface, A/D Converter, SRAM, Timer/Counters, SPI port, and interrupt system to

    continue functioning. The Power-down mode saves the register contents but freezes the

    Oscillator, disabling all other chip functions until the next External Interrupt or Hardware Reset.

    In Power-save mode, the Asynchronous Timer continues to run, allowing the user to maintain a

    timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops theCPU and all I/O modules except Asynchronous Timer and ADC, to minimize switching noise

    during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the

    rest of the device is sleeping. This allows very fast start-up combined with low-power

    consumption. In Extended Standby mode, both the main Oscillator and the Asynchronous Timer

    continue to run. The device is manufactured using Atmels high density nonvolatile memory

    technology. The On chip ISP Flash allows the program memory to be reprogrammed in-system

    http://letsmakerobots.com/files/field_primary_image/L293D-200-110.jpg?
  • 8/8/2019 Final Report Electric Motor

    26/45

    through an SPI serial interface, by a conventional nonvolatile memory programmer, or by an On-

    chip Boot program running on the AVR core. The boot program can use any interface to

    download the application program in the Application Flash memory. Software in the Boot Flash

    section will continue to run while the Application Flash section is updated, providing true Read-

    While-Write operation. By combining an 8-bit RISC CPU with In-System Self-Programmable

    Flash on a monolithic chip, the Atmel ATmega32 is a powerful microcontroller that provides a

    highly-flexible and cost-effective solution to many embedded control applications. The

    ATmega32 AVR is supported with a full suite of program and system development tools

    including: C compilers, macro assemblers, program debugger/simulators, in-circuit emulators,

    and evaluation kits.

    Fig.3.9.1 Microcontroller ATmega32

  • 8/8/2019 Final Report Electric Motor

    27/45

    Fig.3.9.2 Pin Diagram

  • 8/8/2019 Final Report Electric Motor

    28/45

    3.9.1 PIN description

    VCC Digital supply voltage.

    GND Ground.

    Port A (PA7..PA0) Port A serves as the analog inputs to the A/D Converter. Port A also serves

    as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal

    pull-up resistors (selected for each bit). The Port A output buffers have symmetrical drive

    characteristics with both high sink and source capability. When pins PA0 to PA7 are used as

    inputs and are externally pulled low, they will source current if the internal pull-up resistors are

    activated. The Port A pins are tri-stated when a reset condition becomes active, even if the clock

    is not running.

    Port B (PB7..PB0) PortB is an 8-bit bi-directional I/O port with internal pull-up resistors(selected for each bit). The Port B output buffers have symmetrical drive characteristics with

    both high sink and source capability. As inputs, Port B pins that are externally pulled low will

    source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset

    condition becomes active, even if the clock is not running.

    Port B Pins Alternate Functions

    Port Pin Alternate Functions

    PB7 SCK (SPI Bus Serial Clock)

    PB6 MISO (SPI Bus Master Input/Slave Output)

    PB5 MOSI (SPI Bus Master Output/Slave Input)

    PB4 SS (SPI Slave Select Input)

    PB3 AIN1 (Analog Comparator Negative Input)

    OC0 (Timer/Counter0 Output Compare Match Output)

    PB2 AIN0 (Analog Comparator Positive Input)

    INT2 (External Interrupt 2 Input)

    PB1 T1 (Timer/Counter1 External Counter Input)

    PB0

    T0 (Timer/Counter0 External Counter Input)XCK (USART External Clock Input/output)

    The alternate pin configuration is as follows:

    SCK Port B, Bit 7

    SCK: Master Clock output, Slave Clock input pin for SPI. When the SPI is enabled as a Slave,

    this pin is configured as an input regardless of the setting of DDB7. When the SPI is enabled as a

  • 8/8/2019 Final Report Electric Motor

    29/45

    Master, the data direction of this pin is controlled by DDB7. When the pin is forced by the SPI to

    be an input, the pull-up can still be controlled by the PORTB7 bit.

    MISO Port B, Bit 6

    MISO: Master Data input, Slave Data output pin for SPI. When the SPI is enabled as a Master,

    this pin is configured as an input regardless of the setting of DDB6. When the SPI is enabled as a

    Slave, the data direction of this pin is controlled by DDB6. When the pin is forced by the SPI to

    be an input, the pull-up can still be controlled by the PORTB6 bit.

    MOSI Port B, Bit 5

    MOSI: SPI Master Data output, Slave Data input for SPI. When the SPI is enabled as a Slave,

    this pin is configured as an input regardless of the setting of DDB5. When the SPI is enabled as a

    Master, the data direction of this pin is controlled by DDB5. When the pin is forced by the SPI to

    be an input, the pull-up can still be controlled by the PORTB5 bit.

    SS Port B, Bit 4

    SS: Slave Select input. When the SPI is enabled as a Slave, this pin is configured as an input

    regardless of the setting of DDB4. As a Slave, the SPI is activated when this pin is driven low.

    When the SPI is enabled as a Master, the data direction of this pin is controlled by DDB4. When

    the pin is forced by the SPI to be an input, the pull-up can still be controlled by the PORTB4 bit.

    Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull-up resistors

    (selected for each bit). The Port C output buffers have symmetrical drive characteristics with

    both high sink and source capability. As inputs, Port C pins that are externally pulled low will

    source current if the pull-up resistors are activated. The Port C pins are tri-stated when a resetcondition becomes active, even if the clock is not running. If the JTAG interface is enabled, the

    pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset

    occurs. The TD0 pin is tri-stated unless TAP states that shift out data are entered.

    Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port with internal pull-up resistors

    (selected for each bit). The Port D output buffers have symmetrical drive characteristics with

    both high sink and source capability. As inputs, Port D pins that are externally pulled low will

    source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset

    condition becomes active, even if the clock is not running.

    Alternate Functions of Port D

    Port D Pins Alternate Functions

    Port Pin Alternate Function

    PD7 OC2 (Timer/Counter2 Output Compare Match Output)

    PD6 ICP1 (Timer/Counter1 Input Capture Pin)

    PD5 OC1A (Timer/Counter1 Output Compare A Match Output)

  • 8/8/2019 Final Report Electric Motor

    30/45

    PD4 OC1B (Timer/Counter1 Output Compare B Match Output)

    PD3 INT1 (External Interrupt 1 Input)

    PD2 INT0 (External Interrupt 0 Input)

    PD1 TXD (USART Output Pin)

    PD0 RXD (USART Input Pin)

    OC2 Port D, Bit 7

    OC2, Timer/Counter2 Output Compare Match output: The PD7 pin can serve as an external

    output for the Timer/Counter2 Output Compare. The pin has to be configured as an output

    (DDD7 set (one)) to serve this function. The OC2 pin is also the output pin for the PWM mode

    timer function.

    OC1A Port D, Bit 5

    OC1A, Output Compare Match A output: The PD5 pin can serve as an external output for the

    Timer/Counter1 Output Compare A. The pin has to be configured as an output (DDD5 set (one))to serve this function. The OC1A pin is also the output pin for the PWM mode timer function.

    OC1B Port D, Bit 4

    OC1B, Output Compare Match B output: The PD4 pin can serve as an external output for the

    Timer/Counter1 Output Compare B. The pin has to be configured as an output (DDD4 set (one))

    to serve this function. The OC1B pin is also the output pin for the PWM mode timer function.

    RESET Reset Input. A low level on this pin for longer than the minimum pulse length will

    generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a

    reset.

    XTAL1 Input to the inverting Oscillator amplifier and input to the internal clock operating

    circuit.

    XTAL2 Output from the inverting Oscillator amplifier.

    AVCC A VCC is the supply voltage pin for Port A and the A/D Converter. It should be

    externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be

    connected to VCC through a low-pass filter.

    AREF AREF is the analog reference pin for the A/D Converter.

    Configuring the Pin Each port pin consists of three register bits: DDxn, PORTxn, and PINxn.

    the DDxn bits are accessed at the DDRx I/O address, the PORTxn bits at the PORTx I/O

    address, and the PINxn bits at the PINx I/O address. The DDxn bit in the DDRx Register selects

    the direction of this pin. If DDxn is written logic one, Pxn is configured as an output pin. If

  • 8/8/2019 Final Report Electric Motor

    31/45

    DDxn is written logic zero, Pxn is configured as an input pin. If PORTxn is written logic one

    when the pin is configured as an input pin, the pull-up resistor is activated. To switch the pull-up

    resistor off, PORTxn has to be written logic zero or the pin has to be configured as an output pin.

    The port pins are tri-stated when a reset condition becomes active, even if no clocks are running.

    If PORTxn is written logic one when the pin is configured as an output pin, the port pin is driven

    high (one). If PORTxn is written logic zero when the pin is configured as an output pin, the port

    pin is driven low (zero). When switching between tri-state ({DDxn, PORTxn} = 0b00) and

    output high ({DDxn, PORTxn} = 0b11), an intermediate state with either pull-up enabled

    ({DDxn, PORTxn} = 0b01) or output low ({DDxn, PORTxn} = 0b10) must occur. Normally, the

    pull-up enabled state is fully acceptable, as a high-impudent environment will not notice the

    difference between a strong high driver and a pull-up. If this is not the case, the PUD bit in the

    SFIOR Register can be set to disable all pull-ups in all ports.

    Pin Description

    Pin Number Description

    1 (XCK/T0) PB0

    2 (T1) PB1

    3 (INT2/AIN0) PB2

    4 (OC0/AIN1) PB3

    5 (SS) PB4

    6 (MOSI) PB5

    7 (MISO) PB6

    8 (SCK) PB7

    9 RESET

    10 VCC

    11 GND

    12 XTAL2

    13 XTAL1

    14 (RXD) PD0

    15 (TXD) PD1

    16 (INT0) PD2

    17 (INT1) PD3

    18 (OC1B) PD4

  • 8/8/2019 Final Report Electric Motor

    32/45

    19 (OC1A) PD5

    20 (ICP1) PD6

    21 (OC2) PD7

    22 (SCL) PC0

    23 (SDA) PC1

    24 (TCK) PC2

    25 (TMS) PC3

    26 (TDO) PC4

    27 PC5 (TDI)

    28 PC6 (TOSC1)

    29 PC7 (TOSC2)30 AVCC

    31 GND

    32 AREF

    33 PA7 (ADC7)

    34 PA6 (ADC6)

    35 PA5 (ADC5)

    36 PA4 (ADC4)

    37 PA3 (ADC3)

    38 PA2 (ADC2)

    39 PA1 (ADC1)

    40 PA0 (ADC0)

    CHAPTER-4

    DESIGNING OF PCB

  • 8/8/2019 Final Report Electric Motor

    33/45

    Steps of circuit Design

    Stage-1:Initial Stage

    In this stage a rough sketch is prepared deciding the components and their connection.

    This rough sketch is further modified and a final layout is decided which is to be implementedusing Eagle Software, Commonly used for designing the circuit . In eagle software first the

    schematics layout is prepared selecting the desired component. The Schematic Editor without

    Layout Editor is applicable for drawing electrical wiring diagrams(connection scheme, contact

    plans.).The Schematic editor comes , as well as the layout editor ,with the full library editor

    for designing. The Schematic layout is switched to board with a option Switch to Board

    provided in the File Menu. The next step is to arrange the component on the board according to

    the circuit. Then we use the option of DRC for setting the wire width and other connection. The

    circuit is optimized accordingly then by removing the jumpers and replacing the components by

    its leg size dot plus space for soldering. Thus the figure-4.2 shows the PCB layout with all the

    component, connection and jumpers.

    Stage-II Printing the circuit on PCB

    The final layout i.e. the BOARD CIRCUIT given by the software Eagle is then printed on

    a glossy paper. The print on the glossy paper is then transferred to the printed Circuit Board by

    continuously ironing the glossy paper with a thick cloth on the top for 15 to 20 minutes. The

    minor image printed on the PCB is darkened with the help of permanent marker.

    Stage-III:Etching the PCB

    Etching is the process of attacking and removing the unprotected copper from the PCB to

    yield the desired conductor pattern. Several commercial etchant and techniques are available for

    processing PC Boards. These materials and method attack the unprotected copper yet to do affect

    the adhesive , supporting laminate and photoresist.The most common chemicals used by industry

    as an etchant are ferric and cupric chloride. Of these, ferric chloride is commonly ,used since it is

    less expensive and potentially the least dangerous.

    Stage-IV:Cleaning the PCB

    In this stage we took a thinner in order to remove the marks of the marker and thus PCB

    is cleaned and ready with the copper tracks on it.

    Stage V:Drilling the PCB

    We next took the Precision Hand Drill and did holes in the PCB at the required places.

    Subsequently we solder the deficiencies of the copper track to complete the circuit.

  • 8/8/2019 Final Report Electric Motor

    34/45

    Stage VI:Assembly and Soldering the Components

    We assemble the various components onto the PCB and soldered the component solidly

    on the PCB and check the soldering with the multimeter for the continuity of the circuit.

    Stage-VII:Mounting the PCB

    To give a neat look we place the PCB LCD key pad and motor on the wooden board and

    fix it with the help of machine screws.And the Circuit is finally ready to work and perform iys

    duty of operation.

    CHAPTER 5

    5.1 CIRCUIT DESCRIPTION

  • 8/8/2019 Final Report Electric Motor

    35/45

  • 8/8/2019 Final Report Electric Motor

    36/45

  • 8/8/2019 Final Report Electric Motor

    37/45

    5.2 CIRCUIT OPERATION

    The 12V input DC supply used for staring the circuit is provided through the terminal box and is

    filtered through the filter circuit comprising capacitors. The input is indicated through LED in

    series with the resistance .As the micro Controller works on 5V, the voltage is lowered down

    with the help of 7805 voltage regulator IC.The Micro controller provides digital signals for the

    operations of LCD and the motor .The LCD and the LED in the LCD are provided with their

    respective VCC and GND .Program is burn in to the Micro controller with the help of AVR

    Studio Software and Robotic USB Programmer .The respective programs for LCD Display,

    Direction and Speed Control of Motor are fed in to the Micro controller .Firstly the LCD is

    initialize and a string is displayed on the LCD panel. The next step is to register the data

    direction with the help data direction register which is done in Hexa-Decimal Code. This is used

    to register 1 for output port and 0 for output port. Initially the LCD screen is cleared and it

    display a string LCD IS READY and with a delay of 2000ms it display a string PRESS ANY

    KEY and further it again clear the LCD screen and display ???KEY with a delay of2000ms.The Enable pin of the motor driver IC is set to 1(Enable) or 0(Disable)for different

    duration of the time through the pin 5 of the port D(OC1A).This procedure of varying the on

    time of decoders is known as Pulse Width Modulation. When the Enable Pin of the motor driver

    IC is set to 1 i.e. enabled its check either Pin of Controller (PC0 or PC1) which key is pressed. It

    display a string MOTOR IN REVERSE DIRECTION if the first key is pressed and set to the

    pin 6 of the Port D to 1 and Pin 7 to 0.When other key is pressed LCD display MOTOR IN

    FORWARD DIRECTION by setting pin 7 of Port D to 1 and pin 6 of Port D to 0.When the

    digital signal 00 or 11 is passed to pin 6 and 7 of Port D Motor will stop and LCD displays a

    message MOTOR IS STOPPED.

    The figure below illustrates the connection diagram.

  • 8/8/2019 Final Report Electric Motor

    38/45

    CHAPTER 6

    ERRORS & PRECAUTIONS

    The various precautions and area of errors to be taken into account while working on the

    following circuit are as follows

    1. Sufficient amount of darkening should be done while drawing the PCB layout over the

    copper plate

    2. Copper plate should be stirred well enough amount of FeCl3 solution

    3. The DC supply of the battery should be connected by taken care of the polarities

    otherwise the voltage regulator IC 7805 blows off..

    4. While providing supply AC adaptor red wire should go to VDD terminal and while wire

    should go to the GND terminal.

    5. In case the polarities are not correct the regulator IC 7805 may blow causing direct

    supply to the micro Controller (ATmega32) and damage it also.

    6. Also the incorrect connection would result in burning of motor driver IC L239D

    7. The on boars connection of ISP should be correct otherwise no detection of device will

    be related by Win AVR and hence the program will not get executed.

  • 8/8/2019 Final Report Electric Motor

    39/45

    CHAPTER 7

    CONCLUSION & FUTURE EXPANSION

    7.1 Conclusion

    From this project Microcontroller based Elevator System we conclude that an effective speed

    control can be achieved by varying the width of the pulse efficiently. The reason why this

    method is more effective than other method is that the regulation achieved in this method issharp, accurate and we can get variety of range of speed above and below the rated speed.

    We successfully achieved the objective of the project with the effective speed control and

    displaying the speed on the motor on RPM along with the direction of rotation on LCD panel.

    7.2 Future Expansion

    The Future expansion of the project could be that, now in this project the speed is

    control is done by the keypad by using keys .In future we are planning to control

    the speed using a wireless device (Remote) and a wireless module. The rangespeed can be indicated by the LED. Thus many motor can be controlled from the

    one location with the help of Remote.

  • 8/8/2019 Final Report Electric Motor

    40/45

    CHAPTER-8

    APPENDIX

    CODING

    #include

    #include

    #include

    #include // HEADER FILE FOR FUNCTIONS LIKE SBI AND CBI

    #include

    #include

    #include lcd.h

    #define OC1A_PIN PD5 //OC1A pin

    #define OC1B_PIN PD 6 //OC1B pin

    #define OC1_DDR DDRD //OC1 DDR

    Void lcd_putint(int i);

    Void motor_speed(void );

    Void lcd_putint(int i) //print integer on lcd(no auto linefeed)

  • 8/8/2019 Final Report Electric Motor

    41/45

    {

    char buffer[7];

    itoa(i,buffer,10); //convert integer into string(decimal format)

    lcd_puts(buffer); //and transmit string to LCD

    } // lcd_putint

    int i=0,j=0;

    void motor_speed()

    {

    for(int k=0;k==0;)

    {

    if(bit_is_clear(PINC,0)) //if INT0 switch is passed to increase

    {

    i=i+10;

    if(i>255)

    i=255;

    lcd_clrscr();//clear display and home cursor

    lcd_puts(0 pressed);

    lcd_putint(i);

    j=255-I;

    if(i

  • 8/8/2019 Final Report Electric Motor

    42/45

    if(bit_is_clear(PINC,1)) //if INT1 switch is pressed to decrease speed

    {

    i=i-10;

    if(i

  • 8/8/2019 Final Report Electric Motor

    43/45

    DDRA=0x00;

    sbi(PORTD,5); //Motor1 Enable

    sbi(PORTC,0); //Motor1 Enable

    sbi(PORTC,1); //Motor1 Enable

    OC1_DDR|=_BV(OC1A_PIN)+_BV(OC1B_PIN);

    //Set OC1A and OC1B pin as output,required for output toggling

    TCCR1A=_BV(WGM10) |_BV(COM1A1)|_BV(COM1A0) | _BV(COM1B1) |_BV(COM1B0);//enable 8 bit PWM,select inverted PWM

    //timer1 running on 1/8MCU clock with clear timer/counter1 on Compare Match

    //PWM frequency will be MCU clock /8/512,e.g. with 1 MHz Crystal 244 Hz.

    TCCR1B=_BV(CS11) |_BV(WGM12);

    lcd_init(LCD_DISP_ON); //initialize display,cursor off

    lcd_clrscr()(); //clear display and home cursor

    lcd_puts(LCD is Ready\n); //put string to display (line1) with line feed

    _delay_ms(2000);

    lcd_clrscr(); //clear display and home cursor

    lcd_puts(???Key); //cursor is now on second line , write second line

    _delay_ms(2000);

    for(;;)

    {

    lcd_puts(SELECT DIRECTION\n);

    lcd_puts(1:-UP 2:- DOWN );

    if(bit_is_clear(PINC,0))

    {

    lcd_clrscr(); //clear display and home cursor

    lcd_puts(Motor in Forward\n);

    lcd_puts(Direction\n);

    _delay_ms(2000);

  • 8/8/2019 Final Report Electric Motor

    44/45

    sbi(PORTD,6);

    cbi(PORTD,7);

    motor_speed();

    }

    else

    {

    if(bit_is_clear(PINC,1))

    {

    lcd_clrscr(); //clear display and home cursor

    lcd_puts(Motor in Reverse\n);

    lcd_puts(Direction\n);

    _delay_ms(2000);

    sbi(PORTD,7);

    cbi(PORTD,6);

    motor_speed();

    }

    else

    {

    cbi(PORTD,7);

    cbi(PORTD,7);

    }

    }

    }

    Return 0;

    }

  • 8/8/2019 Final Report Electric Motor

    45/45

    CHAPTER-9

    REFERENCES AND BIBLOGRAPHY

    1. Working with win AVR

    2. Robotics trainer Manual

    3. let us C-By-Yashwant Kanetkar

    4. www.wikipedia.com

    5. www.google.com

    6.http://en.wikipedia.org/wiki/Resistor

    7. http://personal.ee.surrey.ac.uk/Personal/H.M/UGLabs/images/resistor_packages.jpg

    8.http://en.wikipedia.org/wiki/Capacitor

    9.http://en.wikipedia.org/wiki/Linear_regulator

    10.http://en.wikipedia.org/wiki/Liquid_crystal_display

    11.http://en.wikipedia.org/wiki/Electric_motor

    12.http://www.futurlec.com/Atmel/ATMEGA32.shtml

    http://en.wikipedia.org/wiki/Resistorhttp://en.wikipedia.org/wiki/Capacitorhttp://en.wikipedia.org/wiki/Linear_regulatorhttp://en.wikipedia.org/wiki/Liquid_crystal_displayhttp://en.wikipedia.org/wiki/Electric_motorhttp://en.wikipedia.org/wiki/Resistorhttp://en.wikipedia.org/wiki/Capacitorhttp://en.wikipedia.org/wiki/Linear_regulatorhttp://en.wikipedia.org/wiki/Liquid_crystal_displayhttp://en.wikipedia.org/wiki/Electric_motor