In The Trenches
at 100 samples per cycle). If we
measure from zero crossing to zero
crossing point (the proper method),
the basic A/D error is 0.224 degrees
(see above). So, our total error can be
a maximum of 3. 82 degrees or
1.06%. The 1,000 Hz signal might be
measured as 1,060 Hz. Again, this
is well in excess of the basic 0.4%
eight-bit A/D error.
You can improve things by sampling faster. You will need to sample
every 1.44 degrees (0.4% of 360) or
250 samples per cycle to match the
A/D error of 0.4%. For our 1,000 Hz
signal, this comes to a 250,000 Hz
sample rate.
Another way to increase the
accuracy of your measurements is
to measure multiple cycles. This is
usually easy to do. Count 10 cycles
instead of one for a 10-fold increase
in accuracy. This spreads the error
over 10 cycles and reduces the per-cycle error by 10. (Many hardware
frequency counters do this. Some
count 1,000s of cycles for very high
accuracy.)
relatively long time. This is the
opposite of the frequency error
above. The amplitude error can be
1/256 of full-scale. This corresponds to 0.996 instead of 1.000
(full-scale equals 1.000). The
inverse sine of 0.996 is about 85
degrees. This is a difference of 5
degrees from the proper value of
90. Add this 5 degree error to the
sampling error of 3. 6 degrees and
there is a whopping 8. 6 degree
potential phase error (or 9.5%) at 90
degrees. This is nearly 25 times
worse than the basic A/D error
of 0.4%.
How fast do we need to sample
to get the phase error down to our
basic 0.4% A/D amplitude error?
Quite simply, you can't get there
from here. We just saw that there was
an inherent 5 degree error due to the
step-size of our eight-bit A/D. An
eight-bit A/D is just not good enough
to resolve 1.44 degrees (0.4% of 360
degrees). We will need a step-size of
0.03%, which corresponds to about
3,000 steps — which means a 12-bit
A/D converter.
Here's how those values were
determined. Our desired resolution is
1.44 degrees. The worst case point is
at 90 degrees. So, we have to be able
to resolve the difference in amplitude
between 90 degrees and 88. 56
degrees (90-1.44). The sine of 90
degrees is 1.000 and the sine of
88. 56 degrees is 0.99968. They differ
by 0.00032. This defines the minimum step-size necessary (with a
full-scale of 1.000). There are 3,125
steps of 0.00032 in a full-scale value
of 1.000 (or 1/3125). A 12-bit A/D
has 4,096 steps.
We still have to sample faster,
too. We saw that 100 samples per
cycle yielded a 3. 6 degree error. It's
easy to calculate our sampling speed
for 1.44 degrees per sample. It's just
360/1.44 or 250 samples per cycle.
Phase Errors
The last basic error is phase.
(Amplitude, frequency, and phase
define any signal.) Basically, this is a
delay error from the sampling and
conversion process. This is probably
the most obvious error of the three.
Generally, it is usually the least
significant. However, there are times
when phase error can be really
nasty.
First, how much error is there?
With 100 samples per cycle, the error
is 1% or 3. 6 degrees. However, this is
only due to the sampling error. There
is also the acquisition error. This
depends on how long the sampling
process takes. Usually, this is much
less than the sampling error, but it is
important to verify that. (We will
ignore that factor because it is A/D
dependent.)
The worst case phase error
from the A/D comes at the peak
and trough of the sine wave where
the amplitude changes take a
JANUARY 2005
INCREASE DATA
SPEEDS
and eliminate
intermittents
Apply DeoxIT to edge
connectors and cable
connections to increase
performance and
reliability!
Used by those who
demand the best:
• Bose
• Ford
• General Electric
• Hewlett Packard
• Honeywell
• Intel
• Monster Cable
• Motorola
• Texas Instruments
• Toshiba • Xerox
• and Many More!
Available in spray, pen & other forms
• Audio/Radio • Computer • Automotive • Communications • Marine • Electrical • Video • Photography • Medical • Security • Avionics
Available at:
electronicaspirin.com
Circle #107 on the Reader Service Card.
91