ECE Mechtronics Notes
ECE Mechtronics Notes
OMR351 - MECHATRONICS
UNIT I INTRODUCTION 9
TOTAL: 45 PERIODS
TEXT BOOKS:
1. Bolton, “Mechatronics”, Printice Hall, 2008
2. Ramesh S Gaonkar, “Microprocessor Architecture, Programming, and
Applications with them 8085”, 5th Edition, Prentice Hall, 2008.
PREPARED BY S.NIRMALA,AP/ECE 1
REFERENCES:
PREPARED BY S.NIRMALA,AP/ECE 2
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.
2) What is meant by system in mechatronics?
The system is a group of physical components combined to perform a specific function. Any
mechatronics devices consist of system.
3) What are the main applications of mechatronics?
Washing machines, dish washers, micro ovens, cameras, atm and camcorders.
PREPARED BY S.NIRMALA,AP/ECE 1
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
3) Fidelity
4) Dynamic error
a) Ceramic cement
b) Epoxy
c) Nitrocellulose
PART B
If there is feedback device to compare the actual value with desired one, then the
system is called closed loop control system.
PREPARED BY S.NIRMALA,AP/ECE 2
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.
This element decides the corrective action to be taken when an error signal is received by it.
v. Measurement element
The measurement element produces a signal related to the variable condition of the process
that is being controlled.
PREPARED BY S.NIRMALA,AP/ECE 3
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
For example, if the transducer gives a temperature reading of 30°C when the actual
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:
Accuracy is defined as the ability of the instrument to respond to the true value of the
measure variable under the reference conditions.
For example, a thermocouple has an accuracy of ± 1° C. This means that reading given
by the thermocouple can be expected to lie within + 1°C (or) — 1°C of the true value.
Accuracy is also expressed as a percentage of the full range output (or) full scale
deflection.
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
PREPARED BY S.NIRMALA,AP/ECE 4
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.
Repeatability:
The repeatability and reproducibility of a transducer are its ability to give the same
output for repeated applications of the same input value.
Reliability:
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.
PREPARED BY S.NIRMALA,AP/ECE 5
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 which will produce an
observable change in the input.
Backlash:
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 any motion of the
attached part.
Backlash is an undesirable phenomenon and is important in the precision design of gear
trains.
Dynamic characteristics
Response time:
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 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.
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.
PREPARED BY S.NIRMALA,AP/ECE 6
3. Explain the construction and working of potentiometer sensor and LVDT sensor.
Potentiometer
Principle:
It works on variable resistance transduction principle Linear or Rotary potentiometer is a
variable resistance displacement transducer which uses the 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
Secondary coils are connected in series opposition and equally positioned with respect to
primary coil
The output voltage is proportional to the displacement of the core from null position
PREPARED BY S.NIRMALA,AP/ECE 8
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 moving electron
deflected becomes negatively charged and the other side of the plate becomes positively charged
or the electrons moving away from it.
This charge separation produces an electrical voltage which continues until the Lorentz
force on the charged particles from the electric field balances the forces produced by the
magnetic field. The result is a traverse potential difference known as Hall voltage.
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.
PREPARED BY S.NIRMALA,AP/ECE 9
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:
When a coil is supplied with alternating current, an alternating magnetic field 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.
PREPARED BY S.NIRMALA,AP/ECE 10
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 on the plates
due to voltage applied across the plate which is separated by dielectric material.
Formula:
PREPARED BY S.NIRMALA,AP/ECE 11
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
PREPARED BY S.NIRMALA,AP/ECE 12
Strain gauge:
Strain gauges are passive type resistance sensor whose electrical resistance change when
it is stretched or compressed (mechanically strained) under the application of force.
The electrical resistance is changed due to the change in length (increases) and cross
sectional area (decreases) of the strain gauge.
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 Strain Gauge Bridge)
and applying excitation to the bridge. The bridge output voltage is then a measure of
strain, sensed by each strain gauge.
Unbonded Type Strain Gauges:
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.
The frames are held close with a spring-loaded mechanism.
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 consist of resistance elements arranged in the form of a grid
of fine wire, which is cemented to a thin paper sheet or very 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
PREPARED BY S.NIRMALA,AP/ECE 13
Fine Wire Gauges:
Wire of 3 to 25 microns diameter is arranged in the form of grid consisting of parallel
loops
PREPARED BY S.NIRMALA,AP/ECE 14
6. Explain any four temperature sensors.
Bimetallic Strips:
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.
This deformation may be used as a temperature- controlled switch, as in the simple
thermostat.
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
Thermistors:
Thermistor is a semiconductor device that has a negative temperature coefficient of
resistance in contrast to positive coefficient displayed by most metals.
Thermistors are small pieces of material made from mixtures of metal oxides, such as
Iron, cobalt, chromium, Nickel, and Manganese.
The shape of the materials is in terms of discs, beads and rods.
The thermistor is an extremely sensitive device because its resistance changes rapidly
with temperature.
The resistance of conventional metal-oxide thermistors decreases in a very non-linear
manner with an increase in temperature.
PREPARED BY S.NIRMALA,AP/ECE 16
The change in resistance per degree change in temperature is considerably larger than
that which occurs with metals.
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.
The simple series circuit for measurement of temperature using a thermistor and the
variation of resistance with temperature for a typical thermistor.
"When two dissimilar metals are joined together an e.m.f will exist between 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..
The thermocouple consist of one hot junction and one cold junction
Hot junction is inserted where temperature is measured
Cold junction is maintained at a constant reference temperature.
PREPARED BY S.NIRMALA,AP/ECE 18
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) AD 0 – AD7 lines to A0 – A7 (address lines)
and D0 – D7 (data lines). The separation of address lines and data lines is achieved by
connecting an external latch to AD0 – AD7 lines and enabling the latch when signal is active.
3. List the 8085 flags.
Various flags are: S (Sign flag), Z (Zero flag), AC (Auxiliary carry flag), P (Parity flag), CY
(Carry flag).
4. What is the function of program counter in 8085 microprocessors?
Program counter stores the address of the next instruction to be fetched. Thus, it is used as
pointer to the instruction.
5. What is trap interrupt and its significance?
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.
PREPARED BY S.NIRMALA,AP/ECE 19
8. List the five interrupts pins available in the 8085.
The five interrupt pins are: TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR.
9. What is interrupt?
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.
PREPARED BY S.NIRMALA,AP/ECE 20
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
Immediate addressing
Register addressing
Direct addressing
Indirect addressing
Implicit addressing
14. Define stack and stack related instructions?
The stack is a group of memory locations in the R/W memory that is used for the temporary
storage of binary information during the execution of the program. The stack related
instructions are PUSH and POP
15. What is subroutine?
Subroutine is group of instructions stored as a separate program in memory and it is called
from the main program whenever required.
PREPARED BY S.NIRMALA,AP/ECE 21
PART – B
1.Draw and explain the architecture of 8085.
PREPARED BY S.NIRMALA,AP/ECE 22
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 registers can be classified as,
PREPARED BY S.NIRMALA,AP/ECE 23
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:
It is an 8-bit register in which five of the bits carry significant information in the form
of flags.
S – Sign flag; Z – Zero flag; AC – Auxiliary carry flag; P – Parity flag; CY – carry flag.
S- Sign flag:
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.
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.
The carry flag also serves as a borrow flag for subtraction.
PREPARED BY S.NIRMALA,AP/ECE 24
© Instruction registers:
In a typical processor operation, the processor first fetches the opcode of
instruction from memory.
The CPU stores this opcode in a register called the instruction register.
This opcode is further sent to the instruction decoder to select one of the 256
alternatives.
16-bit registers:
PREPARED BY S.NIRMALA,AP/ECE 26
2. Draw and explain the timing diagram of memory read and write operation.
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.
Memory write cycle:
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)
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.
The status signals for memory write cycle are: IO/𝑀̅ =0, S 1=0, S 0=1. The
following section describes the memory write machine cycle in step by step manner.
PREPARED BY S.NIRMALA,AP/ECE 28
Step 1: (State T1)
In T1-state, the 8085 places the address on the address lines from stack pointer or
general-purpose register pair and activates ALE signal in order to latch low-order byte of
address.
During T1, 8085 sends status signals: IO/𝑀̅ = 0, S1=0, S0=1 for memory write
machine cycle.
Step 2: (State T2)
In T2, 8085 places data on the data bus and sends WR signal low for writing into the
addressed memory location.
Step 3: (State T3)
During T3, WR signal goes high, which disables the memory device and terminates the
write operation.
3. What are the different addressing modes in 8085 microprocessors? 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
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 instruction. The data
will be in memory. In this addressing mode, the program instructions and data can be stored
indifferent memory blocks. This type of addressing can be identified by 16-bit address present in
the instruction.
Example:LDA 4500H- Load the data available in memory location 4500H in A register.
c. Register Addressing:
PREPARED BY S.NIRMALA,AP/ECE 29
In register addressing mode, the instruction specifies the name of the register in which
the data is available. This type of addressing can be identified by register names in the
instruction.
Example: MOV A, B -Move the content of B register to A register.
PREPARED BY S.NIRMALA,AP/ECE 30
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 moves the content of C register to B register.
MOV B, M -This instruction moves 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 registers.
Load accumulator:
LDA 16-bit address
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. This is a 3-byte instruction,
the second byte specifies the low-order address and the third byte specifies the high-order
address.
Example: LDA 4000 –The content of memory location 4000 is loaded into A register. Store
accumulator:
STA 16-bit address
The contents of the accumulator are copied into the memory location 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 exchanges the content of H and L with D and E
ii. Arithmetic instructions:
The arithmetic instructions include addition, subtraction, increment and decrement
operations.
Addition:
ADD REGISTER OR MEMORY TO ACCUMULATOR
PREPARED BY S.NIRMALA,AP/ECE 31
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 memory location, its
locations specified by the contents of the HL registers. All flags 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 and the
result is stored in A register.
ADD M -The content of A register is added with the content of memory
Location pointed by HL register and the result is stored in A register.
Add register to accumulator with carry:
ADC R
ADC
M
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. 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 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.
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 are modified to reflect the result
of the subtraction.
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 subtracted with the content of
memory location pointed by HL register and the result is stored in A register.
SUBTRACT SOURCE AND BORROW FROM ACCUMULATOR:
SBB R
PREPARED BY S.NIRMALA,AP/ECE 32
SBB
M
The contents of the operand (register or memory) and the Borrow flag are 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.
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
PREPARED BY S.NIRMALA,AP/ECE 33
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 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: INR B – The content of B register is incremented by 1. INR M – The content of
memory location pointed by HL register is incremented by 1.
INCREMENT REGISTER PAIR:
INX R
The contents of the designated register pair are incremented by1 and the result is stored in the
same place.
Example: INX H – The HL register pair is incremented by 1 and showing the next memory
location.
Decrement register or memory
DCR R
DCR
M
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.
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. Logical instructions:
The logical instructions include AND, OR, XOR, Complement operations.
Logical AND:
PREPARED BY S.NIRMALA,AP/ECE 34
Logical AND register or memory with accumulator
ANA R
ANA
M
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 memory location, its
address is specified by the contents of HL registers, Z, P are modified to reflect the result of the
operation. CY is reset. AC is set.
Example: ANA B - The content of A register is AND with the content of B register and the result
is stored in A register. ANA M - The content of A register is AND with the content of memory
location pointed by HL register and the result is stored A register.
Logical and immediate with accumulator
ANI 8-bit data
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.
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 content of memory
location pointed by HL register and the result is stored A register.
Exclusive or immediate with accumulator
XRI 8-bit data
The contents of the accumulator are Exclusive 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: XRI 45 -The data 45H is immediately XOR with the content of A register and result is
stored in A register.
LOGICAL OR REGISTER OR MEMORY WITH ACCUMULATOR
ORA R
ORA
PREPARED BY S.NIRMALA,AP/ECE 35
M
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.
Logical or immediate with accumulator:
ORI 8-bit data
The contents of the accumulator are logically OR 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 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
The contents of the accumulator are complemented. No flags are affected.
PREPARED BY S.NIRMALA,AP/ECE 36
JP Jump on Positive S=0
JZ Jump on Zero Z =1
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.
PREPARED BY S.NIRMALA,AP/ECE 37
Example: RZ
RC Return on Carry CY = 1
RZ Return on Zero Z =1
d. Port Structures
The 8051 contains four I/O ports
All four ports are bidirectional
PREPARED BY S.NIRMALA,AP/ECE 39
Each port has SFR (Special Function Registers P0 through P3) which works like a
latch, an output driver and an input buffer
Both output driver and input buffer of Port 0 and output driver of Port 2 are used for
accessing external memory
Accessing external memory works like this
Port 0 outputs the low byte of external memory address (which is time- multiplexed
with the byte being written or read)
Port 2 outputs the high byte (only needed when the address is 16 bits
wide)
Port 3 pins are multifunctional. The alternate functions are activated
with the 1 written in the corresponding bit in the port SFR.
PREPARED BY S.NIRMALA,AP/ECE 40
PREPARED BY S.NIRMALA,AP/ECE 41
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
PREPARED BY S.NIRMALA,AP/ECE 42
External Interrupts
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.
PREPARED BY S.NIRMALA,AP/ECE 43
UNIT – III PROGRAMMABLE PERIPHERAL INTERFACE
PART – A
PREPARED BY S.NIRMALA,AP/ECE 44
7. Define PPI.
8255 is widely used, programmable, parallel I/O device. It can be programmed to transfer
data under various conditions from simple I/O to interrupt I/O.
8. Name any two types of ADC.
Successive approximation ADC
Dual slope ADC
Flash type ADC
9. Name the modes available in 8255 A Control Word Format.
BSR Mode
I/O Mode
o Mode 0: Simple I/O Mode.
o Mode 1: I/O with Handshaking Mode.
o Mode 2: Bidirectional data transfer mode.
10. Show the control word format of 8255 in BSR mode.
PREPARED BY S.NIRMALA,AP/ECE 45
PART - B
1. Draw the functional block diagram of 8255 ppi and explain each block.
4. Port A, B and C
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.
PREPARED BY S.NIRMALA,AP/ECE 46
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
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 status
word through data bus buffer.
c) WR (Write): A low on this pin, the CPU can write data on to the ports or on to the control
register through
d) RESET: A high on this pin clears the control register and all ports are set to the input
mode
e) A0 and A1 (Address pins): These pins in conjunction with RD and WR pins control the
selection of one of the
3 ports.
These blocks receive control from the CPU and issues commands to their respective ports.
a) Port A: This has an 8- b i t 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- b i t input latch. It can be
programmed in mode 0, mode1.
PREPARED BY S.NIRMALA,AP/ECE 47
c) Port C: This has an 8- b i t latched input buffer and 8 bit outp ut latched/buffer.
This port can be divided into two 4
bit ports and can be used as control signals for port A and port B. it can be programmed in
mode 0.
These are two basic modes of operation of 8255. I/O mode and Bit Set-Reset mode (BSR).
• In I/O mode, the 8255 ports work as programmable I/O ports, while in BSR mode only port C
(PC0-PC7) can be used to set or reset its individual port bits.
• Under the I/O mode of operation, further there are three modes of operation of 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 microcontrollers.
Stepper Motor Control using 8051 Microcontroller Circuit Design:
T h e complete board consists of transformer, control circuit, keypad and stepper motor as
shown in snap. The given figure shows the block diagram of project.
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 circuit through which user
can give the command to control stepper motor. The control circuit includes micro controller
89C51, indicating LEDs, and current driver chip ULN2003A. One can program the controller to
control the operation of stepper motor. He can give different commands through keypad like, run
clockwise, run anticlockwise, increase/decrease RPM, increase/decrease revolutions, stop motor,
change the mode, etc. before we start with project it is must that we first understood the
PREPARED BY S.NIRMALA,AP/ECE 48
operation of unipolar stepper motor.
The table given below will give you the complete idea that how to give pulses in each mode
SCA
D
PREPARED BY S.NIRMALA,AP/ECE 49
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 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.
PREPARED BY S.NIRMALA,AP/ECE 50
* 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.
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.
PREPARED BY S.NIRMALA,AP/ECE 51
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) 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 (Red) are for the
stop signal for the vehicles on the road N, S, W, & E respectively. L2, 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 road S. similarly L12-L13-L14, L23-L22-L21 &
L32-L31-L30 simulates same function for the roads E, N, W respectively. A total of 16 LED’s
(2 Red & 2 Green at each road) are provided for pedestrian crossing.
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 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 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 west & east
d) From road east to west From road west to east Pedestrian crossing at roads north &
south
SCA
PREPARED BY S.NIRMALA,AP/ECE 52
D
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 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 shown in the image below.
The circuit diagram shown below is of an AT89S51 microcontroller based 0 to 9 counter which
has a 7 segment LED display interfaced to it in order to display the 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 display to 8051 in order to display a particular result. The
common cathode seven segment display D1 is connected to the Port 1 of the microcontroller
(AT89S51) as shown in the circuit diagram. R3 to R10 are current limiting resistors. S3 is the
reset 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.
The circuit diagram shown above is of an AT89S51 microcontroller based 0 to 9 counter which
has a 7 segment LED display interfaced to it in order to display the count. This simple circuit
illustrates things. How to setup simple 0 to 9 up counter using 8051 and more importantly two
how to interface a seven segment LED display to 8051 in order to display a particular result. The
common cathode seven segment display D1 is connected to the Port 1 of the microcontroller
(AT89S51) as shown in the circuit diagram. R3 to R10 are current limiting resistors. S3 is the
reset 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.
characters. The common digit drive patterns (0 to 9) of a seven-segment display are shown in the
table below.
PREPARED BY S.NIRMALA,AP/ECE 54
Digit a B C d e f G
0 1 1 1 1 1 1 0
1 0 1 1 0 0 0 0
2 1 1 0 1 1 0 1
3 1 1 1 1 0 0 1
4 0 1 1 0 0 1 1
5 1 0 1 1 0 1 1
6 1 0 1 1 1 1 1
7 1 1 1 0 0 0 0
8 1 1 1 1 1 1 1
9 1 1 1 1 0 1 1
PREPARED BY S.NIRMALA,AP/ECE 55
UNIT – IV PROGRAMMING LOGIC
CONTROLLERS
PART – A
PREPARED BY S.NIRMALA,AP/ECE 56
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 rung goes true again.
7. What are counters?
Counters allow a number of occurrences of input signals to count or record 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 pulse has been received, it will
operate its contact, the normally open contacts would be closed and a normally closed
contact would be opened
8. Write down various types of counters.
Down counters
Up-counters
9. What are the types of memory?
Random Access Memory
Read Only Memory (ROM)
10. List down the different types of timers.
On delay timer
Off delay timer
Retentive timer
Pulse delay
PREPARED BY S.NIRMALA,AP/ECE 57
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 condition occurs which is used to
reset the coil to OFF
13. List down general application of PLCs for control.
Control of a process motor, vibrating machine.
Control of two pneumatic pistons.
Detection, sorting and packaging unit.
14. What are the factors to be considered for selecting PLC?
System definition
Choosing the input and output hardware
Analog Input /Output module
Input and Output timing consideration
PART - B
1. With the help of block diagram, explain the main components of a plc. 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.
Basic components of plc:
Processor
Memory
Power Supply
Input I Output modules
PREPARED BY S.NIRMALA,AP/ECE 58
Programming device
Monitor
Processor:
Memory:
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).
PREPARED BY S.NIRMALA,AP/ECE 59
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.
The Input module receives information from extended devices and sends to processor and
communicates the processed information to the external devices through output modules.
The Input devices are mechanical switches, photo sensors, temperature sensors, flow
sensors, other type of sensors keypads etc.,
The output devices may include solenoid valves, Relays, contactors, lights, Horns,
Heating elements, fans, Motor starter, signal Amplifiers. Conveyor belt, lift, automatic
door etc.,
I/O devices are also called peripheral devices.
Programming Device:
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
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.
The CPU consists of the following units
PREPARED BY S.NIRMALA,AP/ECE 60
Arithmetic and Logic Unit (ALU):
This unit performs data manipulation and arithmetic and logical operations on input I
variable data and determines the proper state of the output variables.
The arithmetic operation includes addition, subtraction etc., and logic operations include
AND, OR, AND, EXCLUSIVE - OR.
Memory Unit:
Memory termed registers located within the microprocessor and used to store
information involved in a program execution.
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:
The sequence of instructions to be executed, programs are stored in the memory unit.
During entering and editing including Debugging, the program is stored in the temporary
storages called RAM (Random Access memory).
Once the program is completely finished (free & from errors).
It may be 'burned' into ROM
When the ROM is plugged into the PLC, the device is ready to be placed into service
in the industrial environment.
For network programmed PLCs, the final PLCs program is downloaded into a special
reprogrammable
ROM (EPROM, PROM, and EEPROM) in the PLC.
Memory may be either volatile type or Non-volatile type.
Volatile Memory:
PROM:
EPROM:
EEPROM:
Data Bus:
PREPARED BY S.NIRMALA,AP/ECE 63
The data bus contains 8, 16 or 32 parallel signal lines for sending data between the
various devices of a system.
An 8-bit microprocessor has an internal data bus which can handle 8-bit numbers.
Address Bus:
The Address bus contains 16, 20, 24 or 32 parallel signal lines to carry the Address
of the memory locations for accessing stored data.
Every memory location is given a distinct unique address to locate easily and accessed
by the CPU either to read or write data.
Control Bus:
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.
The I/O system bus provide the communication between the I/O ports and I/O units
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.
The sourcing and sinking are used to describe the way in which DC devices are
connected to PLC
Sourcing:
If a switch is connected to the positive of the battery and current flows from positive 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 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.
PREPARED BY S.NIRMALA,AP/ECE 64
Here, the input device supplies current to the input module. For the PLC 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.
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.
Set / Reset the outputs for that rung
Move on the next rung and repeat the operations 1, 2, 3
Continuous updating
Mass Input / Output copying
Continuous Updating:
PREPARED BY S.NIRMALA,AP/ECE 65
The sequence followed thus in continuous updating is as follows:
3. Discuss how plc logic gate system can be formed with ladder diagram.
Instruction Code
Mnemonics:
PREPARED BY S.NIRMALA,AP/ECE 66
AND Logic Function:
0 0 0
PREPARED BY S.NIRMALA,AP/ECE 67
0 1 0
1 0 0
1 1 1
SCA
D
OR Logic Function:
PREPARED BY S.NIRMALA,AP/ECE 68
INPUT(A) INPUT(B) OUTPUT
0 0 0
0 1 1
1 0 1
1 1 1
PREPARED BY S.NIRMALA,AP/ECE 69
NAND Logic Function:
0 0 1
0 1 1
1 0 1
1 1 0
PREPARED BY S.NIRMALA,AP/ECE 70
NOR Logic Function:
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
0 0 1
0 1 0
1 0 0
1 1 0
PREPARED BY S.NIRMALA,AP/ECE 71
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
When any one input is HIGH state the output will be at HIGH state
0 0 0
0 1 1
1 0 1
1 1 0
(i) Timers
PREPARED BY S.NIRMALA,AP/ECE 72
(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.
Types of Timers:
Delay ON Timers:
The term delay is used to indicate that this timer burns on, after waiting for a fixed time
delay period.
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.
PREPARED BY S.NIRMALA,AP/ECE 73
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.
Pulse Timers:
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.
TP is used to denote Pulse Timers.
Cascaded Timers:
PREPARED BY S.NIRMALA,AP/ECE 74
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
An internal relay behaves like relays with their associated contacts, buy they 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.
PREPARED BY S.NIRMALA,AP/ECE 75
In using an internal relay, 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:
Types of Counters:
Up Counters
Down Counters
Up Counters:
Down Counters:
Down counters count down from the pre – set value to zero
PREPARED BY S.NIRMALA,AP/ECE 76
The events are subtracted until the pre – set value is reached
When the counter reaches the Zero value, its contacts change state
(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
5. Draw and explain the ladder diagram for the data handling system. Data
handling:
The steps involved in data handling with a PLC system are
Data Movement:
Instruction: MOV
Program: LD
X400 MOV
D1
D2
PREPARED BY S.NIRMALA,AP/ECE 77
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
Data Comparison:
The data comparison instruction gets the PLC to compare two data values. It
compares a pre – set value (1) to the input value (2)
Instruction:
< or LES
= or EQU
> or GRT
< or LEQ
≠ or <> or NEQ
> or GEQ
For data comparison the typical instruction will contain the data transfer instruction to
PREPARED BY S.NIRMALA,AP/ECE 78
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.
For this, the ladder diagram is shown above.
The input temperature data is inputted to the source address and the destination
address contains the set value.
When the temperature rises 90˚C or higher, the data value in the source address
becomes >the destination address value and there is an output to the alarm which latches
the input
When the temperature falls to 75˚C or lower, the data value in the source address
becomes < the destination address value and there is an output to the relay which then
opens the contacts and so switches the alarm off.
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.
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.
PREPARED BY S.NIRMALA,AP/ECE 79
When a decimal (input) signal is given, BCD conversion is used.
PREPARED BY S.NIRMALA,AP/ECE 80
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 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 start switch and stopped by a normally closed switch.
PREPARED BY S.NIRMALA,AP/ECE 81
UNIT – V
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
PREPARED BY S.NIRMALA,AP/ECE 82
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.
5. What are the axes of a pick and place robot?
The robot has three axes about which motion can occur.
Rotation in a clockwise or counter clockwise direction of the unit on its base.
Arm extension or contraction and arm up or down.
Gripper can open or close.
6. What is the use of PLC in automatic car park system?
An illustration of the use of a PLC in the coin operated barriers for a car park. The in- barrier is
to open when the correct money is inserted in the collection box and the out – barrier is to open
when a car is detected at the car park side of the barrier.
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 movement of the arm might
result from the piston in a linear cylinder being extended and the downward motion from it
retracting, the extension of the arm by the piston in another cylinder extending and its return
movement by the piston retracting.
PART – B
1. Clock wise and anticlockwise rotation of the robot unit of its base.
PREPARED BY S.NIRMALA,AP/ECE 84
The foresaid movements can be obtained by pneumatic cylinders which are operated by
solenoid valves with limit switches. Limit switches are used to indicate when a motion is
completed.
The clockwise rotation of the robot unit on its base can be obtained from a piston and
cylinder arrangement during pistons forward movement. Similarly 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.
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.
PREPARED BY S.NIRMALA,AP/ECE 85
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 opt isolator 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.
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 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 shows the various components in the typical engine management system.
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.
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.
PREPARED BY S.NIRMALA,AP/ECE 86
a. Throttle – Position Sensors:
A throttle – position sensor sends the signal to ECU about the throttle 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.
d. Temperature Sensors:
Temperature sensors are used to report engine temperature to the driver / operator
via dash panel mounted temperature gauge, report engine temperatures 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 mixtures for maximum fuel economy. Two common temperature
sensors are thermistors or thermodiodes.
PREPARED BY S.NIRMALA,AP/ECE 87
e. Engine Speed / Timing Sensors:
Speed / Timing sensors provide information to the ECU regarding engine speed
and the crank position. This information is used by the ECU to control fuel and ignition, as well
as to make sure that engine speed does not exceed safe 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.
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.
1. The cam operated rocker arm mechanism The valve operation is controlled by the
controls the valve operation. The rotation signal received from electronic control
of cam is based on the crank rotation. unit. The timing of valve operation is
preprogrammed in the micro controller.
2. The engine speed regulation is based on the The engine speed regulation is based on
governor-controlled throttle valve. The the input signal from and MAF sensor.
governor is actuated by the speed of the Based on the sensor information the
crank shaft. The speed control has not throttling valve is controlled by
affected on the engine temperature and air microcontroller.
flow rate.
PREPARED BY S.NIRMALA,AP/ECE 88
3. Spark timing of the spark plug is controlled Spark timing of the spark plug is
by the ignition coil and distributor at controlled by the ignition coil that
constant pre set intravel receives signal from the
microcontroller through a timing
sequence program
Consider an automatic car park barrier 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 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 used to
move the piston upward in turn barrier whereas solenoid B is used to move 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 upward and causes the barrier to rotate
about its pivot and rises to let a car through.
PREPARED BY S.NIRMALA,AP/ECE 89
When the barrier hits the limit switch, it will turn 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.
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.
Analysis of problem
Preparation of specification
PREPARED BY S.NIRMALA,AP/ECE 91
Generation of possible solution
Evaluation
Implementation of 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.
In other words, the stepper motor transforms the electrical pulses in to equal increments of
rotary shaft motion.
Example : If 1 pulse produces a rotation of 60, then for complete rotation of 3600, there
will be 60 pulses needed.
PREPARED BY S.NIRMALA,AP/ECE 92
Stepper motor
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 stator of
stepper motor.
SCA
Working:
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.
PREPARED BY S.NIRMALA,AP/ECE 93
Permanent Magnet Stepper Motor
Construction:
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.
Working :
Thus for the currents given in the situation shown in Figure 2.81, the rotor moves to 450
position.
If the current is switched so that the polarities are reversed, the rotor will move a further
450 in order to line up again.
Thus, by switching currents through the coils, the rotor rotates by 450 steps.
With this type of motor, step angle of 1.80, 7.50, 150, 300, 340 or 900 can be achieved.
It combines the features of both the variable reluctance and permanent magnet motors.
PREPARED BY S.NIRMALA,AP/ECE 94
Construction:
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 energized. In
this stepper motor, step angles of 0.90 and 1.80 are achieved.
Applications :
Advantages :
(i) These stepper motors combine the features of both variable reluctance and permanent
magnet motors.
(ii) Minimum step angle can be achieved.
Disadvantages :
PREPARED BY S.NIRMALA,AP/ECE 95
Vr = Reference Winding
Vc = Control winding
Construction :
It consists of two stator windings namely reference winding and control winding as
shown in Figure 2.87.
The rotor is squirrel cage or drag – cup type having small diameter in order to reduce
the inertia.
Operation :
The two windings are excited by voltage of magnitude and 900 phase shift.
It develops a magnetic field of constant magnitude rotating at synchronous speed.
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.
Control scheme for an AC servomotor
PREPARED BY S.NIRMALA,AP/ECE 96
The reference winding is excited by a reference voltage source.
The control winding is supplied by a Zener amplifier having variable magnitude and
polarity.
Advantages:
This low inertia can be achieved by reducing armature diameter with increasing armature
length so that desired output power can be achieved.
PREPARED BY S.NIRMALA,AP/ECE 97
Ra - Armature resistance ()
PREPARED BY S.NIRMALA,AP/ECE 98
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)
The flux Φ is proportional to the field current If.
Φ ∞ If
= Kf If (Kf = constant)
Then, Tm Ia Φ
Tm = K1 Ia Φ
Tm = K1 Ia KF IF.
Tm = KT Ia.
When the armature is rotating, a voltage proportional to product of the flux and the angular
velocity.
As constant flux,
PREPARED BY S.NIRMALA,AP/ECE 99
As the armature current flows, it produces torque.
By taking Laplace transforms, we can get the transfer function of DC servomotor is
In which the armature current is maintained constant and speed of the DC servomotor is
controlled by field voltage.