You are on page 1of 126

Downloaded From : www.EasyEngineering.

net

ww
w.E
a syE
ngi
nee
rin
g.n
et

**Note: Other Websites/Blogs Owners Please do not Copy (or) Republish


this Materials without Legal Permission of the Publishers.

**Disclimers : EasyEngineering not the original publisher of this Book/Material


on net. This e-book/Material has been collected from other sources of net.
Downloaded From : www.EasyEngineering.net
Downloaded From : www.EasyEngineering.net

SYLLABUS
ME6702- MECHATRONICS

UNIT I INTRODUCTION 12

Introduction to Mechatronics – Systems – Concepts of Mechatronics


approach – Need for Mechatronics – Emerging areas of Mechatronics

ww
– Classification of Mechatronics. Sensors and Transducers: Static and

w.E
dynamic Characteristics of Sensor, Potentiometers – LVDT –
Capacitance Sensors – Strain gauges – Eddy current sensor – Hall

asy
Effect sensor – Temperature sensors – Light Sensors.

En
UNIT II 8085 MICROPROCESSOR AND 8051 MICROCONTROLLER
10
gin
ee
Introduction – Architecture of 8085 – Pin Configuration –
Addressing Modes –Instruction set, Timing Diagram of 8085 –
rin
Concepts of 8051 microcontroller – Block diagram.
g.n
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE

Introduction – Architecture of 8255, Keyboard interfacing, LED


et 8

display –interfacing, ADC and DAC Interface, Temperature Control –


Stepper Motor Control – Traffic Control interface.

UNIT IV PROGRAMMABLE LOGIC CONTROLLER 7

Introduction – Basic structure – Input and output processing –


Programming – Mnemonics – Timers, Counters and internal relays –
Data handling – Selection of PLC.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

UNIT V ACTUATORS AND MECHATRONIC SYSTEM DESIGN 8

Types of Stepper and Servo motors – Construction – Working


Principle – Advantages and Disadvantages. Design process-stages of
design process – Traditional and Mechatronics design Concepts –
Case studies of Mechatronics systems – Pick and place Robot –
Engine Management System – Automatic car park barrier.

ww TOTAL: 45 PERIODS

w.E
Text Books:

asy
1. Bolton, “Mechatronics”, Printice Hall, 2008
2. Ramesh S Gaonkar, “Microprocessor Architecture, Programming,

En
and Applications with them 8085”, 5th Edition, Prentice Hall, 2008.

gin
REFERENCES:
ee
1. Michael B.Histand and Davis G.Alciatore, “Introduction to
rin
Mechatronics and Measurement systems”, McGraw Hill International
g.n
edition, 2007.
2. Bradley D.A, Dawson D, Buru N.C and Loader A.J, “Mechatronics”,
Chapman and Hall, 1993.
et
3. Smaili.A and Mrad.F , “Mechatronics Integrated Technologies for
Intelligent Machines”, Oxford University Press, 2007.
4. Krishna Kant, “Microprocessors & Microcontrollers”, Prentice Hall
of India, 2007.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

TABLE OF CONTENTS

PAGE.
S.NO TABLE OF CONTENTS
NO

a. Aim and Objective of the subject 5

b. Detailed Lesson Plan 6-8


wwc. Unit I- Introduction -Part A 9-10
w.E
d. Unit I- Introduction -Part B 10-27

e. asy
Unit II -8085 Microprocessor And 8051 Microcontroller
Part A
En
Unit II -8085Microprocessor And 8051 Microcontroller
28-30

f. Part B
gin 31-54

g.
ee
Unit III- Programmable Peripheral Interface-Part-A
rin 55-56

h. Unit III- Programmable Peripheral Interface-Part-B g.n 57-67

i. Unit IV- Programmable Logic Controller-Part-A et 68-70

J. Unit IV- Programmable Logic Controller-Part-B 70-92

k. Unit V- Actuators And Mechatronic System Design-Part- A 93-95

l. Unit V- Actuators And Mechatronic System Design-Part -B 95-114


115-
m. Model Question Paper 116

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

AIM :

 The aim of the program is to equip students with the skills and knowledge
required to function as an effective mechatronic engineer.
 This requires studies in the foundations of electrical and mechanical
engineering and the integration of these areas to problem involving the
design of mechatronic system.
 This study aims to further develop your understanding of robotic and

ww mechatronic system.

w.E
OBJECTIVE:

asy
 Select and apply the knowledge, techniques, skills and modern tools in

En
mechatronics engineering technology.

gin
 Apply concepts of circuit analysis, analog and digital electronics, automation

computers to aid inee


and controls, motors, electric drives, power systems, instrumentation, and
the design,
rin
characterization, analysis, and
troubleshooting of mechatronics systems.
g.n
 Use advanced principles of statics, dynamics, fluid mechanics, strength of

et
materials, engineering materials, engineering standards, and manufacturing
processes to aid in the design, characterization, analysis, and troubleshooting
of mechatronics systems.
 Design a system component or process to meet desired needs within realistic
constraints, such as economic, environmental and/or social.

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

DETAILED LESSON PLAN

Name of the Subject& Code: ME6702 MECHATRONICS

TEXT BOOKS

1. Bolton, “Mechatronics”, Printice Hall, 2008

2. Ramesh S Gaonkar, “Microprocessor Architecture, Programming, and Applications

ww
with the 8085”, 5th Edition, Prentice Hall, 2008.

w.E
REFERENCES
1. Michael B.Histand and Davis G.Alciatore, “Introduction to Mechatronics and

asy
Measurement systems”, McGraw Hill International edition, 2007.

En
2. Bradley D.A, Dawson D, Buru N.C and Loader A.J, “Mechatronics”, Chapman and
Hall, 1993.
gin
ee
3. Smaili.A and Mrad.F , “Mechatronics Integrated Technologies for Intelligent
Machines”, Oxford University Press, 2007.
rin
g.n
4. Devadas Shetty and Richard A. Kolk, “Mechatronics Systems Design”, PWS
publishing company, 2007.
et
5. Krishna Kant, “Microprocessors & Microcontrollers”, Prentice Hall of India, 2007.

6. Clarence W, de Silva, "Mechatronics" CRC Press, First Indian Re-print, 2013

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NO OF CUMULATIVE BOOKS
S.NO UNIT TOPICS COVERED
HOURS HOURS REFERRED
INTRODUCTION
Introduction to Mechatronics –
Systems – Concepts of
1 3 3 TI, R1
Mechatronics approach – Need

ww for Mechatronics –
Emerging areas of Mechatronics
w.E Classification of Mechatronics.
Sensors and Transducers: Static
1 4 TI, R1

2 1
Sensor,
asy
and dynamic Characteristics of 2 6 T1, R1

En
Potentiometers – LVDT –
3
gin
Capacitance sensors
2 8 T1, R1

4
ee
Strain gauges – Eddy current
sensor – Hall effect sensor –
Temperature sensors – Light
2

rin
10 T1, R1

5
Sensors
2
g.n
12 T1, R1

1
MICROPROCESSOR AND 8051 MICROCONTROLLER
Introduction – Architecture of
8085
2
et
14 T2, R5

Pin Configuration – Addressing


2 2 16 T2, R5
Modes
2 Instruction set, Timing diagram
3 of 8085 2 18 T2, R5

Concepts of 8051
4 4 22 T2, R5
microcontroller – Block diagram

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PROGRAMMABLE PERIPHERAL INTERFACE


Introduction – Architecture of
1 8255, 2 24 T2, R5

Keyboard interfacing, LED


2 2 26 T2, R5
3 display –interfacing
ADC and DAC interface,
3 2 28 T2, R5
Temperature Control
Stepper Motor Control – Traffic
4 2 30 T2, R5

ww Control interface.
PROGRAMMABLE LOGIC CONTROLLER
1
w.E Introduction – Basic structure 2 32 T1

2
asy
Input and output processing –
Programming
2 34 T1

4
En
Data handling -Selection of PLC.
3
gin 1 35 T1

4
and internal relaysee
Mnemonics – Timers, counters
2

rin
37 T1

ACTUATORS AND MECHATRONIC SYSTEM DESIGN


Types of Stepper and Servo g.n
1
motors – Construction –
Working Principle – Advantages
and Disadvantages.
2 et
39 T1

Design process-stages of design


2 process – Traditional and 2 41 T1,R4
5 Mechatronics design concepts
Case studies of Mechatronics
3 2 43 T1,R4
systems – Pick and place Robot
Engine Management system –
4 Automatic car park barrier. 2 45 T1, R4

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

UNIT-I

INTRODUCTION

PART A

1) Define mechatronics?
Mechatronics brings together the areas of technology involving sensors and
measurement system, drive and actuation system, analysis of behavior of the
system, control system and microprocessor system.

ww
2) What is meant by system in mechatronics?
The system is a group of physical component combined to perform a specific

w.E
function. Any mechatronics devices consist of system.
3) What are the main applications of mechatronics?

asy
Washing machines, dish washers, micro ovens, cameras, atm and camcorders.

En
4) What are the types of control systems?
a) Closed loop system
b) Open loop system gin
ee
5) Obtain the basic function of control system?
rin
a) To minimize the error between the actual and desired output
b) To minimize the time response to load changes in the system.
g.n
6) Name elements of feedback system?
et
a) Forward path
b) Feedback path
c) Error detecting device
d) Amplifier
e) Compensating network

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

7) What is a sensor?
A sensor is an element in measurement system that acquires a physical parameter
and changes it into signal.
8) What is hysteresis?
Hysteresis is defined as the difference in the output for a given input when this
value is approached from the opposite direction.
9) State the dynamic characteristics of simplified measuring system?
1) Speed of response
2) Lag

ww
3) Fidelity

w.E
4) Dynamic error

10) Name few materials used in binding of strain gauge?


a) Ceramic cement asy
b) Epoxy
En
c) Nitrocellulose
gin
ee PART B

1. What are the basic elements of a closed loop control system?


rin
g.n
If there is feedback device to compare the actual value with desired one, then
the system is called closed loop control system.
et

10

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Elements of Closed Loop System:

The elements of closed loop control system are Comparison Unit, Control
Unit, Correction Unit, Process Unit, Measurement Device

i. Comparision element

This element compares the required or reference value of the variable condition
being controlled with the measured value and produces an error signal.

Error signal = reference value-measured value

ww
ii. Control element

w.E This element decides the corrective action to be taken when an error signal is
received by it.

iii.
asy
Correction element
En
gin
Correction element is an actuator that produces a change in a process to correct
or change the controller condition.

iv. Process element ee rin


An element that controls the process is known as process element.
g.n
v.
Eg. Room temperature of a house is being controlled

Measurement element
et
The measurement element produces a signal related to the variable condition of
the process that is being controlled.

2. Explain the static and dynamic characteristic of a sensor?

Range and Span:


 The range of a transducer defines the limits between which the input can
vary.
11

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 The difference between the limits (maximum value - minimum value) is


known as span.
 For example a load cell is used to measure force. An input force can vary from
20 to 100 N. Then the range of load cell is 20 to 100 N. And the span of load
cell is 80 N (i.e., 100-20)
Error:
 The algebraic difference between the indicated value and the true value of the
measured parameter is termed as the error of the device.
 Error = Indicated value — true value

ww For example, if the transducer gives a temperature reading of 30°C when the

w.Eactual temperature is 29° C, then the error is + 1°C. If the actual temperature
is 3 1° C, then the error is — 1°C.
Accuracy:
asy
En
 Accuracy is defined as the ability of the instrument to respond to the true
value of the measure variable under the reference conditions.
gin
 For example, a thermocouple has an accuracy of ± 1° C. This means that

1°C of the true value.


ee
reading given by the thermocouple can be expected to lie within + 1°C (or) —

rin
g.n
 Accuracy is also expressed as a percentage of the full range output (or) full
scale deflection.
et
 For example, a thermocouple can be specified as having an accuracy of ±4 %
of full range output. Hence if the range of the thermocouple is 0 to 200°C, then
the reading given can be expected to be within + 8°C (or) — 8°C of the true
reading.
Sensitivity:
 The sensitivity is the relationship showing how much output we can get per
unit input.
Sensitivity = Output / Input

12

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Precision:
 It is defined as the degree of exactness for which the instrument is intended
to perform.
Hysteresis error:
 When a device is used to measure any parameter plot the graph of output Vs
value of measured quantity.
 First for increasing values of the measured quantity and then for decreasing
values of the measured quantity.
 The two output readings obtained usually differ from each other.

ww
w.E
asy
En
gin
Repeatability: ee rin
 The repeatability and reproducibility of a transducer are its ability to give the
same output for repeated applications of the same input value. g.n
Reliability:
et
 The reliability of a system is defined as the possibility that it will perform its
assigned functions for a specific period of time under given conditions.
Stability:
 The stability of a transducer is its ability to give the same output when used
to measure a constant input over a period of time.
Drift:
 The term drift is the change in output that occurs over time.

13

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Dead band:
There will be no output for certain range of input values. This is known as dead
band. There will be no output until the input has reached a particular value.
Dead time:
 It is the time required by a transducer to begin to respond to a change in
input value.
Resolution:
 Resolution is defined as the smallest increment in the measured value that
can be detected. The resolution is the smallest change in the input value

ww which will produce an observable change in the input.

w.E
Backlash:

asy
 Backlash is defined as the maximum distance (or) angle through which any
part of a mechanical system can be moved in one direction without causing

En
any motion of the attached part.

gin
 Backlash is an undesirable phenomenon and is important in the precision
design of gear trains.
Dynamic characteristics ee rin
Response time:
g.n
 This is the time which elapses after a constant input is applied to the
