MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0...

68
MECHATRONICS Unit I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use the camera all you need to do is point it at the subject and press the button to take the picture. The camera automatically adjusts the focus so that the subject is in focus and automatically adjusts the aperture and shutter speed so that the correct exposure is given. Consider a truck smart suspension. Such suspension adjusts to uneven loading to maintain a level platform, adjusts to cornering, moving across rough ground. etc. to maintain smooth ride. Consider an automated production line. Such a line may involve a number of production processes which are all automatically carried out in the correct sequence and in the correct way. The automatic camera, the truck suspension and the automatic production line are examples of a marriage between electronic control systems and mechanical engineering. Such control systems generally use microprocessors as controllers arid have electrical sensors extracting information from the mechanical inputs and outputs via electrical actuators to mechanical systems. The term mechatronics is used for this integration of microprocessor control systems, electrical systems and mechanical system. A mechatronics system is not just a marriage of electrical and mechanical systems and is more than just a control system; it is a complete integration of all of them. In the design now of cars, robots, machine tools, washing machines, cameras, and very many other machines. Such an integrated and interdisciplinary approach to engineering design is increasingly being adopted the integration across the traditional boundaries of mechanical engineering, electrical engineering, electronics and control engineering has to occur at the earliest stages of the design process if cheaper more reliable, more flexible systems are to be developed. Mechatronics has to involve a concurrent approach to these disciplines rather than a sequential approach of developing, say, a mechanical system then designing the electrical part and the microprocessor part. Mechatronics involves what are termed as systems. A system can be thought of as a box which has an input, and an output and where we are not concerned with what goes on inside the box but only the relationship between the output and the input. Thus for example, a motor may be thought of as a system which has as input electric power and as output the rotation of a shaft. 2.0 Systems: A system can be defined as a box which has an input and an output where we concentrate about the relationship between the input and output, not with the input. Example: a motor. A motor has input as electric power as input and rotation as output. The following figure shows the representation. Fig: 1.1 System

Transcript of MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0...

Page 1: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

MECHATRONICS

Unit – I

1.0 Introduction to Mechatronics:

Consider the modern auto-focus, auto-exposure camera. To use the camera all you need to do is point it at

the subject and press the button to take the picture. The camera automatically adjusts the focus so that the subject is

in focus and automatically adjusts the aperture and shutter speed so that the correct exposure is given. Consider a

truck smart suspension. Such suspension adjusts to uneven loading to maintain a level platform, adjusts to cornering,

moving across rough ground. etc. to maintain smooth ride. Consider an automated production line. Such a line may

involve a number of production processes which are all automatically carried out in the correct sequence and in the

correct way. The automatic camera, the truck suspension and the automatic production line are examples of a

marriage between electronic control systems and mechanical engineering. Such control systems generally use

microprocessors as controllers arid have electrical sensors extracting information from the mechanical inputs and

outputs via electrical actuators to mechanical systems. The term mechatronics is used for this integration of

microprocessor control systems, electrical systems and mechanical system. A mechatronics system is not just a

marriage of electrical and mechanical systems and is more than just a control system; it is a complete integration of

all of them.

In the design now of cars, robots, machine tools, washing machines, cameras, and very many other

machines. Such an integrated and interdisciplinary approach to engineering design is increasingly being adopted the

integration across the traditional boundaries of mechanical engineering, electrical engineering, electronics and

control engineering has to occur at the earliest stages of the design process if cheaper more reliable, more flexible

systems are to be developed. Mechatronics has to involve a concurrent approach to these disciplines rather than a

sequential approach of developing, say, a mechanical system then designing the electrical part and the

microprocessor part.

Mechatronics involves what are termed as systems. A system can be thought of as a box which has an input, and an

output and where we are not concerned with what goes on inside the box but only the relationship between the

output and the input. Thus for example, a motor may be thought of as a system which has as input electric power

and as output the rotation of a shaft.

2.0 Systems: A system can be defined as a box which has an input and an output where we concentrate about the

relationship between the input and output, not with the input.

Example: a motor.

A motor has input as electric power as input and rotation as output. The following figure shows the

representation.

Fig: 1.1 System

Page 2: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

3.0 Measurement System Definition:

A measurement system can be defined as a black box which is used for making measurements. It has an

input the quantity being measured and its output the value of that quantity.

Example: A temperature measurement system. i.e. Thermometer

Fig: 1.2 Measurement System

4.0 Control System:

A control system can be defined as a block box which can be used to control its output to some particular

value.

Example: a domestic central heating control system.

We can set the required temperature on the thermostat or controller and the pump can be adjusted to supply

water through radiators. So the required temperature can be maintained in the house.

Fig: 1.3 Control System

5.0 Measurement Systems:

Measurement System can be considered to be made up of three elements as shown in figure.

Fig: 1.4 Measurement System and its Elements

Page 3: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

1. A sensor which responds to the quantity being measured by giving as its output a signal which is related to the

quantity. Ex. a thermocouple is a temperature sensor.

2. A signal conditioner takes the signal from the sensor and manipulates it into a condition which is suitable for

either display or in the case of a control system, for use to exercise control. Thus for example the output from a

thermocouple is a rather small e.m.f and might be fed through an amplifier to obtain a bigger signal. The amplifier

is the signal conditioner.

3. A display system where the output from the signal conditioner is displayed. This might, for example be a pointer

moving across a scale or a digital readout.

As an example, consider a digital thermometer. This has an input of temperature to a sensor probably a

semiconductor diode. The potential difference across the sensor is a constant current.

6.0 Open and closed-loop systems:

· There are two basic forms of control system one being called and Open loop and other closed-loop systems.

The difference between these can be illustrated by a simple example.

· Consider an electric fire which has a selection switch which allows a 1 KW or a 2 kW heating element to

be selected. If a person used the heating element to heat a room, he or she might just switch on the 1 kW element if the room is not required to be at too high a temperature. The room will heat up and reach a temperature which is only determined by the fact the 1 kW element was switched on, and not the 2 kW elements. If there are changes in the conditions perhaps someone opening a window, there is no way the heat output is adjusted to compensate.

Fig:1.5 Open and Closed Loop System

· This is an example of open loop control in that there is no information fed back to the element to adjust it

and maintain a constant temperature.

· The heating system with the heating element could be made a closed loop system if the person has a

thermometer and switches the 1 kW and 2 kW elements on or off, according to the difference between the

actual temperature and the required temperature, to maintain the temperature of the room constant.

· In this situation there is feedback, the input to the system being adjusted according to whether its output is

the required temperature. This means that the input to the switch depends on the deviation of the actual

temperature from the required temperature.

· The difference between them determined by a comparison element. The person in this case.

To illustrate further the differences between open and closed-loop systems, consider a motor.

· With an open-loop system the speed of rotation of the shaft might be determined solely by the initial setting

of a knob which affects the voltage applied to the motor.

Page 4: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

· Any changes in the supply voltage, the characteristics of the motor as a result of temperature changes, or

the shaft load will change the shaft speed but not be compensated for.

· There is no feedback loop. With a closed-loop system, however, the initial setting of the control knob will

be for a particular shaft speed and this will be maintained by feedback, regardless of any changes in supply

voltage, motor characteristics or load.

· In an open-loop control system the output from the system has no effect on the input signal. In a closed-

loop control system the output does have an effect on the input signal, modifying it to maintain an output

signal at the required value.

Open-loop systems have the advantage of being

· relatively simple and · consequently low cost with generally good reliability.

However, they are disadvantages like

· inaccurate since there is no correction for error.

Closed-loop systems have the advantage of being · relatively accurate in matching the actual to the required values. They are, however,

having disadvantages like,

· more complex and · so more costly and a · greater chance of breakdown as a consequence of the greater number of components.

7.0 Basic elements of a closed-loop system: The following figure shows the general form of a basic closed-loop system.

Fig.1.6 Basic elements of closed loop

It consists or the following elements:

1 Comparison element

· This compares the required or reference value of the variable condition being controlled with the measured

value of what is being achieved and produces an error signal.

· It can be regarded as adding the reference signal, which is positive, to the measured value signal, which is

negative in this case:

· Error signal = reference value signal - measured value signal

Page 5: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

· The symbol used, in, general, for an element at which signals are summed is a segmented circle, inputs

going into segments.

· The inputs are all added; hence the feedback input is marked as negative and the reference signal positive

so that the sum gives the difference between the signals.

· A feedback loop is a means whereby a signal related to the actual condition being achieved is fed back to

modify the Input signal to a process. The feedback is said to be negative feedback when the signal which is

fed back subtracts from the input value. It is negative feedback that is required to control a system. Positive

feedback occurs when the signal fed back adds to the input signal.

2 Control element · This decides what action to take when it receives an error signal.

· It may be for example, a signal to operate a switch or open a valve.

· The control plan being used by the element may be just to supply a signal which switches on or off when

here is an error, as in a room thermostat or perhaps a signal which proportionally opens or closes a valve

according to the size of the error.

· Control plans may be hard-wired systems in which the control plan is permanently fixed by the way the

elements are connected together or programmable systems where the control plan is stored within a

memory unit and may be altered by reprogramming it Controllers.

3. Correction element · The correction element produces a change in the process to correct or change the controlled condition.

· Thus it might be a switch which switches on a heater and so increases the temperature of the process or a

valve which opens and allows more liquid to enter the process.

· The term actuator is used for the element of a correction unit that provides the power to carry out the

control action.

4 Process element · The process is what is being controlled. It could be a room in a house with its temperature being controlled

or a tank of water with its level being controlled.

5 measurement element · The measurement element produces a signal related to the variable condition of the process that is being

controlled.

· For example, a switch which is switched on when a particular position is reached or a thermocouple which

gives an e.m.f related to the temperature.

With the closed-loop system illustrated in Fig.1.6 for a person controlling the temperature of a room, the

various elements are:

Controlled variable Reference value

Comparison element

Error signal

Control unit Correction unit

Process

Measuring device

- the room temperature - the required room temperature

- the person comparing the measured value with the required value of temperature

- the difference between the measured and required

temperatures.

- the person

- the switch on the fire

- the heating by the fire

- a thermometer

Page 6: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

An automatic control system for the control of the room temperature could involve a temperature sensor, after

Suitable signal conditioning, feeding an electrical signal to the input of a computer where it is compared with the set

value and an error signal generated. This is then acted on by the computer to give at its output a signal, which, after

suitable signal conditioning, might be used to control a heater and hence the room temperature. Such a system can

readily be programmed to give different temperatures al different times of the day.

Fig:1.7 The automatic control of water level

The above figure shows an example of a simple control system used to maintain a constant water level in a tank.

The reference value is the initial setting of the lever arm arrangement so that it just cuts off the water supply at the

required level. When water is drawn from the tank the float moves downwards with the water level. This causes the

lever arrangement to rotate and so allows water to enter the tank. This flow continues until the ball has risen to such

a height that it has moved the lever arrangement to cut off the water supply. It is closed loop control system with the

elements being:

Comparison clement

7.0 Sequential Controllers:

Fig.1.8 Washing Machine System · The above figure shows the basic washing machine system and gives a rough idea of its constituent

elements.

· The system that used to be used for the washing machine controller was a mechanical system which

involved a set of cam-operated switches, i.e mechanical switches. Figure 1.9 show the basic principle of

one such switch.

Page 7: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

· When, the machine is switched on, a signal electric motor slowly rotates its shaft, giving an amount of

rotation proportional no tune. The rotation turns the controller cams so that each in turn operates electrical

switches and so switches on circuits in the correct sequence. The contour of a cam determines the time at

which it operates a switch. the lever

· The contours of the cams and the means by which the program is specified and stored in the machine. The

sequence of instructions and the instructions used in a particular washing program are determined by the set

of cams chosen.

· With modern washing machines the controller is a microprocessor and the program is not supplied by the

mechanical arrangement of cams but by a software program.

Fig.1.9 Cam Operated Switch

· For the pre-wash cycle an electrically operated valve is opened when a current is supplied and switched off

when it ceases. This valve allows cold water into the drum for a period of time determined by the profile of

the cam or the output from the microprocessor used to operate its switch.

· However, since the requirement is a specific level of water in the washing machine drum, there needs to be

another mechanism which will stop the water going into the tank, during the permitted time, when it

reaches the required level.

· A sensor is used to give a signal when the water level has reached the preset level and give art output front

the microprocessor which is used to switch off the current to the valve. In the case of a cam-controlled

valve, the sensor actuates a switch which closes the valve admitting water to the washing machine drum.

Page 8: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

· When this event is completed die microprocessor, or the rotation of the cams, initiates a pump to empty the

drum.

· For the main wash cycle, the microprocessor gives an output which starts when lie pre-wash part of the

program is completed: in the case of the cam-operated system the cam has a profile such that it starts in

operation when the pre-wash cycle is completed. It switches a current into a circuit to open a valve to allow

cold water into the drum. This level is sensed and the water shut off when tine required level is reached.

· The microprocessor or cam then supplies a current to activate a switch which applies a larger current to an

electric heater to heat the water. A temperature sensor is used to switch off the current when the water

temperature reaches the preset value.

· The microprocessor or cams then switch on the drum motor to rotate the drum. This will continue for the

time determined by the microprocessor or cam profile before switching off. Then the microprocessor or a

cam switches on the current to a discharge pump to empty the water from the drum.

· The rinse part of the operation is now switched as a sequence of signals to open valves which allow cold

water into the machine. Switch it off, operate the motor to rotate the drum, operate a pump to empty the

water from the drum, and repeat this sequence a number of times.

8.0 Microprocessor based Controllers:

8.1 The automatic camera:

Fig.1.10 Elements of Automatic Camera

The modern camera is likely to have automatic focusing and exposure. Figure 1.10 illustrates the basic

aspects of a microprocessor-based system that can’ t be used to control the focusing and exposure.

· When the switch is operated to activate the system and the camera pointed at the object being

photographed, the microprocessor takes the input from the range sensor and sends an output to the lens

position drive to move the lens to achieve focusing. The lens position is fed back to the microprocessor so

that the feedback signal can’ t be used to modify the lens position according to the inputs from the range

sensor.

Page 9: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

· The light sensor gives an input to the microprocessor which then gives an output to determine, if the

photographer has selected the shutter controlled rather than aperture controlled mode, the time for which

the shutter will be opened. When the photograph has been taken, the microprocessor gives an output to the

motor drive to advance the film ready for the next photograph.

· The program for the microprocessor is a number of steps where the microprocessor is making simple

decisions of the form: is there an input signal of a particular input line or not and if there is output a signal

on a particular output line. The decisions are logic decisions with the input and output signals either being

low or high to give on-off states. A few steps of the program for the automatic camera might be of the

form:

begin if battery check input OK

then continue

otherwise stop

loop

read input from range sensor calculate lens movement output signal to

lens position drive input data from lens position encoder compare calculated output with actual output stop output when lens in correct position send in-focus signal to viewfinder display etc.

8.2 The Engine Management System:

· The engine management system of a car is responsible for managing the ignition and fuelling requirements

