Questions on interfacing to current sense transformer

On Jun 26, 7:42=A0pm, John Larkin wrote: [....]

[....]

You can improve things a little if you sample V then A or A then V depending on how you see the phase shifts stack up in your design. The two errors can be made to cancel slightly.

Make your sample rate such that "1024" samples is an integer number of cycles of the 60Hz.

Also try to make it so that this integer is odd. This means that in different cycles you samples land at different points. This removes some of the errors.

Assuming you don't want to keep lots of values around:

Since you are already computing the average, subtract the previously computed average from each value before doing the square but also remember the average of the numbers you are squaring. The previous average may be off a little but it is close enough that the some of squares is kept from growing way too many bits.

The corrected mean square is the mean square minus the square of the mean. The mean in this case is the mean of what you actually squared.

Doing square roots can be a bit tricky and slow in smallish processors. You have a few things working for you. If you are doing:

while not good enough Y =3D 0.5 * (Y + X/Y)

you can start off with the Y value from last time you did the sqrt. This is likely to be close to the right answer so you loop less.

There are methods that compute 1/sqrt(X) that don't divide inside the loop.

There are methods that work from the observation that the sum of the first N odd numbers is always N^2. This in practice is faster than methods involving multiplies or divides on machines that don't natively do those operations.

Since your voltage is nearly a sinewave, you can make a 90 degree phase shifter in software so that you can compute and estimate of the imaginary part of the power. This number can be handy if you want to display the phase angle.

If you have the imaginary part, you have the sign.

arctan is a very nasty function to compute when you are moderately far from zero. A table look up may be the best for this step.

Reply to
MooseFET
Loading thread data ...

On Jun 26, 9:18=A0pm, John Larkin [....]

You can do both. Average over lets say one cycle of the 60Hz and then make your "analog" filter. This way your filter has a more constant input since all of the 60Hz harmonics are gone before you get to it.

[...]

Watch how the noise you add and the sampling of the ADC alias. You don't want the aliased thing to correlate to the mains frequency either

Reply to
MooseFET

Right. And make the number of cycles relatively prime to 1024, so you get all phase angles (every 0.3515 degrees) every pass.

It's also good to have the first N harmonics of the sample rate land far away from all M harmonics of the line frequency. That avoids aliasing line harmonics into cosmetically ugly measurement ripples.

That's easy if the sample rate is high, which modern uPs can usually do. The best-selling meter I did handled 16 CT inputs using an MC6803 (8 bits, nmos) clocked at 2 MHz! Having an AVR-type chip is a real luxury.

Yes, if you can afford to derive the cosine voltage samples accurately.

The next meter we do, we'll do the heavier parts of the math in an FPGA. Things like allpass networks and Hilberts and DDS-based PLLs are neat.

Yes!

John

Reply to
John Larkin

I saw that the language of this thread got unpleasant right around this post, and I did not mean to be a part of that, or to challenge anyone. I agree, real power is the most important, and I can tell you now, I'm not going to take special steps to switch my implementation to something that can conserve DC, because it increases the hassle factor immensely.

It just so happens that I work for a utility, and though I don't work in any engineering capacity, I know something about the rate design. Indeed, for some large customers on certain rates there is indeed a rate adjustment for power factor -- but that's of no concern at all in this household tinkerer application.

I believe you.

-- dave j

Reply to
David Jacobowitz

I was thinking I'd do this, too. It's just makes sense to have some basic filtering on these signals.

Also, though I've been warned of phase error on the voltage transformer, I think this will be constant (after all, the loading on the transformer won't be varying), and so can be calibrated out using a known resistive load.

-- dave j

Reply to
David Jacobowitz

Current transformers, especially ones made of cheap silicon steel, are the real bad guys. Their phase error is seriously nonlinear on current, bad enough to fail the ANSI meter accuracy test if uncorrected.

John

Reply to
John Larkin

"David Jacobowitz"

Also, though I've been warned of phase error on the voltage transformer, I think this will be constant (after all, the loading on the transformer won't be varying), and so can be calibrated out using a known resistive load.

** Fraid that is wrong.

The error ( assuming small E-core and no load) will be mostly in the zero crossing time - cos this coincides with maxima in the magnetising current.

.... Phil

Reply to
Phil Allison

There's no power at the zero crossing time, so it doesn't matter.

But it's easier to pick off the line voltage with resistors anyhow.