transducer up to the point at which the transducer gives an output
et
corresponding to some specified percentage, e.g.95%, of the value of the
input.
Time constant:
 This is the 63.2% response time. The time constant is a measure of the inertia
of the sensor and so how fast it will react to changes in its input. The bigger
the time constant, the slower the reaction to a changing input signal.

14

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Rise time:
 This is the time for the output to rise to some specified percentage of the
steady state output. Often the rise time refers to the time taken for the output
to rise from 10% of the steady state value to 90 or 95% of the steady state
value.
Settling time:
 This is the time for the output to settle to within some percentage, example
2% of the steady state value.

ww
3. Explain the construction and working of potentiometer sensor and LVDT
sensor.

w.E
Potentiometer
Principle:

asy
It works on variable resistance transduction principle Linear or Rotary

En
potentiometer is a variable resistance displacement transducer which uses the

gin
variable resistance transduction principle in which the displacement or rotation is
converted into a potential difference due to the movement of sliding contact over a
resistive element ee rin
g.n
et
Construction & working:
 A resistor with three terminals.
 Two end terminal & one middle terminal (wiper)
 Two end terminal are connected to external input voltage
 One middle and one end terminal as output voltage

15

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 The slider determines the magnitude of the potential difference developed


Characteristics:
 Resistance element = Precision Drawn wire with a diameter of about 25 to 50
microns, and wad over a cylindrical or a flat mandrel of ceramic, glass or
Anodized Aluminium. 2mm to 500 mm in case of linear pot.
 Wipers (Sliders) = Tempered phosphor bronze, beryllium copper or other
precious alloys.
 Wire Material = Strong, ductile and protected from surface corrosion by
enamelling or oxidation. Materials &e alloys of copper nickel, Nickel

ww chromium, and silver palladium.

w.E
 Resistance range = 20Ω to 200KΩ and for plastic 500Ω to 80KΩ
 Accuracy = Higher temperature coefficient of resistance than the wire and so

asy
temperature changes have a greater effect Accuracy.

En
Linear variable differential transformer:
 It consists of three symmetrically spaced coils.
gin
 The centre coil is primary coil and other two are secondary coil
ee rin
 Secondary coils are connected in series opposition and equally positioned
with respect to primary coil
g.n
et
 The output voltage is proportional to the displacement of the core from null
position

16

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

4. Explain the construction and working of eddy current and Hall Effect
sensor.
Principle:
When a current carrying semiconductor plate is placed in a transverse
magnetic field, it experiences a force (Lorentz force). Due to this action a beam of
charged particles are forced to get displaced from its straight path. This is known as
Hall Effect.
A current flowing in a semiconductor plate is like a beam of moving charged
particles and thus can be deflected by a magnetic field. The side towards which the

ww
moving electron deflected becomes negatively charged and the other side of the

w.E
plate becomes positively charged or the electrons moving away from it.

This charge separation produces an electrical voltage which continues until

asy
the Lorentz force on the charged particles from the electric field balances the forces

En
produced by the magnetic field. The result is a traverse potential difference known
as Hall voltage.
gin
ee rin
g.n
et

Current is passed through leads 1 and 2 of the semiconductor plate and the output
leads are connected to the element faces 3 and 4.

17

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 These output faces are at same potential when there is no transverse


magnetic field passing through the element and voltage known as Hall
voltage appears when a transverse magnetic field is passing through the
element.
 This voltage is proportional to the current and the magnetic field.
 The direction of deflection depends on the direction of applied current and
the direction of magnetic field
Eddy current proximity sensor:
Principle:

ww When a coil is supplied with alternating current, an alternating magnetic field

w.E
is produced which induces an EMF on it. If there is a metal near to this alternating
magnetic field, on EMF is induced in it. The EMF cause current to flow. This current
flow is eddy current.
asy
En
gin
ee rin
g.n
et
Construction & working:
 It has two identical coils.
 One reference coil & another sensing coil which senses the magnetic current
in the object.
 Eddy current start to flow due to AC(conducting object) close to sensor

18

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 Eddy current produce a magnetic field to oppose the magnetic field generated
by sensing coil.
 Due to this opposition reduction flux is created. To detect 0.001mm

5. Explain the construction and working of capacitive and strain gauge sensor.
Capacitive Sensors:
It is used for measuring, displacement, velocity, force etc.
Principle:
It is passive type sensors in which equal and opposite charges are generated

ww
on the plates due to voltage applied across the plate which is separated by dielectric

w.E
material.
Formula:

asy
En
gin
ee rin
g.n
By Changing the Distance between Two Plates:
 The displacement is measured due to the change in capacitance
et

19

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

By Varying the Area of Overlap:


 The displacement causes the area of overlap to vary
 The capacitance is directly proportional to the area of the plates and varies
linearly with changes in the displacement between the plates

ww
w.E
By Varying the Dielectric Constant:
 The change in capacitance can be measured due to change in dielectric

asy
constant as a result of displacement.
 When the dielectric material is moved due to the displacement, the material
En
causes the dielectric constant to vary in the region where the two electrodes

gin
are separated that results in a charge in capacitance

ee rin
g.n
Push Pull Sensor:
et
 Push pull displacement sensor is used to overcome the non-linearity error.
 The sensor consists of three plates with the upper pair forming one capacitor
and the lower pair forming another capacitor.
 The displacement moves central plate between the two other plates.
 If the central plate moves downwards.
 The plate separation of the upper capacitor increases and the separation of
the lower one decreases.

20

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Strain gauge:
 Strain gauges are passive type resistance sensor whose electrical resistance
change when it is stretched or compressed (mechanically strained) under the

ww application of force.

w.E
 The electrical resistance is changed due to the change in length (increases)
and cross sectional area (decreases) of the strain gauge.

asy
 This change in resistance is then usually converted into voltage by connecting
one, two or four similar gauges as an arm of a Wheatstone bridge (known as
En
Strain Gauge Bridge) and applying excitation to the bridge. The bridge output

gin
voltage is then a measure of strain, sensed by each strain gauge.
Unbonded Type Strain Gauges:
ee rin
 In unbonded type, fine wire filaments (resistance wires) are stretched around
rigid and electrically insulated pins on two frames.
 One frame is fixed and the other is movable. g.n
 The frames are held close with a spring loaded mechanism. et
 Due to the relative motion between two frames, the resistance wires are
strained.
 This strain is then can be detected through measurement of the change in
electrical resistance since they are not cemented with the surfaces, they can
be detached and reused.
Bonded Type Strain Gauges:
 Bonded type strain gauges consists of resistance elements arranged in the
form of a grid of fine wire, which is cemented to a thin paper sheet or very

21

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

thin Bakelite sheet, and covered with a protective sheet of paper or thin
Bakelite.
 The paper sheet is then bonded to the surface to be strained. The gauges have
a bonding material which acts an adhesive material during bonding process
of a surface with the gauge element.
Classification of Bonded Type Strain Gauges:
 Fine wire gauges
 Metal foil gauges
 Semiconductor filament type

ww
Fine Wire Gauges:

w.E
 Wire of 3 to 25 microns diameter is arranged in the form of grid consisting of
parallel loops

asy
En
gin
Metal Foil Gauges:
ee rin
g.n
 A thin foil of metal, deposited as a grid pattern onto a plastic backing material
using polyimide
 Foil pattern is terminated at both ends with large metallic pads
et
 Entire gauge size 5- 15mm

22

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
Semiconductor Filament Type:
 The gauges are produced in wafers from silicon or germanium crystals

w.E
 Special impurities such as boron is added
 It is mounted on an epoxy resin backing with copper on nickel leads
asy
 Filament about 0.05mm thick 0.25mm wide and 1.25 to 12mm length

En
gin
ee rin
g.n
6. Explain any four temperature sensors.
Bimetallic Strips:
et
 A Bimetallic thermostat consists of two different metal strips bounded
together and they cannot move relative to each other.
 These metals have different coefficients of expansion and when the
temperature changes the composite strips bends into a curved strip, with the
higher coefficient metal on the outside of the curve.
 The basic principle in this is all metals try to change their physical dimensions
at different rates when subjected to same change in temperature.

23

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 This deformation may be used as a temperature- controlled switch, as in the


simple thermostat.

ww
w.E
asy
Resistance Temperature Detectors (RTDs):

En
 The materials used for RTDs are Nickel, Iron, Platinum, Copper, Lead,

gin
Tungsten, Mercury, Silver, etc.

ee
 The resistance of most metals increases over a limited temperature range and

rin
the relationship between Resistance and Temperature is shown below.

g.n
et
 The Resistance temperature detectors are simple and resistive elements in
the form of coils of wire
 The equation which is used to find the linear relationship in RTD is

24

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Constructional Details of RTDs:


 The platinum, nickel and copper in the form wire are the most commonly
used materials in the RTDs.
 Thin film platinum elements are often made by depositing the metal on a
suitable substrate wire- wound elements involving a platinum wire held by a
high temperature glass adhesive inside a ceramic tube.

ww
w.E
Thermistors:
 Thermistor is a semiconductor device that has a negative temperature
asy
coefficient of resistance in contrast to positive coefficient displayed by most
metals.
En
gin
 Thermistors are small pieces of material made from mixtures of metal oxides,
such as Iron, cobalt, chromium, Nickel, and Manganese.
ee
 The shape of the materials is in terms of discs, beads and rods.
rin
 The thermistor is an extremely sensitive device because its resistance
changes rapidly with temperature. g.n
et
 The resistance of conventional metal-oxide thermistors decreases in a very
non-linear manner with an increase in temperature.

 The change in resistance per degree change in temperature is considerably


larger than that which occurs with metals.

25

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 The resistance-temperature relationship for a thermistor can be described by


an equation of the form
Rt = Keβ/t
Where Rt, is the resistance at temperature t, with K and β being constant.
Thermistors have many advantages when compared with other temperature
sensors.

ww
w.E
asy
En
 The simple series circuit for measurement of temperature using a thermistor

gin
and the variation of resistance with temperature for a typical thermistor.

ee rin
g.n
et
 The thermistor is an extremely sensitive device because its resistance
changes rapidly with temperature.

Thermocouples:
 Thermocouples are based on the See back Effect.
 The thermocouple temperature measurement is based on a creation of an
electromotive force (emf).
26

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 "When two dissimilar metals are joined together an e.m.f will exist between

ww the two points A and B, which is primarily a function of the junction


temperature. The above said to be principle is See back effect..

w.E
 The thermocouple consist of one hot junction and one cold junction

asy
 Hot junction is inserted where temperature is measured
 Cold junction is maintained at a constant reference temperature.

En
gin
ee rin
g.n
et

27

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

UNIT II
8085 MICROPROCESSOR AND 8051 MICROCONTROLLER
PART – A
1. What is stack and what is the use of stack pointer?
The stack is a reserved area of the memory in the RAM where temporary
information may be stored. A 16-bit stack pointer is used to hold the address of the
most recent stack entry.
2. Mention the use of ALE.
The ALE signal is used to demultiplex (separate) AD0 – AD7 lines to A0 – A7 (address

ww
lines) and D0 – D7 (data lines). The separation of address lines and data lines is

w.E
achieved by connecting a external latch to AD0 – AD7 lines and enabling the latch
when signal is active.
3.
asy
List the 8085 flags.
Various flags are: S (Sign flag), Z (Zero flag), AC (Auxiliary carry flag), P (Parity
flag), CY (Carry flag). En
4. gin
What is the function of program counter in 8085 microprocessor?

used as pointer to the instruction.


ee
Program counter stores the address of the next instruction to be fetched. Thus it is

rin
5. What is trap interrupt and its significance?
g.n
This interrupt is a non-maskable interrupt. It is unaffected by any mask or

et
interrupt enable. TRAP has the highest priority. TRAP interrupt is edge and level
triggered. This means that the TRAP must go high and remain high until it is
acknowledged. This avoids false triggering caused by noise and transients.
6. List the control and status signals of 8085 and mention its need.
 ALE (Address Latch Enable)
 ̅̅̅̅
RD and ̅̅̅̅̅
WR (Read and Write)
̅ , S0 S1
 IO/M
 READY

28

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

7. Define the function of parity flag and zero flag in 8085.


Parity is defined by the number of one’s present in the accumulator. After an
arithmetic or logical operation if the result has an even number of ones, i.e., even
parity, the flag is set. If the parity is odd, flag is reset. Zero flag – the zero flag sets if
the result of operation in ALU is zero and flag resets if result is non zero. The zero
flag is also is also set if certain register content becomes zero following an
increment or decrement operation of that register.
8. List the five interrupts pins available in the 8085.

ww
The five interrupt pins are : TRAP RST 7.5, RST 6.5, RST 5.5, and INTR.
9.
w.E What is interrupt?
Interrupt is an external signal that causes a microprocessor to jump to a specific
subroutine.
10.
asy
What is Microcontroller?
En
A device which contains the microprocessor with integrated peripherals like

gin
memory, serial ports, parallel ports, timer/counter, interrupt controller, data

11. What are the


ee
acquisition interfaces like ADC, DAC is called microcontroller.
differences between a
rin
Microcontroller and
Microprocessor?
Microprocessor g.n
Microcontroller

It is termed as general purpose


digital computer.
et
It is termed as special purpose
digital Controller.

It contains the CPU, memory, It possesses all features of


addressing circuits and interrupt microprocessor and additionally it
handling circuit. includes timers, parallel and serial
I/O and the internal RAM and ROM.

It has one or two types of bit It has many bit handling instructions.
handling Instructions.

