Вы находитесь на странице: 1из 5

UNIVERSITY OF SANTO TOMAS | ECE DEPARTMENT | ECE 511L

PART 1 Exercise 1: Analog to Digital Point Conversion

Exercise

Analog to Digital Point


Conversion

UNIVERSITY OF SANTO TOMAS | ECE DEPARTMENT | ECE 511L


PART 1 Exercise 1: Analog to Digital Point Conversion

1.

Objective
This experiment will highlight and verify the various characteristics that determine the
performance specifications of Analog to Digital (A/D) conversion of numbers. All
programming is done using LabVIEW Virtual Instrument. This experiment will
introduce the LabVIEW graphical software and basic software manipulation will be
tested.

2.

Theoretical Background
Digital controllers have many advantages, including increased flexibility and ease of
change to the control program, the logic capabilities of digital systems that allow the
implementation of complex algorithm and the immunity to drift faced by electronic
components in analog control. Most of the signals that appear in the industry are analog
(Temp, pressure, etc). Hence, these signals need to be converted to digital signals to be
used by the digital controller feedback loop. The control signal produced by the digital
controller needs also to be converted back to analog to drive the plant being controlled.
This experiment covers the details of analog to digital conversion of numbers.
3.1 Analog to Digital Conversion
The output of an A/D converter depends on the following:
Low and high reference voltages VRL and VRH (If VRL and VRH have the same
polarity, the A/D is a unipolar device; otherwise it is bipolar).
The number of bits k, the signal is coded into
A k-bit A/D generates 2k output levels called quanta. The minimum value is called
offset, and the difference between the minimum and the maximum is called the range,
span or full scale. Example, for an 8-bit code, VRL will be eight zeros, VRH will be eight
ones and the number of levels is 28 = 256.
The resolution VQ is the smallest variation in the analog input signal that would cause
the A/D output code to change by one level or quantum.
=

2 1

