You are on page 1of 45

Instrumentation and Control Systems

Digital Signals

Rajiv Gandhi University of Knowledge Technologies,


Basar
Instrumentation and Control Systems RGUKT Basar

Introduction
• Output from most sensors tends to be in analogue form varying
continuously with time
• Digital format offers several advantages: digital signal
processing, storage, use of computers, robust transmission, etc.
• most actuators operate with analogue inputs
• so the digital output from a microprocessor has to be converted
into an analogue form before it can be used as an input by the
actuator.
Instrumentation and Control Systems RGUKT Basar
• An analogue signal is continuous variable, changing smoothly over a
range of values.

• A digital signal increases in jumps, being a sequence of pulses, often


just on-off signals.
• The value of the quantity instead of being represented by the height
of the signal, as with analogue, is represented by the sequence of on-
off signals
Instrumentation and Control Systems RGUKT Basar

Analog-to-Digital Converter (ADC)


• ADC converts this analog input from transducer into a digital output.
• This digital output consists of a number of bits that represent the
value of the analog input.
• For example, the ADC might convert the transducer’s 800- to 1500-
mV analog values to binary values ranging from 01010000 (80) to
10010110 (150).
• Note that the binary output from the ADC is proportional to the
analog input voltages so that each unit of the digital output represents
10mV.
Instrumentation and Control Systems RGUKT Basar

Digital-to-Analog Converter (DAC)

• This digital output from the computer is connected to a DAC,


which converts it to a proportional analog voltage or current.
• For example, the computer might produce a digital output
ranging from 0000000 to 11111111, which the DAC converts
to a voltage ranging from 0 to 10V.

DAC
Instrumentation and Control Systems RGUKT Basar
Digital to analogue (D/A) conversion
• Output voltage of an n bit converter

E0  ER   d n 1  21  d n  2  22  ......  d 2  2 ( n2)  d1  2 (n 1)  d 0  2 n 


Where
• ER = reference voltage
• coefficient dn-1 represent the binary word and is either 0 or 1.
• MSB corresponds to dn-1 and its weight is ER/2
• LSB corresponds to d0 and its weight is ER/2n
• The equation can be written as

ER
E0  n   d n 1  2n 1  d n  2  2n  2  ......  d1  21  d 0  20 
2
Instrumentation and Control Systems RGUKT Basar
• Example: 5 bit DAC with digital input 10000
• Output voltage
ER
E0   16d 4  8d 3  4d 2  2d1  d 0 
32
ER
E0  16
32
• For binary number 11000 ER
E0  24
32

• For binary number 11111


ER
E0  31
32

• Hence the analogue output voltage is proportional to the digital


input.
Instrumentation and Control Systems RGUKT Basar

Input/output for a DAC.


Instrumentation and Control Systems RGUKT Basar

• Example
• microprocessor gives an output of an 8-bit word. This is fed
through an 8-bit DAC to a control valve. The control valve
requires 6.0 V to be fully open. If the fully open state is
indicated by 11111111 what will be the output to the valve for a
change of 1 bit?
• The full-scale output voltage of 6.0 V will be divided into 28
intervals.
• A change of 1 bit is thus a change in the output voltage of 6.0/28
= 0.023 V.
Instrumentation and Control Systems RGUKT Basar

• Determine how many bits a D/A converter must have to provide


output increments of 0.04 V or less. The reference is 10 V.

• Resolution

• Taking logarithms

• Thus, a n= 8 bit will be satisfactory.


Instrumentation and Control Systems RGUKT Basar

R-2R ladder DAC


• The benefit of using the R/2R ladder is that we need only two resistor
values, R and 2R.
Instrumentation and Control Systems RGUKT Basar

• The current drawn through any one switch is always the same,
no matter if it is thrown up or thrown down.

• If a switch is thrown down, current will flow through the


switch into ground (0 V).

• If a switch is thrown up, current will flow toward virtual


ground— located at the op amp’s inverting input (recall that if
the noninverting input of an op amp is set to 0 V, the op amp
will make the inverting input 0 V, via negative feedback).

• Current through any given switch is always constant, hence


current (I) supplied by Vref will be constant as well
Instrumentation and Control Systems RGUKT Basar
Instrumentation and Control Systems RGUKT Basar
Instrumentation and Control Systems RGUKT Basar

Analogue-to-digital (A/D) conversion


• Three operations involved in A/D conversion

1. sampling
– process of taking a sufficient number of discrete values at
point on a waveform that will define the shape of
waveform.
2. quantisation
– breaking down analog value in a set of finite states
3. encoding
– assigning a digital word or number to each state and
matching it to the input signal
Instrumentation and Control Systems RGUKT Basar

Sampling

• It is a process of taking a sufficient number of discrete values


at point on a waveform that will define the shape of waveform.
• The more samples you take, the more accurately you will
define the waveform.
• It converts analog signal into series of impulses, each
representing amplitude of the signal at given point……
Instrumentation and Control Systems RGUKT Basar