Memory and I/O access time is large Memory and I/O access time is less.

29

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

12. What are the various types of 8085 instructions?


 Data transfer group – MOV A,B
 Arithmetic group – ADD B
 Logical group- ANA B
 Branch group – JMP LABEL
 Stack I/O and Machine Control group – PUSH, POP, HLT.
13. What are the different types of addressing modes?
The addressing modes specify the location of the operand (data). The different types
are as follows

ww
 Immediate addressing

w.E
 Register addressing
 Direct addressing
 Indirect addressing
 Implicit addressing
asy
14. En
Define stack and stack related instructions?

gin
The stack is a group of memory locations in the R/W memory that is used for the

ee
temporary storage of binary information during the execution of the program. The
stack related instructions are PUSH and POP
rin
15. What is subroutine?
g.n
Subroutine is group of instructions stored as a separate program in memory and it
is called from the main program whenever required. et

30

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PART – B
1.Draw and explain the architecture of 8085.

ww
w.E
asy
En
gin
ee rin
g.n
et
 It consists of various functional blocks.
 Registers
 Arithmetic and logic unit
 Instruction decoder and machine cycle encoder
 Address buffer
 Address/Data buffer
 Increment / Decrement address latch
 Interrupt control
31

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 Serial control
 Serial I/O control
 Timing and control circuitry
Registers
It has eight addressable 8-bit registers A,B,C,D,E,H,L,F and two 16-bit
registers PC and SP
These register can be classified as,
1. General purpose registers
2. Temporary registers

ww (a) Temporary data register (b) W and Z registers

w.E 3. Special purpose registers


(a) Accumulator (b) Flag registers (c) Instruction registers

asy
4. 16-bit registers
(a) Program counter (PC) (b) Stack pointer (SP)
General purpose registers:En
gin
 B,C,D,E,H,L are 8-bit general purpose registers can be used as a separate (or)

ee
as 16-bit register pairs BC, DE, HL.

rin
 When used in register pair mode the higher order byte resides in the first
register and the low order byte in the second.
g.n
 HL pair also functions as a data pointer (or) memory pointer. These are also
called scratched registers as user can store data in them. et
 To store and read data from these registers bus access is not required, it is an
internal operation.
 Used to store intermediate results and use them when required.
Temporary registers:
(a) Temporary data register:
 The ALU has two inputs
 One input is supplied by the accumulator and other from temporary data
register.

32

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 The programmer cannot access this temporary data.


(b) W and Z registers:
 W and Z registers are temporary registers.
 These registers are used to hold 8-bit data during execution of some
instructions.
 These registers are not available for programmer since 8085 uses them
internally.
Special purpose registers:
(a) Register A (Accumulator)

ww  It is a tri state 8-bit register.

w.E
 It is extensively used in arithmetic, logic, load and store operations as well as
input/output (I/O) operations.

asy
 Most of the times the result of arithmetic and logical operations is stored in
the register A.
(b) En
Flag register:

gin
 It is an 8-bit register in which five of the bits carry significant information in
the form of flags.
ee rin
 S – Sign flag; Z – Zero flag; AC – Auxiliary carry flag; P – Parity flag; CY – carry
flag.
S- Sign flag: g.n
et
 After the execution of arithmetic (or) logical operations if bit D7 of the result
is 1, the sign flag is set.
 In a given byte if D7 is 1, the number will be viewed as negative number.
 If D7 is 0, the number will be considered as positive number.
Z – Zero flag:
 The zero flag sets if the result of operation is ALU is zero and flag resets if
result is non zero.
 The zero flag is also set if certain register content becomes zero following as
increment (or) decrement operation of that register.

33

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

AC – Auxiliary carry register:


 This flag is set if there is an overflow out of bit 3 i.e., carry from lower nibble
to higher nibble (D3 bit to D4 bit).
 This flag is used for BCD operations and it is not available for the
programmer.
P – Parity flag:
 Parity flag is defined as the number of one’s present in the accumulator.
CY – carry flag:
 This flag is set if there is an overflow out of bit 7.

ww  The carry flag also serves as a borrow flag for subtraction.

w.E
© Instruction registers:
 In a typical processor operation the processor first fetches the opcode of

asy
instruction from memory.
 The CPU stores this opcode in a register called the instruction register.
En
 This opcode is further sent to the instruction decoder to select one of the 256
alternatives. gin
16-bit registers:
(a) Program counter (PC):
ee rin
 Program counter is sequence of instructions
g.n
 The PC is a special purpose register which at a given time stores the address
of the next instruction to be fetched.
 Program counter acts as a pointer to the next instruction.
et
 The Pc increments depends upon the nature of the instruction, for one byte
instruction it increments program counter by one, for two byte instruction it
increments PC by two and so on.
(b) Stack pointer (SP):
 The stack pointer is a reserved area of the memory in the RAM where
temporary information may be stored.

34

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 A 16-bit stack pointer is used to hold the address of the most recent stack
entry.
Arithmetic logic unit (ALU):
 The 8085’s ALU performs arithmetic and logical functions on 8-bit variables.
 The arithmetic unit performs addition and subtraction.
 The logic unit perform logical operations such as complement, AND, OR, EX-
OR, rotate, clear etc.,
 The ALU also looks after the branching decisions.
Instruction decoder:

ww  The processor first fetches the opcode of instructions from memory and

w.E stores this opcode in the instruction register.


 It is then send to the instruction decoder.

asy
 The instruction decoder decodes it and accordingly gives the timing and
control signals which control the register, the data buffers, ALU etc.,
En
 The 8085 executes seven different types of machine cycles

gin
 It gives the information about which machine cycle is currently executing in

ee ̅ lines
the encoded from on the S0, S1 and IO/𝑀
 This task is done by machine cycle encoder.
rin
Address buffer:
 This is an 8-bit unidirectional buffer. g.n
 It is used to drive external high order address bus (A15 – A8). et
 It is also used to tri-state the high order address bus under certain conditions
such as reset, hold, halt, and when address lines are not in use.
Address/Data buffer:
 This is an 8-bit bi-directional buffer.
 It is used to drive multiplexed address/data bus ie, lower order address bus
(A7-A0) abd data bus (D7-D0).
 It is also used to tri-state the high order address bus under certain conditions
such as reset, hold, halt, and when address lines are not in use.

35

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 The address and data buffers are used to drive external address and data
buses respectively.
 Due to these buffers the address and data buses can be tri-stated when they
are not in use.
Increment/Decrement address latch:
 This 16-bit register is used to increment (or) decrement the contents of PC
(or) AP as a part of execution of instruction related to them.
Interrupt control:
 The processor fetches, decodes and execute instructions in a sequence.

ww
Serial I/O control:

w.E
 In serial communication one bit is transferred at a time over a single line.
 The 8085 serial I/O control provides two lines, SOD and SID for serial
communication.
asy
 The serial output data (SOD) line is used to send data serially and serial input
En
data (SID) line is used to receive data serially.
Timing and control circuitry: gin
operations.
ee
 The control circuitry in the processor 8085 is responsible for all the

rin
g.n
 The control circuitry and operations in 8085 are synchronized with the help
of clock signal.

et
 Control circuitry also generates signals required to interface external devices
to the processor 8085.

36

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

2. Draw and explain the timing diagram of memory read and write
operation.

ww
w.E
Memory read cycle:
asy
 The 8085 executes the memory read cycle to read the contents of R/W
memory or ROM. En
gin
 The length of this machine cycle is 3T-states(T1-T3)

ee
 In this machine cycle processor places the address on the address lines from

rin
the stack pointer, general purpose register pair or program counter and

g.n
through the read process, reads the data from the addressed memory
location.
 Memory read cycle is similar to the opcode fetch machine cycle. et ̅ =0,
 However they use only states T1 to T3 and the status signal values (IO/𝑀
S1=1, S0=0) appropriate for memory read machine cycle are issued in T1.
The following section describes the memory read machine cycle in step by step
manner.
Step 1: (State T1)
 In T1 state, microprocessor places the address on the address lines from the
stack pointer, general purpose register pair or program counter and activates
ALE signal in order to latch low-order byte of address.

37

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 During T1, 8085 sends status signal: IO/M=0, S1=1, S0=0 for memory read
machine cycle.
Step 2: (State T2)
 In T2, 8085 sends RD signal low to enable the addressed memory location.
 The memory device then places the contents of addressed memory location of
the data bus (AD0-AD7).
Step 3: (State T3)
During T3, 8085 loads the data from the data bus into specified register (F, A, B, C, D,
E, H and L) and raises RD to high which disables the memory device.

ww
Memory write cycle:

w.E
asy
En
gin
ee rin
g.n
et

 The 8085 executes the memory write cycle to store the data into data
memory or stack memory.
 The length of this machine cycle is 3T-states(T1-T3)

38

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 In this machine cycle processor places the address on the address lines from
the stack pointer general purpose register pair and through the write process,
stores the data into the addressed memory location.
 The memory write timing diagram is similar to the memory read timing
diagram, except the instead of RD, WR signal goes low during T2 and T3.
 ̅ =0, S1=0, S0=1. The
The status signals for memory write cycle are: IO/𝑀
following section describes the memory write machine cycle in step by step
manner.
Step 1: (State T1)

ww  In T1-state, the 8085 places the address on the address lines from stack

w.E pointer or general purpose register pair and activates ALE signal in order to
latch low-order byte of address.

asy ̅ = 0, S1=0, S0=1 for memory write


 During T1, 8085 sends status signals: IO/𝑀
machine cycle.
Step 2: (State T2) En
gin
 In T2, 8085 places data on the data bus and sends WR signal low for writing

Step 3: (State T3)


ee
into the addressed memory location.

rin
g.n
 During T3, WR signal goes high, which disables the memory device and
terminates the write operation.

et
3. What are the different addressing modes in 8085 microprocessor? Explain
it with an example?
Addressing mode specifies the location of operand (data). Every instruction of
a program has to operate on a data. The method of specifying the data to be
operated by the instruction is called Addressing. The 8085 has the following 5
different types of addressing.
a. Immediate Addressing
b. Direct Addressing
c. Register Addressing

39

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

d. Register Indirect Addressing


e. Implied Addressing
a. Immediate Addressing:
In immediate addressing mode, the data is specified in the instruction itself.
The data will be a part of the program instruction. All instructions that have ‘I’ in
their mnemonics are of immediate addressing type.
Example: MVI A, 01H- Move the data 01H given in the instruction to A register.
b. Direct Addressing:
In direct addressing mode, the address of the data is specified in the

ww
instruction. The data will be in memory. In this addressing mode, the program

w.E
instructions and data can be stored indifferent memory blocks. This type of
addressing can be identified by 16-bit address present in the instruction.

asy
Example:LDA 4500H- Load the data available in memory location 4500H in A
register.
c. Register Addressing: En
gin
In register addressing mode, the instruction specifies the name of the register

names in the instruction.


ee
in which the data is available. This type of addressing can be identified by register

rin
Example: MOV A, B -Move the content of B register to A register.
d. Register Indirect Addressing: g.n
et
In register indirect addressing mode, the instruction specifies the name of the
register in which the address of the data is available. The data will be in memory
and the address will be in the register pair. This type of addressing can be identified
by letter ‘M’ present in the instruction.
Example: MOV A, M - The content of memory (data) addressed by HL pair is moved
to A register.

40

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

e. Implied Addressing:
In implied addressing mode, the instruction itself specifies the type of operation and
location of data to be operated. This type of instruction does not have any address,
register name, immediate data specified along with it.
Example: CMA - Complement the content of accumulator

4. Explain the different types of instruction in 8085.


An instruction is a command given to the microprocessor to perform
specified operation on a given data. The instruction set of a microprocessor is the

ww
collection of instructions that the microprocessor is designed to execute. It is

w.E
classified into
i. Data Transfer Instructions.

asy
ii.
iii.
Arithmetic Instructions.
Logical Instructions.
iv. En
Branching / Control Transfer Instructions.
v. gin
Stack & I/O Machine Control Instructions.
i. Data transfer instructions:
ee rin
The data transfer instructions move the data between registers or between

g.n
registers and memory. It copies the data from source location to destination
location. No flags will be affected.
Move instruction:
 MOV Rd, Rs
et
 MOV M, Rs
 MOV Rd, M
This instruction copies the contents of the source register into the destination
register. The contents of the source register are not altered. If one of the operands is
a memory location, its location is specified by the contents of the HL registers.
Example: MOV B, C - This instruction move the content of C register to B register.

41

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

MOV B, M -This instruction move the content of memory location pointed


by HL register to B register.
Move immediate 8-bit:
MVI Rd, data
MVI M, data
The 8-bit data is stored in the destination register or memory. If the operand
is a memory location, its location is specified by the contents of the HL registers.
Example: MVI A, 01 - The data 01 will move to A register.
MVI M, 01 – The data 01 will move to the memory location pointed by HL

ww registers.

w.E
Load accumulator:
LDA 16-bit address

asy
The contents of a memory location, specified by a16-bit address in the
operand, are copied to the accumulator. The contents of the source are not altered.
En
This is a 3-byte instruction, the second byte specifies the low-order address and the

gin
third byte specifies the high-order address.

Store accumulator:
ee
Example: LDA 4000 –The content of memory location 4000 is loaded into A register.

rin
STA 16-bit address
g.n
The contents of the accumulator are copied into the memory location

et
specified by the operand. This is a 3-byte instruction, the second byte specifies the
low-order address and the third byte specifies the high-order address.
Example: STA 4500–The content of A register is loaded into memory location 4500.
Exchange:
XCHG
The contents of register H are exchanged with the contents of register D, and
the contents of register L are exchanged with the contents of register E.
Example: XCHG: This instruction exchange the content of H and L with D and E