of the engine.

· With a four-stroke internal combustion engine there are several cylinders, each of which has a piston

connected to a common crankshaft and each of which carries out a four-stroke sequence of operations (fig.

1.11).

· When the piston moves down a valve opens and the air —fuel mixture is drawn into the cylinder.

· When the piston moves up again the valve closes and the air —fuel mixture is compressed.

· When the piston is near the top of the cylinder the spark plug ignites the mixture with a resulting expansion

of the hot gases. This expansion causes the piston to move back down again and so the cycle is repeated.

· The pistons of cacti cylinder are connected to a common crankshaft and their power strokes occur at

different times so that here is continuous power for rotating the crankshaft.

Fig.1.11 Four Stroke Sequence

Page 10: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Fig1.12 Elements of Engine Management System

· The power and speed of the engine are controlled by varying the ignition timing and the air —fuel mixture.

· With modem car engines this is done by a microprocessor. Figure 1.12 shows the basic elements of a

microprocessor control system.

· For ignition timing, the crankshaft drives a distributor which makes electrical contact for each spark plug in

turn and a timing wheel. This timing wheel generates pulses to indicate he crankshaft position.

· The microprocessor then adjusts the timing at which high voltage pulses are sent to the distributor so they

occur at the right moments of time.

· To control the amount of air —fuel mixture entering a cylinder during the intake strokes, the

microprocessor varies the time for which a solenoid is activated to open the intake on the basis of inputs

received of the engine temperature and the throttle position.

· The amount of fuel to be injected into the air stream can be determined by an input from a sensor of the

mass rate of air flow, or computed from other measurements, and the microprocessor hen gives an output to

control a fuel injection valve.

Mechatronics Approach:

· The domestic washing machine is used cam-operated switches in order to control the washing cycle is now

out-of-date. Such mechanical switches are being replaced by microprocessors.

· A microprocessor can be just considered as being essentially a collection of logic gates and memory

elements that are not wired up as individual components but whose logical functions are implemented by

means of software.

· The microprocessor-controlled washing machine can be considered an example of a mechatronics approach

in that a mechanical system has become integrated with electronic controls.

· As a consequence, a bulky mechanical system is replaced by a much more compact microprocessor system

which is readily adjustable to give a greater variety of programs.

Page 11: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

UNIT – II

SENSORS AND TRANSDUCERS

1.0 INTRODUCTION:

Sensor is used to produce a varying signal according to the quantity being measured.

Sensor is an element in a mechatronic system which acquires a physical parameter

and changes it into signal that can be processed by the system.

The active element of a sensor is known as transducer.

Transducer converts the measured quantity, property (or) condition into a usable

electrical output.

The mechatronic system requires sensors to measure physical quantities such as

position, distance, force, strain, temperature, vibration and acceleration. Simply

sensors are also called transducers.

2.0 PERFORMANCE TERMINOLOGY:

The function of the sensor (or) transducer is to sense (or) detect a parameter such as

pressure, temperature flow, motion, resistance, voltage, current and power.

The sensor should be capable of faithfully and accurately detecting any changes that

occur in the measured parameter.

The performance of transducers can be defined by using the following terms:

1. Range and span

2. Error

3. Accuracy

4. Sensitivity

5. Hysteresis error

6. Non linearity error

7. Repeatability/Reproducibility

8. Reliability

9. Stability

10. Dead band/time

11. Resolution

12. Backlash

13. Output impedance

1. Range and Span:

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

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

span.

For example a load cell is used to measure force. An input force can vary from 20 to

100 N. Then the range of load cell is 20 to 100 N. And the span of load cell is 80 N

(i.e., 100-20)

Page 12: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

2. Error:

If the transducer is ideally designed and made from appropriate materials with ideal

workmanship, then output will indicate the true value. But in actual practice the

output of the transducer will deviate from the true value.

The algebraic difference between the indicated value and the true value of the

measured parameter is termed as the error of the device.

Error = Indicated value —true value

For example, if the transducer gives a temperature reading of 30°C when the actual temperature is 29° C, then the error is + 1°C. If the actual temperature is 3 1° C, then the error is —1°C.

3. Accuracy:

Accuracy is the extent to which the value indicated by the measurementsystem would be

wrong.

Accuracy is the summation of all possible errors that are likely to occur.

For example, a thermocouple has an accuracy of ± 1° C. This means that reading

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

value.

Accuracy is also expressed as a percentage of the full range output (or) full-scale

deflection.

For example, a thermocouple can be specified as having an accuracy of ±4 % of full

range output. Hence if the range of the thermocouple is 0 to 200°C, then the reading

given can be expected to be within + 8°C (or) —8° C of the true reading.

4. Sensitivity:

The sensitivity is the relationship showing how much output we can get per unit

input.

ie sensitivity = Output / Input

5. Hysteresis error: When a device is used to measure any parameter plot the graph of output Vs value of

measured quantity. First for increasing values of the measured quantity and then for decreasing values of

the measured quantity.

The two output readings obtained usually differ from each other.

This is because of a certain amount of internal (or) external friction in the response

of the sensing element.

The maximum difference in between any part of output readings so obtained is known as hysteresis error.

The hysteresis error can be reduced by proper design and selection of the mechanical components, introducing greater flexibility and providing suitable heat treatment to the materials.

6. Non-linearIty error: A linear relationship is assumed between the input and output and hence, a straight

line is drawn in the graph as shown here.

Page 13: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Fig.1.2

Some transducers, do not have linear relationship and errors occur as a result of the

assumption of linearity.

The error is defined as the maximum difference from the straight line.

There are three methods to find the the numerical error. They are namely,

(i) End range value

(ii) Best straight line for all values

(iii) Best straight line, through zero point.

In the first method, (fig 1.2), the straight line is drawn by joining the output values at

the end points of the range.

In the next method, the straight line is drawn by using the method of least squares to

determine the best fit line by considering all data values are in error. Refer fig (1.3).

In the last method, the straight line is drawn by using the method of least squares to

determine the best fit line which passes through the zero point.

Fig.1.3 Fig.1.4

7. Repeatability/Reproducibility:

The repeatability and reproducibility of a transducer are its ability to give the same

output for repeated applications of the same input value.

Repeatability is also defined as the measure of the deviation of test results mean

value.

8. Reliability:

The reliability of a system is defined as the possibility that it will perform its

assigned functions for a specific period of time under given conditions.

Page 14: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

The reliability of a device (or) system is affected not only by the choice of individual

parts in system but also by manufacturing methods, quality of maintenance and the

type of user.

9. Stability:

The stability of a transducer is its ability to give the same output when used to

measure a constant input over a period of time.

The term drift is the change in output that occurs over time.

The drift can be expressed as a percentage of the full range.

Zero drift means if there is change in output when there is zero input.

10. Dead band / time:

There will be no output for certain range of input values. This is known as dead

band. There will be no output until the input has reached a particular value.

The length of time from the application of an input until the output begins to respond

and change is known as Dead time.

11. Resolution:

Resolution is defined as the smallest increment in the measured value that canbe

detected.

The resolution is the smallest change in the input value which will produce an

observable change in the input.

Resolution is also known as the degree of fineness with which measurements can be

made.

For example, if a micrometer with a minimum graduation of 1mm is. used to

measure to the nearest 0.5 mm, then by interpolation, the resolution is estimated as

0.5 mm.

12. Backlash:

Backlash is defined as the maximum distance (or) angle through which any part of a

mechanical system can be moved in one direction without causing any motion of the

attached part.

Backlash is an undesirable phenomenon and is important in the precision design of

gear trains.

13. Output Impedance:

Before defining impedance, we should know about Ohm’ s law.

Ohm’ s law is used to define the relationship between voltage V, Current I and

Resistance R.

(i.e.,) V=IR

Ohm’ s law can be extended to the AC circuit analysis of resistor, capacitor and

inductor elements as

v=ZI

where Z is called impedance of the elements. So impedance is similar to resistance.

The sensors produce electrical output.

When these sensors are interfaced with an electronic circuit, it is necessary to know

the output impedance.

Page 15: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

This impedance is connected in either series (or) parallel with that circuit and the

inclusion of the sensor will modi1 the behaviour of the system to which it is

connected.

3.0 DISPLACEMENT, POSITION AND PROXIMITY

Displacement Sensors:

The measurement of the amount by which some object has been moved. 1. Potentiometer, 2. Resistance strain gauge,

3. LVDT, 4. Push pull displacement sensor.

Position Sensors: The determination of the position of some object with reference to some reference

point.1. Photo electric sensors, 2. H sensors.

Proximity Sensors:

Used to determine when an object has moved to within some particular critical

distance.

1. Pneumatic proximity sensor, 2. Eddy current proximity sensor,

3. Inductive proximity switch, 4. Micro switch,

5. Reed switch.

Factors to be considered while selecting displacement, Position and Proximity sensors:

1. The accuracy required 2. The resolution required

3. The size of the displacement 4. Displacement type (linear or angular) 5. The cost and material made

1. Contact Sensors:

The measured object is mechanical contact with the sensor. In the contact sensors there is a sensing shaft which is direct contact with

theobject being monitored. The movement of the shaft may be used to make changes in electrical voltage,

capacitance, resistance.

2. Non-contact sensors:

The measured object is no physical contact between the measured object and the

sensor.

In the non-contact sensors the measured object causing a change in the air pressure in the sensor, or a change in inductance or capacitance.

3.1 DISPLACEMENT SENSORS:

A potentiometer can be used to convert rotary or linear displacement to a voltage.

Page 16: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

The potentiometers can be classified into three types.

. Potentiometer Sensor

Potentiometers consists of a resistance element with a sliding contact and the sliding

contact can be moved over the length of the element. This sliding contact is called

Wiper.

The motion of the sliding contact may be linear or rotational. The Fig.1.5 shows the linear potentiometer and the Fig.1.6 shows the rotary

potentiometer. The rotary potentiometer consists of a circular wire-wound track over which a

rotatable sliding contact can be rotated.

The wire-wound track may be single turn or helical turn.

Displacement and Position Sensor Types:

The displacement and position sensors are grouped into: 1. Contact sensors

2. Non-contact sensors 1. Rotary

2. Linear 3. Helical potentiometers

Fig.1.5

Fig.1.6

Advantages of Resistance Potentiometers: 1. They are simple and in expensive, 2. Electrical efficiency is high,

3. Simple in operation. 4. Useful for measurement of large amplitudes of displacement

2. Strain Gauged Element:

The change in length divided by original length is called strain.

The strain gauge consists of metal wire, metal foil strip. When subject to strain, the resistance ‘ R’ changes, and the change in resistance L is proportional to strain E.

where G is a constant (gauge factor).

In the Fig.1.9 the strain gauge is attached to flexible elements in the form of cantilevers, rings, U shapes.

When the flexible element is bent, as a result of this the electrical resistance will change due to force applied by a contact point.

The change in resistance is the measure of displacement. The Fig.1.8 and 1.9 shows the strain gauges and strain gauged elements. The major types of strain gauges are

I. Metal wire strain gauges, 2. Metal foil strain gauges,

In Metal Wire Strain Gauges a wire stretched between two points in an insulating

medium such as air.

4. Linear Variable Differential Transformer (LVDT)

Page 17: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

It consists of three coils symmetrically spaced along an insulated tube.

The central coil is primary and other two are secondary. A magnetic core is moved through the central tube, so that the displacement being

monitored. When voltage is supplied to the primary coil, alternating e.m.f.s are induced in the

secondary coils. Suppose the magnetic core is in central, the e.rn.f. induced in each coil is same

because of magnetic material in each coil is same and oppose to each other. So there is no output.

If the core is displaced from the central position there is a greater amount of magnetic core in one coil than the other. This will create a higher e.m.f. in one coil and lesser e.m.f. in the other coil. This will make a net difference in two e.m.f.s and

the displacement being monitored.

The formulas which are used in LVDT are:

1. The e.m.f.s induced in the two secondary coils 1 and 2 are:

where K1, K2 are degree of coupling between the primary and secondary coils.

Advantages of L VDT: 1. High range 2. Friction and electrical isolation 3. Low hysteresis 4. Power consumption is less.

3.2 POSITION SENSORS position sensors report the position of an object with respect to a reference part. The information can be an angle as in many degree a dish antenna has turned.

The following are the position sensors.

1. Photoelectric Sensors It is used to detect the object by breaking a beam of light (Refer Fig.1.12(a)) or

radiation falling on a device or by detecting the light reflected back by the object (Refer Fig.1.12(b)).

2. Hall effect Sensors

Hall effect: Hall effect is defined as when a beam of charged particles passesthrough

magnetic field, the beam is deflected from its straight line path due to

the forces acting on the particles.

Page 18: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

A current flowing in a conductor like a beam is deflected by a magnetic field.

The working principle of a Hall effect sensor is that if a strip of conducting material

carries a current in the presence of a transverse ngnei shown in Fig.1.13.

he difference of potential is produced between the opposite edges of the conductor.

The magnitude of the voltage depends upon the current and magnetic field.

In the Fig. the current is passed through leads 1 and 2 of the strip. The output leads connected with Hall strip.

When a transverse magnetic field passes through the strip the voltage difference occur in the output leads.

The hail effect sensor have the advantages of being able to operate as switches and it operate upto 100 KHz.

Applications of Hall Effect Sensors:

1. It is used as a Magnetic to electric transducer. 2. It is used for the measurement of the position or displacement of a structural element. 3. It is used for measurement of current.

4. It is used for measurement of power.

Digital Optical Encoder:

A digital optical encoder is a device that converts motion into a sequence of digital

pulses.

By counting or decoding these bits and the pulses can be converted into relative or absolute position measurements.

Encoders are in Rotary, linear configurations. The Rotary encoders are in two forms.

1. Absolute encoder 2. Incremental encoder.

1. Absolute Encoder:

The absolute encoder is designed to produce a digital word that distinguishes ‘ N’

distinct positions of the shaft.

The Fig. shows the basic form of an absolute encoder.

The rotating disc has four concentric circles of slots and four sensors to detect the light pulses.

The slots are arranged in such a way that the output is made in the binary code.

Page 19: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

The number of bits in the binary number will be equal to the number of tracks.

The most common types of numerical encoding used in the absolute encoder are gray and natural binary codes.

To illustrate the action of an absolute encoder, the gray code and natural binary code disk track patterns for a simple 4 track (4-bit) encoder is shown in Fig.1.16

2. Incremental Encoder: Working: A beam of light passes through the slots in a disc and it is detected

by a suitable light sensor. v When the disc is rotated, the output is shown in terms of pulses and these pulses being proportional to the angle of disc rotation.

So the angular position of the disc is determined by the number of pulses produced.

In the above Fig. three tracks and three sensors are used.

The inner track has just one hole and other two tracks have a series of equally spaced holes.

The angle is determined by the number slots on the disc.

3.3 PROXIMITY SENSOR

A proximity simply tells the contra! system whether a moving part is at a certain

place.

Proximity sensors come under the non contact type sensors.

The following are the some of the proximity sensors.

