[sci.electronics] Geting my A/D converter to read current

bbs00068@uafcseg.uucp (Joel Kolstad) (08/10/90)

Hi...  I'm currently working on a project where I need an A/D converter to
read the (average) current going through a load.  The power supply for 
this project uses phase-angle control with a TRIAC to vary how much power
gets to the load (a filiament, in this case).  There's also a choke to
reduce the RF harmonics produced when the TRIAC switches on in mid-cycle.

As I said, what I need to do is measure the current going through the
filiament.  There is a shunt (if you can call it that) resistor that goes
after the load and to ground.  It is approximaterly .025 ohms.  By looking
at this on a scope, I can watch the power going through the filiament and
the load resistor.  Since V=IR, I can measure the voltage, I know the
resistance, and therefore calculate I at any point.  If I look at the
angle that the TRIAC fires at, I can integrate all this (v*t, in effect) and
get the average current going through the filiament.

HOWEVER... I need a computer to be able to read this.  So, I need some sort
of integrator circuit that's LINEAR with respect to current -- I need to 
able to feed the output of some circuit through an A/D converter.  My question,
then, is: How do I build such a circuit!?  Put a digital meter across the
shunt and ground works fine, so I know that you can build such a creature.

Ideally, I want this circuit to be able to use a single sided power supply...
I have some LN324's on the board with some of their op-amps free, so it'd
be ideal if I had a circuit that could use LM324's.  

Any ideas?  As I said, I know it can be done, but I don't know how -- so I'm
asking you!!!  It doesn't have to be perfect -- if it's 10% accurate, I'd be
happy!  

I should also mention that I tried just feeding the shunt resistor's output
through an op-amp to up the voltage a little, and then chopped off the
negative part of the waveform, and finally ran it into a capcitor.  This
gave me a reading, but it's FAR from linear!  I assume because the voltage
on a capcitor vs. time for an applied voltage is logrithmic, right?

Thanks to anyone who can help.  I really appreciate it!

				---Joel Kolstad
				kolstad@cae.wisc.edu

corey@verdix.com (Corey Ashford) (08/10/90)

In article <5064@uafhp.uark.edu> bbs00068@uafcseg.uucp (Joel Kolstad) writes:
... some stuff ...
>gave me a reading, but it's FAR from linear!  I assume because the voltage
>on a capcitor vs. time for an applied voltage is logrithmic, right?


Nope, unless there is a resistance in series with the capacitor.  Try
putting in a resistor before the cap such that R*C = .1 or so

from rectifier >-------/\/\/\-----*----> output
                                  |
                                -----
                                -----
                                  |
                                 gnd

By the way, I would suggest full-wave rectifying the output of the
op amp so that the filtering can be more effective.

- Corey Ashford

dbell@cup.portal.com (David J Bell) (08/11/90)

Joel Kolstad kolstad@cae.wisc.edu asks:

>Hi...  I'm currently working on a project where I need an A/D converter to
>read the (average) current going through a load.  The power supply for 

>filiament.  There is a shunt (if you can call it that) resistor that goes
>after the load and to ground.  It is approximaterly .025 ohms.  By looking
>at this on a scope, I can watch the power going through the filiament and
>the load resistor.  Since V=IR, I can measure the voltage, I know the
>resistance, and therefore calculate I at any point.  If I look at the
>angle that the TRIAC fires at, I can integrate all this (v*t, in effect) and
>get the average current going through the filiament.

>HOWEVER... I need a computer to be able to read this.  So, I need some sort
>of integrator circuit that's LINEAR with respect to current -- I need to 


OK, first off, do you really need to measure (at high speed) the instantaneous
load current, then integrate it, or do you *really* want a measure of the
effective ("average", actually R.M.S.) current?

If you want instantaneous current, just read it. Your A/D will need to
read both input polarities, or you could amplify and offset the voltage
across then shunt, giving a value from 0 to 10V, for example, with
0 volts corresponding to max negative, and 5V corresponding to zero current.
Then integrate in software...

If all you need is RMS current, you will need to rectify the signal from
the shunt, to produce a series of positive-only half cycle pulses. Then
a capacitive filter will give you the effective current, filtered over
several power line cycles.  Read that result with the A/D.....


Dave       dbell@cup.portal.com