42

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ii. Arithmetic instructions:


The arithmetic instructions include addition, subtraction, increment and
decrement operations.
Addition:
ADD REGISTER OR MEMORY TO ACCUMULATOR
ADD Rs
ADD M
The contents of the operand (register or memory) are added to the contents
of the accumulator and the result is stored in the accumulator. If the operand is a

ww
memory location, its locations specified by the contents of the HL registers. All flags

w.E
are modified to reflect the result of the addition.
Example: ADD B – The content of A register is added with the content of B register

asy
and the result is stored in A register.
ADD M -The content of A register is added with the content of memory
En
Location pointed by HL register and the result is stored in A register.

gin
Add register to accumulator with carry:
ADC R
ADC M
ee rin
g.n
The contents of the operand (register or memory) and the Carry flag are
added to the contents of the accumulator and the result is stored in the accumulator.

et
If the operand is a memory location, its location is specified by the contents of the
HLregisters. All flags are modified to reflect the result of the addition.
Example: ADC B -The content of A register is added with the content of B register
and also Carry and the result is stored in A register.
ADD IMMEDIATE TO ACCUMULATOR
ADI 8-bit data
The 8-bit data (operand) is added to the contents of the accumulator and the result
is stored in the accumulator. All flags are modified to reflect the result of the
addition.

43

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Example: ADI 45 – The data 45H is immediately added with the content of A register
and result Is stored in A register.
Subtraction:
SUBTRACT REGISTER OR MEMORY FROM ACCUMULATOR
SUBRs
SUB M
The contents of the operand (register or memory) are subtracted from the contents
of the accumulator and the result is stored in the accumulator. If the operand is a
memory location, its locations specified by the contents of the HL registers. All flags

ww
are modified to reflect the result of the subtraction.

w.E
Example: SUB B – The content of A register is subtracted with the content of B
register and the result is stored in A register. SUB M -The content of A register is

asy
subtracted with the content of memory location pointed by HL register and the
result is stored in A register.
En
SUBTRACT SOURCE AND BORROW FROM ACCUMULATOR:
SBB R gin
SBB M
ee rin
The contents of the operand (register or memory) and the Borrow flag are

g.n
subtracted from the contents of the accumulator and the result is placed in the
accumulator. If the operand is a memory location, its location is specified by the
contents of the HL registers.
All flags are modified to reflect the result in accumulator.
et
Example: SBB B - The content of A register is subtracted with the content of B
register and also Borrow flag and the result is stored in A register. SBB M- The
content of A register is subtracted with the content of memory location pointed by
HL register and also Borrow and the result is stored in A register.
Subtract immediate from accumulator:
SUI 8-bit data

44

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

The 8-bit data (operand) is subtracted from the contents of the accumulator and the
result is stored in the accumulator. All flags are modified to reflect the result of the
subtraction.
Example: SUI 45 -The data 45H is immediately subtracted with the content of A
register and Result is stored in A register.
Increment register or memory
INR R
INR M
The content of the designated (register or memory) are incremented by 1 and the

ww
result is stored in the same place. If the operand is a memory location, its location is

w.E
specified by the contents of the HL registers.
Example: INR B – The content of B register is incremented by 1. INR M – The content

asy
of memory location pointed by HL register is incremented by 1.
INCREMENT REGISTER PAIR:
INX R En
gin
The contents of the designated register pair are incremented by1 and the result is
stored in the same place.
ee rin
Example: INX H – The HL register pair is incremented by 1 and showing the next
memory location.
Decrement register or memory g.n
DCR R
DCR M
et
The contents of the designated (register or memory) are decremented by 1 and the
result is stored in the same place. If the operand is a memory location, its location is
specified by the contents of the HL registers.
Example: DCR B – The content of B register is decremented by 1.
DCR M –The content of memory location pointed by HL register is
decremented by 1.

45

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Decrement register pair:


DCX R
The contents of the designated register pair are decremented by1 and the result is
stored in the same place.
Example: DCX H – The HL register pair is decremented by 1 and showing the
previous Memory location.
iii. Logicalinstructions:
The logical instructions includes AND, OR, XOR, Complement operations.
Logical AND:

ww
Logical AND register or memory with accumulator

w.E ANA R
ANA M

asy
The contents of the accumulator are logically AND with the contents of the operand
(register or memory), and the result is placed in the accumulator. If the operand is a
En
memory location, its address is specified by the contents of HL registers, Z, P are

gin
modified to reflect the result of the operation. CY is reset. AC is set.

ee
Example: ANA B - The content of A register is AND with the content of B register and

rin
the result is stored in A register. ANA M - The content of A register is AND with the

g.n
content of memory location pointed by HL register and the result is stored A
register.
Logical and immediate with accumulator
ANI 8-bit data
et
The contents of the accumulator are logically AND with the 8-bit data (operand) and
the result is placed in the accumulator. S, Z, P are modified to reflect the result of the
operation. CY is reset. AC is set.
Example: ANI 45 -The data 45H is immediately ANDed with the content of A register
and result is stored in A register.

46

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Exclusive or register or memory with accumulator


XRA R
XRA M
The contents of the accumulator are Exclusive OR with the contents of the operand
(register or memory), and the result is placed in the accumulator. If the operand is a
memory location, its address is specified by the contents of HL registers.S, Z, P are
modified to reflect the result of the operation. CY and AC are reset.
Example: XRA B -The content of A register is XOR with the content of B register and
the result is stored in A register. XRA M -The content of A register is XOR with the

ww
content of memory location pointed by HL register and the result is stored A

w.E
register.
Exclusive or immediate with accumulator

asy
XRI 8-bit data
The contents of the accumulator are Exclusive OR with the8-bit data (operand) and
En
the result is placed in the accumulator.S, Z, P are modified to reflect the result of the

gin
operation. CY and AC are reset.

ee
Example: XRI 45 -The data 45H is immediately XOR with the content of A register
and result is stored in A register.
rin
LOGICAL OR REGISTER OR MEMORY WITH ACCUMULATOR
ORA R g.n
ORA M et
The contents of the accumulator are logically OR with the contents of the operand
(register/memory), and the Result is placed in the accumulator. If the operand is a
memory location, its address is specified by the contents of HL registers.S, Z, P are
modified to reflect the result of the operation. CY and AC are reset.
Example: ORA B -The content of A register is OR with the content of B register and
the result is stored in A register. ORA M- The content of A register is OR with the
content of memory location pointed by HL register and the result is stored A
register.

47

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Logical or immediate with accumulator:


ORI 8-bit data
The contents of the accumulator are logically OR with the8-bit data (operand) and
the result is placed in the accumulator. S, Z, P are modified to reflect the result of the
operation. CY and AC are reset.
Example: ORI 45 - The data 45H is immediately OR with the content of A register
and result is stored in A register.
Complement accumulator:
CMA

ww
The contents of the accumulator are complemented. No flags are affected.

w.E
iv. Branching (control transfer)instructions :
The branching instructions are used to change the execution order. They are divided

asy
into conditional jump/call or unconditional jump/call.
JUMP UNCONDITIONALLY
En
JMP 16-bit address

gin
The program sequence is transferred to the memory location specified by the 16-bit
address given in the operand.
Example: JMP 4000
ee rin
JUMP CONDITIONALLY
g.n
The program sequence is transferred to the memory location specified by the 16- bit
address given in the operand based on the specified flag of the PSW.
Example:
et
OPCODE DESCRIPTION FLAG STATUS

JC Jump on Carry CY = 1

JNC Jump on no Carry CY = 0

48

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

JP Jump on Positive S=0

JM Jump on Minus S=1

JZ Jump on Zero Z =1

JNZ Jump on no Zero Z=0

JPE Jump on parity even P = 1

JPO Jump on parity odd P=0

ww
w.E
Unconditional subroutine call :
CALL 16-bit address

asy
The program sequence is transferred to the memory location specified by the 16-bit
address given in the operand. Before the transfer, the address of the next
En
instruction after CALL the contents of the program counter is pushed onto the stack.
Example: CALL 4000 gin
CONDITIONAL SUBROUTINECALL:
ee rin
The program sequence is transferred to the memory location specified by the 16-bit

g.n
address given in the operand based on specified flag of the PSW. Before the
transfer, the address of the next instruction after the call the contents of the
program counter is pushed onto the stack.
Unconditional return from subroutine:
et
RET
The program sequence is transferred from the subroutine to the calling program.
The two bytes from the top of the stack are copied into the program counter, and
program execution begins at the new address.
Example: RET
CONDITIONAL RETURN FROM SUBROUTINE:

49

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

The program sequence is transferred from the subroutine to the calling program
based on the specified flag of the PSW. The two bytes from the top of the stack are
copied into the program counter, and program execution
begins at the new address.
Example: RZ

OPCODE DESCRIPTION FLAG STATUS

ww RC Return on Carry CY = 1

w.E RNC Return on no Carry CY = 0

RP
asy Return on Positive S=0

RM
En Return on Minus S=1

RZ
gin
Return on Zero Z =1

RNZ

RPE
ee
Return on no Zero

Return on parity even P = 1


Z=0

rin
RPO Return on parity odd P=0 g.n
v. Stack i/o,machine control instructions:
et
These instructions are used to manipulate the stack to perform the input /output
and to alter the internal control flags. Unless specified the flags are not affected.
Stack instruction:
PUSH :
Example: PUSH PSW
The contents of register A and the contents of condition flags which form the PSW
are pushed onto the stack.

50

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Pop instruction:
Example: POP PSW The contents of register A and the contents of condition flags
which form the PSW are restored from the stack.
I/O instruction :
IN port
The data placed on the 8 bit bidirectional data bus by the specified port is moved to
register A.
OUT port
The contents of register A are placed on the 8 bit data bus is transferred to the

ww
specified port.

w.E
Machine control instruction:
EI

asy
The interrupt system is enabled.
DI
En
The interrupt system is disabled.
NOP gin
No Operation is performed.
No flags are affected.
ee rin
HLT
The processor is stopped. g.n
No flags are affected. et
5. Explain with block diagram the architecture of 8051 microcontroller.
a. Memory Organization
 Program Memory
 Data Memory
b. Program Status Word
 The Program Status Word (PSW) contains several status bits that
reflect the current state of the CPU.

51

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 It contains the Carry bit, the Auxiliary Carry (for BCD operations), the
two register bank select bits, the Overflow flag, a parity bit, and two
user-definable status flags.
c. Interrupt Structure
The 8051 provides 4 interrupt sources
Two external interrupts
Two timer interrupts
d. Port Structures
 The 8051 contains four I/O ports

ww All four ports are bidirectional

w.E
 Each port has SFR (Special Function Registers P0 through P3) which works
like a latch, an output driver and an input buffer

asy
 Both output driver and input buffer of Port 0 and output driver of Port 2 are

En
used for accessing external memory
 Accessing external memory works like this
gin
Port 0 outputs the low byte of external memory address (which is time-

ee
multiplexed with the byte being written or read)

rin
Port 2 outputs the high byte (only needed when the address is 16 bits
wide)
g.n
Port 3 pins are multifunctional. The alternate functions are activated
with the 1 written in the corresponding bit in the port SFR. et

52

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et
e. Timer/Counters
 The 8051 has two 16-bit Timer/Counter registers
 Timer 0
 Timer 1
 Both can work either as timers or event counters

53

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 Both have four different operating modes from which to select.


 Mode 0 (13-bit Timer)
 Mode 1 (16-bit Timer)
 Mode 2 (8-bit Timer with Auto-Reload)
 Mode 3 (Two 8-bit Timers)
6. Explain the interrupt structure of 8051 microcontroller.
 8051 provides 4 interrupt sources
o 2 external interrupts
o 2 timer interrupts

ww They are controlled via two SFRs, IE and IP

w.E
 Each interrupt source can be individually enabled or disabled by setting or
clearing a bit in IE (Interrupt Enable). IE also exists a global disable bit, which

asy
can be cleared to disable all interrupts at once.

En
 Each interrupt source can also be individually set to one of two priority levels
by setting or clearing a bit in IP (Interrupt Priority)
gin
 A low-priority interrupt can be interrupted by high-priority interrupt, but not
by another low-priority one
ee rin
 A high-priority interrupt can’t be interrupted by any other interrupt source

g.n
 If interrupt requests of the same priority level are received simultaneously, an
internal polling sequence determines which request is serviced, so within
each priority lever there is a second priority structure
External Interrupts
et
 External interrupts ~INT0 and ~INT1 have two ways of activation
o Level-activated
o Transition-activated
Timer 0 and Timer 1 Interrupts
 Timer interrupts are generated by TF0 and TF1 flags in their respective
Timer/Counter registers.

54

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

UNIT – III

PROGRAMMABLE PERIPHERAL INTERFACE

PART – A

1. What is key debouncing?


When a key press is found, the microprocessor waits for at least 10ms before
it accepts the key as input. It is called key debouncing.
2. Name any two types of ADCs.

ww  Single Ramp or Single Slope


 Dual slope

w.E  Successive approximation


 Flash

asy
3. What is the bit set Reset mode of 8255 PPI?

En
The individual bits of port C can be set or reset by sending out a single

gin
OUTPUT instruction to the control register. When port C is used for
control/status operation, this feature can be used to set or reset individual
bits. ee rin
4. What are the applications of D/A converter interfacing with 8255?
 Temperature control
g.n
 Air conditioning control
 Washing machine control
et
 Traffic light control
