LN1b - Sensors
LN1b - Sensors
INDUSTRIAL
AUTOMATION
WEEK 2
SENSORS
1
Optical Encoders
• A device that provides a digital output as a result
of a linear or angular displacement
• Two types:
• Incremental encoders – detect changes in rotation
from some datum position
• Absolute encoders – give the actual angular position
2
Optical Encoders: Fundamental
Components
• Light source(s)
• LEDs or IR LEDs provide light source.
• Light is collimated using a lens to make the beams parallel.
• Photosensor(s)
• Either Photodiode or Phototransistor.
• Opaque disk (Code Disk)
• One or more “tracks” with slits to allow light to pass through.
3
Optical Encoder: Components
4
Optical Encoders: • A beam of light passes through slots in a
disc and is detected by a suitable light
Incremental Encoders sensor
• When the disc rotated, a pulse output is
produced by the sensor with the number
of pulses being proportional to the angle
through which the disc rotates
• The angular position of the disc and the
shaft rotating it, can be determined by the
number of pulses produced since some
datum position
5
Incremental Encoder:
Quadrature signal
• Two tracks (A & B) at 90 degrees offset
(half-width).
• If complements are included (𝐴, 𝐵), the
signal is “quadrature”, providing speed of
rotation AND direction of rotation.
• Signal A leads B in one direction, B leads
A in the reverse direction
• Provides up to 4 times resolution.
6
Quadrature Signal (continued)
Falling edge –
transition from
• 1X resolution HIGH to LOW
• provides an output
transition at each
falling edge
(negative) of signal
A or B
• Resulting in a
single pulse for
each quadrature
cycle
7
Quadrature Signal (continued)
Rising edge –
transition from
LOW to High
• 2X resolution
• Provides an output
transition at every
falling or rising
(positive) edge of
signal A or B
• Resulting in two times
the number of output
pulses
8
Quadrature Signal (continued)
• 4X resolution
• Provides an
output pulse at
every rising and
falling edge of
signal A and B
• Resulting in four
times the
number of
output pulses
9
Quadrature Signal
(continued)
• Direction of rotation
• Determined by the
level of one
quadrature signal
during an edge
transition of the
second quadrature
signal
• For example in 1X
mode, A=↓ with
B=1 implies
clockwise rotation,
and B=↓ with A=1
implies counter-
clockwise rotation
10
Incremental Encoder: Marker Pulse
A marker pulse (reference, index or Z pulse) is a once per revolution pulse that occurs at
precisely the same mechanical point in a 360º revolution of the encoder shaft.
Marker
Z
Although a “Marker” pulse is standard on some encoders, it is additional feature (charge) on many encoders.
Ask for one, if you need one.
11
Optical
• Gives an output in the form of a binary number of
Encoders: several digits with each number representing a
particular angular position
Absolute • For 3-bit absolute encoder, the rotating disc will have
Encoders three concentric circles of slots and three sensors to
detect the light pulses
• The slots are arranged in such a way that the sequential
output from the sensor is a number on the binary code
• Typically, it will have 10 to 12 tracks and the number of
bits in the binary number will equal to the number of
tracks
12
Absolute Encoders:
Codes • Example: 3 bit binary code
Bit 0 Angle Binary Decimal
Bit 1 0-45 000 0
• Natural binary code is not generally used because changing from one binary
number to the next can result in more than one bit changing
• If through misalignment, one of the bit changes fractionally before the
others, then an intermediate binary number is momentarily indicated, which
can lead to false counting
• Gray code is used to overcome this problem
14
Binary Code Angle Binary Decimal
270-315 110 6
315-360 111 7
Binary Code Angle Binary Decimal
0-45 000 0
Bit 0
45-90 001 1
Bit 1
90-135 011 2
Bit 2
135-180 010 3
225-270 111 5
Bit 1
270-315 101 6
Bit 2 315-360 100 7
17
Binary code vs. Gray Code
18
Gray Code-to-Binary Code
• Gray code provides data with the least uncertainty
• But natural binary code is the preferred choice for
direct interface to computers an other digital devices
• Thus, a circuit (utilising Exclusive OR, XOR gates) to
convert from gray to binary code is desirable
• MSB for both codes are always identical, and for each
other bit; b(i) = b(i+1) ⊕ g(i), for i=0 to N-2
19
Converting from Gray Code to Binary Code
1. Copy MSB.
2. If MSB is 1, write 1s until next 1 is met. If MSB is 0, write 0s until
next 1 is met.
3. When 1 is met, logically switch what you are writing (1=>0 or 0=>1).
4. Continue writing the same logical until next 1 is met.
5. Loop back to step 3.
20
Example: Convert 0010 to Binary Code
• Copy MSB: 0_ _ _
• Write 0s until next 1 is met: 00_ _
• Switch to writing 1s: 001_
• Write 1s: 0011
21
Example: Convert 1110 to Binary Code
• Copy MSB: 1_ _ _
• Write 1s until next 1 is met: 1_ _ _
• Switch to writing 0s until next 1 is met: 10_ _
• Switch to writing 1s until next 1 is met: 1011
22
Optical Encoder: Resolution
• Absolute 360
n
where n=# of tracks.
2
360
90
4
23
Optical Encoders: Examples
• Incremental encoder:
• If 60 slots occurring with 1 revolution (1 rev = 360 deg), thus the resolution is 360
deg/60 = 6 deg
• Absolute encoder:
• For 10 tracks (i.e. 10 bits), the number of positions that can be detected is 210 = 1024.
Resolution = 360 deg/1024 = 0.35 deg
24
Example (continued)
• Determine the angular resolution of a two channel incremental encoder with
a 2X quadrature decoder circuit if the code disc track has 1000 radial lines.
360° 360°
∆𝜃 = = = 0.18°
2𝑁 2(100)
25
Question 1
• For an absolute encoder with 7 tracks on its code disc:
• Determine the number of position that can be detected
• Calculate the resolution of the encoder
Answers:
128 position
Resolution = 2.8125 deg
26
Optical Encoders: Applications
27
Other Types of Sensors
• Photodiode – capable of converting light to electrical signal
28
• Strain gauge – analogue sensor to
measure force
29
• Pitot tube – flow sensor to measure • Orifice meter – measure pressure
the difference between total and drops across obstructions to flow
static pressure of a moving fluid
30
• Thermocouple – analogue
temperature measuring device based
on thermoelectric effect, in which the
junction of 2 dissimilar metal wires
emits a small voltage that is a
function of the temperature of the
junction
• Resistance temperature detector –
based on increase in electrical
resistance of a metallic material as
temperature increased
31
Future Trends of Sensors
• Micro-electromechanical system (MEM)
• use integrated circuit (IC) technology.
• One important class - surface acoustic wave (SAW) which consists of flat piezoelectric
substrate with metallic pattern lithography deposited on the surface
• can be demonstrated in automatic highway toll booths to identify vehicles as they pass
under a transceiver.
32
Future Trends of Sensors (continued)
• Nano sensors
• any biological, chemical, or surgery sensory points used to convey information about
nanoparticles to the macroscopic world
• Though humans have not yet been able to synthesize nano sensors, predictions for their
use mainly include various medicinal purposes and as gateways to building other
nanoproducts, such as computer chips that work at the nanoscale and nanorobots.
• Presently, there are several ways proposed to make nano sensors, including top-down
lithography, bottom-up assembly and molecular self-assembly.
33
Future Trends of Sensors (continued)
• Vision sensing (machine vision, computer vision)
• It is a general purpose sensor, where it uses cameras to optically sense (or measure) the
presence, shape orientation, are, defects, differences between part, etc.
• Then, a microprocessor processes the image so that the image can be measured and the
measurement then will be digitized (also call the image recognition process). How smart
the vision system is determined totally by its image processing software.
34
Future Trends of Sensors (continued)
• Integrated and distributed sensors
• These are based on sensor fusion concept that involves the integration of multiple
sensors, where individual data for each of the sensors (e.g. force, vibration, temperature,
dimensions, etc) are combined to provide a higher level of information and reliability.
• They are integral with the components and agents, which communicate with each other
in an overall multi-agent system.
• Micro-measurement system (MMS) - integrate sensors and signal processing circuits in
a hybrid circuit that contain transducer (or sensor), ADC, programmable memory and
microprocessor.
35