1. Pneumatic proximity sensor: Working: Low-pressure air is allowed and to escape through a port which is placed

in the front position of the sensor. This escaping air reduces the pressure in the nearby sensor output port, when there is no close by object.

If there is a close by object means the air will not escape

readily, so the pressure increases in the sensor output

port. This output from the sensor depends on the

proximity of objects.

2. Eddy current proximity sensors:

Working: When alternating current is supplied to the coil means the

alternating magnetic field is produced. If there is a metal object in

Page 20: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

close proximity to this alternating magnetic field the eddy current is induced in it.

This eddy current will produce a magnetic field themselves and the impedance of the

coil changes the amplitude of the alternating current.

The above Fig. shows the basic form of such sensor and it is used for the detection of

non-magnetic conductive materials.

3. Inductive proximity switch: It is used for the detection of metal objects and it consists of a coil wound around a

core. The metal object is close to the coil means it will produce a inductance change in the

coil. This inductive change is being monitored.

4. Microswitch: It is used for determining the presence of an item on a conveyor belt

and this might be actuated by the weight of the item on the belt depressing the belt by a spring loaded platform nearer to the sensor the presence of item in the conveyor is determined.

The closeness of switch is done by movement of this spring loaded platform.

5. Reed switch: It is a non-contact proximity switch. It is used for checking the closure ofdoors. It consists of two magnetic switch contacts sealed in a glass tube.

When a magnet is brought close to the switch, the magnetic reeds are attracted each

other and close the switch contacts.

4.0 VELOCITY AND MOTION:

To detect and monitor the velocity and motion the following sensors are used.

4.1 VELOCITY MEASUREMENT Velocity sensors or tachogenerators are devices that give an output proportional to

angular velocity. These sensors find wide application in motor speed control systems. The following are the various velocity sensors.

1. Electro Magnetic Transducer, The most commonly used transducer for measurement of linear

velocities is electromagnetic transducer. The electromagnetic transducers are classified into two categories.

1. Moving Magnet Type: 2. Moving coil type.

In moving magnet type the sensing element is a rod that is rigidly

coupled to the device whose velocity is being measured.

This rod is a permanent magnet. This permanent magnet is surrounded by a coil.

The motion of the magnet induces a voltage in the coil and the amplitude of the voltage is directly proportional to the velocity.

2. Moving coil type velocity transducer:

Page 21: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

It is operated through the action of a coil moving in a magnetic field.

A voltage generated in the coil is proportional to the velocity of the coil. This is a more satisfactory arrangement due to it forms a closed magneticcircuit

with a constant air gap and the device is contained an antimagnetic case which reduces the effects of stray magnetic field.

3. Tachogenerators:

A sensor that converts speed of rotation directly into electrical signal is called

a tachogenerator. It is used to convert angular speed into a directly dependent voltage signal.

(a) Toothed Rotor Variable Reluctance Tachogenerator: It is used to measure angular velocity. This tachogenerator consists of a metallic toothed rotor mounted on the shaft whose

speed is to be measured. A magnetic pick up is placed near the toothed rotor and this magnetic pick up

consists of a housing, and the housing containing a small permanent magnet with a coil wound around it.

When the rotor rotates, the reluctance of the air gap between pickup and the toothed rotor changes and the rise in e.m.f. is induced in the pickup coil. Finally the output is in the form of pulses

and wave shapes.

The pulses induced depend upon the number of teeth in the rotor and the rotational speed. When the speed is known, the rotational speed is calculated by measuring the frequency pulses.

Suppose the rotor has ‘ n’ teeth and the speed of

rotation is ‘ N’ r.p.s. and number of pulses per second is

‘ p’ .

The number of pulses per revolution = ‘ n’ = n

The advantage of toothed rotor variable reluctance tachogenerator is the information from

this device can be easily transmitted and easy to calibrate.

4. A. C. Generator Form of Tachogenerator: It consists of rotor, which rotates with the rotating shaft and a coil.

When the coil rotates in the magnetic field the e.m.f. is induced. The magnet may be in the form of stationary permanent magnet orelectromagnet. The frequency of this alternating e.m.f. is used to measure the angularvelocity.

The output voltage is rectified and it is measured with a permanent magnetmoving coil (PMCC) voltmeter.

Page 22: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

4.2 MOTION SENSORS 1. Stroboscope:

Stroboscope is a simple portable manually operated device for periodic or rotary motions measurement.

It is a variable frequency flashing light instrument and the flashing is set by the operator.

If a strong light is caused to flash on a moving object at the time each flash occurs. The stroboscope occupies a given position, and the object will appear to be stationary.

The flashing light whose frequency can be varied and controlled, and this source is called strobotron.

2 Pyroelectric Sensors: It consists of a polarised pyroelectric crystal

with thin metal film electrodes on opposite faces. (Pyro electric materials, e.g., lithium tantalate are crystalline materials which generate charge in response to heat flow. When such materials heated to about 610°C in an electric field, the electric dipoles within the material line up and it becomes polarised as shown in Fig.).

Due to the crystal is polarised with charged surfaces, the ions are drawn from the surrounding air and electrons from any measurement circuit is connected to the sensor to balance the surface charge as

shown in Fig.

For measurement of a human or heat source motion, the sensing element has to differentiate between general background heat radiation and a moving heat source. For that a single pyroelectric sensor is not capable to use and dual pyroelectric sensors are used as shown in Fig.

In this dual pyroelectric sensors the sensing element has the one front electrode and

two back electrodes. When two sensors being connected means both sensors are

receive the same heat signal and their outputs are cancelled.

Suppose a heat source moves from its position means the heat radiation moves from one

of the sensing elements to the other, then the current is alternates in one direction first

and then reversed to the other direction second.

A moving human gives an alternating current of 1O A. When the infrared radiation is incident on the dual pyroelectric sensor material and changes its temperature, the polarisation in the crystal is reduced. A focusing device is needed to direct the infrared radiation onto the sensor.

5.0 FLUID PRESSURE SENSORS The devices which are used to monitor fluid pressure in industrial processes is

diaphragms, bellows, capsules and tubes. The types of pressure measurements required are

(1) Absolute pressure measurement, (2) Differential pressure measurements.

In absolute pressure measurements the measurement is related to vacuum pressure (zero pressure) and in differential pressure measurement the difference in pressure is measured. The types of pressure measurement devices are discussed below.

Page 23: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

1. Diaphragms In this the pressure to be measured is applied to the

diaphragm, causing it to deflect, and the deflection

being proportional to the applied pressure. This movement can be monitored by some form of displacement sensor. (Example for displacement sensor is strain gauge) and it is shown in Fig..

A specially designed strain gauge is also used for measuring pressure and it

consisting of four strain gauges with, two measuring the strain in a circumferential

direction while remaining two measure strain in a radial direction. The four strain

gauges are connected to form the arms of a wheatstone bridge a shown in Fig.2.28.

The deflection at any point is shown in terms of +ve and —ye sign. The stress distribution on the diaphragm surface is almost ideal for practical purposes, since both compressive and tensile stresses exit. So this will allow the use of a four arm wheatstone bridge where all the gauges are active and consequently there is a large output.

The strain gauges I and 4 are placed at close to the centre and oriented to read tangential strain and its value is +ve maximum at this point.

The gauges 2 and 3 are oriented to read radial strain and it is placed close to the edge as possible.

2. Bellows A metallic bellows is a series of circular parts as shown in Fig. and the parts are

formed or joined in such a manner that they are expanded or contracted axially by change in pressure.

The Fig.2.30 shows the bellows can be combined with a LVDT to give a pressure

sensor with an electrical output.

The bellows are made up of materials like stainless steel, phosphor bronze, nickel, rubber and nylon.

The output pressure is calibrated through the LVDT.

3. Capsule

Page 24: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Capsules are one of the pressure measuring device and it can be considered to be just

two corrugated diaphragms combined and give even greater sensitivity.

The capsules are more sensitive in measuring pressure.

4. Tube Pressure Sensors

In tube pressure measurement the increase in pressure in a tube is cause the tube in

circular cross-section. It is shown in the above Fig. The tubes having greater

sensitivity while the pressure increases.

The tubes are made up of stainless steel and phosphor bronze.

5. Tactile Sensor It is one form of pressure sensor and it is used to determine the pressure in Robotics

in such a form fingertips of robotics contact with the object.

These type of sensors also used in ‘ touch display screens’ where physical contacts to

be sensed.

The above Fig. shows the one form of tactile sensor. It uses piezo electric polyvinylidene fluoride (PVDF) film. There are two layers of such film is used and it is separated by a soft film which

transmits vibrations.

The alternating voltage is supplied in the lower PVDF film and this results in

mechanical oscillations of the film.

The intermediate film transmits these vibrations to the upper PVDF film. Due to the piezoelectric effect the vibrations formed are cause an alternating voltage

to be produced across the upper film. So the pressure is applied to the upper PVDF film and its vibrations are affected the

output voltage.

6. Piezoelectric sensor

The electrical circuit for a piezo electric sensor is a charge generator in parallel with

capacitance Cs and in parallel with Resistance Rs.

Page 25: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

The effective circuit is as shown by the Fig. when the sensor is connected via a cable of capacitance C and resistance RA.

The sensor is charged subject to pressure change and the capacitor will discharge with time. The discharge time depends on the time constant of the circuit.

LIQUID FLOW SENSORS There are many devices used to measure the liquid flow. The basic principle in measuring flow is the fluid flowing

through the pipe per second is proportional to square root of pressure difference.

The following flow measuring devices are used to measure the liquid flow.

1. Turbine Flowmeter The Fig.2.35 shows the turbine flowmeter and it consists of a

multi-bladedrotor which is supported in the pipe along with the flow occurs.

The rotor rotation depends upon the fluid flow and the angular velocity is proportional to the flow rate.

The rotor rotation is determined y the magnetic pick-up, which is connected to the coil.

The revolution of the rotor is determined by counting the number of pulses produced in the magnetic pick up. The accuracy of this instrument is ± 3%.

2. Orifice Plate It is a simple disc with a central hole and it is placed in the tube through whichthe

fluid flow.

From the above Fig.2.36 the pressure difference measured between a point equal to

the diameter of the tube upstream and half the diameter of down stream.

The accuracy of this instrument is ±1.5%.

LIQUID LEVEL MEASUREMENT The liquid level measurement is done by using

1. Differential pressure sensor and 2. Float system. 3. 1. Differential Pressure Sensor

In this the differential pressure cell determines the pressure difference betweenbase of the liquid and atmospheric pressure.

The differential pressure sensor can be used in either form of open or closed vessel system.

Page 26: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

2. Float System In this method the level of liquid is measured by movement of a float. The movement of float rotates the arm and slider will move across a potentiometer. The output result is related to the height of the liquid.

6.0 TEMPERATURE SENSORS Temperature measurements are amongst the most common and the most important

measurements made in controlling industrial processes. Changes that are commonly used to monitor temperature are, the expansion or

contraction of solids, liquids or gases, the change in electrical resistance of conductors, semiconductors and thermoelectric e.m.f.s. The control system which are used to measure the temperature is as follows

1 Thermocouples The most common electrical method of temperature measurement uses the

thermocouples. The basic principle of this is, if two different metals

are joined together, a potentiometer difference occurs across the junction.

The potential difference depends on the metals used and the temperature of the junction.

When both junctions are at the same temperature, there is no net e.ni.f. But if there is a difference in temperature between the junction the e.m.f. will be produced.

This e.m.f. will depend upon the two metals and the temperature between the junctions. One junction is held at 0°C and the equation which is used to find out the e.m.f. is

There are three e.m.f.s present in a thermoelectric circuit. In this the Seebeck e.m.f.

is caused by the junction of dissimilar metals and the Pettier e.m.f. is caused by a

current flow in the circuit, and the Thomson e.m.f. which results from a temperature

gradient in the materials.

It is observed that all thermocouple circuits must involve at least two junctions. In that one of the junctions senses the desired or unknown temperature.

This junction is called the hot or measuring junction. The other junction is usually maintained at a known fixed temperature and this junction is called the cold or reference junction.

If the temperature of the reference or cold junction is known, the temperature of the hot or the measuring junction can be calculated by using the thermoelectric properties of the materials.

If thermocouple circuit can have other metals in the circuit and they will have no effect on the thermoelectric e.m.f.

A thermocouple can be used with the reference junction at a temperature other than 0°C. For that we assume a 0°C junction and the correction has to be applied using the law

of intermediate temperatures.

The equation used in this is

Page 27: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Here to maintain the 0°C at one junction a

compensation circuit is Used to provide an

e.m.f. which varies with the temperature of

the cold junction.

v When it is added to the thermocouple e.m.f. it will generate a combined e.m.f. This is shown in Fig..

In the above Fig.2.42, the wires from the

measuring junction are screwed directly to an isothermal block terminal strip.

The temperature of the block is ambient temperature. This reference temperature is measured by semiconductor sensor and compensation

circuitry develops a voltage Ecomp which is combined with measuring junction and the net voltage across the voltmeter = T (Temperature being measured).