5. What is keyboard interfacing?
A keyboard consists of number of key switches used for entering data, event
etc., using this keyboard, the input data is applied to the microprocessor is
known as keyboard interfacing.

55

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

6. State the purpose and importance of NOP instructions.


NOP: Perform NO Operation
 This instruction simply used up three clock cycles and
increments the instructions.
 Pointer to pointer to the next instruction.
 It can also be used to hold a place In a program for instruction
that will be added later.
7. Define PPI.
8255 is widely used, programmable, parallel I/O device. It can be

wwprogrammed to transfer data under various conditions from simple I/O to

w.E
interrupt I/O.
8. Name any two types of ADC.

asy
 Successive approximation ADC

En
 Dual slope ADC
 Flash type ADC
gin
9. Name the modes available in 8255 A Control Word Format.
 BSR Mode
 I/O Mode
ee rin
o Mode 0: Simple I/O Mode.
o Mode 1: I/O with Handshaking Mode.
g.n
o Mode 2: Bidirectional data transfer mode.
10. Show the control word format of 8255 in BSR mode.
et

56

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PART - B

1. Draw the functional block diagram of 8255 ppi and explain each block.

ww
w.E
asy
En
It has a 40 pins of 4 groups. gin
1. Data bus buffer ee rin
2. Read Write control logic
g.n
3. Group A and Group B controls

4. Port A, B and C
et
Data bus buffer:

This is a tri state bidirectional buffer used to interface the 8255 to system data bus.
Data is transmitted or received by the buffer on execution of input or output
instruction by the CPU.

• Control word and status information are also transferred through this unit.

57

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Read/Write control logic

This unit accepts control signals ( RD, WR ) and also inputs from address bus and
issues commands to individual group of control blocks

( Group A, Group B).It has the following pins.

a) CS – Chip select : A low on this PIN enables the communication between CPU and
8255.

b) RD (Read) – A low on this pin enables the CPU to read the data in the ports or the

ww
status word through data bus buffer.

w.E
c) WR (Write ) : A low on this pin, the CPU can write data on to the ports or on to the
control register through

the data bus buffer. asy


En
d) RESET: A high on this pin clears the control register and all ports are set to the
input mode gin
ee
e) A0 and A1 (Address pins): These pins in conjunction with RD and WR pins
control the selection of one of the rin
3 ports. g.n
Group A and Group B controls et
These block receive control from the CPU and issues commands to their respective
ports.

Group A - PA and PCU ( PC7 –PC4)

Group B - PCL ( PC3 – PC0)

• Control word register can only be written into no read operation of the CW
register is allowed.

58

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

PORTS

a) Port A: This has an 8 bit latched/buffered O/P and 8bit input latch. It can be
programmed in 3 modes – mode 0,

mode 1, mode 2.

b) Port B: This has an 8 bit latched / buffered O/P and 8 bit input latch. It can be
programmed in mode 0, mode1.

c) Port C : This has an 8 bit latched input buffer and 8 bit out put latched/buffer.

ww
This port can be divided into two 4

w.E
bit ports and can be used as control signals for port A and port B. it can be
programmed in mode 0.

asy
Modes of Operation of 8255

En
These are two basic modes of operation of 8255. I/O mode and Bit Set-Reset mode
(BSR). gin
ee
• In I/O mode, the 8255 ports work as programmable I/O ports, while in BSR mode

rin
only port C (PC0-PC7) can be used to set or reset its individual port bits.

g.n
• Under the I/O mode of operation, further there are three modes of operation of

et
8255, so as to support different types of applications, mode 0, mode 1 and mode 2.

BSR Mode: In this mode any of the 8-bits of port C can be set or reset depending on
D0 of the control word.

2. Explain with a neat diagram the stepper motor control using 8051
microcontroller.
Stepper Motor Control using 8051 Microcontroller Circuit Design: The
complete board consists of transformer, control circuit, keypad and stepper motor
as shown in snap. The given figure shows the block diagram of project.

59

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

The circuit has inbuilt 5 V power supply so when it is connected with transformer it
will give the supply to circuit and motor both. The 8 Key keypad is connected with

ww
circuit through which user can give the command to control stepper motor. The
control circuit includes micro controller 89C51, indicating LEDs, and current driver
w.E
chip ULN2003A. One can program the controller to control the operation of stepper

asy
motor. He can give different commands through keypad like, run clockwise, run
anticlockwise, increase/decrease RPM, increase/decrease revolutions, stop motor,

En
change the mode, etc. before we start with project it is must that we first understood

gin
the operation of unipolar stepper motor.
Unipolar stepper motor:-
ee rin
In the construction of unipolar stepper motor there are four coils. One end of each
coil is tide together and it gives common terminal which is always connected with
g.n
positive terminal of supply. The other ends of each coil are given for interface.

et
Specific color code may also be given. Like in my motor orange is first coil (L1),
brown is second (L2), yellow is third (L3), black is fourth (L4) and red for common
terminal.
By means of controlling a stepper motor operation we can
1. Increase or decrease the RPM (speed) of it

2. Increase or decrease number of revolutions of it

3. Change its direction means rotate it clockwise or anticlockwise

60

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

To vary the RPM of motor we have to vary the PRF (Pulse Repetition Frequency).
Number of applied pulses will vary number of rotations and last to change direction
we have to change pulse sequence.
So all these three things just depends on applied pulses. Now there are three
different modes to rotate this motor
1. Single coil excitation

2. Double coil excitation

3. Half step excitation

ww
The table given below will give you the complete idea that how to give pulses in

w.E
each mode

asy
En
gin
ee rin
g.n
et
Stepper motor has 6 pins. In these six pins, 2 pins are connected to the supply of 12V
and the remaining are connected to the output of the stepper motor. Stepper rotates
at a given step angle. Each step in rotation is a fraction of full cycle. This depends on
the mechanical parts and the driving method.
Similar to all the motors, stepper motors will have stator and rotor. Rotor has
permanent magnet and stator has coil. The basic stepper motor has 4 coils with 90
degrees rotation step. These four coils are activated in the cyclic order. The below

61

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

figure shows you the direction of rotation of the shaft. There are different methods
to drive a stepper motor. Some of these are explained below.

Pulses for stepper motor module


Note:- In half step excitation mode motor will rotate at half the specified given step
resolution. Means if step resolution is 1.8 degree then in this mode it will be 0.9
degree. Step resolution means on receiving on 1 pulse motor will rotate that much
degree. If step resolution is 1.8 degree then it will take 200 pulses for motor to
compete 1 revolution (360 degree).

ww
Now let me give you the specification of the stepper motor that I have used.
Max rated voltage: - 5 V Max rated current per coil: – 0.5 Amp Step resolution: - 1.8

w.E
degree / pulse Max RPM: - 20 in single/double coil excitation mode and 60 in half
step mode Torque: – 1.5 Kg/cm2
RPM calculation:- asy
En
One can calculate the exact RPM at which motor will run. We know that motor needs

gin
200 pulses to complete 1 revolution. Means if 200 pulses applied in 1 second motor
will complete 1 revolution in 1 second. Now 1 rev. in 1 sec means 60 rev. in 1
ee
minute. That will give us 60 RPM. Now 200 pulses in 1 sec means the PRF is 200 Hz.
And delay will be 5 millisecond (ms). Now lets see it reverse. rin
g.n
* If delay is 10 ms then PRF will be 100 Hz. * So 100 pulses will be given in 1 sec *
Motor will complete 1 revolution in 2 second * So the RPM will be 30.
et
In same manner as you change delay the PRF will be changed and it will change RPM
Full Step Drive: In this method two coils are energized at a time. Thus, here two
opposite coils are excited at a time.
Half Step Drive: In this method coils are energized alternatively. Thus it rotates
with half step angle. In this method, two coils can be energized at a time or single
coil can be energized. Thus it increases the number of rotations per cycle. It is
shown in the below figure.

62

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

3. Explain in detail about the traffic light controller using 8086.

Traffic light controller interface module is designed to simulate the function


of four way traffic light controller. Combinations of red, amber and green LED’s are
provided to indicate Halt, Wait and Go signals for vehicles. Combination of red and
green LED’s are provided for pedestrian crossing. 36 LED’s are arranged in the form
of an intersection. A typical junction is represented on the PCB with comprehensive
legend printing.

At the left corner of each road, a group of five LED’s (red, amber and 3 green)

ww
are arranged in the form of a T-section to control the traffic of that road. Each road
is named North (N), South(S), East (E) and West (W). LED’s L1, L10, L19 & L28
w.E
(Red) are for the stop signal for the vehicles on the road N, S, W, & E respectively. L2,

asy
L11, L20 & L29 (Amber) indicates wait state for vehicles on the road N, S, W, & E
respectively. L3, L4 & L5 (Green) are for left, strait and right turn for the vehicles on

En
road S. similarly L12-L13-L14, L23-L22-L21 & L32-L31-L30 simulates same

gin
function for the roads E, N, W respectively. A total of 16 LED’s (2 Red & 2 Green at

ee
each road) are provided for pedestrian crossing.

rin
L7-L9.L16-L18, L25-L27 & L34-L36 (Green) when on allows pedestrians to
cross and L6-L8, L15-L17, L24-L26 & L33-L35 (Red) when on alarms the
g.n
et
pedestrians to wait. To minimize the hardware pedestrian’s indicator LED’s (both
red and green are connected to same port lines (PC4 to PC7) with red inverted. Red
LED’s L10 & L28 are connected to port lines PC2 & PC3 while L1 & L19 are
connected to lines PC0 & PC1 after inversion. All other LED’s (amber and green) are
connected to port A & B.

Working:- 8255 is interfaced with 8086 in I/O mapped I/O and all ports are output
ports. The basic operation of the interface is explained with the help of the enclosed
program. The enclosed program assumes no entry of vehicles from North to West,
from road East to South. At the beginning of the program all red LED’s are switch
ON, and all other LED‘s are switched OFF. Amber LED is switched ON before
63

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

switching over to proceed state from Halt state. The sequence of traffic followed in
the program is given below.

a) From road north to East From road east to north From road south to west From
road west to south From road west to north

b) From road north to East From road south to west From road south to north From
road south to east

c) From road north to south From road south to north Pedestrian crossing at roads

ww
west & east

d) From road east to west From road west to east Pedestrian crossing at roads
w.E
north & south

asy
En
gin
ee rin
g.n
et
4. Explain in detail with relevant diagrams the led display interfacing.

Seven segment LED display is very popular and it can display digits from 0 to
9 and quite a few characters like A, b, C, ., H, E, e, F, n, o,t,u,y, etc. Knowledge about
how to interface a seven segment display to a micro controller is very essential in
designing embedded systems. A seven segment display consists of seven LEDs
arranged in the form of a squarish ‘8’ slightly inclined to the right and a single LED

64

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

as the dot character. Different characters can be displayed by selectively glowing the
required LED segments.

Seven segment displays are of two types, common cathode and common
anode. In common cathode type , the cathode of all LEDs are tied together to a single
terminal which is usually labeled as ‘com‘ and the anode of all LEDs are left alone as
individual pins labeled as a, b, c, d, e, f, g & h (or dot) . In common anode type, the
anode of all LEDs are tied together as a single terminal and cathodes are left alone as
individual pins. The pin out scheme and picture of a typical 7 segment LED display is

ww
shown in the image below.

The circuit diagram shown below is of an AT89S51 microcontroller based 0 to 9


w.E
counter which has a 7 segment LED display interfaced to it in order to display the

asy
count. This simple circuit illustrates two things. How to setup simple 0 to 9 up
counter using 8051 and more importantly how to interface a seven segment LED

En
display to 8051 in order to display a particular result. The common cathode seven

gin
segment display D1 is connected to the Port 1 of the microcontroller (AT89S51) as

ee
shown in the circuit diagram. R3 to R10 are current limiting resistors. S3 is the reset

rin
switch and R2,C3 forms a debouncing circuitry. C1, C2 and X1 are related to the
clock circuit. The software part of the project has to do the following tasks.
g.n

 Convert the current count into digit drive pattern.


et
Form a 0 to 9 counter with a predetermined delay (around 1/2 second here).

 Put the current digit drive pattern into a port for displaying.

65

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
The circuit diagram shown above is of an AT89S51 microcontroller based 0 to 9

En
counter which has a 7 segment LED display interfaced to it in order to display the

gin
count. This simple circuit illustrates two things. How to setup simple 0 to 9 up
counter using 8051 and more importantly how to interface a seven segment LED
ee
display to 8051 in order to display a particular result. The common cathode seven
rin
segment display D1 is connected to the Port 1 of the microcontroller (AT89S51) as

g.n
shown in the circuit diagram. R3 to R10 are current limiting resistors. S3 is the reset

et
switch and R2,C3 forms a debouncing circuitry. C1, C2 and X1 are related to the
clock circuit. The software part of the project has to do the following tasks.

 Form a 0 to 9 counter with a predetermined delay (around 1/2 second here).


 Convert the current count into digit drive pattern.
 Put the current digit drive pattern into a port for displaying.
Digit drive pattern.
Digit drive pattern of a seven segment LED display is simply the different
logic combinations of its terminals ‘a’ to ‘h‘ in order to display different digits and

66

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

characters. The common digit drive patterns (0 to 9) of a seven segment display are
shown in the table below.

Digit a B C d e f G

0 1 1 1 1 1 1 0

1 0 1 1 0 0 0 0

ww
2 1 1 0 1 1 0 1

w.E
3 1
asy
1 1 1 0 0 1

4 0 1 En 1 0 0 1 1

gin
5 1 0
ee1 1 0

rin
1 1

6 1 0 1 1 1
g.n 1 1