Procedure
• clock supplies regular time signal pulses (Fig. C) to the
analogue-to-digital converter (ADC) and every time it receives
a pulse it samples the analogue signal (Fig. b).
• The result of the sampling is a series of narrow pulses (Figure
(d)).
• A sample and hold unit is then used to hold each sampled value
until the next pulse occurs, with the result shown in Figure (e).
• The sample and hold unit is necessary because the ADC
requires a finite amount of time, termed the conversion time, to
convert the analogue signal into a digital one.
Instrumentation and Control Systems RGUKT Basar
Instrumentation and Control Systems RGUKT Basar

Sampling theorem

• How often should an analogue signal be sampled in order to


give an output which is representative of the analogue signal?

Effect of sampling frequency


Instrumentation and Control Systems RGUKT Basar

Nyquist criterion or Shannon’s sampling


theorem
• A continuous signal can be represented by, and reconstituted from, a
set of sample values provided that the number of samples per second
is at least twice the highest frequency present in the signal
• Sampling frequency
Instrumentation and Control Systems RGUKT Basar

• When the sampling rate is less than twice the highest frequency,
the reconstruction can represent some other analogue signal and
we obtain a false image of the real signal.
• This is termed aliasing.

Frequency of
original signal= 1Hz

sampling frequency= 1Hz


< 2samples/sec
(as per criterion)
Instrumentation and Control Systems RGUKT Basar

Sample and Hold Circuit


• operation of analogue-to-digital conversion can take up to a few
milliseconds; it is necessary therefore to hold the output of the
sampler constant at the sampled value while the conversion takes
place
• The circuit consists of a voltage-holding capacitor and a voltage
follower.
Instrumentation and Control Systems RGUKT Basar

With switch S closed,

When the switch is opened, the capacitor C holds the input


voltage corresponding to the last sampled value, because
negligible current is drawn by the follower. Therefore,

where tsampled is the time when the switch was last opened.
Instrumentation and Control Systems RGUKT Basar
• Sampling begins when the switch is closed and ends when the
switch is opened.
• When the switch is opened, the input voltage present at that exact
moment will be stored in C.
• The op amp acts as a unity-gain amplifier (buffer), relaying the
capacitor’s voltage to the output but preventing the capacitor from
discharging (recall that ideally, no current enters the inputs of an op
amp).
• The length of time a sample voltage can be held varies depending on
how much current leaks out of the capacitor.
• To minimize leakage currents, use op amps with low input-bias
currents.
• Capacitors best suited for sample/hold applications include Teflon,
polyethylene, and polycarbonate dielectric capacitors to ensure low
leakage of currents.
Instrumentation and Control Systems RGUKT Basar

• In the sample state the output signal follows the input signal;
• In the hold state the output signal is held constant at the value of the
input signal at the instant of time the hold command is sent
Instrumentation and Control Systems RGUKT Basar

Quantisation
• Although the sample values are taken at discrete intervals of time, the
values yi can take any value in the signal range yMIN to yMAX
• In quantisation the sample voltages are rounded either up or down to
one of Q quantisation values or levels Vq, where q = 0, 1, 2, . . , Q−1.
• Quantum levels correspond to the Q decimal numbers 0, 1, 2, . ., Q−1.
• If V0 = yMIN and VQ−1 = yMAX, then there are (Q − 1) spacings
occupying a span of yMAX − yMIN.
Instrumentation and Control Systems RGUKT Basar

• The spacing width or quantisation interval ΔV is

• Normally if yi is above the halfway point between two levels q, q + 1 it


is rounded up to Vq+1; if yi is below halfway it is rounded down to Vq
Instrumentation and Control Systems RGUKT Basar

• The operation of quantisation produces an error eq = Vq − yi


termed the quantisation error.

• Maximum percentage quantisation error (expressed as a


percentage of span yMAX − yMIN)
Instrumentation and Control Systems RGUKT Basar

• Relationship between Vq and yi is characterised by a series of


discrete steps or jumps;
Instrumentation and Control Systems RGUKT Basar

Encoding
• encoder converts the quantisation values Vq into a parallel digital
signal corresponding to a binary coded version of the decimal
numbers 0, 1, 2, . . . , Q − 1.
• Decimal number system
• any positive integer is expressed as a series of powers of 10

where weights or digits di take the values 0 to 9


• Binary number system
• any positive integer can be expressed as a series of powers of 2:

where bits bi take only the values 0 or 1


Instrumentation and Control Systems RGUKT Basar

• Consider a thermocouple giving an output of 0.6 mV/°C. What will


be the word length required when its output passes through an ADC
if temperatures from 0 to 100°C are to be measured with a resolution
of 0.5°C?
• The full-scale output from the sensor is 100 x0.6 = 60 mV.
• With a word length n, this voltage will be divided into steps
60/2n mV.
• For a resolution of 0.5°C we must be able to detect a signal from the
sensor of 0.6 x 0.5 = 0.30 mV.
• Thus we require
60
0.3  n
2
• Hence n = 7.64. Thus a 8-bit word length is required.
Instrumentation and Control Systems RGUKT Basar

Digital output from an 3 bit ADC


Instrumentation and Control Systems RGUKT Basar