The isothermal block can accept many thermocouple pairs in multichannel instruments with microprocessor computing power since the T (reference junction sensor now sends its temperature data to the computer which computes the needed voltage correction for each thermocouple.

The thermocouples like E, J, K and T are relatively cheap and it has accuracies of about ± ito 3%.

2. Resistance Temperature Detectors (RTDs)

Resistance temperature detectors (RTDs) or resistance thermometers are basic

instruments for measurement of resistance.

The materials used for RTDs are Nickel, Iron, Platinum, Copper, Lead, Tungsten, Mercury, Manganin, Silver, etc.

The resistance of most metals increases over a limited temperature range and the relationship between Resistance and Temperature is shown below.

The Resistance temperature detectors are simple,

and resistive elements in the form of coils of wire and it is shown in the above

Fig.2.44.

v The equation which is used to find the linear relationship in RTD is

Constructional Details ofRTDs: The platinum, nickel and copper in the

form wire are the most commonly used materials in the RTDs.

Thin film platinum elements are often made by depositing the metal on a

Page 28: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

suitable substrate wire- wound elements involving a platinum wire held by a high temperature glass adhesive inside a ceramic tube.

1. High degree of accuracy. 2. Resistance thermometer is interchangeable in a process without compensation or recalibration. 3. It is normally designed for fast response as well as accuracy to provide close control of processes.

3. Thermistors Thermistor is a semiconductor device that has a negative temperaturecoefficient of

resistance in contrast to positive coefficient displayed by most metals. Thermistors are small pieces of material made from mixtures of metal oxides, such

as Iron, cobalt, chromium, Nickel, and Manganese. The shape of the materials is in terms of discs, beads and rods. The thermistor is an extremely sensitive device

because its resistance changes rapidly with temperature.

The resistance of conventional metal-oxide thermistors decreases in a very non-linear manner with an increase in temperature is shown in the Fig. below.

v The change in resistance per degree change in

temperature is considerably larger than that which occurs with

metals.

v The simple series circuit for measurement of temperature using a thermistor and the variation of resistance with temperature for a typical thermistor is shown in the below Fig.

The thermistor is an extremely sensitive device because its resistance changes

rapidly with temperature.

Thermistors have many advantages when compared with other temperature sensors. The main disadvantage is highly non-linear behaviour.

4. Thermodiodes and Transistors

(a) Thermodiodes: Thermodiode is widely used method for measuring temperature. When

thetemperature of doped semiconductors changes, the mobility of their charge carriers changes and this affects the rate at which electrons and holes can

diffuse across ap-n junction. 1. Measurement of temperature, 2. Control of temperature, 3. Temperature compensation,

4. Measurement of thermal conductivity, 5. Measurement of power at high frequencies,

6. Measurement of composition of gases, 7. Providing time delay,

8. Vacuum measurements.

The difference in voltage and current through the junction is a function of

thetemperature. The equation which is used to find the I is

Page 29: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

From the above equation the voltage ‘ V’ is proportional to the temperature on

Kelvin scale and the potential difference measurement

across a diode at constant current is used to measure the

temperature.

7.0 LIGHT SENSORS 1. Photodiodes

Diodes like photodiodes and semiconductor diodes are

connected into a circuitin reverse bias giving a very high resistance.

When light falls on the junction the resistance of the diode will drop and the current in the circuit will rise.

The Fig.2.51 shows the diode characteristics.

the diode is sufficiently reverse biased, it will breakdown.

The current passing through the diode when forward biased only. If an A.C. voltage is applied across a diode, it can be regarded as only switching on

when forward bias it and being off in the reverse direction. The photodiodes have a very fast response to light and it can be used as a variable

resistance device controlled by the light incident on it.

8.0 SELECTION OF SENSORS

The factors to be considered while selecting sensors are

1. The nature of output required from the sensor. 2. The nature of measurement required. 3. The accuracy of the sensor. 4. The cost of the sensor. 5. The power requirement of the sensor. 6. The speed response of the sensor.

7. The linearity of the sensor. 8. The Reliability and Maintainability of the sensor.

9. Environmental conditions under which the measurement is to be made. 10. Signal conditioning requirements.

11. The nominal and range of values of the sensor. 12. Suitable output signals from the measurement.

PART- A

1. What is the use of sensors and transducers?

2. Differentiate between Range and Span. 3. Give the formula for finding the repeatability of a transducer. 4. What is hysteresis error?

5. What is the difference between ‘ Accuracy’ and ‘ Precision’ ? 6. What is threshold?

7. What is Dead time and Dead zone?

8. What is resolution?

9. What is Rise time and Settling time?

10. What is meant by Hall effect?

Page 30: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

11. What are the velocity and motion sensors?

12. What is non-linearity error?

13. Give the example for measuring force.

14. What are the fluid pressure sensors?

15. What are the liquid flow measuring devices?

16. What are the two types diaphragms?

17. What are the Temperature measuring devices?

18. Give the example for light sensors.

19. What is the basic principle in thermocouples?

20. Give some materials used in thermocouples

21. What is offset voltage of an operational amplifier

22. What is the equation for V of an integrator?

23. What is a precision diode?

24. What is a comparator?

25. Name an application of a Schmitt trigger.

26. Why integrators are preferred over differentiators in analog computers?

27. What is a voltage follower?

28. What is the advantage of CMOS Schmitt trigger?

PART-B

1. Explain the terminologies used in transducers.

2. What are all the displacement sensors? Explain each one briefly.

3. Explain the position sensors with neat figure.

4. Define proximity and explain the proximity sensors.

5. What are all the velocity and Motion sensors?

6. How the pressure is measured? Explain the pressure sensors neatly.

7. Explain the temperature measurement sensors.

8. Explain the light sensors with neat figure.

9. What are all the points to be considered while selecting the sensors?

10. Explain the signal processing.

11. Explain some applications of operational amplifier.

12. Explain the operation of successive approximation ADC.

13. How do a dual slope ADC and single slope ADC differ?

14. What is Flash ADC ? Discuss.

15. Explain the construction of R-DR ladder DAC.

16. Discuss the various terms associated with ADC.

Page 31: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

UNIT – III MICROPROCESSOR 8085

INTRODUCTION:

Ø The microprocessor is a clock-driven semiconductor device consisting of

electronic logic circuits manufactured by using either a large-scale integration (LSI) or very-large-scale integration (VLSI) technique.

Ø The microprocessor is capable of performing various computing functions and

making decisions to change the sequence of program execution. In large

computers, a CPU implemented on one or more circuit boards performs these

computing functions. Ø The microprocessor is in many ways similar to the CPU, but includes all the

logic circuitry, including the control unit, on one chip. Ø The microprocessor can be divided into three segments for the sake of clarity,

arithmetic/logic unit (ALU), register array, and control unit. Arithmetic/Logic Unit: This is the area of the microprocessor where various

computing functions are performed on data. The ALU unit performs such

arithmetic operations as addition and subtraction, and such logic operations as

AND, OR, and exclusive OR. Register Array: This area of the microprocessor consists of various registers

identified by letters such as B, C, D, E, H, and L. These registers are primarily

used to store data temporarily during the execution of a program and are

accessible to the user through instructions. Control Unit: The control unit provides the necessary timing and control signals to all the operations in the microcomputer. It

controls the flow of data between the microprocessor and memory and peripherals.

Memory: Memory stores such binary information as instructions and data, and provides that information to the microprocessor

whenever necessary. To execute programs, the microprocessor reads instructions and data from memory and performs the computing

operations in its ALU section. Results are either transferred to the output section for display or stored in memory for later use. Read-Only memory (ROM) and Read/Write memory (R/WM), popularly known as Random-Access memory (RAM).

1. The ROM is used to store programs that do not need alterations. The monitor program of a single-board microcomputer is generally stored in the ROM. This program interprets the information entered through a keyboard and provides equivalent binary digits to the

microprocessor. Programs stored in the ROM can only be read; they cannot be altered. 2. The Read/Write memory (RIWM) is also known as user memory It is used to store user programs and data. In single-board

microcomputers, the monitor program monitors the Hex keys and stores those instructions and data in the R/W memory. The

information stored in this memory can be easily read and altered.

I/O (Input/

MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS:

Architecture of 8085 Microprocessor

Page 32: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Ø Address Bus: The address bus is a group of 16 lines generally identified as A0 to A15. The address bus is unidirectional: bits flow in one direction —from the MPU to peripheral devices. The MPU uses the address bus to perform the first function: identifying a peripheral or a memory location. 8085 Bus Structure

Data Bus: The data bus is a group of eight lines used for data flow. These lines are bidirectional —data flow in both directions between

the MPU and memory and peripheral devices. The MPU uses the data bus to perform the second function: transferring binary information .The eight data lines enable the MPU to manipulate 8-bit data ranging from 00 to FF (28 = 256 numbers). The largest number that can appear on the data bus is 11111111. Control Bus:

The control bus is comprised of various single lines that carry synchronization signals, providing timing signals. The MPU

generates specific control signals for every operation it performs. These signals are used to identify a device type with which the MPU intends to communicate.

Registers:

The 8085 programmable register

The 8085 have six general-purpose registers to

perform the first operation listed above; that is, to store 8-bit

data during program execution. These registers are identified

as B, C, D, E, H, and L. They can be combined as register

pairs —BC, DE, and HL —to perform some 16-bit operations.

Ø Accumulator: The accumulator is an 8-bit

register that is part of the arithmetic/logic unit

(ALU). This register is used to store 8-bit data and

to perform arithmetic and logical operations. The

result of an operation is stored in the

accumulator. The accumulator is also identified

as register A.

Ø Flags: The ALU includes five flip-flops that are set or reset according to the result of an opera tion. The microprocessor uses them

to perform the third operation; namely, testing for data conditions. They are Zero (Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags. The most commonly used flags are Sign, Zero, and Carry; the others will be explained as necessary. The bit position for the flags in flag register is,

D7 D6 D5 D4 D3 D2 D1 D0

S Z AC P CY

(1) Sign Flag (S): After execution of any arithmetic and logical operation, if D7 of the result is 1, the sign flag

is set. Otherwise it is reset. D7 is reserved for indicating the sign; the remaining is the magnitude of number. If D7 is 1, the number will be viewed as negative number. If D7 is 0, the number will be viewed as positive number.

Page 33: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

(2) Zero Flag (z): If the result of arithmetic and logical operation is zero, then zero flag is set otherwise it is reset.

(3) Auxiliary Carry Flag (AC): If D3 generates any carry when doing any arithmetic and logical operation, this flag is set. Otherwise it is reset.

(4) Parity Flag (P): If the result of arithmetic and logical operation contains even number of 1’ s then this flag will be set and if it is odd number of 1’ s it will be reset.

(5) Carry Flag (CY): If any arithmetic and logical operation results any carry then carry flag is set otherwise it is reset.

Program Counter (PC): Ø This 16-bit register deals with the fourth operation, sequencing the execution of instructions. This register

is a memory pointer. Ø The microprocessor uses this register to sequence the execution of instructions. The function of the

program counter is to point to the memory address from which the next byte is to be fetched. Ø When a byte (machine code) is being fetched, the program counter is incremented by one to point to the

next memory location.

Stack Pointer (Sp): The stack pointer is also a 16-bit register used as a memory pointer; initially, it will be called the stack pointer register to

emphasize that it is a register. It points

to a memory location in R/W memory, called the stack. The beginning of the stack is defined by loading a 16-bit address in the stack

pointer (register).

Temporary Register: It is used to hold the data during the arithmetic and logical operations.

Instruction Register: When an instruction is fetched from the memory, it is loaded in the instruction register.

Instruction Decoder: It gets the instruction from the instruction register and decodes the instruction. It identifies the instruction to be

performed.

Serial I/O Control: It has to control signals named SID and SOD for serial data transmission.

Timing and Control unit: It has control and status signals. It provide control signal to synchronize the components of

microprocessor and timing for instruction to perform the operation.

Interrupt Control Unit: It is used to receive an interrupt signal for process the operation and send an acknowledgement for

receiving the interrupt signal.

I/O INTERFACING:

The two methods of data transfer are:

· Serial I/O : One bit is transferred using one data line · Parallel I/O : Data can enter (or exit) in groups of eight bits using the entire data bus.

Thus the I/O devices (Keyboards and displays) can be interfaced using two methods namely:

· Peripheral-mapped I/O: The device is identified with an 8-bit address and enabled by I/O – related control signals.

· Memory-mapped I/O: The device is identified with a 16-bit address and enabled by memory related control signals.

Concepts Review for peripheral mapped I/O a) When an I/O instruction is executed, 8085 places the device address (Port number) on the de multiplexed low –

order and high – order address bus. b) The address is decoded to generate the pulse corresponding to the device. c) The device address pulse is AND ed with the appropriate control signals like IO/M, RD and WR to assert the I/O

device. d) A latch is used for an output port and a tri-state buffer is used for an input port.. e) The address bus can be decoded by using either the absolute or the linear select decoding reduces the component cost

but the I/O device ends up with multiple addresses.

Memory Mapped I/O :

Page 34: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Here, the input and output devices are assigned and identified by 16-bit addresses. To transfer data between 8085 and I/C

devices, memory – related instructions like LDA, STA etc are used. The control signals MEMR and MEMW should be

connected to I/O devices.

STA 8000H; Address 2050H; stores the contents of A to 8000.

2050 32; 2051 00; 2052 80;

8085 requires 4 Machine cycles to execute STA; Instruction fetch and decode in M1; read 2051 and 2052 in M2 an M3; In M4

8085 places the entire address (8000H) on the address lines, the contents of the accumulator on data bus and generates MEMW

Characteristics

Memory-Mapped I/O Peripheral I/O

1. Device address 16 Bit 8 Bit

2. Control Signals RD / WR (MEMR / IO/M , RD / WR (IOR, MEMW) IOW)

3. Instructions Memory related IN, OUT

instructions

LDA, STA, MOV, ADD,

SUB

4. Data transfer Between any register Between I/O and

and I/O Accumulator

5.Maximum number of I/O 64K memory shared 256 Input; 256 Output

between I/O and system

memory.

6. Execution 13 T States (LDA, STA) 10 T States

7 T States (MOV)

7. Hardware More hardware required Less hardware to decode

to decode 16 bit address 8 bit address

8. Other features Arithmetic or Logical Not Possible.

operations can be

performed

8085 INSTRUCTION SET:

The 8085 instruction set can be classified into the following five functional headings.

1. DATA TRANSFER INSTRUCTIONS : Includes the instructions that moves (copies) data between registers or between memory locations and registers. In all data

transfer operations the content of source register is not altered. Hence the data transfer is copying operation. 2. ARITHMETIC INSTRUCTIONS:

Includes the instructions, which performs the addition, subtraction, increment or decrement operations. The flag conditions

are altered after execution of an instruction in this group.

3. LOGICAL INSTRUCTIONS: The instructions which performs the logical operations like AND, OR, EXCLUSIVE- OR, complement, compare and rotate

instructions are grouped under this heading. The flag conditions are altered after execution of an instruction in this group.

4. BRANCHING INSTRUCTIONS: The instructions that are used to transfer the program control from one memory location to another memory location are

grouped under this heading.

5. MACHINE CONTROL INSTRUCTIONS: Includes the instructions related to interrupts and the instruction used to halt program execution.

1. ACI: Add Immediate to Accumulator with Carry.

Description: The 8-bit data (operand) and the Carry flag are added to the contents of the accumulator, and the result is stored in the

accumulator. All flags are modified to reflect the result of the addition.

Page 35: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

2. ADC: Add Register to Accumulator with Carry

Description: The contents of the operand (register or memory) and the Carry flag are added to the contents of the accumulator and

the result is placed in the accumulator. The contents of the operand are not altered; however, the previous Carry flag is reset.

All flags are modified to reflect the result of the addition.

3. ADD: Add Register to Accumulator

Description: The contents of the operand (register or memory) are added to the contents of the accumulator and the result is stored in

the accumulator. If the operand is a memory location, that is indicated by the 16-bit address in the HL register. All flags are modified

to reflect the result of the addition.

4. ADI: Add Immediate to Accumulator

Description : The 8-bit data (operand) are added to the contents of the accumulator, and the result is placed in the accumulator. All

flags are modified to reflect the result of the addition.

5. ANA: Logical AND with Accumulator

Description: The contents of the accumulator are logically AND ed with the contents of the operand (register or memory), and the

result is placed in the accumulator. If the operand is a memory location, its address is specified by the contents of HL registers. Flags

S, Z, P are modified to reflect the result of the operation. CY is reset. In 8085 AC is set.

6. ANI: AND Immediate with Accumulator

Description: The contents of the accumulator are logically AND ed with the 8-bit data (operand) and the results are placed in the

accumulator. Flags S, Z, P are modified to reflect the results of the operation. CY is reset. In 8085, AC is set.

7. CALL: Unconditional Subroutine Call

Description: The program sequence is transferred to the address specified by the operand. Before the transfer, the address of the next