7 1 1 1 0 0 et0 0

8 1 1 1 1 1 1 1

9 1 1 1 1 0 1 1

67

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

UNIT – IV
PROGRAMMING LOGIC CONTROLLERS
PART – A

1. Define a programmable logic controller.


 A programmable logic controller (PLC) is a microprocessor based
controller that uses
 Programmable memory to store instructions and to implement
functions such as logic, sequencing, timing, Counting and arithmetic in
order to control machines and process
ww
2. What are the main component parts of a PLC?

w.E  Central processing unit (CPU)


 The input/output unit

asy
 The programming device
 Memory unit.
En
gin
3. List various types of PLC programming devices.
 Use of hand held programmer

ee
 Terminal with video display unit
 A personal computer with appropriate software. rin
 List down the types of buses required in a PLC.
g.n
 Data buses for communications data between elements.
et
 The address buses to read the address of locations for accessing stored
data.
 Control buses for internal control actions.
4. What is ALU? State its function.
The ALU is responsible for data manipulation and performs arithmetic and
logical operations such as addition and subtraction. In addition, the ALU
contains a number of control inputs, which specify the data manipulation
function to be performed. ALU is combinational logic circuit, whose output is
an instantaneous function of its data and control inputs.
68

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

5. What is meant by program scan?


A PLC does control the machine by taking repeated snapshots of the input
state and reads to take the values, and energize or de-energize outputs
according to the user programme. This process is known as a program scans
6. What is meant by a “retentive timer”?
A retentive timer accumulates time as and when it receives the power and
time due to loss of power which will not be accounted for the timer coil
operation. Retentive on delay timer will hold its accumulated value when the
timer rung goes false and will continue timing where it left off when the timer

ww rung goes true again.

w.E
7. What are counters?
Counters allow a number of occurrences of input signals to count or record

asy
the number of times some event occurs. PLCs include some form of counting
element and are set to some preset number value. When this value of input
En
pulse has been received, it will operate its contact, the normally open contacts

gin
would be closed and a normally closed contact would be opened

 Down counters
ee
8. Write down various types of counters.

rin
 Up-counters
9. What are the types of memory? g.n
 Random Access Memory
 Read Only Memory (ROM)
et
10. List down the different types of timers.
 On delay timer
 Off delay timer
 Retentive timer
 Pulse delay

69

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

11. What is an ‘internal relay’ in a PLC?


Most PLCs have an area of memory allocated for internal storage that is
used to hold data, which behave like relays. Is can able to switch ON
and OFF. But this is for only internal purpose. This will not exist in the
real world.
12. Explain latching with ladder diagram.
A ladder latch circuit is used to hold an output energized, even when the input
INI lease. The output coil maintains its status until a different conditions
occurs which is used to reset the coil to OFF

ww 13. List down general application of PLCs for control.

w.E  Control of a process motor, vibrating machine.


 Control of a two pneumatic pistons.

14.
asy
 Detection, sorting and packaging unit.
What are the factors to be considered for selecting PLC?
En
 System definition

gin
 Choosing the input and output hardware

ee
 Analog Input /Output module
 Input and Output timing consideration
rin
g.n
PART - B

1. With the help of block diagram, explain the main components of a plc.
et
Definition of plc:

A programmable logic controller (PLC) Program is a specially designed digital


operating microprocessor-based controller that uses a programmable memory for
internal storage of instructing and for internal storage of instructing and for
implementing function such as logic, sequencing, timing, counting and arithmetic in
order to control machines and processes.

70

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Basic components of plc:

The PLC hardware system consists of the basic components are

 Processor
 Memory
 Power Supply
 Input I Output modules
 Programming device
 Monitor

Processor:

ww  It is the heart of PLC


 He processor processes the signals from input module and generates

w.Econtrolling signals for the system


 It also scans and solve the logic of the user program

asy
 It consists of ALU, microprocessor unit, memory unit and system power
supply

En
gin
ee rin
g.n
et

Memory:

 The memory unit contains the program stored in it


 The programs were written with control actions to be executed by the
microprocessor for the input given
71

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 RAM is a temporary storage device used to store ladder diagram and for
testing and evaluation
 Then it is stored in ROM where changes cannot done

Power Supply:

 The purpose of a power supply unit is to convert the main A.C voltage into a
low – level D.C voltage (5V).
 The D.C. voltage is supplied to the processor and the circuits in the input and
output interface modules.
 The power supply should be free from heavy loads, noises and voltage
fluctuations.

ww
Input / Output Modules:

w.E
 The Input module receives information from extended devices and sends to
processor and communicates the processed information to the external

asy
devices through output modules.
 The Input devices are mechanical switches, photo sensors, temperature

En
sensors, flow sensors, other type of sensors keypads etc.,
 The output devices may include solenoid valves, Relays, contactors, lights,
Horns, gin
automatic door etc., ee
 Heating elements, fans, Motor starter, signal Amplifiers. Conveyor belt, lift,

 I/O devices are also called peripheral devices. rin


Programming Device: g.n
et
 It is used to enter the required program into the memory of the CPU
 The program is developed in programming device and stored into memory
unit

Central Processing Unit:

 The CPU controls and processes all the operations within the PLC.
 It is supplied with a clock with a frequency of typically between 1 to 8 MHz.
 This frequency determines the operating speed of the PLC and provides the
timing and synchronization for all elements in the system.
 The information within the PLC is carried by means of digital signals.
 The processor is a microprocessor that executes a program to perform the
operations specified in a ladder diagram or a set of Boolean equations.
72

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 The CPU consists of the following units

ww
w.E
asy
Arithmetic and Logic Unit (ALU):

En
 This unit performs data manipulation and arithmetic and logical operations
on input I variable data and determines the proper state of the output
variables. gin
ee
 The arithmetic operation includes addition, subtraction etc., and logic
operations include AND, OR, AND, EXCLUSIVE - OR.
rin
Memory Unit:
g.n
 Memory termed registers located within the microprocessor and used to
store information involved in a program execution.
et
 These programs contain control actions to be executed by the microprocessor
for the given input. There are several memory elements in a PLC system.
 System Read-only Memory (ROM) gives permanent storage for the operating
system and fixed data wed by the CPU.
 RAM for the user to develop program and acts a temporary memory.
 In addition, temporary buffer stores for the I/O channels.

Control Unit:

 A control unit is used to control the timing of operations.

73

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 The processor functions under a permanent supervisory operating system


that directs the overall operations from data input and output to execution of
user programs.
 The controller can perform only one operation at a time. So, it scans each of
the inputs sequentially, evaluates the ladder diagram program, provide each
output(s), and then repeat the whole process.
 Hence, the timing control's necessary for a PLC system.

Memory Unit:

 The sequence of instructions to be executed, programs are stored in the


memory unit.

ww During entering and editing including Debugging, the program is stored in the
temporary storages called RAM (Random Access memory).

w.E
 Once the program is completely finished (free & from errors).
 It may be 'burned' into ROM

asy
 When the ROM is plugged into the PLC, the device is ready to be placed into
service in the industrial environment.

En
 For network programmed PLCs, the final PLCs program is downloaded into a
special reprogrammable
gin
 ROM (EPROM, PROM, and EEPROM) in the PLC.

Volatile Memory:
ee
 Memory may be either volatile type or Non-volatile type.

rin
g.n
 Volatile memory or temporary memory or Application memory is the user
memory, where the user can enter and edit the program.

et
 Volatile memory will lose all its programmed contents if operating power is
removed or lost.
 here for necessary to provide a battery backup power to all times.

Non Volatile Memory:

 Non-volatile memory or permanent memory or system memory is (used) a


system memory that stores the monitor a booting programs, lookup tables
etc.,
 This usually programmed and supplied by the manufacturer.
 This controls the operation of PLC.
 It does not lose its content during power failure.
 It does not require any battery.
74

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 The ROM memory offers the CPU to use only fixed amount of data.

The Different Types of ROMS are

 Mask programmed ROM


 PROM
 EPROM
 EEPROM

Mask Programmed ROM:

 It is a special type of ROM which is programmed during manufacturing.


 The programmed content stored by this type of ROM memory cannot be

ww altered.

w.E
PROM:

 PROM stands for programmable Read only memory.



asy
It is a special type of ROM usually programmed by manufacturer during
manufacturing.

En
 It has the disadvantage of requiring special programming device and once

gin
programmed Cannot be erased or altered.

EPROM:
ee
 EPROM stands for electrically programmable Read only Memory.
 Here, the user programs electrically. rin
g.n
 One can erase the program completely by shining UV light source or quartz
window in package.
et
 After the program chip is erased completely, program changes can be made.
 When the program developed in RAM, the manufacturers usually load it in
EPROM to make permanent storage.

EEPROM:

 EEPROM - Electrically Erasable programmable Read-only memory.


 Even though, it is a non-volatile memory, it offers some programming
flexibility as RAM.
 One can erase the program completely by electrical signals.
 Program changes can be made very easily with the use of a PC with EEPROM
software.
 It can be electrically programmable by the user.
75

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Buses:

 A set of parallel lines that provides communication between various devices


of a system is termed as a Bus.
 The bus system carries information and data’s to and from the CPU, Memory
and I/O units.
 The information is transmitted in binary form as 0 or 1
 Digital signals or electrical signals are flowing inside the bus.
 It might be tracks on a printed circuit board (PCB) or wires in a ribbon cable.
 The PLC system contains four buses.

ww They are namely Data Bus, Address Bus, Control bus and system bus.

w.E
Data Bus:

 The data bus contains 8, 16 or 32 parallel signal lines for sending data

asy
between the various devices of a system.
 An 8-bit microprocessor has an internal data bus which can handle 8-bit
numbers.
En
Address Bus:
gin

ee
The Address bus contains 16, 20, 24 or 32 parallel signal lines to carry the
Address of the memory locations for accessing stored data.
rin
 Every memory location is given a distinct unique address to locate easily and
accessed by the CPU either to read or write data.
g.n
Control Bus:
et
 The Control bus contains 4 to 10 parallel signal lines to carry the signals used
by the CPU that are related to internal Control actions. Typical control bus
signals are Memory read Memory write, I/O Read and I/O write.

I/O System Bus:

 The I/O system bus provide the communication between the I/O ports and
I/O units

76

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Input / Output Unit:

 The I/O units provide the interface between the system and the outside
world, allowing for connections to be made through I/O channels to input /
output devices.
 Programs are entered from a program panel through I/O unit.

2. Explain the input / output processing of plc.

 The sourcing and sinking are used to describe the way in which DC devices
are connected to PLC

Sourcing:

ww  If a switch is connected to the positive of the battery and current flows from

w.Epositive to negative, it is said to be the sourcing the current. So, the input
device receives current from the input module.
 For the PLC, input unit, hence input module is the source of the current. For
asy
the PLC output unit, output module is the source of current as it supplies
current to the output devices. Sourcing output units for interfacing with
solenoids. En
gin
ee rin

g.n
Here, the input device supplies current to the input module. For the PLC
et
input unit, hence the input module is the sink for the current. Sinking input
units are used for interfacing with electronic equipment.
 So, if a switch is connected to the negative of the battery and current flows
from positive to negative, by conventional current flow direction, it is said to
be the sinking for Current. For the PLC output unit, the current flows from
output device to the output module then the output module is the sink for
current.

77

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Steps involved in input / output processing:

The sequence followed by a PLC when carrying out a program can be as follows:

 Scan the inputs associated with one rung of the ladder program
 Solve the logic operation involving those inputs.
ww 

Set / Reset the outputs for that rung
Move on the next rung and repeat the operations 1, 2, 3
w.E
asy
En
gin
ee rin
g.n
The two methods of Input/ Output processing operations are
et
 Continuous updating
 Mass Input / Output copying

Continuous Updating:

The sequence followed thus in continuous updating is as follows:

 Fetch and decode the first program instruction


 Scan there relevant inputs
 Fetch and decode the second program instruction
 Scan the relevant inputs etc. For the remaining program instructions
78

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 Update outputs
 Report the entire sequence.

Mass Input / Output Copying:

The sequence followed in Mass I/O copying is thus:

 Scan all the inputs and copy into RAM


 Fetch and decode and execute all the program instructions in sequence
 Copy all the output instructions to RAM
 Update all outputs.
 Repeat the sequence

ww
3. Discuss how plc logic gate system can be formed with ladder diagram.

w.E
Instruction Code Mnemonics:

asy
En
gin
ee rin
g.n
et
AND Logic Function:

 AND logic circuit represents series circuit


 AND gate is composed with two inputs and one output.
 AND gate produce output when both the inputs are HIGH state.

79

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

INPUT(A) INPUT(B) OUTPUT

0 0 0

ww 0

1
1

0
0

0
w.E 1 1 1

asy
En
gin
ee rin
g.n
OR Logic Function:

 OR logic circuit represents the parallel circuit.


et
 OR Gate is composed of two or more inputs and one output.
 OR operation is like addition of binary numbers.
 OR gate produce output when any one input are HIGH state.

80

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

INPUT(A) INPUT(B) OUTPUT

0 0 0

0 1 1

1 0 1

1 1 1

ww
w.E
asy
NOT Logic Function:
En

 gin
NOT function is also known as Inverter.
NOT gate is composed of single input and a single output.

ee
The bubble, or circle, at the output is the standard symbol used to represent
inversion.
rin
 In NOT gate, there is an output, when there is no input and no output when
there is an input g.n
et

81

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

NAND Logic Function:

 NAND is a combination of AND and NOT gates.


 Arrangement shows AND gate is followed by NOT gate. Hence it is called NOT