• There are eight possible words which can be used to represent the
analogue input; the number of possible words with a word length
of n bits is 2n.
• Thus maximum analogue voltage can be divide into eight parts
and one of the digital words corresponds to each.
• Each rise in the analogue voltage of (1/8) of the maximum
analogue input then results in a further bit being generated.
• Thus for word 000 we have 0 V input.
• To generate the next digital word of 001 the input has to rise to 1/8
of the maximum voltage.
• To generate the next word of 010 the input has to rise to 2/8 of the
maximum voltage.
Instrumentation and Control Systems RGUKT Basar

Resolution of ADC
VFS
Re solution  n
2

Where VFS = full scale analogue input


n = no. of bits.
For sampled analogue input of 8 V and 3 bit ADC,
Resolution = 1V
For sampled analogue input of 10 V and 10 bit ADC,
Resolution = 10/1024 = 1mV
Instrumentation and Control Systems RGUKT Basar

• Most commonly used analogue-to-digital converter are


1. Successive approximations ADC
2. Ramp ADC
3. Flash ADC
Instrumentation and Control Systems RGUKT Basar

Successive approximation ADC.


• method involves making successive guesses at the binary code
corresponding to the input voltage.
• A voltage is generated by a clock emitting a regular sequence of
pulses which are counted, in a binary manner,
• the resulting binary word (trial code) is converted into an analogue
voltage by a DAC.
• a comparator is used to decide whether the guess is too high or too
low.
• On the basis of this result another guess is made, and the process is
repeated until Vq is within half a quantisation interval of yi.
Instrumentation and Control Systems RGUKT Basar
Instrumentation and Control Systems RGUKT Basar
• Example
• 4 bit ADC
• Vin= 11.2 volts (from analog device)
• Vref(for DAC) =16 volts
• Find the digital value of Vin using successive approximation

• N=2n (N of possible states)


• N= 24 = 16
• Vmax-Vmin/N = 16 V/16 = 1V of Vref (resolution)
Instrumentation and Control Systems RGUKT Basar
• MSB (bit 4)
• Initialize MSB MSB-1 MSB-2 LSB
1 0 0 0

VREF
VDAC  4   d3  23  d 2  22  d1  21  d 0  20 
2
• VDAC = 8 V
• Vin >VDAC MSB is on (1)
• If Vin< VDAC, MSB is off (0)

• Vin = 11.2 >VDAC MSB is on (1)


• Hence output is

MSB MSB-1 MSB-2 LSB


1 0 0 0
Instrumentation and Control Systems RGUKT Basar

• MSB-1 (bit 3)
• Initialize MSB MSB-1 MSB-2 LSB
1 1 0 0
VREF
VDAC  4   d 3  23  d 2  22  d1  21  d 0  20 
2
• VDAC = 12 V
• Vin >VDAC MSB is on (1)
• If Vin< VDAC, MSB is off (0)

• (Vin = 11.2) <VDAC MSB is off (0)


• Hence output is

MSB MSB-1 MSB-2 LSB


1 0 0 0
Instrumentation and Control Systems RGUKT Basar
• MSB-2 (bit 2)
• Initialize
MSB MSB-1 MSB-2 LSB
1 0 1 0
VREF
VDAC  4   d 3  23  d 2  22  d1  21  d 0  20 
2
• VDAC = 10 V
• Vin >VDAC MSB is on (1)
• If Vin< VDAC, MSB is off (0)

• (Vin = 11.2) >VDAC MSB is on (1)


• Hence output is

MSB MSB-1 MSB-2 LSB


1 0 1 0
Instrumentation and Control Systems RGUKT Basar
• LSB (bit 1)
• Initialize MSB MSB-1 MSB-2 LSB
1 0 1 1

VREF
VDAC  4   d3  23  d 2  22  d1  21  d 0  20 
2
• VDAC = 11 V
• Vin >VDAC MSB is on (1)
• If Vin< VDAC, MSB is off (0)

• (Vin = 11.2) >VDAC MSB is on (1)


• Hence output is
MSB MSB-1 MSB-2 LSB
1 0 1 1
Instrumentation and Control Systems RGUKT Basar

Frequency to digital conversion


• In several cases the output signal from primary sensing or signal
conditioning elements is an a.c. voltage with a frequency which
depends on the measured variable.
• Examples are:
1. The variable reluctance tachogenerator
2. Electrical and electromechanical oscillators for displacement
and differential pressure measurement
3. Turbine, vortex flow meters
• methods are used to convert a variable frequency sinusoidal
signal into a parallel digital output signal
Instrumentation and Control Systems RGUKT Basar

Period measurement – system.


• Sine wave must first be converted into a square wave signal with
sharp edges using a Schmitt trigger circuit.
• Both counters (signal and clock counter) are initially set to zero;
• clock pulses are input to the clock counter and signal pulses to the
signal counter.
Instrumentation and Control Systems RGUKT Basar

Clock counter counts up until a


count of 1 is registered in the signal
counter; the count then stops.

• Period TS of the signal is measured by counting the number of clock


pulses within TS
• number NC of positive-going edges is counted, giving

• where 1/fC is the clock period


• parallel digital output signal is proportional to this clock count.

You might also like