instruction to CALL (the contents of the program counter) is pushed on the stack.

8. CMA: Complement Accumulator

Description: The contents of the accumulator are complemented. No flags are affected.

9. CMC: Complement Carry.

Description: The carry flag is complemented.

10. CMP: Compare with Accumulator.

Description: The contents of the operand (register or memory) are compared with the contents of the accumulator.

11. CPI: Compare Immediate with Accumulator

Description: The second byte (8-bit data) is compared with the contents of the accumulator.

12. DAA: Decimal-Adjust Accumulator

Description: The contents of the accumulator are changed from a binary value to two 4-bit binary-coded decimal (BCD) digits. This

is the only instruction that uses the auxiliary flag (internally) to perform the binary-to-BCD conversion. Flags S, Z, AC, P. CY flags

are altered to reflect the results of the operation.

13. DAD: Add Register Pair to H and L Registers

Description: The 16-bit contents of the specified register pair are added to the contents of the HL register and the sum is saved in the

HL register. The contents of the source register pair are not altered. If the result is larger than 16 bits the CY flag is set. No other

flags are affected.

Page 36: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

14. DCR: Decrement Source by 1

Description: The contents of the designated register/memory are decremented by 1 and the results are stored in the same place. If the

operand is a memory location, it is specified by the contents of the HL register pair. Flags S. Z, P, AC are modified to reflect the

result of the operation. CY is not modified.

15. DCX: Decrement Register Pair by 1

Page 37: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Description: The contents of the specified register pair are decremented by 1. This instruction views the contents of the two registers

as a 16-bit number. No flags are affected.

16. DI: Disable Interrupts

Description: The Interrupt Enable flip-flop is reset and all the interrupts except the TRAP (8085) are disabled. No flags are affected.

17. El: Enable Interrupts

Description: The Interrupt Enable flip-flop is set and all interrupts are enabled. No flags are affected.

18. HLT: Halt and Enter Wait State

Description: The MPU finishes executing the current instruction and halts any further execution. The MPU enters the Halt

Acknowledge machine cycle and Wait states are inserted in every clock period. The address and the data bus are placed in the high

impedance state. The contents of the registers are unaffected during the HLT state. An interrupt or reset is necessary to exit from the

Halt state. No flags are affected.

19. IN: Input Data to Accumulator from a Port with 8-bit Address

Description: The contents of the input port designated in the operand are read and loaded into the accumulator. No flags are affected.

20. INR: Increment Contents of Register/Memory by 1

Description: The contents of the designated register/memory are incremented by I and the results are stored in the same place. If the

operand is a memory location, it is specified by the contents of HL register pair. Flags S. Z, P, AC are modified to reflect the result of

the operation. CY is not modified.

21. INX: Increment Register Pair by 1

Description: The contents of the specified register pair are incremented by 1. The instruction views the contents of the two registers

as a 16-bit number. No flags are affected.

22. JMP: Jump Unconditionally.

Description: The program sequence is transferred to the memory location specified by the 16-bit address. This is a 3-byte instruction;

the second byte specified the low-order byte and the third byte specifies the high-order byte. No flags are affected.

Jump Conditionally: Description: Jump on carry

Jump on No carry Jump on Positive Jump on minus

Jump on Parity Even

Jump on parity Odd Jump on Zero

Jump on No Zero

23. LDA: Load accumulator Direct

Description: The contents of a memory location, specified by a 16-bit address in the operand, are copied to the accumulator. The

contents of the source are not altered. This is a 3-byte instruction; the second byte specifies the low-order address and the third byte

specifies the high-order address. No flags are affected.

24. LDAX: Load Accumulator Indirect.

Description: The contents of the designated register pair point to a memory location. This instruction copies the contents of that

memory location into the accumulator. The contents of either the register pair or the memory location are not altered. No flags are

affected.

Page 38: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

25. LD: Load H and L Registers Direct

Description: The instruction copies the contents of the memory location pointed out by the 16-bit address in register L and copies

the contents of the next memory location in register H. The contents of source memory locations are not altered. No flags are

affected.

26. Load Register Pair Immediate

Description: The instruction loads 16-bit data in the register pair designated in the operand. This is a 3-byte instruction; the second

byte specifies the low-order byte and third byte specifies the high-order byte.

27. MOV: Move – Copy from Source to Destination.

Description: This instruction copies the contents of the source register into the destination register; the contents of the source register

are not altered. If one of the operand is a memory location, it is specified by the contents of HL registers. No flags are affected.

28. MVI: Move Immediate 8-Bit

Description: The 8-bit data is stored in the destination register or memory. If the operand is a memory location, it is specified by the

contents of HL registers. No flags are affected.

29. NOP: No Operation

Description: No operation is performed. The instruction is fetched and decoded; how ever, no operation is executed. No flags are

affected.

30. ORA: Logically OR with Accumulator

Description: The contents of the accumulator are logically OR with the contents of the operand (register or memory), and the results are placed in the accumulator. If the operand is a memory location, its address is specified by the contents of HL registers. Flags Z, S,

P are modified to reflect the results of the operation. AC and CY are reset. 31. ORI: Logically OR Immediate

Description: The contents of the accumulator are logically OR with the 8-bit data in the operand and the results are placed in the

accumulator. Flags S, Z, P are modified to reflect the results of the operation. CY and AC are reset.

32. OUT: Output Data from Accumulator to a Port with 8-Bit Address

Description: The contents of the accumulator are copied into the output port specified by the operand. Flags No flags are affected.

33. PCHL: Load Program Counter with HL Contents

Description: The contents of registers H and L are copied into the program counter. The contents of H are placed as a high-order byte and of L as a low-order byte. No flags are affected.

34. POP: Pop off Stack to Register Pair

Description: The contents of the memory location pointed out by the stack pointer register are copied to the low-order register (such

as C, E, L, and flags) of the operand. The stack pointer is incremented by 1 and the contents of that memory location are copied to the

high-order register (B, D, H, A) of the operand. The stack pointer register is again incremented by 1. No flags are modified.

35. PUSH: Push Register Pair onto Stack

Description: The contents of the register pair designated in the operand are copied into the stack in the following sequence. The

stack pointer register is decremented and the contents of the high-order register (B, D, H, A) are copied into that location. The stack

pointer register is decremented again and the contents of the low-order register (C, E, L, flags) are copied to that location. No flags are modified.

36. RAL: Rotate Accumulator Left through Carry

Page 39: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Description: Each binary bit of the accumulator is rotated left by one position through the Carry flag. Bit D is placed in the bit in the

Carry flag and the Carry flag is placed in the least significant position D. Flags CY is modified to bit D S, Z, AC, P are not affected.

37. RAR: Rotate Accumulator Right through Carry

Description: Each binary bit of the accumulator is rotated right by one position through the Carry flag. Bit D is placed in the Carry

flag and the bit in the Carry flag is placed in the most significant position, D. Flags CY is modified according to bit D S, Z, P, AC are

not affected.

38. RLC: Rotate Accumulator Left

Description: Each binary bit of the accumulator is rotated left by one position. Bit D is placed in the position of D as well as in the

Carry flag. Flags CY is modified according to bit D S, Z, P, AC are not affected.

39. RRC: Rotate Accumulator Right Description: Each binary bit of the accumulator is rotated right by one position. Bit D is placed in the position of D as well as in the Carry flag. Flags CY is modified according to bit Do. S. Z, P, AC are not affected.

40. RET: Return from Subroutine Unconditionally.

Description: The program sequence is transferred from the subroutine to th4e calling program. The two bytes from the top of the

stack are copied into the program, counter and the program execution begins at the new address. The instruction is equivalent to POP

Program Counter. No flags are affected.

41. RIM: Read Interrupt Mask.

Description: This is a multipurpose instruction used to read the status of interrupts 7.5, 6.5, 5.5 and to read serial data input bit. No flags are affected.

42. RST: Restart.

Description: The RST instructions are equivalent to 1-byte call instruction to one of the eight memory locations on page 0. The

instructions are generally used in conjunction with interrupts and inserted using external hardware. However, these can be used as

software instructions in a program to transfer program execution to one of the eight locations. No flags are affected.

43. SBB: Subtract Source and Borrow from Accumulator.

Description: The contents of the operand (register or memory) and the Borrow flag are subtracted from the contents of the

accumulator and the results are placed in the accumulator. The contents of the operand are not altered; however, the previous Borrow

flag is reset. All flags are altered to reflect the result of the subtraction.

44. SBI: Subtract Immediate with Borrow.

Description: The 8-bit data (operand) and the borrow are subtracted from the contents of the accumulator, and the results are placed

in the accumulator. All flags are altered and the results are placed in the accumulator.

45. SHLD: Store H and L Register Direct.

Description: The contents of register L are stored in the memory location specified by the 16 bit address in the operand, and the

contents of H register are stored in the next memory location by incrementing the operand. The contents of registers HL are not

altered. This is a 3-byte instruction; the second byte specifies the low-order address and the third byte specifies the high order

address. No flags are affected.

46. SIM: Set Interrupt Mask.

Description: This is a multipurpose instruction and used to implement the 8085 interrupts (RST 7.5,6.5 and 5.5) and serial data

output.

47. SPHL: Copy H and L Registers to the Stack Pointer.

Page 40: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Description: The instruction loads the contents of the H and L registers into the stack pointer register; the contents of the H register

provide the High order address, and the contents of the L register provide the low order address. The contents of the H and L registers

are not altered. No flags are affected.

48. STA: Store Accumulator Direct.

Description: The contents of the accumulator are copied to a memory location specified by the operand. This is a 3-byte instruction;

the second byte specifies the low order address and the third byte specifies the high order address. No flags are affected.

49. STAX: Store Accumulator Indirect.

Description: The contents of the accumulator are copied into the memory location specified by the contents of the operand (register pair). The contents of the accumulator are not altered. No flags are affected.

50. STC: Set Carry.

Description: The carry flag is set to 1. No other flags are affected.

51. SUB: Subtract Register or Memory from Accumulator.

Description: The contents of the register or the memory location specified by the operand are subtracted from the contents of the

accumulator, and the results are placed in the accumulator. The contents of the source are not altered. All flags are affected to reflect

the result of the subtraction.

52. SUI: Subtract Immediate from Accumulator.

Description: The 8-bit data (the operand) are subtracted from the contents of the accumulator and the results are placed in the

accumulator. All flag are modified to reflect the results of the subtraction.

53. XCHG: Exchange H and L with D and E.

Description: The contents of register H are exchanged with the contents of register D and the contents of register L are exchanged with the contents of register E. No flags are affected.

54. XRA: Exclusive OR with Accumulator.

Description: The contents of the operand (register or memory) are Exclusive OR with the contents of the accumulator, and the

results are placed in the accumulator. The contents of the operand are not altered. Z,S,P are altered to reflect the results of the operation. CY and AC are reset.

55. XRI: EXCLUSIVE OR Immediate with Accumulator.

Description: The 8 bit data (operand) are exclusive ORed with the contents of the accumulator, and the result are placed in the

accumulator. Z,S,P are altered to reflect the results of the operation. CY and AC are reset.

56. XTHL: Exchange H and L with Top of Stack. Description: The contents of the L register are exchanged with the stack location pointed out by the contents of the stack pointer

register. The contents of the H register are exchanged with the next stack location (SP+1); however, the contents of the stack pointer

register are not altered. No flags are affected.

ADDRESSING MODES: Every instruction of a program has to operate on a data. The method of specifying the data to be operated by the

instruction is called Addressing. The 8085 has the following 5 different types of addressing. 1. Immediate Addressing 2. Direct Addressing 3. Register Addressing 4. Register Indirect Addressing 5. Implied Addressing

Immediate Addressing: In immediate addressing mode, the data is specified in the instruction itself. The data will be a part of the program

instruction. Ex: MVI B, 3EH - Move the data 3EH given in the instruction to B register.

Page 41: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Direct Addressing: In direct addressing mode, the address of the data is specified in the instruction. The data will be in memory. In this

addressing mode, the program instructions and data can be stored in different memory. Ex: LDA 1050H - Load the data available in memory location 1050H in to accumulator..

Register Addressing: In register addressing mode, the instruction specifies the name of the register in which the data is available.

Ex: MOV A, B - Move the content of B register to A register.

Register Indirect Addressing: In register indirect addressing mode, the instruction specifies the name of the register in which the address of the data is

available. Here the data will be in memory and the address will be in the register pair. Ex; MOV A, M - The memory data addressed by H L pair is moved to A register.

Implied Addressing: In implied addressing mode, the instruction itself specifies the data to be operated.

Ex: CMA - Complement the content of accumulator. ASSEMBLY LANGUAGE PROGRAMMING: ASSEMBLER:

An ASSEMBLER is a program, which is used to translate assembly language program to correct binary code for each

instruction.

Types of assembler: 1. One pass assembler:

· It is an assembler in which the source codes are processed only once. · Very fast. · Backward reference only used. · It issues an error message if it encounters a label or variable that is defined at a later end of a program. So it

cannot have forward references. 2. Two pass assembler:

· The source codes are processed two times. · In the first pass it assigns addresses to all the labels and attach values to all the variables used in the program. · In the second pass it converts the source code into machine code.

Advantages of assembler: · Translates mnemonics into binary code with speed and accuracy. · Allows the programmer to use variables in the program. · It is easier to alter the program and reassemble. · It identifies the syntax error. · It can reserve memory locations for data or result. · It provides list file for documentation.

· They are the instructions to the assembler regarding the program being assembled. · Also called as pseudo instructions or pseudo op-codes. · They will give information’ s like start and end of program, values of variables used in the program, storage

locations of output and input data etc.

· Assemblers are ORG origin of a program END End of program EQU Equate DB Define Byte

DW Define Word DS Define Storage

SUBROTINE: · It is a group of instructions written separately from the main program to perform a function that occurs

repeatedly in the main program. · It is called in the main program by using CALL addr16 instruction. The addr16 is the starting address of

subroutine.

· It should be terminated by RET instruction.

· Modular programming: The various tasks in a program can be developed as separate modules and called in the

main program.

Page 42: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

· Reduction in the amount of work and program development time. · Reduces memory requirement for program storage.

DELAY ROUTINE: It is a subroutine used for maintaining the timings of various operations in microprocessor.

List: List is a linked data structure used in programming techniques. The linked data structure will have a number of components

linked in a particular fashion. Each component will consists of a string data and a pointer to next component. Types of list are, · Linear linked lists · Linked list with multiple pointers

· Circular inked list & Tress

Array: it is a series of data of the same type stored in successive memory locations. EACH value in the array is referred to as an element of the array.

Flow chart: It is a graphical representation of the operation flow of the program. It is a graphical form of algorithm.

Symbol Operation

Race track shape box

To indicate the start or end of the program

Parallelogram To represent input or output operation

Rectangular box

To represent simple operations other than I/O

operations

Rectangular box with

double lines on vertical

sides

To represent a subroutine or procedure

Diamond shaped box

To represent the decision point

Small circle It is used as a connector to show the

connections between various part of flowchart

within a page. Identical numbers are entered

