Remote-processing RPC-330 Manuel d'utilisateur Page 37

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 48
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 36
ANALOG INPUT SECTION 10
Page 10-3 RPC-330
40 NEXT
This next program saves data to RAM segment 1 in a
system with 128K of RAM. It takes approximately 2 mS
per data point and is not affected by the memory location
saved to.
10 A = 0
20 FOR X=0 TO 999
30 POKE W1,A,AIN(0)
40 A=A+2
50 NEXT
Data is retrieved using the PEEK W command.
Noise Notes
An input channel can appear to be noisy (change
readings at random) if unuse d inputs are allowed to float.
To minimize noise (and increase accur acy), connect all
unused inputs to ground.
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 reasonable amount of noise cancellation.
Noise is defined in this section as any random change
from a known input. The amount of noise you can
exp ect und er nor mal operatin g ci rc um sta nce s 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 6 or more
samples would, in theory, cancel out any effects of
noise. A problem with this is noise tends to group
together. Taking 6 readings at one time might show no
change fr om the norm. Another 6 readings might be all
high. If possible, try to spread out readings over a
period of time (several seconds if possible).
Noise is, by definition, random. If you were to plot out
the deviations from a norm, it would roughly resemble a
bell shaped curve. Exper iments on the RPC-330 have
shown that 99% of the readings are within the ±3 count
reading. N oise read ings wer e made with all inputs
shorted to ground.
Temperature Measurement
Reference IC U14 outputs a voltage pr oportiona l to its
temperature.
Vo = 2.1(T + 273)
or
T = Vo/2. 1 - 273
or
T = Vc * .581428 - 273
Where T = Te mp er atu re in °C
Vo = Output voltage in mV
Vc = Count returned using AIN, 0 -
5V range
At 25°C the output voltage is approximately 630 mV, or
516 counts.
The output from U14 must be buffered. To measure
temperature, jumper H1[1-3]. Remove resistor R13.
Jumper H1[2-4]. Temperature is read at analog channel
0.
100 T = AIN(0) * .581428 - 273
T returns the temperature in celsius.
The output from the temperature sensor varies from unit
to unit.
You can increase the output voltage from the
temperature sensor by lowering R12 and grounding H1
pin 5 (jumper H1-5 to H1-7).
Data logging on a timer tick
Some applications require that data is read at fixed
intervals. The ONTICK construct can be used to take
data in intervals from 0.01 to 327 seconds. T he exam ple
below takes 1 sample per second until 100 samples have
been obtained.
10 DIM A(100)
20 ONTICK 1,500
30 REM THE REST OF YOUR PROGRAM
40 REM CONTINUES
80 GOTO 30
500 A(N) = AIN(3)
510 N=N+1
520 IF N = 100 THEN ONTICK 0,500
530 RETI
Vue de la page 36
1 2 ... 32 33 34 35 36 37 38 39 40 41 42 ... 47 48

Commentaires sur ces manuels

Pas de commentaire