Maker Pro
Maker Pro

Measure average current

H

Hammy

Jan 1, 1970
0
I want to be able to measure a pulse unipolar with a DC offset
(programmable) from 10mV to 250mV; maximum amplitude of 500mv square
wave Variable duty cycle 10 to 50%.The frquency of the pulse is
seletable from 10kHz to 100kHz. The measurement is a square wave from a
resistor current shunt.

The idea I have is use an rms to DC converter IC and feed the DC
output to a PIC 10 bit ADC clocked at 20MHz and do the math on the
pic to get the average current then calculate the average power. I
was wondering is this the best way to go about this or is their a
better way? Looking at rms to dc IC's with 100 kHz + BW aren't
exactly cheap.
 
S

Sylvia Else

Jan 1, 1970
0
I want to be able to measure a pulse unipolar with a DC offset
(programmable) from 10mV to 250mV; maximum amplitude of 500mv square
wave Variable duty cycle 10 to 50%.The frquency of the pulse is
seletable from 10kHz to 100kHz. The measurement is a square wave from a
resistor current shunt.

The idea I have is use an rms to DC converter IC and feed the DC
output to a PIC 10 bit ADC clocked at 20MHz and do the math on the
pic to get the average current then calculate the average power. I
was wondering is this the best way to go about this or is their a
better way? Looking at rms to dc IC's with 100 kHz + BW aren't
exactly cheap.

RC filter and measure the resulting voltage?

Sylvia.
 
H

Hammy

Jan 1, 1970
0
Interesting.
For RMS simplest would be to have the pulse heat up something and
measure temperature rise? Just joking.

I could cheat the PIC will be setting the pulse frequency and duty and
magnitude and range so I know what the value would be assuming
everything works as it should.;-)So far it does but it would be nice to
know for sure by being able to take an actual measurment.

I just thought it would be a nice feature to add to my programable
load. That way I could display total power and avg current.But its
looking like it might be to complex and to expensive to do so I might
be having to settle with just the ability for DC mesurments.

I have some 32 MHz 8 bit video flash digitiser chips laying about,
one connected to a FPGA, could do mutiplications and additions in
hardware to get RMS value.

I dont have FPGA hardware or experience using them,that is likely the
way it should be done though.
Maybe you could simply use an analog
peak detector to get the amplitude, and count clock pulses to get
the width, and multiply in a PIC 18F @ 64 MHz. This should work if
the pulse amplitude only changes slowly.
The fastest rise times are about 100nS or so. Thanks its something I'll
look into.
 
H

Hammy

Jan 1, 1970
0
[snip]
I actually ment pulse amplitude, given a flat top, over time, not
rise time. I thought about it some more,
maybe you can use the PICs analog comparator to detect the start
of a 'pulse' (high level), then take one sample, use the analog
comparator again to find the end of the pulse (low level), take
one sample again (assuming a flat pulse top). In between count
clock ticks... I have even done video black level sampling with
the smallest PIC 12F that way. Deteced sync, detected V sysnc,
waited some clocks, sampled Y into a capacitor with a 4053. Then
later used that value by connecting that capacitor to an amp
input, that PIC did not even have an ADC. If you have an ADC, the
ADC sampling time is much shorter then the conversion time, you
could perhaps wait for the 'conversion ready' interrupt.

Thanks Jan you gave me a couple of ideas I can look into further.

The pulse amplitude is 500mV max. I'm using a 16F887 for know; it
has 2 comparators and a 10 bit ADC.
 
J

Jamie

Jan 1, 1970
0
Hammy said:
[snip]
I actually ment pulse amplitude, given a flat top, over time, not
rise time. I thought about it some more,
maybe you can use the PICs analog comparator to detect the start
of a 'pulse' (high level), then take one sample, use the analog
comparator again to find the end of the pulse (low level), take
one sample again (assuming a flat pulse top). In between count
clock ticks... I have even done video black level sampling with
the smallest PIC 12F that way. Deteced sync, detected V sysnc,
waited some clocks, sampled Y into a capacitor with a 4053. Then
later used that value by connecting that capacitor to an amp
input, that PIC did not even have an ADC. If you have an ADC, the
ADC sampling time is much shorter then the conversion time, you
could perhaps wait for the 'conversion ready' interrupt.