inside the boxes that represent the same

connecting point.

Five sided box It is used as a off-page connector to show the

connections between various sections of

flowchart in a different page. Identical

numbers are entered inside the boxes that

represent the same connecting point.

The lines are drawn between boxes and

Line

diamonds to indicate the program flow and

Arrow the arrow is placed on the lines to indicate the

direction of flow.

TIMING DIAGRAM OF 8085 INSTRUCTIONS:

· The 8085 instructions consist of one to five machine cycles. · Actually the execution of an instruction is the execution of the machine cycles of that instruction in the predefined order.

Therefore, from the knowledge of the timing diagrams of each machine cycle of an instruction, the timing diagram of

that instruction can be obtained. · The timing diagram of an instruction ate obtained by drawing the timing diagrams of the machine cycles of that instruction, one by

one in the order of execution.

Page 43: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

MICROPROCESSOR APPLICATIONS:

1.TEMPERATURE CONTROL SYSTEM: The microprocessor based temperature control system can be used for automatic control of the temperature of a body. A

simplified block diagram of 8085 microprocessor based temperature control system is, 8085 Microprocessor based Temperature Control System

· The system consist of 8085 microprocessor as CPU,

EPROM & RAM memory for program & data storage,

INTEL 8279 for keyboard and display interface, ADC,

DAC, INTEL 8255 for I/O ports, Amplifiers, Signal conditioning circuit, Temperature sensor and Supply

control circuit. · The EPROM memory is provided for storing system

program and RAM memory for temporary data storage & stack operation.

· Using INTEL 8279, a keyboard and six numbers of 7-

segment LEDs are interfaced to the system. The system has been designed to accept the desired temperature and

various control commands through keyboard.

· The 7-segment display has been provided to display the

temperature of the body at any time instant.

· The temperature of the body is measured using a

temperature sensor. The different types of temperature

sensors that can be used for temperature measurement are

Thermo-couples, Thermistors, PN-junctions, IC sensors like AD590, etc.

Page 44: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

· The sensors will convert the input temperature to proportional analog voltage or current. The output signal of

the sensor will be a weak signal and so it has to be amplified using high input impedance op-amp.

Page 45: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

· The error is used to compute a digital control signal, which is converted to analog control signal by DAC. The DAC is interfaced to the system through port-B of 8255.

· The analog control signal produced by DAC is used to control the power supply of the heating element of the body. · The digital control signal can be computed by the 8085 processor using different digital control algorithms (P/PL’

PID/FUZZY logic control algorithms).s · The control circuit for power supply can be either thyristor - based circuit or relay. In case of thyristor control circuits the

firing angle can be varied by the control signal to control the power input to the heater. · In case of relay the control signal can switch ON/OFF the re to control the power input to the heater.

2.TRAFFIC LIGHT CONTROL SYSTEM:

The traffic lights placed at the road crossings can be automatically switched ON/OFF in the desired sequence using the

microprocessor system. The system can also have a manual control option, so that during heavy traffic (or during traffic jam) the

duration of ON/OFF time can be varied by the operator.

A typical traffic light control system (demonstration type) is, 8085 Microprocessor based Traffic Light Control demonstration System

· The system has been developed

using 8085 as CPU. The system has

EPROM memory for system program storage and RAM memory

for stack operation. For manual

control a keyboard have been

provided. It will be helpful for the

operator if the direction of traffic

flow is displayed during manual control. Hence 7 segment LEDs are

interfaced to display the direction of

traffic flow both during manual and

automatic mode. · The primary function of the microprocessor in the system

is to switch ON/OFF the Red/Yellow/Green lights in the

specified sequence. In the demonstration system of fig

shown, Red/Yellow/Green LEDs are provided instead of

lights (lamps). The LEDs are interfaced to the system

through buffer (74LS245) and ports of 8255.

Ø In the practical implementation scheme the

lights can be turned ON/ OFF using driver

transistors and relays.

Page 46: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Ø In practical implementation the output of buffer (74LS245) can be connected to the driver transistor. Ø A relay placed at the collector of the transistor can be used to switch ON/ OFF the light as shown in fig. Ø A reverse biased diode is connected across relay coil to prevent relay chattering (for free-wheeling action).

The microprocessor sends HIGH through a port line to switch ON the light and LOW to switch OFF the light. A switching schedule (or sequence) can be developed as shown in table. In this switching sequence it is assumed that the traffic is allowed only in

one direction at a time.

Ø The processor can output the codes for switching the lights for schedule-I and then waits. After a specified time

delay the processor output the codes for schedule-I and so on. Ø For each schedule the processor can wait for a specified time. After schedule-XH, the processor can again

return to schedule-I. On observing the schedules we can conclude that three different delay routines are

sufficient for implementing the twelve switching schedules.

3.STEPPER MOTOR CONTROL SYSTEM:

Ø The stepper motors are popularly used in computer

peripherals, plotters, robots and machine tools for precise incremental rotation.

Ø In stepper motor, the stator windings are excited by electrical pulses and for each

pulse the motor

shaft advances by one angular step. (Since digital pulses can drive the stepper

motor, it is also

called digital motor).

Ø The step size in the motor is determined by the number of

poles in the rotor and the number of pairs of stator windings (one pair of stator

winding is called one phase). The stator windings are also called control windings.

Ø The motor is controlled by switching ON/OFF the control winding. The popular stepper motor used for demonstration in laboratories has a

step size of 1.8° (i.e, 200 steps per revolution).

Ø The basic step size of the motor is called full-step. By altering the switching

sequence, the motor can be made to run with incremental motion of half the full-

step value. Ø A two phase or four winding stepper motor control system is

shown in above figure. The system consists of 8085

microprocessor as CPU, EPROM and RAM memory for

program & data storage and for stack. Ø Using INTEL 8279, a keyboard and six number of 7-segment

LED display have been interfaced in the system. Through the keyboard the operator can issue commands to

control the system. The LED displays have been provided to display messages to the operator.

Ø The windings of stepper motor are connected to the collector of Darlington pair transistors. The transistors are switched ON/OFF by the microprocessor through the ports of 8255 and buffer (74LS245).

Ø A freewheeling diode is connected across each winding for fast switching. The flowchart for the operational

flow of the stepper motor control system is shown. Ø The processor has to output a switching sequence and wait for 1 to 5 msec before sending next switching sequence.

Page 47: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

UNIT – IV PROGRAMMEBLE LOGIC CONTROLLERS

4.1 INTRODUCTION A PLC or a programmable logic controller, is a solid state digital industrial computer, in which control devices

such as limit switches, push buttons, proximity or photoelectric sensors, float switches or pressure switches, etc., provide incoming control signal into the unit.

This incoming control signal is called an input.

A formal definition is given by National Electrical Manufactures Association (NEMA):

A PLC is a digitally operated electronic system designed for use in an industrial environment which uses a

programmable memory for the internal storage of user oriented instructions for implementing specific functions such as

logic, sequencing, timing, counting and arithmetic to control, through digital and analog inputs and outputs, various types

of machines or processes. This was designed in the early 1970s to replace electromechanical relays, mechanical timers, counters and

sequencers. It is small, requires less power, has fast switching capability, and a reliable control device. Just like the other controller chips explained in the previous chapter PLC follows the instructions stored in PLC’

s memory.

The processor or CPU reads the input signals, initiates the processes by prompting the PLC. PLC in turn carries out the operations on the inputs and converts them into the proper control operations or switching operations on the system.

Advantages

This is a hardened industrial computer designed to withstand the harsh factory environment.

The troubleshooting is easy so also the installation.

They are compact and are reusable.

4.2 BASIC STRUCTURE The block diagram of a PLC is given in Fig.4. I. The six major sections of a PLC are

Sensing inputs or controlling hardware.

Input section.

CPU

Handheld programming device or personal computer.

Output section.

1. Sensing section: These are usually made up of sensors and switches which transmit the signals from the input devices.

2. Input section: This contains two major areas — the physical terminals where the input signals from the input devices are attached to the PLC and the internal conversion electronics. This internal conversion electronics converts and isolates the high voltage inpul level from field devices, into +5 V dc which is necessary for th microprocessor and the other solid state circuitry.

3. Controller: This is the processor which processes the signals from input section and generates controlling signals for the system.

4. Programmer: This is usually a PC which is used to enter the program to the PLC. 5. Output section: This receives the signals from the PLC which are used to control the system to which the PLC is connected. 6. Field hardware devices: This is the system which is controlled by the PLC. As mentioned before, it may be a motor which controls the movement of a conveyor or a lift, it may be metal cutting machine whose outputs are to be precision made, etc.

4.3 PLC HARDWARE These are two different types of physical configurations in PLC.

1. Fixed Input / Output 2. Modular Input / Output 1. Fixed I/O PLCs: This contains a fixed or a built-in I/O section. The section is built inside the PLC and cannot be changed. 2. Modular I/O PLCs: This contains I/O ports as in a microprocessor to which removable I/O units or modules can be connected as desired. Here the user can select separate modules for I/O or mix them according to use. Typical modules will contain 4, 8, 12, 16 or 32 1/0 points. The printed circuit board which acts as I/O port is built into the chassis and is called backplane. Some PLCs have a simple rail called DIN rail to which the modules simply clip together. The advantage of this type is that it permits the easy addition and removal of modules.

Page 48: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Modular PLC installation on a DIN rail is explained below.

The power supply which is connected to the line voltage is installed either on the right side, or left side or in any position in the modular rack or chassis.

Some PLCs allow the power supply to be installed as either in the chassis or as a standalone device outside the chassis.

CPU takes up the next position to the power supply. The remaining slots are taken up by the I/O modules.

4.4 I/O SIGNALS A standard input modules has 16 input points.

So a 16 bit input is given as signal. To indicate the 16 inputs 16 LEDs serve as indicators.

Eight point input modules are also available.

In these, only the lower 8 bits are used. Fig,4.5 shows the correlation of input signals into control signals in 8, 1 6 bit I/O modules.

A 24 bit I/O module is represented with 2

words of 16 bit. The first word gets all the 16 bit signals while the second word gets only the lower 8 Bits and higher order 8 bits

are ignored. For a 32 bit I/O module, all the 16 bits of both words are used. In a modular PLC, let us assume 4 I/O modules are fixed. So there will

be 4 input words corresponding to them.

These input words at different instants are grouped together to form the data file stored in the memory as shown in Table 4.1.

Page 49: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Here the word 0 indicates the input status of input module 0, word I corresponds to input module 1 and so on. This data file representing a data word for each input module in the system is called the input status file.

This data is processed by the CPU when the program is executed. This is also called I/O mapping.

Similar to this there is an output status file which stores the ON or OFF status of each output module.

This output then is used to control the load connected to the output module. This is shown in Fig.

The main advantage of modular PLC is that after connecting the power supply and CPU in the first two slots we are free to fix up any module whether input or output in any of the slots as shown in Fig.

1. Power supply 2. Processor and memory 3. 1/0 interfaces (modules)

4.8 POWER SUPPLIES v Typically a bridge rectifier with a filter and a regulator constitute a PLC power supply. v In addition a battery back up system is also provided.

v The battery back up switch is provided for emergencies where the power supply fails. If the line input to the power supply ceases the switch switches the output from power supply to battery back up

power quickly and automatically so that the power input to the PLC is not affected. v 4.9 INPUT I OUTPUT PROCESSING PLC is capable of handling discrete as well as analog I/O sigrals.

Discrete input module is the most common input interface used with programmable controllers.

Discrete input signals from field devices can be either AC or DC.

The most common module types are listed below.

Page 50: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

AC input modules The block diagram of a typical AC input circuit is shown below.

o A 120 V AC’ input module will accept signals between 80 and 135 V AC. o This module is considered the load for the field input device. o The module’ s job is to convert the 1 20 V AC high voltage signal to the 5 V dc level, with which the PL(. can

work. It verifies the input as a valid signal, isolate the high voltage field device signal from the lower voltage CPU signal and send the appropriate ON or OFF signal to the CPU for placement in the input status file.

o As shown in Fig.4.l0 the module consists of three parts.

Power file conversion,

Isolation and

Logic.

Rectifier and filter constitutes the power conversion section. v The DC output thus got is passed on to a threshold detector. This detects if the incoming signal has reached or exceeded a predetermined value for a predetermined time and whether it

should be classified as a valid ON OFF signal. A typical valid OFF signal is between 0 and 20 or 30 V AC and ON signal is between 80 and 132 V AC depending on the

manufacturer.

The optical isolation circuit is usually made up of an opto coupler which is a combination of a photoemissive device (LED) and a photodetective device (photodiode).

The input signal energises the LED which transmits a signal of light energy to the receiver i.e., photodiode.

There is no actual electrical or physical coupling between LED and photodiode. So this provides the necessary isolation between power conversion circuitry and the logic circuitry.

This is necessary because the input is 120 V AC but CPU runs from 5 to 18 V DC and any electrical short between these two

will prove fatal for the system. There are two types of input devices commonly interfaced to an input module. One type includes the mechanical limit switch,

toggle switch, selector switch, push button and contacts from an electromechanical relay. All these mechanical contacts which require no electrical power. Circuit continuity is made or broken by physically opening

a set of contacts.

The second type is a solid state proximity device which requires electrical power to operate.

A small amount of current called “leakage current” must continuously flow through the device, even in the OFF state to keep the internal electronics working so that the switch will be able to sense the presence of an object.

DC input modules: Low voltage, 24 V DC inputs are commonly used for start / stop control circuitry and sensor interface to the PLC.

DC sensors can drive electromechanical relays, counters and solenoids and other solid state devices.

A DC sensor with a proper DC input module does not need any interfacing device. The sensors, are commonly solid state sensors like inductive proximity sensors, capacitive proximity sensors or photoelectric sensors. Typical sensors use IOV —3OVDC.

Page 51: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

The sensor’ s switch which controls the input into the module is made of either NPN or PNP transistor. The input device with NPN transistors are called sinking input devices and those with PNP transistors are called sourcing input

devices.

Sourcing and Sinking: Conventional flow of current is defined from positive to negative of the battery. So if a switch is connected to the

positive of the battery it is said to be sourcing the current and if it is connected to the negative of the battery it is said to be sinking the current. Similarly a load may also be sinking or sourcing the current in the same way.

Fig.4.11 shows the different combinations.

The block diagram of a typical DC input module is shown below.

Typical PLC input and output devices with indications to show how they are

indicated in the circuit diagrams in the following topics.

4.10. PROGRAMMING EQUIPMENT AND OPERATIONS PROCEDURE To design any PLC based system, just like any other system, block diagrams

are to be drawn.

In addition, one more diagram indicating the flow of control over the different subsystems, the conditions to be satisfied, also has to be drawn. It is the ladder logic diagram.

A ladder logic diagram is one where all the different inputs and outputs are shown in their order in different branches called rungs of ladder.

The first rung contains the first input and output and the second one the

second pair and so on. Example 4.1 I Let us take an example system to explain the actual operation

/ process of I/O with PLC : A relay coil is to be activated when two toggle switches and one limit switch are operated.

The first step is to assign individual PLC identification numbers to the inputs and outputs.

Inputs are indicated by 1 N and outputs by CR (Control Relay). Therefi)re,

