Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 1
MECHATRONICS & MICROPROCESSOR
(10ME65)
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 2
ATME COLLEGE OF ENGINEERING
VISION
Development of academically excellent, culturally vibrant, socially responsible and globally competent human resources.
MISSION
To keep pace with advancements in knowledge and make the students competitive and capable
at the global level.
To create an environment for the students to acquire the right physical, intellectual, emotional
and moral foundations and shine as torch bearers of tomorrow's society.
To strive to attain ever-higher benchmarks of educational excellence.
DEPARTMENT OFMECHANICAL ENGINEERING
VISION
To impart excellent technical education in mechanical engineering to develop technically competent, morally upright and socially responsible mechanical engineering professionals.
MISSION:
To provide an ambience to impart excellent technical education in mechanical
engineering.
To ensure state of-the- art facility for learning, skill development and research in mechanical engineering.
To engage students in co-curricular and extra-curricular activities to impart social &
ethical values and imbibe leadership quality.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 3
PROGRAM EDUCATIONAL OBJECTIVES (PEO’S)
After successful completion of program, the graduates will be
PEO 1: Graduates will be able to have successful professional career in the allied areas and be proficient to perceive higher education.
PEO 2: Graduates will attain the technical ability to understand the need analysis, design, manufacturing, quality changing and analysis of the product.
PEO 3: Work effectively, ethically and socially responsible in allied fields of mechanical engineering.
PEO 4: Work in a team to meet personal and organizational objectives and to contribute to the development of the society in large.
PROGRAM OUTCOMES (PO’S)
The Mechanical engineering program students will attain:
PO1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and an engineering specialization to the solution of complex engineering problems
PO2. Problem analysis: Identify, formulate, research literature, and analyze complex engineering problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering sciences
PO3. Design/development of solutions: Design solutions for complex engineering problems and design system components or processes that meet the specified needs with appropriate consideration for the public health and safety, and the cultural, societal, and environmental considerations
PO4. Conduct investigations of complex problems: Use research-based knowledge and research methods including design of experiments, analysis and interpretation of data, and synthesis of the information to provide valid conclusions
PO5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern engineering and IT tools including prediction and modeling to complex engineering activities with an understanding of the limitations
PO6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional engineering practice
PO7. Environment and sustainability: Understand the impact of the professional engineering solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable development
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 4
PO8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the engineering practice
PO9. Individual and team work: Function effectively as an individual, and as a member or leader in diverse teams, and in multidisciplinary settings
PO10. Communication: Communicate effectively on complex engineering activities with the engineering community and with society at large, such as, being able to comprehend and write effective reports and design documentation, make effective presentations, and give and receive clear instructions
PO11. Project management and finance: Demonstrate knowledge and understanding of the engineering and management principles and apply these to one’s own work, as a member and leader in a team, to manage projects and in multidisciplinary environments
PO12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in independent and life-long learning in the broadest context of technological change
PROGRAM SPECIFIC OUTCOMES (PSO’S)
After successful completion of program, the graduates will be
PSO 1: To comprehend the knowledge of mechanical engineering and apply them to identify, formulate and address the mechanical engineering problems using latest technology in a effective manner.
PSO 2: To work successfully as a mechanical engineer in team, exhibit leadership quality and provide viable solution to industrial and societal problems.
PSO 3: To apply modern management techniques and manufacturing techniques to produce products of high quality at optimal cost.
PSO 4: To exhibit honesty, integrity, and conduct oneself responsibly, ethically and legally, holding the safety and welfare of the society paramount.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 5
COURSE SYLLABUS
MECHATRONICS & MICROPROCESSOR
Subject Code: 10ME65 IA Marks: 25
Hours/Week: 04 Exam Hours: 03
Total Hours: 52 Exam Marks: 100
PART - A
UNIT - 1
Introduction to Mechatronic Systems: Measurement and control systems Their elements and
functions, Microprocessor based controllers. 06 Hours
UNIT - 2
Review of Transducers and Sensors: Definition and classification of transducers. Definition
and classification of sensors. Principle of working and applications of light sensors, proximity
sensors and Hall effect sensors. 07 Hours
UNIT - 3
Electrical Actuation Systems: Electrical systems, Mechanical switches, solid-state switches,
solenoids, DC & AC motors, Stepper motors and their merits and demerits. 06 Hours
UNIT - 4
Signal Conditioning: Introduction to signal conditioning. The operational amplifier, Protection,
Filtering, Wheatstone bridge, Digital signals Multiplexers, Data acquisition, Introduction to
Digital system. Processing Pulse-modulation. 07 Hours
PART – B
UNIT - 5
Introduction to Microprocessors: Evolution of Microprocessor, Organization of
Microprocessors (Preliminary concepts), basic concepts of programming of microprocessors.
Review of concepts - Boolean algebra, Logic Gates and Gate Networks, Binary & Decimal
number systems, memory representation of positive and negative integers, maximum and
minimum integers. Conversion of real, numbers, floating point notation, representation of
floating point numbers, accuracy and range in floating point representation, overflow and
underflow, addition of floating point numbers, character representation. 07 Hours
UNIT - 6
Logic Function: Data word representation. Basic elements of control systems 8085A processor
architecture terminology such as CPU, memory and address, ALU, assembler data registers,
Fetch cycle, write cycle, state, bus, interrupts. Micro Controllers. Difference between
microprocessor and micro controllers. Requirements for control and their implementation in
microcontrollers. Classification of micro controllers. 07 Hours
UNIT - 7
Organization & Programming of Microprocessors: Introduction to organization of INTEL
8085-Data and Address buses, Instruction set of 8085, programming the 8085, assembly
language programming. 06 Hours
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 6
UNIT - 8
Central Processing Unit of Microprocessors: Introduction, timing and control unit basic
concepts, Instruction and data flow, system timing, examples of INTEL 8085 and INTEL 4004
register organization. 06 Hours
TEXT BOOKS:
1. Mechatronics, W.Bolton, Longman, 2Ed, Pearson Publications, 2007.
2. Microprocessor Architecture, Programming And Applications With 8085/8085A, R.S.
Ganokar, Wiley Eastern.
REFERENCE BOOKS:
1. Mechatronics and Microprocessors, K.P.Ramchandran, G.K.Vijayraghavan,
M.S.Balasundran, Wiley, 1st Ed, 2009
2. Mechatronics - Principles, Concepts and applications – Nitaigour and Premchand Mahilik
Tata McGraw Hill- 2003.
3. Mechatronics Principles & applications, Godfrey C. Onwubolu, Elsevier. .
4. Introduction Mechatronics & Measurement systems, David.G. Aliciatore & Michael. B.
Bihistaned, Tata McGraw Hill, 2000.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 7
UNIT 1
INTRODUCTION TO MECHATRONIC SYSTEMS
CONTENTS
1.1 Introduction
1.2 Definition of Mechatronics
1.3 Multi-disciplinary scenario.
1.4 Origin of Mechatronic system.
1.5 Evaluation of Mechatronics.
1.6.1Advantages of Mechatronic Systems
1.6 .2 Disadvantages of Mechatronic Systems.
1.7 Generalized measurement system
1.8 Functions of each units used in measurement system
1.9 Microprocessor based controllers:
1.9.1 Block diagram of Mechatronic System
1.9.2 Block diagram of working automatic camera
1.9.3 Block diagram of working automatic washing machine
1.9.4 Block diagram of working engine management system.
1.10 PLC (Programmable Logic Controller).
OBJECTIVES
To understand the concepts of mechatronics systems and its applications.
To understand the how microprocessor based controllers works.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 8
1.1 Introduction:
An automation and control method adopting integrated approach to technology has
become relevant to industries, machinery and consumer engineering products. Most of the
domestic equipment like automatic washing machines, automatic cameras, digital cameras,
DVD players, hard disc drives are examples of Mechatronic system which we use without
bothering to know the technology adopted in it.
1.2 Definition of Mechatronics:
Definition 1:
Mechatronics may be defined as” the complete integration of mechanical system with
electronics, electrical and computer system into a single system”.
Definition 2:
Mechatronics is “the synergistic (Together) combination of mechanical engineering, electronic
engineering, control engineering and systems thinking in the design of products and
manufacturing processes”
Example: automatic washing machine, digital fuel injection system, engine management system.
Etc.,
1.3 Multi-disciplinary scenario:
Mechatronics is the synergistic (Together) combination of mechanical engineering,
electronic engineering, control engineering and systems thinking in the design of
products and manufacturing processes”.
Multi-disciplinary products are not new; they have been successfully designed and used
for many years. Most common is the electromechanical system.
It employs a sequential design-by-discipline approach. For example in the design of
electromechanical system three stages of design are adopted.
They are design of mechanical system, design of microelectronic system and control
system.
Each design application follows the completion of the previous one.
It’s having so many drawbacks, to overcome this Mechatronics has been developed and it
uses concurrent engineering.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 9
1.4 Origin of Mechatronic system:
The word Mechatronics was coined by Japanese in the late 1970‟s to describe the
philosophy adopted in the design of subsystem of electromechanical systems.
The field of Mechatronics received the international recognitions only in the last few years.
The field has been derived by rapid progress in the field of microelectronics.
At R&D level the following areas have been recognized under Mechatronics discipline.
a) Motion control actuators and sensors
b) Micro devices and optoelectronics
c) Robotics
d) Automotive systems
e) Modeling and design
f) System integration
g) Manufacturing
h) Vibration and noise control.
1.5 Evaluation of Mechatronics:
The technology has evolved through several stages that are termed as levels.
The evolution levels of Mechatronics are:
a. Primary level Mechatronics (first)
b. Secondary level Mechatronics (second)
c. Tertiary level Mechatronics (third)
d. Quaternary level Mechatronics (fourth)
a. Primary level Mechatronics (first):
In the early days Mechatronics products were at primary level containing I/O devices such
as sensors, and actuators that integrated electrical signals with mechanical action at the basic
control level.
Examples: electrically controlled fluid valves and relays
b. Secondary level Mechatronics (second):
This level integrates microelectronics into electrically controlled devices.
Examples: cassette player.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 10
c. Tertiary level Mechatronics (third):
This incorporates advances feedback functions into control strategy, thereby enhancing the
quality in terms of sophistication.
Mechatronics system at this level is called ‘smart system’.
The control strategy includes microelectronics, microprocessor and other „application
specific integrated circuits‟ (ASIC).
Examples: DVD player, CD drives, automatic washing machine, CD drives, etc.
d. Quaternary level Mechatronics (fourth):
This level includes intelligent control in Mechatronics system.
The level attempts to improve smartness a step ahead by introducing intelligence and fault
detection and isolation (FDI) capability system.
Examples: artificial neural network and fuzzy logic technologies.
1.6.1 Advantages and disadvantages of Mechatronics:
Advantages:
1. The products produced are cost effective and very good quality.
2. High degree of flexibility
3. Greater extent of machine utilization
4. Greater productivity
5. High life expected by proper maintenance.
6. The integration of sensor and control system in a complex system reduces capital expenses.
1.6.2 Disadvantages:
1. Higher initial cost of the system.
2. Imperative to have Knowledge of different engineering fields for design and implementation.
3. It is expenses to incorporate Mechatronics approaches to existing/old systems.
4. Specific problem of various systems will have to be addressed separately and properly.
1.6.3 Characteristics of Mechatronic system:
1. High quality product.
2. Safe.
3. Low cost.
4. Portable produced quickly
5. Serviceability, maintainability and upgradeability.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 11
1.6.4 Applications of Mechatronic systems:
The areas are:
1. Automotive machines.
2. Fax and photocopier mechanics
3. Dishwashers.
4. Automatic washing machine
5. Air conditioners, elevator controls.
6. Documents scanners
7. IC manufacturing systems.
8. Robotics employed in welding, nuclear inspection, painting etc.,
9. VCRs and CD Players.
Measurement system: a group of device/element arranged in rational manner to achieve the act
of measurement.
Measurand: is a numerical quantity of physical phenomenon such as force, quantity,
displacement, time, velocity, etc,
Measurement: is a represent of physical phenomenon in numerical values.
1.7 Generalized measurement system:
Generally a measurement system consists of 3 basic elements.
1. Sensor/transducer.
2. Signal conditioner.
3. Display/read out devices.
In addition to the above, electrical power is also required.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 12
1.9 Functions of each elements of measurement system:
1.9.1. Sensor/transducer unit:
The heart of any measurement or control system is sensor/transducer.
Sensor/transducer is a device it converts the one form of energy to another form.
Sensor/transducer it senses the physical phenomenon to be measure and transform it from
one form to another form (generally electrical form).
The output of this unit is input to the signal conditioner which is next element.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 13
1.9.2. Signal conditioner unit:
This unit senses the output signals of sensor and converts it into suitable, measurable
level of signals.
An amplifier is acts as a signal conditioner in the figure.
The following functions of signal conditioners are:
a. Amplification of signals: the level of signals from the transducer may be of low level for the
next use and hence need to be amplified (increased).
b. Attenuation: similarly the level of signals from the transducer may be of higher level for the
next use and hence need be attenuated (decreased).
c. Filtering: signals from the transducer may contain some other undesirable signals which need
to be filtered or eliminated before it is used. Otherwise a corrupt output will be generated.
d. Analog to digital conversion (ADC): the signals from the transducer may be analog in nature
and if these signals were to be used as input to electronic system/computer system, they need to
be converting to digital form. Similarly sometimes we use DAC.
1.9.3. Display/read out unit:
It displays the output of signal conditioner unit and this display will be the quantitative form
of measurand.
Display unit may be either of analog (dial gauge) and digital (LED) type.
Example of Measurement system: Digital thermometer principle.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 14
1.9.4 Control system:
The word control means „to regulate‟, „manipulate‟, and „command‟.
Examples:
1. A container is to be filled with water from a tap. Once the water fills the container, the valve is
closed (that is spilling of water is avoided) by observation from a human being who senses the
filling and based on the observation closes the valve.
2. The driver applies the brake of the vehicle, when he/she observes red traffic light.
Definition of Control system:
A group of devices/elements which maintains the required output based on the predefined value
by controlling the parameter responsible for output.
Classification of control system:
1. Open loop control system (NO FEEDBACK control system).
2. Closed loop control system (WITH FEEDBACK control system).
1. Open loop control system (NO FEEDBACK control system):
In which the output is dependent on the input, but input is independent of output is called
open loop control system.
Figure:
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 15
Example:
1. ON/OFF of an electric lamp: electric lamps are used for lighting the lamp. ON/OFF control
is carried out with the help of a switch and the switch is generally operated by an operator
depending on the amount of light that exist in that area.
If the switch is ON, the lamp is glow. If the person operating the switch does not put OFF of the
switch, the lamp remain ON until he switched OFF. So it is called open loop control system.
2. Control the temperature of the room with room heater: the amount of heat generated by a
room heater depends on the amount of input power controlled by a regulator.
If the power is switch ON, the power supplied to the heater continues and temperature of the
room goes on increasing immaterial of whether heat is required in the room or not. Here person
is go and OFF the power supply switch and there by cooling the temperature of the room is
decreasing.
Advantages of open loop control system:
1. Less costly.
2. Relatively simple.
3. Good reliability.
4. Easy maintenance.
5. Inherently stable.
Disadvantages of open loop control system:
1. Inaccurate since there is no correction of error.
2. Relatively slow in response to change in demand.
3. The control depends on the human judgment.
4. Often leads to waste.
5. Any change in system component not to be taken care automatically.
2. Closed loop control system (WITH FEEDBACK control system):
In which input is depend on the output. i.e., variation in the output influences the input by
some means of controlling on the input is called a closed loop system.
Figure:
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 16
Elements of closed loop control system:
The basic elements of a closed loop control system are:
1. Comparison element.
2. Control unit.
3. Correction unit.
4. Process unit.
5. Feedback unit.
Functions of each elements of a closed loop system:
Comparison element: this unit compares the reference value with feedback value and produces
an error signal.
Error = reference value – feedback value
Control unit: Control unit analyses the error signal and decides what action is to be taken.
Correction unit: the modified signal from the control unit will be received by the correction unit
which produces a change in the process to correct or change the controlled condition.
Process unit: process unit is the unit which is being controlled.
Examples:
1. Hand reaching an object.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 17
This is an example of closed loop control system.
A person wants to reach for an object.
Position of the object is given as reference, feedback signals and the eyes compares the
actual position of the hands with reference to the position of the object.
Error signal is given to the brain.
Brain manipulates this error and gives signals to the hands.
This process continues till the hand reaches the object.
2. Speed control of an automobile:
The driver observes the speedometer, and based on the speed shown by the speedometer he
decides whether the fuel supply should be increased or decreased or gear change is to be made.
Here speed shown a speedometer is a feedback. A feedback signal from the eye compares
the desired speed in the memory of the driver.
Error signals are given to brain. Brain manipulates the error signals and gives it ton hand and
leg and increase the fuel supply if the speed is less than the desired speed, otherwise decrease the
fuel supply.
Changing of gear and increase or decrease of fuel supply, depends on whether it an upward
or downward gradient respectively.
3. Water level control of overhead tanks:
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 18
The overhead tank has a fixed float (sensor) fixed at the desired height inside the tanks.
The level of the water is sensed by the float. The float has an electrical contactor, which is
positioned between fixed connectors.
The inflow regulation valve is electrically operated. The electrical circuit of the system is
closed when the float touches the fixed connectors and open when it is not making contact with
it.
When the level of water in the tank falls, the float moves down and makes contact with fixed
contactor and circuit is closed and pump is switched ON.
When the level of water rises the float moves up and breaks the circuit and pump is switches
OFF. Thereby the required level of water is maintained in overhead tank.
3. Room temperature controller (manual):
In this case the required room temperature will be decided by person in the room and thus is
compared mentally.
Based on whether the room temperature is high or low, the person will operate the switch of
the room heater till the desired or comfortable temperature is achieved.
Block diagram is illustrating the above process.
Advantages of closed loop control system:
1. More accurate.
2. Any change in system component can be taken care automatically.
3. Use of feedback system response is relatively insensitive to external disturbances and internal
variations in system parameters.
Disadvantages of closed loop control system:
1. Expensive and complicated to construction.
Differences between open loop control system and closed loop control system
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 19
Sequential control system:
Control of sequences of operations in a sequence is called as a sequence control system.
Working of washing machine is a sequential control system wherein control is exercised
based on event, or parameter etc., i.e., control action will be executed one after another event.
The events to be carried out in a domestic washing machine are soaking, washing, rinsing
and drying.
Each of these operations involves a number of steps.
1.9 Microprocessor based controllers:
1.9.1 Introduction:
Recent development in the large scale integration (LSI), VLSI, SVLSI of semiconductor
devises and the resulting availability of inexpensive microprocessor, memory chips and
analog to digital converters (ADC) have made it possible to use computer as integral part
of control system without much increase in cost.
Some of the application areas of microprocessor and microcontroller based control system
include;
Automatic washing machine, automatic cameras, ATM, Computers, Automatic engine
management systems, Disc drivers in system, Industrial automations, etc.,
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 20
1.9.2 Block diagram of a microprocessor based processor control system:
Using data acquisition system (DAS) which converts the analog signals, from various
sensors to digital signals that can be processed by a microprocessor.
A keyboard in the system allow the user to enter set point values which are stored in the
memory and the feedback of the current values of the process variable are into the memory,
Relays, solenoids values, DAC and other actuators are used to control the process variables using
the program.
1.9.3 Block diagram of a microprocessor based processor control system of an Automatic
camera:
Working:
Camera is used to photograph an object, the switch is pressed which activates the system.
The range sensor sense the distance of the object to be photographed and this data is input to
microprocessor.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 21
The microprocessor in turn sends on output to motor to drive to position the lens for
focusing.
The position of the lens is input to microprocessor.
Next the light sensor sends the signal of light intensity on the object to microprocessor.
Based on this, signals are sent to control the duration of time the shutter have to be kept
open.
All these action and reaction take place within a fraction of second.
Once the film has exposed, the information is input to the microprocessor which gives
output for driving the motor for advancing the film to drive and the camera is ready for the next
exposure.
1.9.4 Block diagram of a microprocessor based processor control system of Automatic
washing machine:
Working:
This is a sequential control system wherein control is exercised based on event, or parameter
etc.,
i.e., control action will be executed one after another event.
The events to be carried out in a domestic washing machine are soaking, washing, rinsing
and drying.
Each of these operations involves a number of steps.
Soaking involves selection of correct quantity of detergent and water based on the type and
amount
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 22
of cloth.
This requires opening of the valve to fill the machine drum to required level and closing the
valve once the required level of water has reached and rotating the drum in either directions for a
pre-set amount of time during the soaking operation.
This is followed by washing which is a time parameter event.
Then the rinsing event which measures the pH value using a chemical sensor of water in the
drum and compares it with supply of water.
This event continues till the pH value of the water in the cloth and the supply water are
equal.
Finally drying operation till the minimum percentage of moisture is retained in the cloth.
All these events were earlier controlled with the help of mechanical system involving a set
of camoperated switches.
In modern washing machine mechanical system is replaced by digital devices. i.e., a
microcontroller and the sequence of instruction; program embedded in the microcontrollers.
The amount of detergent, amount of water, pH value are all sensed by the sensor and these
sensed qualities are input to the microcontroller.
Based on the input and the software embedded, the corresponding output of the
microcontroller to carry out the different sequence of operations.
1.9.5 Block diagram of Engine management system using microprocessor:
The figure illustrates the basic concept of engine management system using a
microprocessor.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 23
Engine management system is used for managing the ignition and air/fuel requirement of an
IC engine.
In the case of four stroke multi cylinder petrol engine, each cylinder has a piston performing
all the four stroke (suction, compression, working or expansion and exhaust strokes) and the
piston rod of each
Piston connected to common crankshaft, and their power strokes at different time‟s resulting
power for rotation of the crankshaft.
The power and speed of an engine are functions of ignition timing and air/fuel mixture.
Hence, by controlling the ignition timing and air/fuel mixture it is possible to control the
speed and power of the engine.
In modern cars the ignition timing, opening and closing of valves at appropriate time,
quality of air/fuel mixture are controlled by microprocessor with the help of sensors.
For ignition timing the crankshaft drives a distributor which makes electrical contacts for
each spark plug and turns a timing wheel.
The timing wheel generates pulses which are input the microprocessor.
The microprocessor as per the program adjusts the timing at which high voltage pulses are
sent to the distributor so that spark occurs at the right time resulting in complete combustion of
fuel.
The quantity of air/fuel mixture entering the cylinder during suction stroke is again
controlled by microprocessor by varying the time for which the solenoid is activated to open the
intake and throttle position.
The quantity of fuel injected into the air stream is sensed by sensor of the mass flow rate
computed from one method, and then input to the microprocessor which in turn gives an output
to control the fuel injection.
1.10 PLC (Programmable Logic Controller):
PLC is also called as modern computers.
In industry control applications are carried out by specialized devices for interfacing with
analog and digital devices with restricted instruction sets using programmable logic controllers
offers more flexibility in developing complex control algorithms and best suited for industrial
monitoring and control, in production environments.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 24
They are usually programmed with ladder logic, which is a graphical method of laying out the
connectivity and logic between system inputs and outputs.
COUSRE OUTCOMES
Students will
1. Understand how mechatronics system works and where it will be applied.
2. Understand how exactly Automatic Camera, Washing Machine works.
SELF ASSESSMENT QUESTIONS
1. Define Mechatronics and list out advantages and disadvantages of mechatronics.
2. Draw a neat block diagram of a generalized measurement system.
3. Define control system and different types of control systems.
4. Enumerate the difference between open loop and closed loop control system.
5. With a block diagram explain the working of a microprocessor controlled washing
machine.
6. With a block diagram explain the working of a microprocessor controlled automatic
camera.
7. With a block diagram explain the working of a microprocessor controlled engine
management system.
8. Explain programmable logic controller.
FURTHER READING
1. Mechatronics and Microprocessors, K.P.Ramchandran, G.K.Vijayraghavan,
M.S.Balasundran, Wiley, 1st Ed, 2009
2. Mechatronics - Principles, Concepts and applications – Nitaigour and Premchand Mahilik
Tata McGraw Hill- 2003.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 25
UNIT 2
REVIEW OF TRANSDUCERS AND SENSORS
CONTENTS
2.1 Introduction
2.2 Definition and Classification of Transducer
2.2.1 Classification of Transducer
2.3 Definitions and Classification of Sensors
2.3.1 Classification of Sensors:
2.4 Light sensors:
2.5 Photo diodes
2.6 Proximity sensors:
2.6.1 Eddy current proximity sensors:
2.6.2 Inductive proximity Sensor:
2.6.3 Optical Proximity Sensor
2.7 Hall Effect Sensor
OBJECTIVE
Is to understand concepts of Transducer and Sensors.
Is to understand working of different types of sensors.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 26
2.1 Introduction:
Sensors and transducers are the heart of any mechatronic system. Without sense organs there is
no life and so also there is no mechatronic system without transducers and sensors. In fact, they
are the essential elements of any measurement or control system.
2.2 Definition and Classification of Transducer:
A Transducer is a device which transforms one form of physical phenomenon or energy to
another form for varies purposes including measurement, control and information transfer. The
physical phenomenon may be position, displacement, force, torque, flow of fluid, pressure of
fluid, temperature, etc..
Transduce ------ Trance (Change) + Induce (Provide)
2.2.1 Classification of Transducer:
Transducers are classified based on the following factors:
a. Whether the device senses and converts or just converts physical phenomenon.
b. Method of conversion of energy.
c. Nature and Type of output signals.
d. Type of sensing element used.
e. Type and nature of measurand to be used.
f. Whether they are self generating or externally powered.
g. Its purpose in the measurement system.
a. Whether the device senses and converts or just converts physical phenomenon.
They are
i. Primary transducer
ii. Secondary transducer
i. Primary transducer:
These are detectors which sense a physical phenomenon and convert it into an analogous output.
E. g: Thermocouple.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 27
ii. Secondary transducer:
These are those which convert the analogous output of the detector, which has sensed the
E.g.: Measurement of compressive force with the help of load cell.
b. Method of conversion of energy:
The energy or signal produced due to physical phenomenon or measurand are converted into
another form using mechanical linkages as in the case of simple dial gauge or the properties of
material like resistance, conduction, expansion etc.
E.g. Strain gauges are used to measure the mechanical strain of a member due to load or force.
The change in resistance of the strain gauges is the measure of force.
c. Nature and Type of output signals:
i. Analog transducer
ii. Digital transducer
i. Analog transducer: These are whose convert physical phenomenon into an analogous output
which is a continuous function of time. Strain gauges, thermisters, LVDT, etc,are examples of
analogue transducer.
ii. Digital transducer: These are whose convert physical phenomenon into an electrical output
which is in the form of pulses. These are not many digital transducers available, although there
importance is well recognized in modern microprocessor based control systems and
instrumentation. Angular digital encoder and digital level transducers are examples are digital
transducers.
d. Type of sensing element used:
i. Elastic elements
ii. Mass sensing elements
iii. Thermal elements
iv. Hydro pneumatic elements.
i. Elastic elements: Most pressure measuring devices use a Bourdon tube, a bellow or a
diaphragm. The action of these elements is based on elastic deformation brought about by the
force resulting from pressure summation.
ii. Mass sensing elements: This is based on the inertia of a concentrated mass. Vibration pick up
accelerometers, liquid manometers are examples of mass sensing element transducer.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 28
iii. Thermal elements: these elements sense the heat of a system by indicating some change in
the property of the material used,which varies with the heat.
iv. Hydro pneumatic elements: The two simple examples of hydro pneumatic elements are
Float and hydrometer.
e. Whether they are self generating or externally powered:
i. Active transducers
ii. Passive transducers
i. Active transducers: These are those which develop their own power. They are also know as
self generating transducers, the energy required for production of output signal form the physical
phenomenon being measured.
E.g.: Piezoelectric pick up, thermocouples photo voltaic cell etc.
ii. Passive transducers: These are those which required externals power of producing output
signal. There also know externally power transducers.
E. g. Resistance thermometer, thermostats, differential transformers etc.
f. Its purpose in the measurement system:
i. Input transducers
ii. Output transducers
i. Input transducers: These transducers convert a non electric quality into an electric signal.
E.g. Strain gauge, photovoltaic cell etc
ii. Output transducers: These transducers convert electrical signal back into non-electrical
signal according to whether they make physical contact or not. They are contact and non-contact
type.
g. Its purpose in the measurement system:
Mechanical transducers for measuring quantities such as position, velocity, force, torque,
displacement, pressure, vibration, strain mass etc.
2.3 Definition and Classification of Sensors:
Definition: Sensor may be define as an element or device which can respond directly to different
physical attributes such as heat, light, force related quantities etc.
The term transducer and sensor have been synonymously used although the principles are
different. Transducers are physical element and are a part of sensor.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 29
A sensor is in fact a highly refined transducer provided with signal conditioning circuit capable
of modifying the signals from the transducer. The most commonly used signal conditioning
circuits are amplifiers, filters, ADC, DAC, attenuators etc. Fig 2.1 shows the basic concept of
sensor.
If the sensor itself transducers the physical attributes in addition to sensing is called detector
transducer.
2.3.1 Classification of Sensors:
The classification of sensors are based on
a. Type of energy transferred, Under this we have:
i. Thermal
ii. Mechanical
iii. Chemical
iv. Optical radiation
v. Ionizing radiation
vi. Electromagnetic
b. Classification based on measurement error
c. Biological sensors
d. Geodetic sensors.
2.4 Light sensors:
Principle of Working and Applications of Light Sensors:
A light sensor is a device that is used to detect light. There are different types of light sensors
such as photocell/ photo resistor and photo diodes being used in manufacturing and other
industrial applications.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 30
Photo resistor is also called as light dependent resistor (LDR). It has a resistor whose resistance
decreases with increasing incident light intensity. It is made of a high resistance semiconductor
material, cadmium sulfide (CdS). The resistance of a CdS photo resistor varies inversely to the
amount of light incident upon it. Photo resistor follows the principle of photoconductivity which
results from the generation of mobile carriers when photons are absorbed by the semiconductor
material.
Figure 2.5.6 shows the construction of a photo resistor. The CdS resistor coil is mounted on a
ceramic substrate. This assembly is encapsulated by a resin material. The sensitive coil
electrodes are connected to the control system though lead wires. On incidence of high intensity
light on the electrodes, the resistance of resistor coil decreases which will be used further to
generate the appropriate signal by the microprocessor via lead wires.
Photo resistors are used in science and in almost any branch of industry for control, safety,
amusement, sound reproduction, inspection and measurement.
Fig. Construction of Light Sensors
Applications of Light Sensor
Computers, wireless phones, and televisions, use ambient light sensors to automatically
control the brightness of a screen
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 31
Barcode scanners used in retailer locations work using light sensor technology
In space and robotics: for controlled and guided motions of vehicles and robots.
Auto Flash for camera
Industrial process control.
2.5 Photo diodes
Photodiode is a solid-state device which converts incident light into an electric current. It
is made of Silicon. It consists of a shallow diffused p-n junction, normally a p-on-n
configuration. When photons of energy greater than 1.1eV (the band gap of silicon) fall on the
device, they are absorbed and electron-hole pairs are created. The depth at which the photons are
absorbed depends upon their energy. The lower the energy of the photons, the deeper they are
absorbed. Then the electron-hole pairs drift apart. When the minority carriers reach the junction,
they are swept across by the electric field and an electric current establishes.
Photodiodes are one of the types of photo detector, which convert light into either current
or voltage. These are regular semiconductor diodes except that they may be either exposed to
detect vacuum UV or X-rays or packaged with a opening or optical fiber connection to allow
light to reach the sensitive part of the device.
Fig. Construction of Photo diodes
Figure .shows the construction of Photo diode detector. It is constructed from single crystal
silicon wafers. It is a p-n junction device. The upper layer is p layer. It is very thin and formed by
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 32
thermal diffusion or ion implantation of doping material such as boron. Depletion region is
narrow and is sandwiched between p layer and bulk n type layer of silicon. Light irradiates at
front surface, anode, while the back surface is cathode. The incidence of light on anode generates
a flow of electron across the p-n junction which is the measure of light intensity.
Applications of photo diodes
Camera: Light Meters, Automatic Shutter Control, Auto-focus, Photographic Flash Control
Medical: CAT Scanners - X ray Detection, Pulse Oximeters, Blood Particle Analyzers.
Industry
• Bar Code Scanners
• Light Pens
• Brightness Controls
• Encoders
• Position Sensors
• Surveying Instruments
• Copiers - Density of Toner
Safety Equipment
• Smoke Detectors
• Flame Monitors
• Security Inspection Equipment
2.6 Proximity sensors:
2.6.1 Eddy current proximity sensors:
Fig Construction of Eddy current proximity sensors:
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 33
Eddy current proximity sensors are used to detect non-magnetic but conductive materials. They
comprise of a coil, an oscillator, a detector and a triggering circuit. Figure shows the construction
of eddy current proximity switch. When an alternating current is passed thru this coil, an
alternative magnetic field is generated. If a metal object comes in the close proximity of the coil,
then eddy currents are induced in the object due to the magnetic field. These eddy currents create
their own magnetic field which distorts the magnetic field responsible for their generation. As a
result, impedance of the coil changes and so the amplitude of alternating current. This can be
used to trigger a switch at some pre-determined level of change in current.
Eddy current sensors are relatively inexpensive, available in small in size, highly reliable and
have high sensitivity for small displacements.
Applications of eddy current proximity sensors:
Automation requiring precise location
Machine tool monitoring
Final assembly of precision equipment such as disk drives
Measuring the dynamics of a continuously moving target, such as a vibrating element,
Drive shaft monitoring
Vibration measurements
2.6.2 Inductive proximity Sensor:
Fig Schematic of Inductive proximity Sensor
Inductive proximity switches are basically used for detection of metallic objects. Figure shows
the construction of inductive proximity switch. An inductive proximity sensor has four
components; the coil, oscillator, detection circuit and output circuit. An alternating current is
supplied to the coil which generates a magnetic field. When, a metal object comes closer to the
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 34
end of the coil, inductance of the coil changes. This is continuously monitored by a circuit which
triggers a switch when a preset value of inductance change is occurred.
Applications of inductive proximity Sensor
Industrial automation: counting of products during production or transfer
Security: detection of metal objects, arms, land mines
2.6.3 Optical Proximity Sensor:
Optical encoders provide digital output as a result of linear / angular displacement. These are
widely used in the Servo motors to measure the rotation of shafts. Figure shows the construction
of an optical encoder. It comprises of a disc with three concentric tracks of equally spaced holes.
Three light sensors are employed to detect the light passing thru the holes. These sensors produce
electric pulses which give the angular displacement of the mechanical element e.g. shaft on
which the Optical encoder is mounted. The inner track has just one hole which is used locate the
‘home’ position of the disc. The holes on the middle track offset from the holes of the outer track
by one-half of the width of the hole. This arrangement provides the direction of rotation to be
determined. When the disc rotates in clockwise direction, the pulses in the outer track lead those
in the inner; in counter clockwise direction they lag behind. The resolution can be determined by
the number of holes on disc. With 100 holes in one revolution, the resolution would be,
360⁰/100 = 3.6⁰.
Fig: Construction and working principle of Optical Proximity Sensor
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 35
2.7Hall Effect Sensors:
Hall Effect sensors work on the principle that when a beam of charge particles passes through a
magnetic field, forces act on the particles and the current beam is deflected from its straight line
path. Thus one side of the disc will become negatively charged and the other side will be of
positive charge. This charge separation generates a potential difference which is the measure of
distance of magnetic field from the disc carrying current.
The typical application of Hall Effect sensor is the measurement of fluid level in a container. The
container comprises of a float with a permanent magnet attached at its top. An electric circuit
with a current carrying disc is mounted in the casing. When the fluid level increases, the magnet
will come close to the disc and a potential difference generates. This voltage triggers a switch to
stop the fluid to come inside the container.
These sensors are used for the measurement of displacement and the detection of position of an
object. Hall Effect sensors need necessary signal conditioning circuitry. They can be operated at
100 kHz. Their non-contact nature of operation, good immunity to environment contaminants
and ability to sustain in severe conditions make them quite popular in industrial automation.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 36
COURSE OUTCOMES
Students will
1. Learn how transducers and sensors work.
SELF ASSESSMENT QUESTIONS
1. Define transducer and its classification.
2. Define sensor and its classification.
3. With an example, explain primary and secondary transducer.
4. What is an encoder and how they are classified.
5. Explain with a simple sketch the constructional features of an absolute encoder.
6. Explain with a simple sketch the constructional features of an incremental encoder.
7. Explain the principle and working of proximity sensor.
8. Explain the principle and working of Hall Effect sensor.
9. Explain the principle and working of pneumatic sensor.
10. Explain performance of a transducer.
11. Define a) range, b) span, c) sensitivity, d) accuracy.
12. Define a) hysteresis, b) resolution, c) threshold, d) system error.
FURTHER READING
1. Mechatronics Principles & applications, Godfrey C. Onwubolu, Elsevier. .
2. Introduction Mechatronics & Measurement systems, David.G. Aliciatore & Michael.
B. Bihistaned, Tata McGraw Hill, 2000.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 37
UNIT 3
ELECTRICAL ACTUATION SYSTEM
CONTENTS
3 Motors
3.1 DC motors
3.2 Brush type DC motor
3.2.1 Advantages of brushed DC motor
3.2.2 Disadvantages of brushed DC motor
3.3 Brushless DC motor
3.3.1 Advantages of brushless DC motor
3.3.2 Disadvantages of brushless DC motor
3.4 Synchronous motor
3.5 Induction motor
3.6 Stepper motor
3.6.1 Types of stepper motors
3.6.2 Permanent magnet (PM) stepper motor
3.6.3 Hybrid stepper motor
3.6.4 Advantages of stepper motors
3.6.5 Disadvantages of stepper motors
OBJECTIVES
Is to get knowledge of different types of motors with their merits and demerits.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 38
3 MOTORS
Electric drives are mostly used in position and speed control systems. The motors can be
classified into two groups namely DC motors and AC motors. In this session we shall study the
operation, construction, advantages and limitations of DC and AC motors.
3.1 DC motors:
A DC motor is a device that converts direct current (electrical energy) into rotation of an element
(mechanical energy). These motors can further be classified into brushed DC motor and
brushless DC motors.
3.2 Brush type DC motor
A typical brushed motor consists of an armature coil, slip rings divided into two parts, a pair of
brushes and horse shoes electromagnet as shown in Fig. A simple DC motor has two field poles
namely a north pole and a south pole. The magnetic lines of force extend across the opening
between the poles from north to south. The coil is wound around a soft iron core and is placed in
between the magnet poles. These electromagnets receive electricity from an outside power source.
The coil ends are connected to split rings. The carbon brushes are in contact with the split rings. The
brushes are connected to a DC source. Here the split rings rotate with the coil while the brushes
remain stationary.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 39
Fig: Brush type DC Motor
The working is based on the principle that when a current-carrying conductor is placed in a
magnetic field, it experiences a mechanical force whose direction is given by Fleming's left-hand
rule. The magnitude of the force is given by
𝐹 = 𝐵𝐼𝐿𝑠𝑖𝑛𝜃
Where,
B is magnetic field density in weber/m2
I is the current in amperes and
L is the length of the conductor in meter
θ is the angle between the direction of the current in the conductor and the electric field
If the current and filed are perpendicular then θ=90°. The equation becomes,
𝐹 = 𝐵𝐼𝐿
A direct current in a set of windings creates a magnetic field. This field produces a force which
turns the armature. This force is called torque. This torque will cause the armature to turn until
its magnetic field is aligned with the external field. Once aligned the direction of the current in
the windings on the armature reverses, thereby reversing the polarity of the rotor's
electromagnetic field. A torque is once again exerted on the rotor, and it continues spinning. The
change in direction of current is facilitated by the split ring commutator. The main purpose of the
commutator is to overturn the direction of the electric current in the armature. The commutator
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 40
also aids in the transmission of current between the armature and the power source. The brushes
remain stationary, but they are in contact with the armature at the commutator, which rotates
with the armature such that at every 180° of rotation, the current in the armature is reversed.
3.2.1 Advantages of brushed DC motor:
• The design of the brushed DC motor is quite simple
• Controlling the speed of a Brush DC Motor is easy
• Very cost effective
3.2.2 Disadvantages of brushed DC motor:
• High maintenance
• Performance decreases with dust particles
• Less reliable in control at lower speeds
• The brushes wear off with usage
3.3 Brushless DC motor:
Fig: Brushless Type DC motor
A brushless DC motor has a rotor with permanent magnets and a stator with windings. The rotor
can be of ceramic permanent magnet type. The brushes and commutator are eliminated and the
windings are connected to the control electronics. The control electronics replace the
commutator and brushes and energize the stator sequentially. Here the conductor is fixed and the
magnet moves.
The current supplied to the stator is based on the position of rotor. It is switched in sequence using
transistors. The position of the rotor is sensed by Hall Effect sensors. Thus a continuous rotation is
obtained.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 41
3.3.1 Advantages of brushless DC motor:
• More precise due to computer control
• More efficient
• No sparking due to absence of brushes
• Less electrical noise
• No brushes to wear out
• Electromagnets are situated on the stator hence easy to cool
• Motor can operate at speeds above 10,000 rpm under loaded and unloaded conditions
• Responsiveness and quick acceleration due to low rotor inertia
3.3.2 Disadvantages of brushless DC motor:
• Higher initial cost
• Complex due to presence of computer controller
• Brushless DC motor also requires additional system wiring in order to power the electronic
commutation circuitry.
AC motors
AC motors convert AC current into the rotation of a mechanical element (mechanical energy).
As in the case of DC motor, a current is passed through the coil, generating a torque on the coil.
Typical components include a stator and a rotor. The armature of rotor is a magnet unlike DC
motors and the stator is formed by electromagnets similar to DC motors. The main limitation of
AC motors over DC motors is that speed is more difficult to control in AC motors. To overcome
this limitation, AC motors are equipped with variable frequency drives but the improved speed
control comes together with a reduced power quality.
Fig: AC Motor Working Principle
The working principle of AC motor is shown in fig. 4.1.6. Consider the rotor to be a permanent
magnet. Current flowing through conductors energizes the magnets and develops N and S poles.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 42
The strength of electromagnets depends on current. First half cycle current flows in one direction
and in the second half cycle it flows in opposite direction. As AC voltage changes the poles
alternate.
AC motors can be classified into synchronous motors and induction motors.
3.4 SYNCHRONOUS MOTOR :
A synchronous motor is an AC motor which runs at constant speed fixed by frequency of the
system. It requires direct current (DC) for excitation and has low starting torque, and hence is
suited for applications that start with a low load. It has two basic electrical parts namely stator
and rotor as shown in fig. The stator consists of a group of individual wounded electro-magnets
arranged in such a way that they form a hollow cylinder. The stator produces a rotating magnetic
field that is proportional to the frequency supplied.
The rotor is the rotating electrical component. It also consists of a group of permanent magnets
arranged around a cylinder, with the poles facing toward the stator poles. The rotor is mounted
on the motor shaft. The main difference between the synchronous motor and the induction motor
is that the rotor of the synchronous motor travels at the same speed as the rotating magnet.
Fig. Synchronous Motor
The stator is given a three phase supply and as the polarity of the stator progressively change the
magnetic field rotates, the rotor will follow and rotate with the magnetic field of the stator. If a
synchronous motor loses lock with the line frequency it will stall. It cannot start by itself, hence
has to be started by an auxiliary motor.
Synchronous speed of an AC motor is determined by the following formula:
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 43
𝑁𝑠 = (120 ∗ 𝑓)/𝑃
Where,
Ns = Revolutions per minute
P = Number of pole pairs
f = Applied frequency
3.5 Induction motor:
Induction motors are quite commonly used in industrial automation. In the synchronous motor
the stator poles are wound with coils and rotor is permanent magnet and is supplied with current
to create fixed polarity poles. In case of induction motor, the stator is similar to synchronous
motor with windings but the rotors’ construction is different.
Fig : Induction Motor
Rotor of an induction motor can be of two types:
A squirrel-cage rotor consists of thick conducting bars embedded in parallel slots.The
bars can be of copper or aluminum. These bars are fitted at both ends by means end
rings as shown in figure.
A wound rotor has a three-phase, double-layer, distributed winding. The rotor is
wound for as many numbers of poles as the stator. The three phases are wired
internally and the other ends are connected to slip-rings mounted on a shaft with
brushes resting on them.
Induction motors can be classified into two types:
o Single-phase induction motor: It has one stator winding and a squirrel cage
rotor.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 44
It operates with a single-phase power supply and requires a device to start
the motor.
o Three-phase induction motor: The rotating magnetic field is produced by the
balanced three-phase power supply. These motors can have squirrel cage or
wound rotors and are self-starting. In an induction motor there is no external
power supply to rotor. It works on the principle of induction. When a conductor
is moved through an existing magnetic field the relative motion of the two
causes an electric current to flow in the conductor. In an induction motor the
current flow in the rotor is not caused by any direct connection of the
conductors to a voltage source, but rather by the influence of the rotor
conductors cutting across the lines of flux produced by the stator magnetic
fields. The induced current which is produced in the rotor results in a magnetic
field around the rotor. The magnetic field around each rotor conductor will
cause the rotor conductor to act like the permanent magnet. As the magnetic
field of the stator rotates, due to the effect of the three-phase AC power supply,
the induced magnetic field of the rotor will be attracted and will follow the
rotation. However, to produce torque, an induction motor must suffer from slip.
Slip is the result of the induced field in the rotor windings lagging behind the
rotating magnetic field in the stator windings. The slip is given by,
𝑆 =((𝑆𝑦𝑛𝑐ℎ𝑟𝑜𝑛𝑜𝑢𝑠 𝑠𝑝𝑒𝑒𝑑 − 𝐴𝑐𝑡𝑢𝑎𝑙 𝑠𝑝𝑒𝑒𝑑)/𝑆𝑦𝑛𝑐ℎ𝑟𝑜𝑛𝑜𝑢𝑠 𝑠𝑝𝑒𝑒𝑑 ))∗ 100%
Advantages of AC induction motors
• It has a simple design, low initial cost, rugged construction almost unbreakable
• The operation is simple with less maintenance (as there are no brushes)
• The efficiency of these motors is very high, as there are no frictional losses, with reasonably
good power factor
• The control gear for the starting purpose of these motors is minimum and thus simple and
reliable operation
Disadvantages of AC induction motors
• The speed control of these motors is at the expense of their efficiency
• As the load on the motor increases, the speed decreases
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 45
• The starting torque is inferior when compared to DC motors
3.6 Stepper motor:
A stepper motor is a pulse-driven motor that changes the angular position of the rotor in steps.
Due to this nature of a stepper motor, it is widely used in low cost, open loop position control
systems.
3.6.1 Types of stepper motors:
1. Permanent Magnet
Employ permanent magnet
Low speed, relatively high torque
2. Variable Reluctance
Does not have permanent magnet
Low torque
2. Variable Reluctance Motor
Figure shows the construction of Variable Reluctance motor. The cylindrical rotor is made of
soft steel and has four poles as shown in Fig. It has four rotor teeth, 90⁰apart and six stator
poles, 60⁰ apart. Electromagnetic field is produced by activating the stator coils in sequence. It
attracts the metal rotor. When the windings are energized in a reoccurring sequence of 2, 3, 1,
and so on, the motor will rotate in a 30⁰ step angle. In the non-energized condition, there is no
magnetic flux in the air gap, as the stator is an electromagnet and the rotor is a piece of soft
iron; hence, there is no detent torque. This type of stepper motor is called a variable reluctance
stepper.
Fig: Variable Reluctance Motor
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 46
Permanent magnet (PM) stepper motor:
In this type of motor, the rotor is a permanent magnet. Unlike the other stepping motors, the PM
motor rotor has no teeth and is designed to be magnetized at a right angle to its axis. Figure shows a
simple, 90⁰ PM motor with four phases (A-D). Applying current to each phase in sequence will cause
the rotor to rotate by adjusting to the changing magnetic fields. Although it operates at fairly low
speed, the PM motor has a relatively high torque characteristic. These are low cost motors with
typical step angle ranging between 7.5⁰ to 15⁰.
Fig: Permanent magnet (PM) stepper motor
3.6.3 Hybrid stepper motor:
Hybrid stepping motors combine a permanent magnet and a rotor with metal teeth to provide features
of the variable reluctance and permanent magnet motors together. The number of rotor pole pairs is
equal to the number of teeth on one of the rotor’s parts. The hybrid motor stator has teeth creating
more poles than the main poles windings.
Fig: Hybrid stepper motor
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 47
Rotation of a hybrid stepping motor is produced in the similar fashion as a permanent magnet
stepping motor, by energizing individual windings in a positive or negative direction. When a
winding is energized, north and south poles are created, depending on the polarity of the current
flowing. These generated poles attract the permanent poles of the rotor and also the finer metal
teeth present on rotor. The rotor moves one step to align the offset magnetized rotor teeth to the
corresponding energized windings. Hybrid motors are more expensive than motors with
permanent magnets, but they use smaller steps, have greater torque and maximum speed.
Step angle of a stepper motor is given by, Step angle = 360°/Number of poles
3.6.4 Advantages of stepper motors
• Low cost
• Ruggedness
• Simplicity of construction
• Low maintenance
• Less likely to stall or slip
• Will work in any environment
• Excellent start-stop and reversing responses
3.6.5 Disadvantages of stepper motors
• Low torque capacity compared to DC motors
• Limited speed
• During overloading, the synchronization will be broken. Vibration and noise occur when
running at high speed.
COURSE OUTCOMES
Students will
1. Understand the working of types of motors and their merits and demerits.
SELF ASSESSMENT QUESTIONS
1. What is meant by electrical actuation system?
2. With a neat diagram explain principle and working of a relay.
3. What is the principle of a solenoid? What are the two basic types of solenoid?
4. Explain the principle of an electric motor. How are they classified.
5. What is a dc motor? Explain the principle of working of a dc motor.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 48
6. What is an ac motor? List the difference between ac and dc motors.
7. What is meant by stepper motor? List out its classification.
8. With a neat sketch explain principle of variable reluctance stepper motor.
FURTHER READING
1. Mechatronics - Principles, Concepts and applications – Nitaigour and Premchand
Mahilik, Tata McGraw Hill- 2003.
2. Mechatronics Principles & applications, Godfrey C. Onwubolu, Elsevier.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 49
UNIT 4
SIGNAL CONDITIONING
CONTENTS
4 Introductions to Signal Conditioning
4.1 Definition
4.2 Necessity of Signal Conditioning:
4.3 Methods adopted for signal conditioning
4.3.1 Amplifiers
4.3.2 The Operational Amplifier:
4.3.3 Filtering
4.4 Wheatstone bridge:
4.5 Basic components used in ADCs and DACs
4.6 Binary Weighted DAC
4.7 Pulse modulation
OBJECTIVES:
Is to get proper knowledge of signal conditioning process.
Concepts of operational amplifier, wheatstone bridge and pulse modulation.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 50
4 Introduction to Signal Conditioning:
4.1 Definition:
Signal Conditioning may be define as the process of modifying the output signal from transducer into
usable and satisfactory level of signals using amplification, attenuation, filtration etc.
In previous lectures we have studied various sensors and transducers used in a mechatronics system.
Transducers sense physical phenomenon such as rise in temperature and convert the measurand into
an electrical signal viz. voltage or current. However these signals may not be in their appropriate
forms to employ them to control a mechatronics system. Figure shows various signal conditioning
operations which are being carried out in controlling a mechatronics based system. The signals given
by a transducer may be nonlinear in nature or may contain noise. Thus before sending these signals
to the mechatronics control unit it is essential to remove the noise, nonlinearity associated with the
raw output from a sensor or a transducer. It is also needed to modify the amplitude (low/high) and
form (analogue/digital) of the output signals into respective acceptable limits and form which will be
suitable to the control system. These activities are carried out by using signal conditioning devices
and the process is termed as ‘signal conditioning’.
Fig. Signal Conditioning Operation.
Signal conditioning system enhances the quality of signal coming from a sensor in terms of:
Protection
To protect the damage to the next element of mechatronics system such microprocessors from the
high current or voltage signals.
Right type of signal
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 51
To convert the output signal from a transducer into the desired form i.e. voltage / current.
Right level of the signal
To amplify or attenuate the signals to a right /acceptable level for the next element.
Noise
To eliminate noise from a signal.
Manipulation
To manipulate the signal from its nonlinear form to the linear form.
4.2 Necessity of Signal Conditioning:
Output Signal from the transducer in most cases will be in the electrical form. It may not be possible
to use these signal directly for further application due to so many reasons. This necessitates the
modification of the transducer. The following are a few general reasons for signal conditioning.
a. Too small level of signals
b. Too high level of signals
c. Too “noisy” usually due to electromagnetic
d. Incorrect form of signals
e. Poor quality of signals.
4.3 Methods adopted for signal conditioning:
4.3.1 Amplifiers:
An amplifier is relatively simple circuit used to amplify the level of electrical signals. The output
signal of the amplifier will be proportional to the input signal. Fig. Shows the concept of
amplification.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 52
Fig. Concept of Amplification
4.3.2 The Operational Amplifier:
Various applications of Mechatronics system such as machine tool control unit of a CNC
machine tool accept voltage amplitudes in range of 0 to 10 Volts. However many sensors
produce signals of the order of milli volts. This low level input signals from sensors must be
amplified to use them for further control action. Operational amplifiers (op-amp) are widely used
for amplification of input signals. The details are as follows.
Operational Amplifier is a basic and an important part of a signal conditioning system. It is often
abbreviated as op-amp. Op-amp is a high gain voltage amplifier with a differential input. The
gain is of the order of 100000 or more. Differential input is a method of transmitting information
with two different electronic signals which are generally complementary to each other. Figure
shows the block diagram of an op-amp. It has five terminals. Two voltages are applied at two
input terminals. The output terminal provides the amplified value of difference between two
input voltages. Op-amp works by using the external power supplied at Vs+ and Vs terminals.
4.3.3 Filtering
Output signals from sensors contain noise due to various external factors like improper hardware
connections, environment etc. Noise gives an error in the final output of system. Therefore it
must be removed. In practice, change in desired frequency level of output signal is a commonly
noted noise. This can be rectified by suing filters. Following types of filters are used in practice:
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 53
Low Pass Filter
High Pass Filter
Band Pass Filter
Band Reject Filter
Low Pass Filter:
Low pass filter is used to allow low frequency content and to reject high frequency content of an
input signal. Its configuration is shown in Figure
Fig Circuit for low passes Filter
Fig. Pass band for low pass filter.
In the circuit shown in Figure resistance and capacitance are in series with voltage at resistance
terminal is input voltage and voltage at capacitance terminal is output voltage.
High Pass Filter:
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 54
Fig Circuit for high passes Filter
These types of filters allow high frequencies to pass through it and block the lower frequencies.
The figure shows circuitry for high pass filter.
Fig. Pass band for high pass filter.
Band Pass Filter:
In some applications, we need to filter a particular band of frequencies from a wider range of
mixed signals. For this purpose, the properties of low-pass and high-pass filters circuits can be
combined to design a filter which is called as band pass filter. Band pass filter can be developed
by connecting a low-pass and a high-pass filter in series as shown in figure
Fig Band Reject Filter
4.4 Wheatstone bridge:
Fig. Configuration of a Wheastone bridge.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 55
Wheatstone bridge is used to convert a resistance change detected by a transducer to a voltage
change. Figure 2.7.3 shows the basic configuration of a Wheatstone bridge. When the output
voltage Vout is zero then the potential at B must be equal to D and we can say that,
𝑉𝑎𝑏 = 𝑉 ……………………………………....1
𝐼1 𝑅 1 = 𝐼2 𝑅2…………………………………….2
Also
𝑉𝑏𝑐 = 𝑉𝑑𝑐…………………………………………………….3
𝐼1 𝑅2 = 𝐼2 𝑅4……………………………………4
Dividing equation 2 by 4
𝑅1/𝑅2 = 𝑅3/𝑅4………………………………………..5
The bridge is thus balanced.
The potential drop across 𝑅1 due to supply voltage Vs,
𝑉𝑎𝑏 = 𝑉𝑠 𝑅1/ (𝑅1 + 𝑅2) ……………………………6
Similarly,
𝑉𝑎𝑑 = 𝑉𝑠𝑅3/(𝑅3 + 𝑅4)……………………………...7
Thus the output voltage Vo is given by,
𝑉𝑜 = 𝑉𝑎𝑏 – 𝑉𝑎𝑑……………………………………..8
𝑉𝑜 = 𝑉𝑠 {(𝑅1/[𝑅1 + 𝑅2]) – (𝑅3/[𝑅3 + 𝑅4])} ………9
When 𝑉𝑜 = 0, above equation gives balanced condition.
Assume that a transducer produces a resistance change from 𝑅1 to 𝑅1 + 𝛿𝑅1 which gives a change in
output from 𝑉𝑜 + 𝛿𝑉𝑜,
From equation 9 we can write,
𝑉𝑜 + 𝛿𝑉𝑜 = 𝑉𝑠 ((𝑅1+𝛿𝑅1/𝑅1+𝛿𝑅1+𝑅2) – (𝑅3/𝑅3+𝑅4))……...................10
Hence,
(𝑉𝑜 + 𝛿𝑉𝑜) –Vo = 𝑉𝑠 ((𝑅1+𝛿𝑅1/𝑅1+𝛿𝑅1+𝑅2) – (𝑅3/𝑅3+𝑅4))…….........11
If 𝛿𝑅1 is much smaller than 𝑅1 the equation 11 can be written as
𝛿𝑉𝑜 ≈ 𝑉𝑠 (𝛿𝑅1/𝑅1+𝑅2) ………………………….……………………...12
We can say that change in resistance 𝑅1 produces a change in output voltage. Thus we can
convert a change in resistance signal into voltage signal.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 56
Data Conversion Devices:
Data Conversion Devices are very important components of a Machine Control Unit (MCU). MCUs
are controlled by various computers or microcontrollers which are accepting signals only in Digital
Form i.e. in the form of 0s and 1s, while the signals received from signal conditioning module or
sensors are generally in analogue form (continuous). Therefore a system is essentially required to
convert analog signals into digital form and vis-à-vis. Analog to Digital Converter is abbreviated as
ADC. Figure shows a typical control system with data conversion devices.
Based on the signals received from sensors, MCU generates actuating signals in the Digital form.
Most of the actuators e.g. DC servo motors only accept analogue signals. Therefore the digital
signals must be converted into Analog form so that the required actuator can be operated
accordingly. For this purpose Digital to Analog Converters are used, which are abbreviated as
DACs. In subsequent sections we will be discussing about various types of ADC and DAC
devices, their principle of working and circuitry.
Fig.. A Control system with ADC and DAC device
4.5 Basic components used in ADCs and DACs
1. Comparators :
In general ADCs and DACs comprise of Comparators. Comparator is a combination of diodes
and Operational Amplifiers. A comparator is a device which compares the voltage input or
current input at its two terminals and gives output in form of digital signal i.e. in form of 0s and
1s indicating which voltage is higher. If V+ and V- be input voltages at two terminals of
comparator then output of comparator will be as
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 57
V+ > V- …………... Output 1
V+ < V- ……………Output 0
2. Encoders:
Though the output obtained from comparators are in the form of 0s and 1s, but can’t be called as
binary output. A sequence of 0s and 1s will be converted into binary form by using a circuit
called Encoder. A simple encoder converts 2ninput lines into ‘n’output lines. These ‘n’ output
lines follow binary algebra.
3. Analog to Digital Converter (ADC):
As discussed in previous section ADCs are used to convert analog signals into Digital Signals.
There are various techniques of converting Analog Signals into Digital signals which are enlisted
as follows. However we will be discussing only Direct Conversion ADC, detail study of other
techniques is out of the scope of the present course.
Direct Conversion ADC or Flash ADC
Successive Approximation ADC
A ramp-compare ADC
Wilkinson ADC
Integrating ADC
Delta-encoded ADC or counter-ramp
Pipeline ADC (also called subranging quantizer)
Sigma-delta ADC (also known as a delta-sigma ADC)
Time-interleaved ADC
Direct Conversion ADC or Flash ADC:
Fir Circuit of flash ADC
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 58
Figure shows the circuit of Direct conversion or Flash ADC. To convert a digital signal of N-
bits, Flash ADC requires 2N-1 comparators and 2N resistors. The circuit provides the reference
voltage to all the comparators. Each comparator gives an output of 1 when its analog voltage is
higher than reference voltage or otherwise the output is 0. In the above circuit, reference voltages
to comparators are provided by means of resistor ladder logic.
The circuit described in figure acts as 3 Bit ADC device. Let us assume this ADC works
between the ranges of 0-10 Volts. The circuit requires 7 comparators and 8 resisters. Now the
voltages across each resistor are divided in such a way that a ladder of 1 volt is built with the
help of 1K-Ohm resistances. Therefore the reference voltages across all the comparators are 1-7
volts.
Now let us assume that an input voltage signal of 2.5 V is to be converted into its related digital
form. As 2.5V is greater than 1V and 2V, first two comparators will give output as 1, 1. But 2.5V
is less than 3,4,5,6,7 V values therefore all other comparators will give 0s. Thus we will have
output from comparators as 0000011 (from top). This will be fed to the encoder logic circuit.
This circuit will first change the output in single high line format and then converts it into 3
output lines format by using binary algebra. Then this digital output from ADC may be used for
manipulation or actuation by the microcontrollers or computers.
Digital to Analog Converters (DAC):
As discussed in previous section DACs are used to convert digital signals into Analog Signals.
There are various techniques of converting Digital Signals into Analog signals which are as
follows however we will be discussing only few important techniques in detail:
1. Pulse-width modulator
2. Oversampling DACs or interpolating DACs
3. The binary-weighted DAC
4. Switched resistor DAC
5. Switched current source DAC
6. Switched capacitor DAC
7. The R-2R ladder
8. The Successive-Approximation or Cyclic DAC,
9. The thermometer-coded DAC
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 59
4.6 Binary Weighted DAC:
Fig an op – amp used in DAC
As name indicates, in binary weighted DAC, output voltage can be calculated by expression
which works on binary weights. Its circuit can be realized in Figure.From the figure it can be
noted that most significant bit of digital input is connected to minimum resistance and vice versa.
Digital bits can be connected to resistance through a switch which connects resistance-end to the
ground. The digital input is zero when former bit is connected to reference voltage and if it is
1. This can be understood from Figure. DAC output voltage can be calculated from property of
operational amplifiers. If V1 be input voltage at MSB (most significant bit), V2 be input voltage
at next bit and so on then for four bit
Hence output voltage can be found as:
𝑉𝑂𝑈𝑇 𝛼 (23∗ 𝑉1 + 22∗ 𝑉2 + 21∗ 𝑉3 + 20∗ 𝑉4)………………………………………….2
However Binary weighted DAC doesn’t work for multiple or higher bit systems as the value of
resistance doubles in each case.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 60
Thus simple and low bit digital signals from a transducer can be converted into a related
continuous value of voltages (analogue) by using binary weighted DAC. These will further be
used for manipulation or actuation.
4.7 Pulse modulation:
Fig . Pulse Modulation
Fig Pulse with Modulation
During amplification of low level DC signals from a sensor by using Op-amp, the output gets
drifted due to drift in the gain of Op-amp. This problem is solved by converting the analogue DC
signal into a sequence of pulses. This can be achieved by chopping the DC signal in to a chain of
pulses as shown in Figure. The heights of pulses are related to the DC level of the input signal.
This process is called as Pulse Width Modulation (PWM). It is widely used in control systems as
a mean of controlling the average value of the DC voltage. If the width of pulses is changed then
the average value of the voltage can be changed as shown in Figure A term Duty Cycle is used to
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 61
define the fraction of each cycle for which the voltage is high. Duty cycle of 50% means that for
half of the each cycle, the output is high.
COURSE OUTCOMES
Students will
1. Learn the concepts of signal conditioning.
2. Learn operation of amplifier, wheatstone bridge, filtering, etc.,
SELF ASSESSMENT QUESTIONS
1. Define signal conditioning. What are the necessity for signal conditioning?
2. What is an amplifier and operation amplifier?
3. With a neat sketch explain instrumentation amplifier.
4. Define filters? How are filters classified?
5. Define the following with filters a) pass band, b) stop band, c) cutoff frequency.
6. What is the difference between passive and active filters.
7. What is a multiplexer and demultiplexer and where are used?
8. What is meant by data acquisition?
FURTHER READING
1. Mechatronics and Microprocessors, K.P.Ramchandran, G.K.Vijayraghavan,
M.S.Balasundran, Wiley, 1st Ed, 2009
2. Introduction Mechatronics & Measurement systems, David.G. Aliciatore & Michael.
B. Bihistaned, Tata McGraw Hill, 2000.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 62
UNIT 5
INTRODUCTION TO MICROPROCESSORS
CONTENTS
5.1 Introduction
5.2 Programmable Logic Controller (PLC):
5.3 Microprocessor
5.3.1 Functions of microprocessor
5.3.2 Elements of microprocessor
5.4 Number System
5.4.1 Number representation
5.4.2 Decimal number system to any number system
5.4.3 Hexadecimal system
5.5 Binary coded decimal (BCD)
OBJECTIVES:
Is to know the knowledge of microprocessor and its functions.
Is to know the concept of number system with conversion.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 63
5.1 Introduction:
Programmable Logic Devices (PLD) are programmable systems and are generally used in
manufacturing automation to perform different control functions, according to the programs
written in its memory, using low level languages of commands. There are following three types
of PLDs are being employed in mechatronics systems.
Microprocessor:
It is a digital integrated circuit which carries out necessary digital functions to process the
information obtained from measurement system.
Microcomputer:
It uses microprocessor as its central processing unit and contains all functions of a computer.
5.2 Programmable Logic Controller (PLC):
It is used to control the operations of electro-mechanical devices especially in tough and
hazardous industrial environments.
A typical programmable machine has basic three components as shown in Figure
1. Processor, which processes the information collected from measurement system and takes
logical decisions based on the information. Then it sends this information to actuators or output
devices.
2. Memory, it stores
The input data collected from sensors
The programs to process the information and to take necessary decisions or actions.
Program is a set of instructions written for the processor to perform a task. A group of
programs is called software.
3. Input/output devices: these are used to communicate with the outside world/operator.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 64
5.3 Microprocessor:
It is a multi-purpose, programmable device that reads binary instructions from a storage device
called memory, processes the data according to the instructions, and then provides results as
output. In common practice it is also known as CPU (central processing unit). CPU can be
referred as complete computational engine on a single chip. First Microcontroller, Intel 4004 was
launched in 1971. It was able to process just 4 bits. It started a new era in electronics
engineering. Microprocessor chip was one of the important inventions of the 20th century.
Applications of microprocessors are classified primarily in two categories:
1. Reprogrammable Systems: Micro computers
2. Embedded Systems: photocopying machine, Digital camera
Microprocessor works or operates in binary digits i.e. 0 and 1, bits. These bits are nothing but
electrical voltages in the machine, generally 0 - low voltage level, and 1 high voltage level. A
group of bits form a ‘word’. In general, the word length is about 8 bits. This is called as a ‘byte’.
A word with a length of 4 bits is called as a ‘Nibble Microprocessor processes the ‘commands in
binary form’ to accomplish a task. These are called as ‘instructions’. Instructions are generally
entered through input devices and can be stored in a storage device called memory.
Fig Configuration of Microprocessor
Show the configuration and basic blocks of a microprocessor. The functions of each element are as
follows.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 65
Fig Working of a Microprocessors
1. ALU: ALU stands for Arithmetical Logical Unit. As name indicates it has two parts:
a. Arithmetical unit which is responsible for mathematical operations like addition, subtraction,
multiplication and division,
b. Logical unit which is dedicated to take logical decisions like greater than, less than, equal to,
not equal to etc. (Basically AND/OR/NOT Operations)
2. Register Array: Registers are small storage devices that are available to CPU or processors.
They act as temporary storage for processing of intermediate data by mathematical or logical
operations.
3. Control: This part of CPU is dedicated to coordinate data flow and signal flow through various
types of buses i.e. Data Bus, Control Bus, and Address Bus etc. It directs data flow between CPU
and storage and I/O devices.
4. Memory: There are two different types of memory segments being used by the CPU. First is
the ROM which stands for Read Only Memory while other is R/W which stands for Read and
Write Memory or Random Access Memory (RAM).
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 66
a. ROM: From this memory unit, CPU can only read the stored data. No writing operations can
be done in this part of memory. Thus it is used to store the programs that need no alteration or
changes like Monitor Program or Keyboard driver etc.
b. R/W: As name indicates it is opposite to ROM and used for both reading and writing
operations. In general User’s program and instruction are stored in this segment of memory unit.
5. Input Devices: Input devices are used to enter input data to microprocessor from Keyboard or
from ADC which receives data from sensors/signal conditioning systems.
6. Output Devices: These devices display the results/conclusions coming out from ALUs either
in soft copy (Monitor) or in Hard Copy (Printer).
5.3.1 Functions of microprocessor:
Various functions of microprocessor are as follows:
Microprocessor performs a variety of logical and mathematical operations using its ALU.
It controls data flow in a system and hence can transfer data from one location to another
based on the instructions given to it.
A microprocessor can take necessary decisions and jump to a new set of instructions
based on those decisions.
5.3.2 Elements of microprocessor:
A simple microprocessor consists of following basic elements.
Data Bus: Through data bus, the data flow between
a. various storage units
b. ALU and memory units
Address Bus: It controls the flow of memory addresses between ALU and memory unit.
RD (read) and WR (write) lines set or obtain the addressed locations in the memory.
Clock line transfers the clock pulse sequence to the processor.
Reset Line is used to restart execution and reset the processor to zero.
Address Latch is a register which stores the addresses in the memory.
Program Counter: It is a register which can increment its value by 1 and keeps the record
of number of instructions executed. It can be set to zero when instructed.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 67
Test Register: It is a register which stores intermediate or in-process data of ALU
operations. For example it is required to hold the ‘carry’ while ALU is performing
‘addition’ operation. It also stores the data which can be accessed by Instruction decoder
to make any decision.
There are following control lines present in a microprocessor, which are used to communicate
instructions and data with the instruction decoder.
Instruct the A register to latch the value currently on the data bus.
Instruct the B register to latch the value currently on the data bus.
Instruct the C register to latch the value currently output by the ALU.
Instruct the program counter register to latch the value currently on the data bus.
Instruct the address register to latch the value currently on the data bus.
Instruct the instruction register to latch the value currently on the data bus.
Instruct the program counter to increment.
Instruct the program counter to reset to zero.
Activate any of the six tri-state buffers (six separate lines).
Instruct the ALU what operation to perform.
Instruct the test register to latch the ALU's test bits.
Activate the RD line.
Activate the WR line
5.4 Number System:
Number system is a way of representing the value of any number with respect to a base value.
Number System can be classified on the basis of its “base”. Each number has a unique
representation in a number system. Different number systems have different representation of the
same number. In general Binary, Octal, Decimal and Hexadecimal Number systems are used in
microprocessor programming. Table shows different numbering systems and their details.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 68
5.4.1 Number representation:
Conversion of any number system to decimal number system:
Let B be the base of number system and An, A n-1 …………………A1, A0 be the digits of
given number. Then to convert it into decimal equivalent we can use the following formula:
5.4.2 Decimal number system to any number system:
Any number in decimal system can be changed to any other number system by continuously
dividing it by base of the required number system and then writing remainders after each step in
reverse order. Let us take an example of converting a decimal number 235 to its binary
equivalent.
Following table shows the conversion process as stated above
5.4.3 Hexadecimal system:
This system is quite extensively used in microprocessor programming. It facilitates much shorter
representation of number in comparison with that obtained by using the binary number system.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 69
Hexadecimal system has a base of 16 and it is easy to write and remember the numbers and
alphabets viz. 0 to 9 and A to F. Table 3.2.3 shows numerals and alphabets used in hexadecimal
system for representation of a number.
Table: Numerical and Alphabetic are used in Hexadecimal System
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 70
Example: Let us convert the number (235)10 to hexadecimal equivalent
Then by arranging the hexadecimals in reverse order i.e. (EB)16. Thus (235)10 = (EB)16.
5.5 Binary coded decimal (BCD)
BCD code expresses each digit of a decimal system by its nibble equivalent. It uses 4 bit binary
strings to represent the digits 0 to 9. Figure 3.2.1 shows the representation of number 523 as
010100100011 using BCD system. Due its longer representation scheme, it is now rarely used in
micro-electronics programming.
Example: (235)10 can be represented by using PCD as 001000110101.
COUSRE OUTCOMES
Students will
1. Learn the working of microprocessor and how microprocessors have been evolved.
2. Know the concept of conversion of number system like decimal to binary or binary to
decimal, decimal to hexadecimal or hexadecimal to decimal.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 71
SELF ASSESSMENT QUESTIONS
1. Describe briefly the evolution of microprocessor.
2. What is meant by multi core design? What are its feature and advantages?
3. Define Boolean algebra. What is meant by Boolean variables?
4. Explain the laws of Boolean algebra with illustrations.
5. With truth table explain De Morgan’s theorems.
6. What are logic gates and what are its functions?
7. Explain a) AND gate, b) OR gate, c) NAND gate, d) NOT gate.
8. Convert the following decimal number into binary equivalent 75, 86, 92,141.
9. Convert the following binary number into decimal equivalent 1001, 1111, 10101, 11011.
10. Add the following binary numbers a) 1001 and 10101, b) 1111 and 1010.
11. Subtract the following binary number a) 101 from 1001, b) 100 from 1111.
12. Convert 162.82 decimal real number to binary real number.
13. What are floating numbers? What is meant by floating point notation?
14. Explain concept of overflow, underflow and no overflow.
15. Represent SIR M VISWESVARAYA in the memory using 7 bit ASCII code.
FURTHER READING
1. Mechatronics and microprocessor, Dr H.D.Ramachandra, Sudha Publications, Bangalore,
2016.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 72
UNIT 6
LOGIC FUNCTION
CONTENTS
6.1 Introduction
6.2 Basic elements of control system
6.3 8085 a microprocessor architecture
6.3.1 Technical specifications
6.3.2 Random access memory (ram)
6.3.3 Read only memory (rom)
6.3.4 Address
6.3.5 Arithmetic and logic unit (alu)
6.3.6 Assembler
6.3.7 Data registers
6.3.8 Clock
6.3.9 Clock cycle
6.3.10 Instruction cycle
6.3.11 Store results
6.3.12 Read cycle
6.3.13 Write cycle
6.3.14 Buses
6.3.15 Interrupts
6.4 Micro controllers
6.5 Character representation
OBJECTIVES
Is to know processor working with different parameters.
Is to understand concept of microcontrollers.
Is to know character representation with binary codes.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 73
Basic elements of control systems, Architecture of 8085a microprocessor, Terminology such as
CPU, Memory , Address, ALU, Assembler, Data registers fetch cycle ,Wire cycle ,Wait state
,Bus interrcepts fetch cycle, Requirements for control and their Implementation in micro
controller,Classification of microcontrollers, Data word presentation.
6.1 INTRODUCTION:
The relational operations such as AND,OR, NOT etc are called logic functions each of these
functions is performed by an electronic circuit is called logic gates.
6.2 BASIC ELEMENTS OF CONTROL SYSTEM:
The control unit co-ordinates the activities taking place in the CPU and between the COU and
peripheral devices via control signal.
In this place where instructions are decoded and executed. The CU and ALU has a number of
registers include.
PROGRAM COUNTER REGISTER: Holds the address of the next instruction to be executed .
Each instruction the processor is going to perform is stored in a memory address. The pc register
is automatically incremented , so that it always holds the memory address of the next
instructions.
INSTRUCTION REGISTER : As the name itself indicates this contains the instruction to be
executed and this register also known as current- instruction register . This contains the operator
and operand of the current instruction . Ex; MOV 80, #B , where MOV - operator 80 and
operand
STATUS REGISTER: In this register each bit of the register represent a different status flag
which is either 1(flagged) or 0 (net flagged).These are typically used to report information about
the result of an operation.
6.3 8085 A PROCESSOR ARCHITECTURE
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 74
6.3.1 TECHNICAL SPECIFICTIONS
Intel 8085A is an 8 –bit NMOS MP.
It is a 40 pin IC package fabricated on a single chip LSI.
If is built in clock generator , with clock speed about 3MHZ.
Clock cycle -320 Nano seconds (ns).
Uses + 5v dc
8085A processor has a six -8 bit GPR , B , C, D , E , H and L , one stack pointer , one flag
register , two temporary registers.
General purpose registers may be used as six 8- bit registers or in pairs BC , DE , HC, as
three 16 bit register.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 75
CPU: The whole CPU built on a single chip called microprocessor. The micro – processor is
generally referred to as the central processing unit (CPU), which processes the data, fetching
instruction from memory , decoding and executing them.
MEMORY AND ADDRESS:
MEMORY: A Memory unit in a MP system stores binary data. The data may be program
instruction codes or number being operated on. A Flip flop is the basic memory unit. If is a 1
– bit memory element .The function of memories is to store program, data and results.
There are 2 kinds of memories;
A) SEMICONDUCTOR MEMORIES :
Semiconductor memories are faster, smaller , lighter and consume less power.
These semiconductors memories are used as the main memory of a computer.
B) MAGNETIC MEMORIES:
Magnetic memories are slower but are cheaper then SM.
Magnetic memories used as secondary memories per bulk storage of dates and
information.
6.3.2 RANDOM ACCESS MEMORY (RAM):
As the name itself indicates, memory location can be accessed randomly .
This is a read and writes memory.
Volatile memory – Its contents are lost when supply is interrupted.
Fig shows typical pin connection for 1K * 8 BIT RAM chip.
These are types of RAM;
Static RAM: Retains information as long as power supply is on.
Dynamic RAM : Loses its contents in very short time even when the power supply is on.
6.3.3 READ ONLY MEMORY (ROM):
It is non – volatile and used for permanent storage .
The user cannot write into the ROM.
The data in the ROM can only be read and is used for fixed programs , such as computer
operating systems.
Data / Information stored is not lost when power is disconnected or interrupted .
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 76
6.3.4 ADDRESS:
Fig: RAM chip Address are memory locations , identified by a unique number or name .
In computer system , memory location is identified with a binary number called an
address , and the address bus carry the address .
The number of address lines of a CPU determines its capacity to identify different
memory locations.
Ex : 24 = 16 – Four line address bus can identify 24 address , 216 = 65536.
Ex : Motorola 6800 processor has 23 address lines
6.3.5 ARITHEMATIC AND LOGIC UNIT (ALU):
A , B - INPUT DATA
R - OUTPUT
F - INSTRUCTION FROM CONTROL UNIT
D - OUTPUT STATUS .
6.3.6 ASSEMBLER:
Any computer processes programs only in machine language, programs written in any language
to be ultimately converted into machine language. The program written in the form of 0’s and 1’s
is called Machine language, also referred to as object code.
Writing a program in machine language is very difficult. Therefore to facilitate to write programs
that are easy, different language have been developed. The simplest symbolic language used for
MP is Assembly language.
“A program which translates an Assembly language program into a Machine language is called
an Assembler.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 77
An assembler which operates within the Micro – computer itself is called a self –
assembler / resident assembler.
An assembler which goes through the assembly language only once during the
process of translation is called one – pass assembler.
An assembler goes through the assembly language program twice.
On the first pass the assembler reads through the assembly language program and collects all labels.
It also assigns addresses to labels by counting their positions from the starting address.
On the second pass the assembler produces the Machine codes for each instruction and assigns
address to each.
6.3.7 DATA REGISTERS (MEMORY DATA REGISTER MDR):
Most but not all, modern computer architectures function on the principle of moving data from
the main memory into registers and then operate on them.
The memory data register (MDR) is the register of a computer control unit that contains the data
to be stored in the computer storage (RAM) or the data after a fetch from computer storage.
Data registers are used to hold numeric value such as integer and floating point values. In some
older CPU’s, a special data register, known as the accumulator is used implicitly for many
operations.
6.3.8 CLOCK:
A clock is a sequence of pulses. A clock is generated by a clock generator. All MP’s needs a clock to
time their functions. Many digital circuits need clock to time their functions.
Some MP’s have built in clock generator, while some require external clock generator. 8085A MP
has a built in clock generator, where as 8088 MP require an external clock generator.
6.3.9 CLOCK CYCLE:
Also known as clock period, is the time interval after which pulse pattern repeats . A clock pulse
is used to initiate action.
6.3.10 INSTRUCTION CYCLE:
Instruction cycle is also called fetch and execute, fetch – decode – execute cycle, FDX.
It is the period during which one instruction is fetched from memory and executed when a
computer is given an instruction in Machine language.
There are typically four stages of instruction cycles that the CPU carries out. They are:
1. Fetch the instruction from memory.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 78
2. Decode the instruction.
3. Fetch data from main memory.
4. Execute the instruction.
Step 1 and 2 are called fetch cycle and are the same for each instruction.
Step 3 and 4 are called execute cycle and will change with each instruction.
An instruction cycle is also called Machine cycle.
I. FETCH:
The CPU induces the values of the program counter on address bus .The CPU the fetches the
instruction from the main memory and the data bus into the memory data register.
The value from the MDR is then placed into the current instruction register, a circuit that
holds the instruction temporarily, so that it can be decoded and executed.
II. DECODE THE INSTRUCTION :
The decoder interprets and implements the instruction. The IR adds the current
instructions, while the PC holds the address in memory of the next instruction to be
executed.
It is a cycle of many events where instruction is fetched, decoded and executed.
III. FETCH DATA FROM MAIN MEMORY :
Read the address from main memory, if the instruction has an indirect address.
Fetch required data from main memory to be processed and placed into the registers.
IV. EXECUTE THE INSTRUCTION :
From the instruction register, the data forming the instruction is decoded by the central
unit.
It then passes the decoded information as a sequence of control signals to relevant
function units of the CPU to perform the action.
6.3.11 STORE RESULTS:
This is also called write back to memory. The executed result in ALU is stored in the main
memory or sent to an output device.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 79
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 80
Based on the condition of the feedback from the ALU, the PC is either incremented to address
the next instruction or updated to a different address, where the next instruction will be fetched.
The cycle then repeats.
6.3.12 READ CYCLE:
Memory access time is the amount of time a memory operations request (read and write) and the time
the memory operation completes.
When reading from memory access time is the amount of time from the point that the CPU places an
address bus and CPU takes the data off the data bus.
6.3.13 WRITE CYCLE:
After the execution of instruction the result written on to the memory. Sometimes before
the end of the close period, the memory subsystem must group and store specified value. CPU places
address and data onto the data bus at this time.
6.3.14 BUSES:
Buses are conductors interconnecting the three types such as
a) Central processor
b) Memory devices
c) Input\output devices
These buses carry electrical signals from one section to another section of the computer .They can be
tracks on a printed circuit board (PCB) or wire in a ribbon cable.
These are three forms of buses in a micro processor system.
a) Data bus
b) Address bus
c) Control bus.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 81
1. DATA BUS
Data buses carry data associated with the processing function.
A data bus is used to transfer data between the processor and memory or I\O devices.
The number of conductors of a data bus depends on the number of bits the data bus has to
carry at a time and depends on computer.
For instant an 8 – bit computer has 8 – conductors in its data bus and that can move 8 bits
of data at a time.
Some computers uses bus – sharing technique to reduce the number of conductors
required in the data bus.
Each conductor or wire carries a binary signal i.e. 0 to 1. Thus a four wire bus carries a
word length of 4 – bits (half byte).
Data bus is bidirectional, i.e. it can transfer data in both direction.
The Intel 8085 is an bit microprocessor .Its data bus is 8 – bit wide and hence 8 – bits of data can
be transmitted in parallel from or to the microprocessor.
The earlier microprocessors were 4 – bit devices, such as Intel 4004 and they are still widely
employed in devices such as toys, washing machines etc. 4 – bit MP were followed by 8 – bit
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 82
processor such as Motorola 6800 , Intel 8085 A . Now 16 – bit, 32 – bit and 64 – bit processors
are available, due to the advancement in the silicon technology.
2. ADDRESS BUS :
These buses carry address of the memory location, each memory location, having its own
address, including I/O devices .
When a particular address is selected and placed on the address bus, only that location is
open to the communication from the CPU. The CPU is able to communicate with only one
location at a time.
Address bus is unidirectional .
A computer with an 8 – bit data has typically 16 – bit address bus , i.e 16 wires.
This size address bus enables 216 locations to be addressed , i.e 65536 and written as 4k .(k =
1024)
More the number of lines of address bus , the greater the greater the number of address
locations that can be stored .
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 83
3. CONTROL BUS :
Control bus carries control signals between the processor and devices connected to it .
Such as to READ data from input device or WRITE data to an output device.
In addition to this, control bus also carries system clock sign. So as to synchronize all
actions of the microprocessor system.
Control bus is bidirectional.
6.3.15 INTERRUPTS :
A method of drawing the attention of the CPU by an external event only when required is known as
interrupt . Unless interrupted CPU will be performing its usual task.
An interrupt is a signal and causes the CPU to
Suspend normal operation .
Jump other tasks .
Return to the current program to place into where it has left .
Finish executing the instruction .
6.4 MICRO CONTROLLERS:
A Micro controller is a Micro – computer on a single chip , i.e , it is the integration of CPU with
memory and I\P and O\P interfaces . (posts) and other peripheral such as timer on a single chip.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 84
A micro controller is a ‘True computer on a chip’ which controls the operation of a machine
using a fixed program that is stored in ROM and that does not change over the life time of the
system.
Represent the character string HAPPY NEW YEAR 2009 in using 7 – bit ASCII code 19 bytes
(including 8 bytes) character between Happy new year and 2009.
6.5 CHARACTER REPRESENTATION:
As we have manipulation with numbers, so also with characters. Arranging a set of names in
alphabetical order is just one of the examples of character manipulation. Hence it is useful to
know how characters are represented in the memory.
The word character refers to the 26 case alphabets, i.e (A – Z) , 26 lower case alphabets (a –z)
and ten digits (0 – 9) and the special character blank and other special characters lie + - x / ,$ etc.
Special 8 – bit, 7 – bit codes have developed and standardized for the memory representation of
these characters.
One popular 8 – bit code is the EBCDIC code (extended binary, code decimal interchange code)
and a 7 – bit code is the ASCII – (AMERICAN STANDARD CODE FOR INFORMATION
INTERCHANGE) . ASCII codes available in the 8 – bit and 6 –bit mode also
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 85
NOTE:
COURSE OUTCOME
Students will
1. Understand how exactly a processor works internally and the concepts of different
parameters included in 8085 processor.
2. Learn the difference between microprocessor and microcontroller.
3. Know how codes are represented with characters.
SELF ASSESSMENT QUESTIONS
1. With a neat block diagram explain Intel 8085A microprocessor architecture.
2. Explain different register present in a control unit.
3. Draw the flow diagram of instruction cycle.
4. Explain the concept of read cycle and write cycle.
5. Explain the main features and functions of data bus.
6. What is microcontrollers and explain its classification?
7. Enumerate the difference between microprocessor and microcontroller.
8. Enumerate the difference between RISC and CISC.
FURTHER READING
1. Mechatronics and microprocessor, Dr H.D.Ramachandra, Sudha Publications, Bangalore,
2016.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 86
UNIT 7
ORGANIZATION AND PROGRAMMING OF MICROPROCESSORS
CONTENTS
7.1 Introduction to organization of Intel 8085
7.1.1 Intel 8085
7.2 General purpose registers
7.2.1 Stack Pointer Registers (SP)
7.2.2 Program Counter Register (PC)
7.2.3 Memory Address Register (MAR)
7.2.4 Instruction Registers (IR)
7.2.4.1 Classification of Instructions
7.2.5 Status Register or Condition Code Register or Flag Register
7.2.6 Temporary Register
7.2.7 Data Register
7.3 Microprocessor Instruction set and languages
7.4 Assembly Language Programming
7.5 8085 Assembly Language
OBJECTIVES
Is to know the concepts of different types of registers used in microprocessor architecture
and also different types of computer language.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 87
7.1 Introduction to organization of Intel 8085:
The heart of any micro – computer is microprocessor. The most popular and widely used is Intel
8085, an 8 – bit microprocessor.
7.1.1 Intel 8085:
Intel 8085 is an 8-bit general purpose N type Metal Oxide Semiconductor (NMOS)
microprocessor capable of addressing 64 K of memory. It is a 40 pin IC package built on a single
LSI chip. It uses a single +5 volts d.c supply for its operation. It has a built in clock with a speed
of 3 MHz and clock cycle is 320 nano second. Show the functional block diagram (Fig 7.1) of
the Intel 8085 microprocessor.
The three important section of the Intel 8085 microprocessor are,
a. Arithmetic and logic unit (ALU)
b. Timing and Control Unit
c. Registers.
a. Arithmetic and logic unit (ALU) : Perform the following Arithmetic and logic operations.
i. Addition
ii. Subtraction
iii. Logical AND
iv. Logical OR
v. Logical XOR
vi. Logical NOT
vii. Increment (Add 1)
viii. Decrement (Subtract 1)
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 88
ix. Left shift (Add input to itself or i.e.., multiply by 1)
x. Clear
b. Timing and Control Unit:
Timing and Control Unit generate control signals such as clock out, RD (Read) etc.
c. Registers:
Registers are small memories within the microprocessor. These registers are used by the
microprocessor for the temporary storage and manipulation of data and instruction Intel 8085
microprocessor has the following registers.
i. One 8 – bit accumulator (ACC) i. e, Register A
ii. Six, 8-bit general purpose registers – B,C,D.E.H and I
iii. One 16 – bit stack pointer. SP
iv. One 16 – bit Program Counter. PC
v. Memory Address Register (MAR)
vi. Instruction Register (IR)
vii. Status Register (SR)
viii. Temporary Register (TR)
7.2 General purpose registers:
There are six 8-bit general purpose register which can be used by the programmer has desired. These
are denoted by B,C ,D,E,H and L. To handle 16-bit data, two 8-bit register can be combined and this
combination is called register pair. The valid register pair are B-C, B-E, and H-L. The H-L pair is
used to address memories.
7.2.1 Stack Pointer Registers (SP):
Stack is a sequence of memory location in which program counter values can be stored when a
subroutine part of a program his being used. The last memory location of the occupied portion of the
stack is called stack top. The stack pointer holds the address of the stack top.
7.2.2 Program Counter Register (PC):
This register contains the address of the next instruction and hence used to allow the CPU to keep
track of its position in program. The CPU fetches an instruction from the memory, executes the same
and increment the content of the program counter. Thus in the next instruction cycle it will fetch the
next instruction. The CPU executes instructions sequentially, unless an instruction such as JUMP or
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 89
BRANCH changes the program counter out of sequence. Fig 7.2 shows basic concept of program
counter register.
7.2.3 Memory Address Register (MAR):
The register contains the address of data. For example in the addition of two numbers the memory
address register is loaded with the address of the first number to be added.
The data of this address is moved to the accumulator. The address of the second number is then
loaded to the memory address register. The data at the second address is then moved to the
accumulator. These data are sent to ALU and result of addition is then stored in a memory location
addressed by the memory address register.
Memory Address Register (MAR) holds the address of next instruction to be executed.
7.2.4 Instruction Registers (IR):
Instruction Register is stored in this register. The CPU after fetching instruction from the memory via
the data bus, stores it in the instruction register. The instruction is then decoded and used to execute
an operation as shown in Fig 7.3.This sequence of fetching from the memory, decoding and then
executing is called fetch-execute cycle.
Fig 7.3 Flow of instuction from memory to instruction register.
7.2.4.1 Classification of Instructions:
a. Data Transfer
b. Arithmetic
c. Logical
d. Program Control
a. Data Transfer
1. Load: It reads content from specified memory location and copies it to specified register location
in CPU.
2. Store: It copies content of a specified register into specified memory location.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 90
b. Arithmetic:
1. Add: It adds contents of a specified memory location to the data in some register.
2. Decrement: It subtracts 1 from contents of specified location.
3. Compare: It tells whether contents of a register are greater than, less than or same as content of
specified memory location.
c. Logical:
1. AND: Instruction carries out Logical AND operation with the contents of specified memory
location and data in some register. Numbers are ANDed bit by bit.
2. OR: Instruction carries out Logical OR operation with the contents of specified memory location
and data in some register. Numbers are ORed bit by bit.
3. Logical Shift: Logical shift instruction involves moving a pattern of bits in the register one place to
left or right by moving a zero in the end of number.
d. Program Control:
1. Jump: This instruction changes the sequence in which program steps are carried out. Normally
program counter causes the program to be carried out sequentially in strict numerical sequence.
However, JUMP causes program counter to some other specified location in the program.
2. Branch: This is a conditional instruction which might ‘branch’ if ‘zero’ results or ‘branch’ if ‘plus’
results of an operation. Branch also followed if right conditions occur in the decision making process.
3. Halt: This instruction stops all further microprocessor activity
7.2.5 Status Register or Condition Code Register or Flag Register.
This contains information concerning the result of the latest process carried out in the arithmetic and
logic unit. It contains individual bit with each having special significance. The bits are called Flags.
The status of the latest operation carried out in the ALU is indicated by each flag, each flag being set
or reset to indicate a specific status. The status of indication can be whether the last operation
resulted in zero result, negative result, carry output has occurred, occurrence of overflow or the
program is to allow to be interrupted. The following are common flags.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 91
7.2.6 Temporary Register:
These registers serve as temporary storage, for data or addresses and used in operations involving
transfer between other registers.8085A has two temporary registers.
Data and Address bus of Intel 8085.
Intel 8085 is an 8-bit microprocessor and hence 8-bits of data can be transmitted in parallel from or
to the microprocessor. The microprocessor requires 16-bit wide address buses as the memory address
are 16 bits. The 8 most significant bits (MSB) of the address are transmitted by the address bus, A
bus and the 8 least significant bits (LSB) of the address are transmitted by AD Bus. Thus AD – bus
operates in a shared mode. This technique is known as Multiplexing.
7.2.7 Data Register:
Data register is a special register which stores data when they are fetched from the memory or input
devices as shown in fig 7.5
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 92
Fig: 7.5 Flow of data from memory to data register through buffer register
Input/ Output Buffers:
Buffers are another type of registers which hold data or address that come into and go out of the
microprocessor. In fact, data or instruction is first transferred into buffer then transferred into the
microprocessor. Similarly data sent out of any register to the outside world is via output buffer. In
fact, buffers are some sort of input/output port and a port is a place where data are loaded and
unloaded. Fig 7.6 shows the concept of I/O buffer in a microprocessor.
Input/ Output buffers
7.3 Microprocessor Instruction set and languages:
Instruction Set of 8085:
An instruction is a command to a computer to perform a specific task on a given data. Instruction
set is the collection of instruction get a computer recognizes. Instructions have been broadly
classified into following 5 groups:
a. Data transfer group
b. Arithmetic group
c. Logical group
d. Branch control group
e. I/O and machine control group
a. Data transfer group:
These instructions are used for transfer of data from one register to another, space from memory to
register, or fro register to memory.
Ex: MOV, MVI, LXI,LDA etc.., data transfer in nothing but similar to copy function.
b. Arithmetic group:
The instructions of this group perform arithmetic operation such as addition, subtraction, increment
and decrement of data in register or memory.
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 93
Ex: ADD, SUB, INR etc..
c. Logical group:
The instructions under this perform logic operations such as AND, OR, Compare, Rotate etc..
Ex: ANA, XRA, ORA, CMP etc.
d. Branch control group:
This group includes the instructions for conditional and unconditional jumps, subroutine call and
return and restart.
Ex: JMP, JC, JZ, CALL, CZ, RST etc..
e. I/O and machine control group:
This group includes the instructions for input and output parts, stacks and machine control.
Ex: IN, OUT, PUSH, POP, HLT etc...
7.4 Assembly Language Programming:
Assembly Language:
Even through the instruction can be written in hexadecimal system, still it is difficult to understand a
program. Hence to facilitate to write programs, easily understandable languages have been
developing. One such language is assembly language. Programs can easily write in alphanumeric
symbols instead of 0s and 1s. Meaningful and easily remembered symbols such as ADD for addition,
SUB for subtraction, CMP for comparison etc.., are chosen for the purpose. Such symbols are called
mnemonics. A Program written in mnemonics is known as Assembly Language Program.
The writing of program in assembly language is much easier and faster as compared to the writing of
a program in machine language. Assembly language is recommended in the following situations.
a. Small to moderate size of program.
b. Real time control applications.
c. Small volume of data is to be processed.
d. Cost of the memory is a consideration.
e. Developing program
f. For industrial applications.
7.5 8085 Assembly Language:
Mnemonics do not specify the complete operations. They only suggest its significant part. The
complete description of each instruction will be supplied by the manufacture. The complete set of
Mechatronics & Microprocessor (10ME65)
Department of Mechanical Engg, ATMECE, Mysuru Page 94
8085 mnemonics is called the 8085 assembly language and a program written in this mnemonics is
called as assembly language program.
OR
As mentioned in above section, a simple and very effective substitution to binary codes could be use
of Standard English words to complete any task. For example addition of two numbers can be
represented by ADD. Such codes are referred as mnemonic codes and that language is called
assembly language. Most of the early processers including 8085, are programmed using mnemonics.
However, assembly language codes should be converted into binary one so that microprocessor can
identify the instructions given to it. This operation is done by Assembler. In assembly language,
instructions are composed of two segments which are as follows:
1. Operation (Op) Code: It depends on which operation is to be performed. For example for OR
operation, we have Op Code “OR”.
2. Operands: Operand is the object on which the required operation is to be done. Generally
operations are done on data stored in registers.
COURSE OUTCOME
Students will
1. Learn different types of registers and their functions used in microprocessor.
2. Also know the knowledge of different types of computer languages.
SELF ASSESSMENT QUESTIONS
1. Explain each type of register a) Accumulator, b) flag register, c) stack register.
2. Discuss the term BUS with reference to the architecture of a microprocessor.
3. What is assembler? What is meant by self-assembler and cross assembler?
4. Explain assembly level language program.
5. List out the situation for recommending assembly language program.
FURTHER READING
1. Mechatronics and microprocessor, Dr H.D.Ramachandra, Sudha Publications, Bangalore,
2016.