Remote-processing RPC-210 Manual de usuario Pagina 45

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 60
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 44
ANALOG I/O BASIC SECTION 10
Page 10-3
A problem with offset and gain errors is that, at the
extreme ranges, readings are probably unreliable. The
upper and lower 100 mV should be deemed as unusable.
Offset
Offset is the initial, or base voltage the A/D reads with 0
volts input. It is also the output voltage of a D/A when
comm anded to outpu t 0 volts. Offset er rors are typically
±25 mV, but can be as high as ±50 mV. Offset errors
are reduced or eliminated simply by subtracting the error
from the current reading.
Gain
An offset error is specified at 0 volts while a gain error
is specified at full scale. Gain error, then, is the
difference betwe en what sho uld be read at full scale
(either 2.500V or 5.000V) and what is actually read after
offset is removed. This can be as high as ±25 mV.
Gain in the 5.000V range can be compensated for by
adjusting R16. Gain for the 2.500V range cannot be
adjusted. Typically it is 2.5V, but can range between
2.45 to 2. 55 volts.
Compensating for offset and gain errors
The best w ay to compensate for gain and offse t errors is
to account for them in your program. Typically some
kind of sensor or other device is connected to the board
anyway. Perform ing a 2 point calibration (offset and
gain) will remove most errors. See AIN-3.BAS for an
example of how these errors are compensated for.
NOISE
An input channel can appear to be noisy (change
readings at rando m) if unuse d inputs are allowed to floa t.
To minimize noise (and increase accur acy), connect all
unused inputs to ground.
RPBASIC-52 takes 8 reads and averages them before
returning the result. In theory, this filters out random
noise from the C PU and external sources. Noisy
environments may still require capacitors on the front
end.
A high impedance input is, by definition, sensitive to
voltage pickup. Noise is minimized by running wires
away from AC power lines. A low impedance voltage
source helps to reduce noise pick up. Shielded cable can
help reduce noise from high impedance sources. Make
sure the shield is not used for power ground. Using the
shield for power ground defeats its purpose. Wire pairs
can also be twisted. 5-6 twists/foot provides a good
amount of noise cancellation.
Noise is defined in this section as any random change
from a known input. The amount of noise you can
expect under good operating cir cumstances is ±3 counts
for any input range.
One way to compensate for noise is to take a number of
samples and average the results. Taking 7 or more
samples seems to cancel out any effects of noise. A
problem with this is noise tends to group together.
Taking 7 readings at one time might show no change
from the norm. Another 7 readings might be all high.
If possible, try to spread out readings over a period of
time.
Noise is, by definition, random. If you wer e to plot out
the deviations from a norm, it would roughly resemble a
bell shaped curve. Exper iments on the RPC-210 have
shown that 99% of readings can be w ithin ±3 counts.
The conversion clock is set for minimum noise.
CONVERTING ANALOG
MEASUREMENTS TO REAL WORLD
UNITS
Inputs are converted to engineering units of measurement
by performing scaling calculations in the program. The
AIN function returns values from 0 to 4095. To change
these numbers into something more meaningful, use the
following formula:
var = K * AIN(n)
n is the analog channel to read. K is the scaling
constant. K is obtained by dividing the highest number
in the range of units by the maximum AIN count (4095).
var result is in real world units (PSI, pounds, inches,
volts, etc.)
Example 1: To measure the results of an A/D
conversion in volts and the voltage range is 0 to 5V,
divided 5 by 4095 to obtain K.
K = 5/4095
K = .001221
Your program could look something like:
1000 C = .001221 * AIN(N)
Example 2: You want to measure a 0 to 200 PSI
pressure transducer with a 0 to + 5V output. Divide 200
by 4095 to obtain the constant K.
Vista de pagina 44
1 2 ... 40 41 42 43 44 45 46 47 48 49 50 ... 59 60

Comentarios a estos manuales

Sin comentarios