the following members can be assigned.

Switch I for relay IN

00

1

Switch 2 for relay IN

00

2

Limit switch for relay IN

00

3

Relay output CR 001

Page 52: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Next, sketch a ladder logic diagram to represent the operational circuit as shown in Fig.4.15.

The next step is the actual hardware connection of input and output modules. Assuming an eight terminal input and output, the connections are shown in Fig.4. 16.

Finally the ladder program must be entered into the CPU by means of a keyboard. For this any one of the programming

equipments may he used. The general procedure to enter the program in ladder format is 1. Clear the PLC program memory with the CPU on stop.

2. Go into the EDIT mode and start entering the relay control line as follows.

Select the input function and enter the number 001. The contact should appear on the monitor.

Moving the cursor one space to right repeat the same procedure for the 002 input and 003 input.

Select the coil / output key and enter 001.

If the arrangement looks correct, select the “ladder” key and enter. The ladder diagram for this arrangement will appear on the monitor as below.

Though the procedure explained above is a general procedure, most of the programming equipments are the same to operate. Three types of programming monitors or PMs are in use.

Hand held, palm size units with dual function keypads and a Liquid Crystal Display (LCD) or Light Emitting Diode (LED) window.

Full size keyboards accompanied by a large LCD display or Cathode Ray Tube (CRT) screen.

PCs with software for developing the PLC program. Advantages of using handheld programming terminal

Easy editing and debugging.

Compact in size, low cost and easy to use.

Easy transport to the field. Disadvantages

Not compatible with all PLC CPUs.

Limited memory and so limited number of programs.

Small screen size and so limited capability to display ladder rungs.

Documentation not displayed.

Volatile memory, so battery back up is required.

Advantages of Software Programming Using PC

Larger screen so possible to display multiple rungs of logic, easy to troubleshoot.

More non-volatile memory, so storage possible.

Easy to transport the program through a floppy or CD, also useful for back up.

Rung comments, instruction comments, symbols, etc., are easy to be displayed or added for editing.

Data tables can be easily monitored.

Page 53: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

The different products follow different formats for programming the PLC. But a general procedure for this as explained in Example 4.1 can be devised along with its ladder diagram for any system. Limitations: There are some limitations to be observed when programming a PLC ladder diagram. When incorrectly formatted ladder diagrams are given, they will not be received by the PLC CPU. Such limitations are to be followed when drawing a ladder diagram.

A contact must always be inserted in slot I in upper left.

A coil must be inserted at the end of a rung.

All contacts must run horizontally. No vertically oriented contacts are allowed. The number of contacts matrix is limited.

Only one output may be connected to a group of contacts.

Contacts must be nested properly or in some PLCs not at all.

Flow must be from left to right.

Contact progress should be right across.

4.11 PLC LOGIC The devices in an electrical schematic diagram are described as being open or closed. Each of the PLC ladder rungs

indicate a program statement.

A program statement consists of a condition or conditions, along with some type of action.

Inputs are the conditions and the action or output is the result of the conditions.

The PLC combines the ladder program instructions, similar to the physical wiring hardware devices, in series or parallel.

For this, it uses logical operators - AND, OR and NOT. They are combined for the instructions on a PLC rung so as to

make the outcome of each rung either true or false, which is the result. AND Logic: This represents a series circuit. For

example, switch I AND switch 2 must be closed in Fig.4. 18 to energise the light.

Combinational Logic: Most of the PLC ladder rungs will include some combination of AND, OR and NOT logic. For each of the rung, there must at least be one logic combination which gives an output of 1.

Priority of Logic:

This is very important in a program. Priority is the method of fixing sequence of the portion of the problem to be solved first and then rest in subsequent steps.

If this sequence is not precisely followed then there is every possibility of an error occurring.

Some of the handheld programmers allow us to enter rungs of logic rather than a list of instructions.

So by entering the rungs of logic, we can see that they are placed in the proper position and so the priority of logic

problem does not arise.

Similarly when PC is used for programming, the same procedure is carried out.

The programmer physically places the instruction on the rung and in the correct position in relation to surrounding instructions, so concerns about logic element priority are eliminated.

For example, the evaluation of following program shows how the PLC rungs are built.

Program: LOAD 11

AN

D

1

2

OR

1

3

AN

D

1

4

OU

T

0

5

Page 54: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Both (a) and (b) seem to be correct for the given set of instructions, though they are not

equivalent. This is where logic priority becomes important. So to solve this problem, while

programming, the following rules are to be adopted. 1. Each rung begins at the left power rail. 2. Start each rung with the appropriate beginning instruction — either “Store” or “Load” instruction. 3. Program the next logic element closest to the one already programmed. In case a series and a parallel logic element are equidistant, always program the parallel logic function first.

4. For connecting two or more instructions in a parallel branch, special instructions are used to connect or group, parallel instructions on that branch.

5. If no grouping instructions are included in the program, they will be programmed as one instruction per parallel branch.

4.12 LADDER DIAGRAMS Ladder diagrams are the elementary or line diagrams used for non-electronic

control circuits.

There are two types of ladder diagrams used in control systems, the control ladder diagram and the power ladder diagrams.

Fig.4.23 shows two basic control ladder diagrams. The first one A is for a single switch that turns a relay output CR on and off.

The second, B is a single function diagram with parallel lines for control and parallel lines for output.

The two outputs can be turned on using any one or both of the two switches.

The general rules to be followed while drawing the basic control ladder diagrams are

1. ll coils, pilot lights and outputs are on the right. 2. An input line can feed more than one output, which are connected in parallel. 3. Switches, contacts and so on may be connected in multiple contacts of series, parallel or series parallel starting from left to right. 4. Every connection node should be given a unique identification number, along with the relays, switches, lights, etc.

Let us draw a t function control diagram as below.

Explaining this diagram, we can see that the sequence of instructions should be as follows.

All switches are open to start; both coils are off.

Closing SWI or SW2 or both energises both R and L

Closing the contact C enables line 3 but does not energise R

Closing C and SW3 energises R Power Ladder Diagrams

For applications like motor control, power ladder diagrams are drawn.

The operation of these power ladder diagrams is straight forward.

In Fig.4.25, when the power contactor coil is energised, the power contacts close and power is applied to the motor or the load device.

The main difference between the power ladder diagram and ordinary ladder diagrams is that the connecting lines are thick.

For a large process, creating a ladder diagram is a little complicated. Hence the following steps

are used for planning a program for a large process.

1. Define the process to be controlled. 2. If possible, do a pictorial explanation of the process, either using a block diagram or detailed diagram. 3. Create an algorithm with all the steps of process in sequence. 4. Add the necessary control relays, inputs and outputs, sensors according to the process sequence, in the above diagram. 5. Add manual controls as required for the process or testing. 6. Add or adjust controls keeping the safety of the operating personnel in mind. 7. Add master stop switches, as required, for safe shutdown. 8. Create the ladder logic.

Page 55: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

4.13 PLC PROCESSOR This is a microprocessor with memory and circuits to store and retrieve information from and also communication circuits.

Just like a microprocessor based control system, the operations are carried out as per the instructions given.

So the explanations are the same as in the systems explained in the previous chapter. The process of reading inputs, solving logic and updating outputs is called the processor scan or processor sweep or operating cycle.

As in any other program, PLC program also will be executed from the top.

So the first rung of the ladder will be executed and subsequent rungs will follow, unless altered by an instruction specifically designed to alter the flow of the program. Program flow instructions direct this flow of instructions and their execution within a ladder. As in microprocessor, jump and branch alter the course of program.

Steps 1. The inputs are read and stored in the input status file. 2. The ladder program is solved starting from rung zero and it goes on to the subsequent instructions. 3. While evaluating the rung, the PLC proceeds from instruction to instruction till output instruction is reached. 4. Executing the output instruction, the logical one or zero output status is placed in the output status file. The output status

is the logical resultant of the solved input logic for that rung. 5. After the last rung is executed, there is one additional rung which is automatically inserted by the software and is called

“end rung” This rung alerts the CPU that it has reached the end of the ladder program. 6. After this the CPU services communications which is really the updating of handheld or personal computers monitor

screen or sending this through to other PLCs in the network etc. 7. Housekeeping and Overhead: These are part of the scan cycle in which the CPU takes care of memory management, updating timers and counters, internal time base, the processor status file and other internal registers.

4.14 PLC INSTRUCTIONS There are many different PLCs in the market, and though they all operate in basically the same way, there are many

differences in features and instruction sets. Basic instructions are the same but they may be programmed differently.

Before going into the actual instructions, it will be better if the registers in the PLC are explained along with how the data and program files are built in a PLC.

There are 10 types of data files which are created automatically by the processor and are assigned a file number and alphabetical file identifier

1. Output status file:

This is, by default, file 0. This is made up of single bits grouped into 16 bit words.

Each bit refers to the ON or OFF state of one output point.

Status file is created only if the processor finds an output module in that particular slot. 2. Input status file:

File I is the input status file.

Similar to the output status file, this is also made up of 16 bit words each bit for one input point. 3.Processor status file:

This is file 2. Information in this file includes that on PLC’ s operating system. The information falls into 3 classifications.

First, status information that cannot be modified or monitored.

Second, dynamic configuration status words, bytes or bits used to select processor options while in run mode.

Third, static configuration status words which select processor options before entering run mode.

4.The bit file :

The bit file is file 3.

A bit file is used to store single bits in a 16 bit word format.

There can be many bit files for a single processor file. Any data file greater than file 10 can be assigned as an additional bit file.

Each file will have 255 sixteen bit words. 5.The Timer file :

This file, file 4 is used to store timer data.

Each timer has three 16 bit words called a “Timer element”.

As in a bit file, this has 256 timer elements and additional files may be created.

The timer element with three 16 bit words consists of three parts.

Word zero is for status bits.

Word one is for preset value.

6.Counter file:

This is file 5 and is used to store counter data.

Here also as in timer file, there are three 16 bit words, called “counter elements”.

Page 56: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

The details of the three words are as in timer file. The counter element format is shown below.

7.Control file:

This is file 6 and is used to store status information for bit shift, first in and first out stacks (FIFO), last in and first out stacks (LIFO), sequencer instructions and certain ASCII instructions.

This is similar to counter and bit files in that this also has three word element with three 16 bit words.

Word zero —Status word

Word one —Length of the bit array or file. Word two —Current position in the bit array

8.Integer file: This is file 7.

The integer file element a 16 bit word representing one whole number, i.e., it stores the binary equivalent of one whole number.

9.Floating point file:

This is file 8.

This stores the floating point data in two word elements.

One word to store the integer and the second word is to store the exponent. 10.Common interface file:

This is file 9.

This is used as the target file in a PLC when the data is transferred from one system to another when connected in a network.

Each system will have a unique identifier called a node address.

Apart from these default files, the programmer can create an ASCII file in any unused data file numbered from 10 to 255.

ASCII data file information is comprised of one word elements.

Two hex characters are typically used to represent an ASCII character.

String data is another type of data used in PLC. The difference between an ASCII file and a string file is that the string file strings together a number of ASCII characters rather than treat them separately.

This can contain upto 255 elements, with each element made up of 42 words. Any unused data file or files other

than the default data files can be designated as a string file. There are a total of 256 files available in a PLC.

Files beyond the automatically created data files (default files) are available as ‘user defined files

The user can define these files for any specific application. No two files will share the same number. 4.15. PLC REGISTERS

In PLC, the registers are found in two locations.

The microprocessor has internal registers, most of which are not directly accessible by the user.

These are used by the microprocessor for the different arithmetic and logic operations. These include accumulators, data registers, index registers, condition code registers, scratch pad registers and instruction registers.

In addition to these internal registers, the CPU’ s RAM also contains slots that are the external registers.

These are 16 bits wide.

Usually these registers are designated using prefixes followed by numbers like OG1 (output group register 1) or HR 55 (Holding register 55), etc.

It can be seen that a certain numerical series of addresses may be assigned to a specific task or a function.

There are 5 key registers in a PLC. Holding registers. Single input registers Group input registers Single output registers Group output registers

Holding register:

This holds the contents of a calculation, arithmetic or logic. In many PLCs, this register is not directly accessible to inputs or outputs. Separate input and output register will be used

for the purpose. The use of this holding register is shown in the Fig.4.27. Processor manipulates the data in the holding register which has been transferred from input registers. This data will be

moved to the output register next. The number of holding registers will depend on the length of the data and the operation. It varies from 16 for small PLCs

to hundreds in large machines.

Page 57: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

For a timer function, the holding register is the register in which the count takes place. Similarly for the counter function, the preset count value is placed in a constant or designated register and the count takes

place in the holding register. Input Registers: This has the same characteristics as a holding register but it is the intermediate register between an input device and a

holding register. The number of input registers in a PLC is normally one tenth of holding registers. These may also be grouped together so that the data may be received from consecutive input ports. If we have 16 input

ports, with 8 bits each, the first bit of each of the 16 ports is connected to one register, the second bit of each port is connected to the second register and so on.

So at least one input point of one port will be connected to a register. This is illustrated in Fig.4.28. The advantage of this group register system is that only one register is required to service 16 inputs. Without this, 16 input registers are required. Output registers: These are similar to input registers except that the data flow is from the holding registers. This also has the same classification of single and group registers.

o PLC INSTRUCTION SET As in the case of microprocessors, each manufacturer’ s PLC processors have their own vocabulary of instructions. But the basic instructions called the relay instructions are shared by all PLCs. The relay instructions and their illustrations with rungs of ladder are given below.

Page 58: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

UNIT – V

5.1 STAGES IN DESIGNING MECHATRONICS SYSTEMS

The design process consists of the following stages.

Satgel: Need for design

The design process begins with a need. Needs usually arise from dissatisfaction with existing situation.

Needs may come from inputs of operating or service personal or from customer through sales or marketing representatives.

They may be to reduce cost, increase reliability or performance or just change because of public has become bored with the product.

Stage2: Analysis of problem

Probably the most critical step in design process is the analysis of the problem i.e., to find out the true nature of the problem.

The true problem is riot always what it seems to be at the first glance. Its importance is often overlooked because this stage requires such small part of the

total time to relate the final design.

It is advantageous to define the problem as broadly s possible. If the problem is not accurately defined, it will lead to waste of time on designs and

will not fulfill the need.

Stage3: Preparation of specification The design must meet the required performance specifications. Therefore, specification of the requirements can be prepared. This will state the problem definition of special technical terms, any constraints placed

on the solution, and the criteria that will be used to evaluate the design. Problem

statement includes all the functions required of the design, together with any desirable features.

The followings are the some of the statements about the problem:

Mass and dimensions of design.

Type and range of motion required. Accuracy of the element.

Input and output requirements of elements. Interfaces.

Power requirements. Operating environment.

Relevant standards and code of practice, etc.

