Remote-processing RPC-52 Manuel d'utilisateur Page 30

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 36
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 29
ANALOG I/O CHAPTER 10
Page 28
measur ement r ange is 1 to 5V, the count range is
reduced by 20% to 818. The constant K is computed as:
K = 5/818
K = .006188
The above equation is assuming the 4-20 ma loop is
returning a value that represents a range of 0 to 5V. As
in the previous example, if pressure were measured:
K = 200/818
K = .24449
There is one addition factor. Since the lowest value read
is 1 V, this offset is subtracted from all readings. A 1 V
offset is 1/5 of 1023 counts, or 205. The program line
then becomes:
200 A=.006112*(AIN(N)-205)
Note that if the current loop line breaks, a negative value
is returned.
CALIBRATION
The A/D comes factory calibrated for a 0 to 5V input.
This span can be changed by adjusting R1. You can
adjust the span to 5.12V. This is useful when the input
is 0 - 5V and you want to know when the input is over-
range.
To calibrate or adjust the voltage reference:
1. Connect the voltmeter ground to any even
numbered pin on J1. Make sure there ar e no
other connections to the analog ground.
2. Connect the voltmeter ' + ' lead to U5, pin 6.
3. Adjust R1 for 5.00 VDC or other voltage as
desired. Do not exceed 5.2 V.
ANALOG OUTPUT
The two analog output channels shar e the PW M outpu ts
at the digital port. Analog output 0 is controlled by
PWM 0 and output 1 by PWM 1. When a PWM output
is used by an opto channel, it should not be used as an
analog output.
To make sure PWM is not used by an opto channel, set
the following jumpers:
W6[1-2] PWM 0
W7[1-2] PWM 1
One channel may be used as a PWM output while the
other is used as an analog output. Both outputs are
independently programmable as to duty cycle but not
frequency.
Analog output is generated from the PWM outputs by
simply placing a low pass filter in the outp ut. T he result
is an output with a 10K series resistance. The filter
capacitor is 10 Mfd. T hese values p rovide r easonable
ripple filtering and response over the PWM' s output
frequency.
The 10K output resistance may be high for some
devices. Check the device you are interfacing to. If the
impedance is less than 1 Meg ohm, and certainly 100K,
then the accuracy and maximum output will be affected.
If the full 5 volt range is not necessary, then the lower
impedance may not be a problem. The output may be
buffered using an external OP amp.
To make sure the output voltage is at the desired level,
the output can be connected to the analog input. Then,
by reading the voltage the output can be adjusted to the
desired level. The maximum output voltage will be
reduced when using this method, however.
The output voltage is proportional to the PWM cha nnel' s
duty cycle. Thus, the output voltage will change in steps
of 1/255, or approximately 20 mv/ step. This effectively
makes the analog output act like an 8 bit D/A converter.
The accuracy of the output depends upon the accuracy of
the + 5 V supply. When the supply is exactly 5 volts,
the output will go nearly to + 5 and ground at the
extrem e range s. W hen the output is loaded, + 5 volts
may not be reached. With the output loaded at 100K,
output voltage is reduced by about 10%.
Programming
The PWM statement is used to set the output voltage.
CONFIG PW M can be used to set the output and
frequency on power up.
The output voltage is proportional to the duty cycle:
Vo = Vcc - (Vcc * duty cycle / 255)
For example, a duty cycle of 80 produces an output of
3.43 volts. This assumes the power supply (Vcc) was
exactly 5 volts and the output was not loaded. The
following example r amps both outputs:
100 FOR N=0 TO 255
110 PWM 0,N
120 PWM 1,N
130 NEXT
140 GOTO 100
The outputs will ramp from + 5 volts to ground then
return to + 5V to repeat the cycle.
Vue de la page 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 36

Commentaires sur ces manuels

Pas de commentaire