Thanks Jan you gave me a couple of ideas I can look into further.

The pulse amplitude is 500mV max. I'm using a 16F887 for know; it
has 2 comparators and a 10 bit ADC.
I don't know why you can't just directly have the ADC input read it
as is and do the math in code ?

The ADC most likely won't produce the exact square wave result but
simply round it a bit how ever, all you're looking for is a change in
amplitude from high to low/ low to high and just measure the Pk-PK
values in code..

I did this a few years ago experimenting with a AM+FM type carrier
protocol to pass information over short wave using a simple PIC with a
ADC on board. The problem I ran into was some of the receivers in use
didn't have a slow enough AGC if I extended amplitude change for too
long. So a sync signal had to be applied with full amplitude with
short frames.. Much like Analog Video..

Jamie.
 
H

Hammy

Jan 1, 1970
0
Depends on whether he wants the average current or the true RMS.
That depends on the details of his load.

Its for a programable load I built. I want to add the ability to
measure the current pulse. The pulse is square and can between 10mV to
500mV. The maximum frequency is 100kHz, minimum duty cycle is 10%. So
a 1uS pulse width is the worst case.

By takeing the average current I can calculate the power dissapeted in
the pass FET's.
 
H

Hammy

Jan 1, 1970
0
@g18g2000yqk.googlegroups.co
m:
But, what do you want to measure? Pulse height? Width? Shape?
Spacing?
Duty cycle? Timing jitter?

It will be a square wave on a DC offset that can vary from 10 to 60%
Vmax where Vmax is 500mV. The voltage signal is from a current
shunt.I want the average so power dissapation can be calculated and
displayed.
It's a known square wave, 'rms' is not any more informative than
any other averaging scheme. What use is it to 'do the math'?

An op amp and diode set up to do a 'peak hold' into a voltmeter is
... simpler.
I've done some more research and the typical way to do it seems to
be sample over a period and take the average of the ADC. But hey if
you know of a simplier way to do it I'm all ears.

The way I was thinking of doing it was start sampling at the start
of one period and stop at the end "do the math" to figure the
average.

Its for an adjustable load I built for testing power supplies just
another little feature I thought I would add. Its simple to
calculate the power for DC I just sense the input voltage (scaled)
using the PICS ADC and sense the current and voila I can display
current voltage and power. I'm also displaying heatsink or case temp
of the FETS. I want to do the same thing when I test PSU's with a
load step.

I'm still looking into it.;-)
 
H

Hammy

Jan 1, 1970
0
[email protected]
m:
Dissipation meaning heat generation? If that is the case, is it
the dissipation in the shunt resistor, or in a load resistor, or
in a possibly nonlinear item (transistor or diode or somesuch)?

It is mosfets that I'm mesuring the power in.
You cannot measure power with only a current measurement,
it takes both current and voltage to compute the work being done.
In all cases, current-versus-time and voltage-versus-time
determinations
WILL suffice. Only in a few special cases will 'average' current
be useful.

Huh did you read my whole post? I'm sensing the input voltage its
for a programable electronic load 300W countnous to 600W peak.
A current shunt could as easily measure current into a battery
for charging, or a motor... the flow of energy is all you can
measure, not the heat generation in any completely unknown load.

The load is 6 mosfets. The voltage across the FETs is the input
voltage minus the shunt voltage. So P=(Vin - Vshunt)* Iavg.
So, this is a periodic repeating signal... and if you control the
duty cycle
the complete information in the shunt output is contained in its
minimum and maximum voltages during a cycle. A quad op amp
and some diodes and capacitors makes a peak-hold and
negative-peak- hold
circuit, you can read out steady voltages at leisure.
Yep your right that is an option I never thought of.
 
H

Hammy

Jan 1, 1970
0
[snip]
Huh did you read my whole post? I'm sensing the input voltage its
for a programable electronic load 300W countnous to 600W peak.


The load is 6 mosfets. The voltage across the FETs is the input
voltage minus the shunt voltage. So P=(Vin - Vshunt)* Iavg.

Actually P= Vin * I avg. I would want to display the power the PSU
under test is delivering.

[snip]
 
Top