AND gate.
 Both the inputs A and B have to be at LOW state to get the output at HIGH
state.
 NAND Gate is composed of two or more input with a single output.
 Any one input is in LOW state also output will be HIGH state

ww
w.E
asy
INPUT(A) INPUT(B) OUTPUT

0
En 0 1

0
gin 1 1

1
ee 0

1
1

0
rin
g.n
et

NOR Logic Function:

 NOR is a combination of OR and NOT gates.


82

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 Arrangement shows OR gate is followed by NOT gate. Hence it is called NOT


OR gate.
 Both the inputs A and B have to be at LOW state to get the output at HIGH
state.
 NOR Gate is composed of two or more input with a single output.
 Any one input is in HIGH state also output will be LOW state

ww
w.E
asy
INPUT(A) INPUT(B) OUTPUT

0
En 0 1

0
gin 1 0

1
ee 0

1
0

0
rin
g.n
et

Exclusive OR (XOR) Logic Function:

 When both the inputs are at LOW state the output will be at LOW state
 When both the inputs are at HIGH state the output will be at LOW state
83

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 When any one input is HIGH state the output will be at HIGH state

ww INPUT(A)

0
INPUT(B) OUTPUT

0 0
w.E 0 1 1

asy
1 0 1

1
En 1 0

gin
ee rin
g.n
et

84

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

4. Explain the following

(i) Timers
(ii) Internal relay
(iii) Counters
(iv) Latching

(i). Timer:

A timer is a special counter ladder function that allows the PLC to perform timing
operations based on a precise internal clock.

ww
Types of Timers:

w.E


Delay ON Timers or ON delay timers
Delay OFF Timers or OFF delay timers


Pulse Timers
Caed Timers asy


ON-OFF Cycle Timers
En
One Shot Timers

Delay ON Timers: gin


ee rin
 The term delay is used to indicate that this timer burns on, after waiting for a
fixed time delay period.

g.n
 When there is an input, the timer is energized and starts timing, after some
pre-set value, the timer contacts are closed to output.
 TON is used to denote ON-delay.
et

85

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Delay OFF Timers:

 OFF delay timers are maintained as ON for a fixed time of delay period before
turning off.
 TOF is used to denote OFF-delay.

ww
Pulse Timers:

w.E
 Pulse timer switches is another type of Timer which comes either ON or OFF
for a fixed period of time as a function of pulses.

asy
 TP is used to denote Pulse Timers.

En
gin
ee rin
g.n
Caed Timers: et
 Caing means more elements are linked together to form a system.
 The caing timers are linked together to give longer delay times which is
easily achieved than just one timer.

86

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ON – OFF Cycle Timer:

 Timers producing an output for some period and no output for some period
and an output for some period.
 The timer is designed to switch an output for T sec and off for another T
second
ww
w.E
asy
En
gin
ee rin
(ii). INTERNAL RELAY:

 g.n
An internal relay behaves like relays with their associated contacts, buy they

et
are not actual relays whose simulations are controlled by the PLC software.
 Internal relays can be very useful in the implementation of switching
sequences.
 They are often used when there are programs with multiple input conditions.
 They are also known as Auxiliary relays or markers.

87

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 In using an internal relays, it has to be activated on one rung of a program and


then its output used to operate switching contacts on another rung of a

program. \

(iii). COUNTERS:

ww Counters are used to count a specified number of contact operations.

w.E
asy
En
gin
Types of Counters:
ee rin


Up Counters
g.n
Down Counters

Up Counters: et
 Up counters count up from the zero to pre – set value
 The events are added until the pre – set value is reached
 When the counter reaches the set value, its contacts change state

Down Counters:

 Down counters count down from the pre – set value to zero
 The events are subtracted until the pre – set value is reached
 When the counter reaches the Zero value, its contacts change state

88

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

(iv). LATCHING:

 It is necessary to hold an output coil energized, even when the input ceases
 The term latch is used for the circuit used to carry out such an operation.
 Latch circuit is a self – maintaining circuit that maintains its output in an
energized state until the next input is updated

ww
w.E
5. Draw and explain the ladder diagram for the data handling system.

Data handling:
asy
En
The steps involved in data handling with a PLC system are

gin
 Moving data from one memory location to another
 Comparison of Magnitudes of data
 Arithmetic operations
 Data conversion
ee rin
Data Movement:
g.n
Instruction: MOV

Function: To copy a value from one address to another


et
Program:

LD X400

MOV

D1

D2

89

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 When there is an input to X400,


 The data moves from the designated source address to the designated
destination address.
 The data transfer might move a constant into a data register

ww
Data Comparison:

The data comparison instruction gets the PLC to compare two data values.
w.E
It compare a pre – set value (1) to the input value (2)

Instruction :
asy
< or LES
En
= or EQU
gin
> or GRT

< or LEQ
ee rin
≠ or <> or NEQ
g.n
> or GEQ
et
For data comparison the typical instruction will contain the data transfer
instruction to

compare the data from source address and designation address

90

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww It is required to sound an alarm if a sensor indicates a temperature above


90˚C and remain sounding until the temperature falls below 75˚C.

w.E


For this, the ladder diagram is shown above.
The input temperature data is inputted to the source address and the

 asy
destination address contains the set value.
When the temperature rises 90˚C or higher, the data value in the source

En
address becomes >the destination address value and there is an output to the

 gin
alarm which latches the input
When the temperature falls to 75˚C or lower, the data value in the source

ee
address becomes < the destination address value and there is an output to the

rin
relay which then opens the contacts and so switches the alarm off.

Data Arithmetic Operations:


g.n
 PLCs are offered with the ability to carry out the arithmetic operations such
as addition, subtraction, multiplication and division only.
 They cannot carry out exponential functions.
et
 Addition and subtraction operations are used to alter the value of data held
in data registers.
 Multiplications are used to multiply some input before adding to or
subtracting it from another.

Code Conversions:

 All the internal operations in the CPU of a PLC are carried out through binary
numbers.
 Most PLCs provide BCD-to-binary and binary-to-BCD conversion for use.
 When a decimal (input) signal is given, BCD conversion is used.
91

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 Similarly, when a decimal output is required, Decimal conversion is used.


 The data at the source address is in BCD and converted to binary and placed
at the destination address

7. Devise a system, using a plc that could be used with a conveyor belt which is
used to move an item to work station. The presence of the item at the work
station is detected by means of breaking a contact activated by a beam of light

ww
to a photo-sensor. There it stops for 100sec for an operation to be carried out
and then starts moving. The motor for the belt is started by a normally open

w.E
start switch and stopped by a normally closed switch.

asy
En
gin
ee rin
I1 – Photo sensor output g.n
I2 – Start button for motor for the belt et
I3 – Stop button

M1,M2 – Memory coil

T1 – Timer for 100 sec

92

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

UNIT – V

ACTUATORS AND MECHATRONIC SYSTEM DESIGN

PART – A

1. Compare and the contrast the traditional design of a watch with that of a
mechatronics based digital watch.
S.No Traditional Design Mechatronics Design

ww1. It is based on traditional


systems such as
It is based on Mechanical,
Electronics, Computer

w.E mechanical, hydraulic and


pneumatic systems.
technology and control
engineering.

2.
asy
It is less flexible. It is more Flexible.
En
3. It is less accurate. gin It is more accurate.

ee rin
2. Write down the applications of stepper motors.
g.n
 Floppy disc head drives
 Printer carriage drives et
 Positioning of printer heads and pens in X-Y plotters
 NC and CNC machine tool slide drives
 Automatic teller machines(ATM)
 Camera iris control mechanisms
 Recording heads in computer disc drives
 Paper feed motors in typewriters and printers.

93

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

3. What is servo motor?


A servomotor is a rotary actuator that allows for precise control of angular position.
It consists of a motor coupled to a sensor for position feedback, through a reduction
gearbox.
4. Write down the applications of Servo motor.
 A servomotor is a rotary actuator or linear actuator that allows for precise
control of angular or linear position, velocity and acceleration.
 Servomotors are used in applications such as robotics, CNC machinery or
automated manufacturing.

ww
5. What are the axes of a pick and place robot?

w.E
 The robot has three axes about which motion can occur.
 Rotation in a clockwise or counter clockwise direction of the unit on its base.

asy
 Arm extension or contraction and arm up or down.

En
 Gripper can open or close.
6. What is the use of PLC in automatic car park system?
gin
An illustration of the use of a PLC in the coin operated barriers for a car park. The in-

ee
barrier is to open when the correct money is inserted in the collection box and the

rin
out – barrier is to open when a car is detected at the car park side of the barrier.

7. What are the advantages of the microprocessor controlled system? g.n


et
The microprocessor controlled system can cope easily with giving precision and
programmed control. The system is much more flexible. This improvement in
flexibility is a common characteristic of Mechatronics systems when compared with
traditional systems.

8. Write about the engine speed sensor?


The engine speed sensor is an inductive sensor and consists of a coil for which the
inductance changes as the teeth of the sensor wheel pass it and so results in an
oscillating voltage.

94

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

9. What are the number of stages in the design process?


The design process can be considered as a number of stages.

They are,

 The need
 Analysis of the problem
 Preparation of a specification
 Generation of possible solutions
 Selections of a suitable solution

ww  Production of a detailed design

w.E  Production of working drawings.

10.
asy
How do the movements of robot take place?

En
Clockwise rotation of the unit might result from the piston in a cylinder being
extended and the counter clockwise direction by its retraction. Likewise the upward

gin
movement of the arm might result from the piston in a linear cylinder being

ee
extended and the downward motion from it retracting, the extension of the arm by

rin
the piston in another cylinder extending and its return movement by the piston
retracting.
g.n
1. Case study on pick and place robot.
PART – B
et
The basic from of a pick and place robot is shown in Figure. The robot has
three axes about which motion can occur. The following movements are required
for this robot.

1. Clock wise and anticlockwise rotation of the robot unit of its base.
2. Linear movement of the arm horizontally i.e., extension or contraction of
arm.
3. Up and down movement of the arm and
95

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

4. Open and close movement of the gripper.

ww
w.E
asy
The foresaid movements can be obtained by pneumatic cylinders which are

En
operated by solenoid valves with limit switches. Limit switches are used to indicate
when a motion is completed.
gin
ee
The clockwise rotation of the robot unit on its base can be obtained from a

rin
piston and cylinder arrangement during pistons forward movement. Similarly

g.n
counter clockwise rotation can be obtained during backward movement of the
piston in cylinder. Linear movement of the arm can result during forward and
backward movement of the piston in a cylinder. et
The upward movement of the arm can result from forward movement of the
piston in a cylinder whereas downward movement from its retardation. The griper
can also be operated in a similar way as explained above i.e., gripper is opened
during forward movement of the piston and closed during backward movement of
the piston in the cylinder. Figure 5.16 shows a mechanism used for this purpose.

96

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et
A microcontroller used to control the solenoid valves of various cylinders is
shown in Figure. The micro controller used of this purpose is M68HC11 type. A
software program is used to control the robot.

TRIAC optoisolator consists of LED and TRIAC. If the input of the LED is 1, it
glows and activates the TRIAC to conduct the current to the solenoid valve.
Otherwise TRIAC will not conduct the current to the solenoid valve.

97

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

2. Case study on engine management system

An electronic engine management system is made up of sensors, actuators,


and related wiring that is tied into a central processor called microprocessor or
microcomputer (a smaller version of a computer)

Electronic management systems monitor and gather data from a number of


sensors in the engine and continuously adjust the fuel supply and injection timing.
This minimizes emissions and maximizes fuel efficiency and engine output at any
given workload. The electronic engine management generally consists of the

ww
following basic components: An electronic control unit (ECU), a fuel delivery system
(typically fuel injection), an ignition system and a number of sensors. Figure 5.21
w.E
shows the various components in the typical engine management system.

1. asy
Electronics control unit (ECU) :

En
The sensors provide feedback to the ECU to indicate how the engine is

gin
running so that the ECU can make the necessary adjustments to the operation of the

2. Fuel delivery system :


ee
fuel delivery and / or ignition system.

rin
g.n
This system consist high pressure fuel pump which is mounted in or

et
near the tank. The fuel line the pump passes through a filter before it runs forward
to the engine bay. The fuel line connects to a fuel rail that feeds each of the injectors.
At the end of the rail is a fuel pressure regulator, with surplus fuel heading back to
the tank in the return line.

3. Ignition system :

Ignition system consists of ignition coil, distributor and spark plug.


These components are connected with the ECU to receive the signal for proper
timed operation.

98

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

4. Various sensors :

Engine sensors fall into five broad categories. Throttle – Position


Sensors, Exhaust Gas Oxygen Sensors, Manifold Absolute Pressure Sensors,
Temperature Sensors and Speed / Timing Sensors. All these sensor functions are
centrally controlled by microcontroller as shown in Figure.

ww
w.E
asy
En
gin
a. Throttle – Position Sensors :
ee rin
g.n
A throttle – position sensor sends the signal to ECU about the throttle

et
opening and the force applied by the driver. Then the ECU controls the fuel delivery
and spark timing based on the throttle position. Two common throttle – position
sensors are potentiometric and Hall – effect sensors.

b. Exhaust Gas Oxygen (EGO) Sensors :


Exhaust gas oxygen (EGO) sensors are places within the engine’s
exhaust system. The amount of oxygen in the exhaust gas indicates whether or not
the ECU has directed the fuel delivery system to provide the proper air – to fuel
ratio. If the relative amount of air is too high or too low, engine power, smoothness,
fuel efficiency and emissions will all suffer.

99

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