John

Reply to
John Larkin

"John Larkin" "Phil Allison"

** Matters to the OP, s*****ad - cos he wants to read load phase angle.
** But no way to do that with safety isolation.

....... Phil

Reply to
Phil Allison

Geez, 100,000 channels of metering delivered, and *now* you tell me.

John

Reply to
John Larkin

That is bass-akwards. To get true power multiply (same time) current times voltage, average, then square root. =46or kVA take absolute value, average, then multiply.

And there are ways to compute them that does not lose that information.

Maybe, that trades a lot of compute power for the price difference of a slightly better ADC.

Reply to
JosephKK

P = E*I, not sqrt(E*I)

Try this: keep E constant and double I. Does the power go up by 2, or by 1.414?

That's wrong too.

Think first, post afterwards.

Sure, but they are more compute intensive.

Lots of sub-dollar uP's have built-in 8 to 10 bit ADCs. They can do revenue-quality metring with a bit of care. Buy a 16-bit ADC if the cost doesn't matter.

As I've noted, I did a 16-channel power meter this way with a 6803 processor, under 1% of the compute power of a modern Coldfire or an Arm. Used home-made 7-bit single-slope ADCs. Software is free in production.

John

Reply to
John Larkin

How can that be? Surely, a smaller burden resistor, or three windings and an op amp in pseudoground input mode, will keep the core of a current sense transformer as close as desired to zero magnetization...

Reply to
whit3rd

Absolutely. When I was in power supply biz at GenRad, I ran them into virtual grounds with a DC restore loop. Made for tiny transformers _and_ accuracy.

...Jim Thompson

--
| James E.Thompson, P.E.                           |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
Gourmet Puzzles:

        What part of the fish are the "sticks"?

        Likewise where are the chicken "fingers" located?
Reply to
Jim Thompson

They still have copper resistance. Permeability drops at low currents, like 1 or 2 amps for a 100A CT, and phase shift goes up. Electric meters have to be accurate over a very wide dynamic range.

Active feedback will of course make a CT super accurate, but the cost of the whole rig goes way up... a couple of hundred ampere-turns is hard to come by. Ditto using a really good core, like tape-wound permalloy or metglas. The usual path is to buy cheap CTs, characterize them, and do a firmware kluge to trim the phase shift as a function of average current. The phase trim can be done by delaying some samples

90 degrees and squirting a calibrated amount into the new samples, with the amount being a function of the average current according to some curve. A little firmware can save a lot of cost on iron.

Pearson makes some wonderful CTs, but they're expensive.

Shunts are nice wideband current sensors.

John

Reply to
John Larkin

Particularly in an application that is sealed from public exposure. Who needs the isolation?

...Jim Thompson

--
| James E.Thompson, P.E.                           |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
Gourmet Puzzles:

        What part of the fish are the "sticks"?

        Likewise where are the chicken "fingers" located?
Reply to
Jim Thompson

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

Yeah, but they have crappy bandwidth. I mean, DC is nice, but there's no way it'll work over about 10kHz (at high amps).

Tim

--
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms
Reply to
Tim Williams

A shunt? Why not? It's just a resistor. Well, unless you do something silly.

Coaxial shunts work at nanosecond speeds. We make our own planar shunts that are PPM transient accurate at 50 KHz.

John

Reply to
John Larkin

Well, physics has that tendency to put a wrench in "ideal" models...

For instance, a 1" long hunk of nichrome, 0.01 ohms and 20W dissipation is already 30nH or so, an L/R time constant of 3us. Square current will have peaks, triangular current will be trapezoidal.

Do you happen to have a cheap source of 0.01 ohm 20W resistors with < 3nH between the kelvin terminals?

Tim

--
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms
Reply to
Tim Williams

Well, clever people work around problems.

3 us is fine for a 60 Hz power meter. But people make shunts with tau's that are three or four orders of magnitude faster than that.

The big problem with AC-measurement shunts is usually 60 Hz magnetic field pickup, not tau... there's no power in the higher harmonics.

There are techniques that fix both.

I know how to make cheap, very wideband planar shunts; we punch or photoetch them from sheet manganin. Their tau's are deep sub-microsecond. And one can always add downstream equalization if really needed. What's tricky is to add a heatsink... then the magnetics gets really weird.

Google "coaxial shunt" for the extreme - picosecond - stuff.

John

Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.