=(

Any voltage level vi within the input signal range is translated to its decimal equivalent
as:
FS
v =N
+V
2 1
Where:
2 1
N = INTEGER
[v V ]
FS
Analog values within a quantum level generate the same output code. The maximum
error is LSB (Least Significant Bit). The error VE between the digitized voltage and
the input voltage is estimated by:

UNIVERSITY OF SANTO TOMAS | ECE DEPARTMENT | ECE 511L


PART 1 Exercise 1: Analog to Digital Point Conversion

V = v NV
The error can be lowered by increasing the number of output bits of the converter
Aliasing is the misrepresentation of a high frequency signal as a low frequency one.
This might happen when we use an ADC as shown in the figure below.
T0

TS

Apparent signal
(frequency fA)

fS = 1/TS

f0 = 1/T0

Sampling
times

To avoid aliasing, the sampling frequency fs should be more than twice the highest
frequency of the sampled analog signal. The sampling frequency of the analog signal fo
affects the accuracy of the discrete time representation of the signal. For a reliable
approximation, the sampling frequency should be 5 to 10 times the analog signal
frequency
3.2 LabVIEW Software
LabVIEW programs are called virtual instruments, or VIs, because their appearance and
operation imitate physical instruments, such as oscilloscopes and multi-meters.
LabVIEW contains a comprehensive set of tools for acquiring, analyzing, displaying,
and storing data, as well as tools to help you troubleshoot your code.
LabVIEW VIs contain three componentsthe front panel, the block diagram, and the
icon and connector pane. In LabVIEW, you build a user interface, or front panel, with
controls and indicators. Controls are knobs, push buttons, dials, and other input devices.
Indicators are graphs, LEDs, and other displays. After you build the user interface, you
add code using VIs and structures to control the front panel objects. The block diagram
contains this code. In some ways, the block diagram resembles a flowchart.
Use LabVIEW to communicate with hardware such as data acquisition, vision, and
motion control devices. Using LabVIEW, you can create test and measurement, data
acquisitions, instrument control, data-logging, measurement analysis, and report
generation applications.
You build the front panel with controls and indicators, which are the interactive input
and output terminals of the VI, respectively. Controls are knobs, push buttons, dials,
and other input devices. Indicators are graphs, LEDs, and other displays. Controls
simulate instrument input devices and supply data to the block diagram of the VI.
Indicators simulate instrument output devices and display data the block diagram
acquires or generates. Controls and indicators have a data type. The data type can be
Numeric, Boolean, String etc. like in the case of any other programming
language.

UNIVERSITY OF SANTO TOMAS | ECE DEPARTMENT | ECE 511L


PART 1 Exercise 1: Analog to Digital Point Conversion

3.

System Hardware/Software Configuration


Make sure all the VIs listed below are placed in the same folder and run the VI called
A2D_D2A.vi.
A2D.vi
A2DSig.vi
D2A.vi
D2ASig.vi
A2D_D2A.vi

4.

In-Lab Experimental Procedure


1. Open the VI named A2D_D2A. Displayed is the Front Panel part of the
Virtual Instrument. This is the user interface.
2. Go to the first Tab named Analog to Digital Point Conversion as shown in
the figure below.

3. Press CTRL + E in order to view the Block Diagram of this virtual


instrument. The block diagram is the area where we write our program
graphically in LabVIEW. Make sure you have Analog To Digital Point
Conversion written on top (if not press left arrow next to the name until you
get it). Familiarize yourself with the blocks used to make the Analog to
Digital conversion. Compare the block with the equation needed to perform
ADC explained in the theoretical background. If you press the question mark
at the top right corner (Context help) and move the mouse to any block, it
will give you an explanation on how the block will work.
4. If we look at the front panel, we see 8 numeric variables drawn on it. The
ones on the left (with white background) are the Controls. These variables
accept input from the user of the program and pass that input for further
calculation to the block diagram. Notice how the name of the controls is
repeated in the block diagram (example: Maximum Voltage); this means,
whatever value entered on the front panel for the Maximum Voltage, will
be used in the block diagram calculation.

UNIVERSITY OF SANTO TOMAS | ECE DEPARTMENT | ECE 511L


PART 1 Exercise 1: Analog to Digital Point Conversion

5. Also, the numeric blocks on the right of the front panel (with gray
background) are the indicators. These blocks will give the values after
calculation. They also exist on the block diagram where they take their value
from the result of the calculation.
6. Assume digitization of a unipolar signal that can change between 0 and 5
Volts into a 3 bit digital equivalent. Referring to the theoretical part of this
experiment, calculate the resolution, the number of quantized levels._______
7. Verify your calculated resolution by putting 0 for the Minimum Voltage, 5
for the Maximum Voltage and 3 for the Number of bits. The VI will
display the resolution in the right column.
8. To check the number of quantized level put the maximum input (5V) in the
input voltage box and check the final quantized level. The number of
quantized level will be the resulting number +1 (Since the first level is 0).
9. Change the input voltage from 0.00 to 5.00 in an increment of 0.01 and fill
the range of voltage for each quantum level. (0.00 to 5.00 with step of 0.01
is 500 measurements; you can try an easier method to fill the table).
Quanta
Binary
Level Representation
7
6
5
4
3
2
1
0

Input Volt
Range
From

Input Volt
Range
To

ADC
Output
Voltage

111
110
101
100
011
010
001
000

10. What is the maximum error that the output voltage can undertake? ________
11. What will the maximum error be if we increased the number of bits to 4 in
the previous example? _________
12. Verify that the error decreases with increasing the number of bits.
13. Change the input voltage range to -5V to +5V and keep the number of bits 3
(Bi-polar signal) and fill the table below.
Quanta
Binary
Level Representation
7
6
5
4
3
2
1
0

Input Volt
Range
From

111
110
101
100
011
010
001
000

14. What will be the maximum error? _________

Input Volt
Range
To

ADC
Output
Voltage

Вам также может понравиться