c. Manifold Absolute Pressure (MAP) Sensors:


Manifold Absolute Pressure (MAP) Sensors measure the degree of
vacuum in the engine’s intake manifold. The amount of vacuum depends on engine
rpm and throttle opening. The most common MAP sensors are piezoresistive and
variable capacitor sensors.

d. Temperature Sensors:
Temperature sensors are used to report engine temperature to the
driver / operator via dash panel mounted temperature gauge, report engine

wwtemperatures to the ECU to activate / de – activate cooling fans in water – cooled


engines, to richen fuel mixtures for easier starting in cold weather and to lean out

w.E
mixtures for maximum fuel economy. Two common temperature sensors are
thermistors or thermodiodes.

e.
asy
Engine Speed / Timing Sensors :

En
Speed / Timing sensors provide information to the ECU regarding

gin
engine speed and the crank position. This information is used by the ECU to control

ee
fuel and ignition, as well as to make sure that engine speed does not exceed safe

rin
operating limits. It is also used to control the fuel injectors and spark plugs. Most
common speed/timing sensors are variable reluctance, optical crankshaft position
and Hall Effect sensors. g.n
f. Exhaust Gas regulation (EGR) Valve Position Sensor: et
The signal from EGR valve position sensor is used to adjust the air fuel
mixture. The exhaust gases introduced by the EGR valve into the intake manifold
reduce the available oxygen and thus less fuel is needed in order to maintain low
hydro carbon level in the exhaust.

g. Mass Air flow (MAF) sensor :


MAF sensor is used to measure engine load to squirt in the right
amount of petrol, and fire the spark at just the right moment. The amount of power

100

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

being developed depends on how much air the engine is breathing. Most common
airlflow sensors are Hot Wire Airflow sensor and V and Airflow Meter.

h. Knock Sensor :
The knock sensor is used to identify the sounds of knocking and sends
signal to ECU to avoid knocking. It is screwed into the engine block and is designed
to separate out the special noise which means that knocking is occurring. Many
Electronic Fuel Injection (EFI) engines run ignition timing very close to knocking.

The comparison of traditional and mechatronics approach in engine

wwmanagement is given in Table.

w.E Table Traditional Vs Mechatronics approach in Engine Management

Sl.No.
asy
Traditional approach Mechatronics approach

1. The cam
mechanism En
operated
controls
rocker
the
arm The valve operation is controlled by
valve the signal received from electronic
gin
operation. The rotation of cam is control unit. The timing of valve

ee
based on the crank rotation. operation is pre programmed in the

rin
micro controller.

2. g.n
The engine speed regulation is based The engine speed regulation is

et
on the governor controlled throttle based on the input signal from and
valve. The governor is actuated by the MAF sensor. Based on the sensor
speed of the crank shaft. The speed information the throttling valve is
control has not effect on the engine controlled by microcontroller.
temperature and air flow rate.

3. Spark timing of the spark plug is Spark timing of the spark plug is
controlled by the ignition coil and controlled by the ignition coil that
distributor at constant pre set receives signal from the
microcontroller through a timing

101

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

interval. sequence program.

3. Case study on automatic car park barrier.

Consider an automatic car park barriers operated by coin inserts. The system
uses a PLC for its operation. There are two barriers used namely in barrier and out
barrier. In barrier is used to open when the correct money is inserted while out
barrier opens when a car is detected in front of it. It consists of a barrier which is

ww
pivoted at one end, two solenoid valves A and B and a piston cylinder arrangement.

Solenoid valves are used to control the movement of the piston. Solenoid A is
w.E
used to move the piston upward in turn barrier whereas solenoid B is used to move

asy
the piston downward. Limit switches are used to detect the foremost position of the
barrier. When current flows through solenoid A, the piston in the cylinder moves

En
upward and causes the barrier to rotate about its pivot and rises to let a car through.

gin
ee rin
g.n
et

102

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

When the barrier hits the limit switch, it will turns on the timer to give a
required time delay. After that time delay, the solenoid B is activated which brings
the barrier downward by an operating piston in the cylinder. This principle is used
for both the barriers.

Figure shows the ladder program for that PLC system.

ww
w.E
asy
En
gin
ee rin
g.n
4. Stages in designing mechatronics systems
et
The design process consists of the following stages (refer Figure):

Stage 1: Need for design

The design process begins with a need. Needs are usually arise from
dissatisfaction with an existing situation. Needs may come from inputs of operating
or service personal or from a customer through sales or marketing representatives.

103

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

They may be to reduce cost, increase reliability or performance or just change


because of public has become bored with the product.

Stage 2 : Analysis of problem

Probably the most critical step in a design process is the analysis of the
problem i.e., to find out the true nature of the problem. The true problem is not
always what is seems to be at the first glance. Its importance is often overlooked
because this stage requires such a small part of the total time to create the final
design. It is advantageous to define the problem as broadly as possible. If the

ww
problem is not accurately defined, it will lead to a waste of time on designs and will
not fulfill the need.
w.E
Stage 3 : Preparation of specification

asy
The design must meet the required performance specifications. Therefore,

En
specification of the requirements needs to be prepared first. This will state the

gin
problem definition of special technical terms. Any constraints placed statement

ee
includes all the functions required of the design, together with any desirable

rin
features. The following are some of the statements about the problem.

Mass and dimensions of design.


g.n
Type and range of motion required.

Accuracy of the element.


et
Input and output requirements of elements.

Interfaces.

Relevant standards and code of practice, etc.,

Stage 4 : Generation of possible solution

This stage is often known as conceptualization stage. The conceptulisation


step is to determine the elements, mechanisms, materials, process of configuration

104

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

that in some combination or other result in a design that satisfies the need. This is
the key step for employing inventiveness and creativity.

A vital aspect of this step is synthesis. Synthesis is the process of taking


elements of the concept and arranging them in the proper order, sized and
dimensioned in the proper way.

Outline solutions are prepared for various models which are worked out in
sufficient details to indicate the means of obtaining each of the required functions.

ww
State 5 : Selection of suitable or Evaluation :

This stage involves a through analysis of the design. The evaluation stage
w.E
involves detailed calculation. Often computer calculation of the performance of the

asy
design by using an analytical model. The various solutions obtained in stage 4 are
analysed and the most suitable is selected.

En
ginNeed for design

ee
Analysis of problem

rin
Preparation of specification
g.n
Generation of possible solution et
Evaluation

Production of detailed design

Implementation of design

Production of working drawing


Stages in designing mechatronics systems
105

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Stage : 6 : Production of detailed design

The detail of selected design has to be worked out. It might have required the
extensive simulated service testing of an experimental model or a full size prototype
in order to determine the optimum details of design.

Stage : 7 : Production of working drawing

The finalized drawing must be properly communicated to the person who is


going to manufacture. The communication may be oral presentation or a design

ww
report. Detailed engineering drawings of each components and the assembly of the
machine with complete specification for the manufacturing process are written in

w.E
the design report.

asy
Stage 8 : Implementation of design

En
The components as per the drawings are manufactured and assembled as a
whole system.
gin
5. Explain the types of Stepper motors with suitable diagrams.
ee
The stepper motor is a device that produces rotation through equal angels
when digital pulses are supplied as input. rin
g.n
In other words, the stepper motor transforms the electrical pulses in to equal
increments of rotary shaft motion. et
Example : If 1 pulse produces a rotation of 60, then for complete rotation of
3600, there will be 60 pulses needed.

Stepper motor

Variable reluctance Permanent magnet Hybrid

Stepper motor Stepper motor Stepper motor


106

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Variable Reluctance Stepper Motor

Construction :

The rotor is made up soft steel and it is cylindrical in shape with four poles.

Usually the number of poles on the rotor is less than number of poles on the
stator. The stator poles have windings and it is switched by means of electronic
switching device.

The function of the switching device is to switch the control windings in the

ww
stator of stepper motor.

w.E
asy
En
gin
ee rin
Working: g.n
et
When current is switched to a pair of windings in stator, a magnetic field is
produce. The line of force passes from stator poles to nearest set of poles on the
rotor.

The rotor will move until the rotor and stator lineup. This is termed as
position of minimum reluctance. This motor generally gives step angels of 7.50 or
150.

Permanent Magnet Stepper Motor

Construction:
107

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

The Stator has four poles. Each pole is wound with a field winding, the coils
on opposite pair of poles being in series.

The rotor is a permanent magnet and when current is switched to a pair of


stator poles, the rotor will move to lineup with it.

ww
w.E
asy
Working :
En
gin
Thus for the currents given in the situation shown in Figure 2.81, the rotor
moves to 450 position.
ee rin
If the current is switched so that the polarities are reversed, the rotor will
move a further 450 in order to line up again.
g.n
et
Thus by switching currents through the coils, the rotor rotates by 45 0 steps.

With this type of motor, step angle of 1.80, 7.50, 150, 300, 340 or 900 can be
achieved.

Hybrid Stepper Motor

It combines the features of both the variable reluctance and permanent


magnet motors.

Construction :

108

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

The Permanent magnet is encased in iron caps which are cut to have teeth.

Working :

The rotor sets itself in minimum reluctance position if a pair of stator coils is

ww
energized. In this stepper motor, step angles of 0.90 and 1.80 are achieved.

w.E
Applications :

High – accuracy positioning applications. Example in computer hard disc


drives. asy
Advantages : En
gin
(i) These stepper motors combine the features of both variable reluctance and
permanent magnet motors. ee
(ii) Minimum step angle can be achieved. rin
Disadvantages :
g.n
et
When it is connected with microprocessor output port, it is must to include
protection to avoid damage to microprocessor.

6. Explain the Construction and working principle of AC and DC servomotors


AC Servomotors.

Basically an AC servomotor is a two phase induction motor.

109

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Vr = Reference Winding

Vc = Control winding

ww
Construction :

w.E It consists of two stator windings namely reference winding and control

asy
winding as shown in Figure 2.87.

En
These two windings are placed at 9

gin
The rotor is squirrel cage or drag – cup type having small diameter in order to
reduce the inertia.

Operation :
ee rin
g.n
The two windings are excited by voltage of magnitude and 900 phase shift.

speed.
et
It develops a magnetic field of constant magnitude rotating at synchronous

The direction of rotation depends upon the phase relationship between Vr


and Vc.

The rotating magnetic field interacts with the currents and produces torque
in the direction of rotation.

110

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

Control scheme for an AC servomotor

Control scheme for an AC servomotor is shown in the Figure.

ww
w.E The reference winding is excited by a reference voltage source.

asy
The control winding is supplied by a zener amplifier having variable
magnitude and polarity.
En
Advantages : gin
Drift – free AC amplifier ee rin
Low rotor inertia.
g.n
Rugged construction

Rotor withstand at higher temperature.


et
Disadvantages

More expensive

Cannot work at open loop

Required more maintenance.

111

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

DC servomotors:

DC motors which are used in servo systems are called DC servomotors.

In DC servomotors, field windings may be connected either in series with the


armature or separate from the armature.

This motor provides high starting torque due to low inertia.

This low inertia can be achieved by reducing armature diameter with


increasing armature length so that desired output power can be achieved.

ww
Two different modes :

w.E Armature control mode

asy
Field control mode

En
Armature control of DC servomotor:

gin
In which the speed of the DC servomotor is controlled by armature current
with field current constant.
ee rin
g.n
et

Ra - Armature resistance ()

La - armature winding inductance (H)

Ia - Armature current (A)

112

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

If - Field current (A)

Ea - Applied voltage (V)

Eb - Back emf (V)

θ - Angular displacement

Tm - Motor torque (N-m)

F0 - Viscous friction coefficient (N-m rad-1/sec)

J - Moment of inertia (kg-m2)

ww
The flux Φ is proportional to the field current If.

Φ ∞ If
w.E
= Kf If (Kf = constant)

Then, Tm Ia Φ asy
Tm = K1 Ia Φ En
Substitute Φ
gin
= Kf If in the above equation.
ee
Tm = K1 Ia KF IF.
rin
The field current is constant, hence the flux is constant.
g.n
Tm = KT Ia.
et
[KT = K1 Ia IF. Where K1 - motor torque constant)

When the armature is rotating, a voltage proportional to product of the flux and the
angular velocity.

As constant flux,

 This is an armature controlled servomotor.


 Its speed is controlled by an armature voltage.
 The differential equation for an armature circuit is.
113

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

 As the armature current flows, it produces torque.


By taking Laplace transforms, we can get the transfer function of DC servomotor is

Field control of DC servomotor:

ww
w.E In which the armature current is maintained constant and speed of the DC

Rf -
asy
servomotor is controlled by field voltage.

Resistance of field winding ()


En
La -
gin
armature winding inductance (H)

Ia

If
-

-
ee
Armature current (A)

Field current (A) rin


Ea - Applied voltage (V) g.n
Eb - Back emf (V) et
θ - Angular displacement

Tm - Motor torque (N-m)

F0 - Viscous friction coefficient (N-m rad-1/sec)

J - Moment of inertia (kg-m2)

114

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

115

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

116

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

117

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

118

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

119

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

120

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

121

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

122

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

123

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

124

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
asy
En
gin
ee rin
g.n
et

125

Downloaded From : www.EasyEngineering.net


Downloaded From : www.EasyEngineering.net

ww
w.E
a syE
ngi
nee
rin
g.n
et

**Note: Other Websites/Blogs Owners Please do not Copy (or) Republish


this Materials without Legal Permission of the Publishers.

**Disclimers : EasyEngineering not the original publisher of this Book/Material


on net. This e-book/Material has been collected from other sources of net.
Downloaded From : www.EasyEngineering.net

You might also like