Stage4: Generation of possible solution This stage is often called as conceptualisation stage. The conceptulisation step is to detennine the elements. mechanisms, materials,

process of configuration that in some combination or other result in a design that satisfies the need.

This is the key step for employing inventiveness and creativity. A vital aspect of this step is synthesis.

Page 59: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Synthesis is the process of taking elements of the concept and arranging them in the

proper order, sized and dimensioned in the proper way.

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

This stage involves a thorough analysis of the design. The evaluation stage involves detailed calculation, often computer calculation of the

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

selected.

Stage6: Production of detailed design The detail of selected design has to be worked out. It might have required the extensive simulated service testing of an experimental

model or a full size prototype in order to determine the optimum details of design.

Stage7: Production of working drawing The finalised drawing must be properly communicated to the person who is going to

manufacture.

The communication may be oral presentation or a design report. Detailed engineering drawings of each components and the assembly of the machine

with complete specification for the manufacturing process are written in the design

report. The components as per the drawings are manufactured.

5.2. TRADITIONAL AND MECHATRONICS DESIGNS

Engineering design is a complex process which involves interaction between many

skills and discipline.

In traditional design, the components are designed through mechanical, hydraulic or pneumatic components and principles.

But in mechatronics approach, mechanical, electronics, computer technology and control engineering principles are included to design a system.

For example design of weighing scale might be considered only in terms of the compression of springs and a mechanism used to convert the motion of spring into rotation of shaft and hence movements of a pointer across a scale.

In this design measurement of weight is depended on the position of weight on the scale.

If we want to overcome foresaid problem, other possibilities can be considered. In mechatronics design, the spring might be replaced by load cells with strain gauges

and output from them used with a microprocessor to provide a digital readout of the weight on an LED display.

This scale might be mechanically simpler, involving fewer components and moving parts. But the software is somewhat complex.

Similarly the traditional design of the temperature control for a central AC system involves a bimetallic thermostat in a closed loop control system.

The basic principle behind this system is that the bending of the bimetallic strip changes as the temperature change and is used to operate an ON/OFF switch for the temperature control of the AC system.

The same system can be modified by mechatronics approach.

This system uses a microprocessor controlled thermo couple as the sensor. Such a system has may advantages over traditional system.

The bimetallic thermostat is less sensitive compared to the thermodiode. Therefore the temperature is not accurately controlled. Also it is not suitable for having different temperature at different time of the day

because it is very difficult to achieve.

Page 60: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

But the microprocessor controlled thermodiode system can overcome foresaid difficulties and is giving precision and programmed control.

This system is much more flexible. This improvement in flexibility is a common characteristics of the mechatronics

system when compared with traditional system.

5.3. POSSIBLE DESIGN SOLUTIONS

Every mechanical design can be considered

as a microprocessor subsystem as a solution.

Some of the possible microprocessor based solutions for traditional systems are given in

the following article. 5.3.1. Timed switch: Consider a requirement for a device which is

used to switch on a motor for some prescribed time.

For this problem, a traditional mechanical system consists of rotating cam and

pivoted flexible arm as shown in fig 5.1.

The cam is rotated at constant rate and the pivoted flexible arm which acts as cam

follower used to actuate a switch.

The amount of time for which the switch is closed depending on the shape of the cam and speed of the revolution of cam.

Some of the possible solution for this problem using mechatronics approach is explained below.

Possible solution: The above problem can be solved by PLC arrangement as shown fig 5.2. The ladder program is also shown in this fig. To start the timer the following

requirements should be satisfied.

Start the pulse applied. Check the timer whether it is ON or OFF condition. The timer should be in OFF condition before triggering. The above 3 steps have been carried out in ladder program.

Page 61: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Apply the start pulse which energies the IR Switch on timer A by IR. Set the timer for which the timer is in ON Get the output from timer A Timer B started when timer A switched ON and determines the time at which output switched OFF. Duration of the timer A and timer B can be varied by using a microprocessor with a memory chip and inputloutput interfaces. The memory chip can be activated by a assembly language program. The program is written in such a manner that the timer is turned ON by a start pulse, after a particular duration (i.e., delay time) the timer is turned OFF.

The delay can be varied using a simple program given below:

BNE LOOP RT S DELAY LOOP LDX DATA DEX In this program LDX represents loading a particular “DATA”. This DATA represents the number of loops DEX-decrements the index register. BNE-branch to loop if not equal to zero. RTS - return to main program.

Advantages of PLC system over traditional mechanical system:

In PLC system, the time duration can be easily adjusted by changing the timer preset

values (i.e., DATA) in the program whereas the traditional system requires various

sizes of the cams.

Possible soltuion2: The alternative for this problem is to use timer IC.

The well- known IC for this purpose is 555. The external resister and capacitor are used to set the

timing intervals in 555 timer. Fig 5.3 shows a internal circuit diagram of 555 timer with external circuits.

When applying the trigger, the output is turned ON and the time duration of ON output being 1.1 R. C. where R = resistance in ohms and C = capacitors in farads. Large

times need larger value of R and C. R value varies from 1 kO to I MO. The C value ranges from 0.1 to l0

The accuracy of 555 timer is the best within the foresaid values of R and C otherwise leakage capacitance becomes a problem.

If more time duration is required, 555 timer can be replaced with ZN! 034E timer. The circuit shown in fig 5.3 is limited to times less than about 11 seconds.

Page 62: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Possible solution 3: Another alternative for this problem is to use the micro

controller timer such as 8051, 8096 and MC68HCI 1. Here we are using MC68HCI 1 micro controller. Fig 5.4

shows clock diagram of MC68HC1I micro controller timer.

This circuit consists of a 8MHz crystal, two 22PF capacitor, a 1 OOMQ resister, and 2MHz E-clock.

The timer is controlled by 16-bit count register (TCNT).

When a system is reset, TCNT is set to $0000. It counts continuously up to $FFFF.

On the application of next pulse it overflows and reset to $0000.

When it overflows, it will set timer flag TOF. Seventh bit of timer interrupt flag register 2 (TFLG 2) is TOF.

The system E-clock can be prescaled by setting bits in the timer interrupt mask register2 (TMSK2).

The prescaling factor is given in fig 5.5.

Fig 5.4. E-clock generation While using this timer, the TOF status is watched by polling. When the flag is set, the program resets the flag in the TFLG2. This timing operation consists of program duration of the timer number of overflow flag

settings.

Port A of the micro controller can be used for general-purpose

input output functions for timing.

The timer port consists of output pins OC 1, 0C2, 0C3, OC4 and 0C5 with their corresponding internal registers TOC1. TOC2, TOC3, TOC4 and TOC5. Fig 5.6 shows the output comparator.

This comparator compares the value in the free timing counter (TCNT) with the preset value in TOC and sets OC according to the preset condition.

The output-compare function can generate timing delays with much higher accuracy than the timer overflow flag.

For example, with a prescale factor of 4 and E-code of 2MHz can generate time delay up to 13 1.072 milliseconds (ms).

The longest delay of 32.768ms with the prescale factor of I. In order to generate longer time delays, multiple output compare functions are

required. To get the total time delay of O.5s, we may use output compare operation producing

a delay of 25ms and repeating for 20 times.

The following program is used to control the micro controller to get the delay of

0.55.REGBAS EQU $1000 TFLG1 EQU $23

TCNT EQU $OE

TDC2 EQU $18

OC1 EQtJ $40

CLEAR EQU $40

D25MS E 50000

NTIMES EQU 20

ORG $1000

COUNT RMB 1

LDX #REGBAS

LDAP #NTIMES

Page 63: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

STAA COUNT

LDAA #OC1

STAA TFLG1, X

LDD TCNT, X

AIT: ADDD #D25MS

STD TOC2, X

BRCLR TFLG1, X,OC1

LDAA #OC1 STAA TFLG1, X

DEC COUNT BEQ OTHER LDD TOC2, X BRPi WAIT

5.3.2. Windscreen wiper motion: Windscreen wiper is a device which is used to clear the front glass of the cars, buses, train

etc., during raining days. It will oscillate an arm back and forth in an arc like a windscreen wiper. A traditional

mechanical solution for this problem is shown in fig 5.7. It uses a principle of four-bar mechanisms. It consists of a crank which rotates about its

center and a connecting rod. An end of a connecting rod is connected to the crank and other with wiper arm. Rotation of

crank causes connecting rod to impart an oscillatory motion to wiper arm.

An alternative mechatronics approach for this problem is to

use a stepper motor. For operating a stepper motor a

microprocessor with a PIA, or a micro controller can be used.

Fig 5.8 shows a circuit for interfacing stepper motor with micro controller or PIA.

The input to the stepper motor is required to cause it to rotate a number of steps in one direction and reversing the same number of steps in other direction while the data is reversed.

In the fig 5.8 isolating diodes are used to prevent the current flow into the micro controller from interfacing circuits.

Transistors are used as a switch to control stepper motor. Data in the data bus causes the transistors to turn ON/OFF according to the data conditions 1 or 0 respectively.

Stepper motor can be operated in two configurations 1. Full-step configuration.

2. Half-step configuration. 1. Full step configuration: If the stepper motor is in the full-step configuration needed from micro controller is shown in table 5.1.

Table 5.1

Page 64: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

To rotate the stepper motor in forward direction the output sequence from the micro

controller is A-9-5-6-1.

To rotate the stepper motor in the reverse direction the sequence from the micro controller is 6-5-9-A.

2. Half-step configuration: If the stepper motor is in half step configuration then the data needed from micro

controller are shown on table 5.2.

Step!: Advance a step by applying a data. Step2: Call time delay routine to complete a step.

To rotate the stepper motor in forward direction the output sequence from the micro

controller is A-8-9-1-5-4-6-2-A. to rotate stepper motor in the reverse direction the output

sequence from the micro controller is 2-6-4-5-1-9-8-A.

The basic steps of the program to run a stepper motor is given as follows. Step3: Repeat step and step2 until the required number of steps completed in forward direction. Step4: To reverse the direction of stepper motor, the same steps given above are repeated in the reverse order of data. The C program can be written for three step forward and three step backward rotation of stepper motor in full-step configuration as follows:

5.3.3. Weighing scales: Consider the simple weighing machine which is used to indicate the weight of a

person standing on it. The important requirement of this weighing machine is to indicate the weight of the

person with reasonable speed and accuracy and be independent of where on the platform the person stand. The traditional mechanical system for this problem is to use the weight of the person

on the platform to deflect an arrangement of two parallel leaf springs as shown in fig 5.10(a).

Page 65: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

The deflection of the leaf spring is transferred to the rack and pinion arrangement

where the linear movement of rack is converted into rotary motion of the pinion

about the horizontal axis.

The rotary motion is transferred to the movement of a pointer across a scale through bevel gears.

With this arrangement the deflection is independent of where on the platform the person stands.

The mechatronics solution for this problem involves the use of a microprocessor. The basic principle behind this approach is to use load cells employing electrical

resistance strain gauges. Fig 5.11 shows a Wheatstone bridge arrangement with ADC. Similarly for displaying number of 6 of 168 in the second LED are given as follows:

5.4 CASE STUDIES OF MECHATRONIC SYSTEM Mechatronics systems are widely used now a days in many industries Some of

the examples are explained here as per our university syllabus.

5.4.1. Pick and Place Robot: The basic form of a pick and place robot is shown in fig 5.13. The robot has three axis about which motion can occur. The following movements are required for this robot.

1. Clockwise and anticlockwise rotation of the robot unit on its

base.

2. Linear movement of the arm horizontally i.e., extension or

contraction of arm. 3. Up and down movement of the arm and 4. Open and close movement of the gripper.

The foresaid movements can be obtained by pneumatic cylinder which isoperated by solenoid valves with limit switches.

Limits switches are used to indicate when a motion is completed. The clockwise rotation of the robot unit on its base can be obtained

from a piston and cylinder arrangement during pistons forward movement

Similarly counter clockwise rotation can be obtained during backward movement of the piston in cylinder.

Page 66: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

5.4.2. Automatic car park system: Consider an automatic car park system with

barriers operated by coin inserts. The system uses a PLC for its operation.

There are two barriers used namely in barrier and out barrier. In barrier is used to open when the correct money is inserted while out barrier open when the car is detected in front of it.

Fig 5.16 shows a schematic arrangement of an

automatic car park barrier. It consists of a barrier

which is pivoted at one end, two Solenoid valves

A and B and a piston cylinder arrangement.

A connecting rod connects piston and barrier as

shown in fig 5.16. Solenoid valves are used to

control the movement of the piston.

Solenoid A is used to move the piston upward inturn barrier whereas solenoid B is used to move the piston downward.

Limit switches are used to detect the foremost position of the barrier. When current flows through solenoid A, the, piston in the cylinder moves upward and causes the barrier to rotate about its pivot and raises to let a car through.

When the barrier hits the limit switch, it will turns

on the timer I give a required time delay.

After that time delay, the solenoid B activated which brings the barrier downward by operating piston in th cylinder.

This principle is used for both the barriers.

Page 67: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

Fig 5.17 shows a PLC arrangement to operate the barrier. Fig 5.1 shows the ladder program for that PLC system.

5.4.3. Engine management system: Engine management system is, now-a-days, used in many of the modern cars such as

Benz, Mitsuibisi, and Toyota etc. This system uses many electronic control system involving micro controllers.

The generalljse block diagram of this system is shown in fig 5.19.

The objective of the system being to ensure that the engine is operated at its

optimum settings.

The system consists of many sensors for observing vehicle speed, engine temperature, oil and fuel pressure, airflow etc. These sensors are supplying input signals to the micro controller after suitable signal conditioning and providing output signals via drivers to actuate corresponding actuators. A single cylinder engine consists of some of these elements in relation to an engine is shown in fig 5.20.

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

Page 68: MECHATRONICS Unit I 1.0 Introduction to Mechatronics YEA… · MECHATRONICS Unit – I 1.0 Introduction to Mechatronics: Consider the modern auto-focus, auto-exposure camera. To use

The engine temperature sensor is generally thermocouple which is made of

bimetallic strip or a thermister.

The resistance of the thermistor changes with change in engine temperature this results in voltage variation.

Hot wire anemometer is used as a sensor for measuring mass airflow rate. The basic principle is that the heated wire will be cooled as air passes over it. The

amount of cooling is depending on the mass rate of flow. The oil and pressure sensors are diaphragm type sensors. According to the pressure

variation, the diaphragm may contract or expand and activates strain gauges which produces voltage variation in the circuit.

The oxygen sensor is usually a close end tube which is made of ZirConium oxide with porous platinum electrode on the inner and outer Surfaces

The sensor becomes permeable to oxygen ions at about 300°C.

This results in generation of voltage between the electrodes. The various drivers such as fuel injector drivers, ignition coil drivers. solenoid

drivers and used to actuate actuation according to the signal by various sensors.

Analog signals given by sensors are converted into digital signal by using analog to digital converters (ADC) and sent it to micro controllers.

The various output digital signals are converted into analog signals by DAC (i.e., Digital to Analog Converter) and shown in various recorders or meters.