DSPRelated.com
Forums

Line-to-Line Sensing: Analog Vs Digital?

Started by Randy Yates May 8, 2011
On May 9, 5:41=A0am, Randy Yates <ya...@ieee.org> wrote:
> On 05/08/2011 11:33 PM, Jerry Avins wrote: > > > > > > > > > > > On May 8, 8:34 pm, Randy Yates<ya...@ieee.org> =A0wrote: > >> Hello comp.dsp > > >> My current client has a requirement to obtain the the line-line > >> voltages of a three-phase power source inside a DSP given the > >> line-neutral inputs. He's thinking of doing it in the analog domain > >> using opamps to do the differencing, and feeding the resulting > >> line-line into the ADC (we're using the 2809, BTW). > > >> Further, there are at least two opamp architectures under consideratio=
n.
> >> One is the standard difference amplifier between each of A-B, A-C, and=
B-C.
> >> The other uses just three opamps to determine A-B and B-C, then relies=
on the
> >> fact that A-C can be derived from those two. > > >> The other alternative is to just input the line-neutral voltages direc=
tly
> >> (after appropriate voltage dividers) into the ADC. > > >> I'd be curious to learn what folks here think the "best" method would =
be
> >> given considerations of 1) noise, and 2) common-mode (the 3-phase cent=
er
> >> isn't necessarily the same as the ADC / opamp circuit ground). > > > Draw the phasor diagrams and you will see that knowledge of phase is > > critical. Phase is implicit with independent ADCs making simultaneous > > measurements. Assunptions about phase symmetry are useless. If they > > held, a single line-to-neutral RMS or peak amplitude would suffice. > > I agree. How is this relevent?
You can't get good "simultaneous" measurements with a single ADC. There's more spread than just the sampling time; you need to wait for the MUX to settle. In my limited experience (two instruments) we found it necessary (and had the time) to use RMS readings computed over a full cycle. I don't know what you plan to do, but it needs to be carefully thought through. Good luck. Jerry -- Engineering is the art of making what you want from things you can get.
On May 9, 8:37=A0am, Jerry Avins <j...@ieee.org> wrote:
> On May 9, 5:41=A0am, Randy Yates <ya...@ieee.org> wrote: > > > > > > > > > > > On 05/08/2011 11:33 PM, Jerry Avins wrote: > > > > On May 8, 8:34 pm, Randy Yates<ya...@ieee.org> =A0wrote: > > >> Hello comp.dsp > > > >> My current client has a requirement to obtain the the line-line > > >> voltages of a three-phase power source inside a DSP given the > > >> line-neutral inputs. He's thinking of doing it in the analog domain > > >> using opamps to do the differencing, and feeding the resulting > > >> line-line into the ADC (we're using the 2809, BTW). > > > >> Further, there are at least two opamp architectures under considerat=
ion.
> > >> One is the standard difference amplifier between each of A-B, A-C, a=
nd B-C.
> > >> The other uses just three opamps to determine A-B and B-C, then reli=
es on the
> > >> fact that A-C can be derived from those two. > > > >> The other alternative is to just input the line-neutral voltages dir=
ectly
> > >> (after appropriate voltage dividers) into the ADC. > > > >> I'd be curious to learn what folks here think the "best" method woul=
d be
> > >> given considerations of 1) noise, and 2) common-mode (the 3-phase ce=
nter
> > >> isn't necessarily the same as the ADC / opamp circuit ground). > > > > Draw the phasor diagrams and you will see that knowledge of phase is > > > critical. Phase is implicit with independent ADCs making simultaneous > > > measurements. Assunptions about phase symmetry are useless. If they > > > held, a single line-to-neutral RMS or peak amplitude would suffice. > > > I agree. How is this relevent? > > You can't get good "simultaneous" measurements with a single ADC. > There's more spread than just the sampling time; you need to wait for > the MUX to settle. In my limited experience (two instruments) we found > it necessary (and had the time) to use RMS readings computed over a > full cycle. > > I don't know what you plan to do, but it needs to be carefully thought > through. Good luck.
Ahh, I neglected to explain the situation properly. Using the 2809, you can do two samples simultaneously. (but not three) What they're currently doing is sampling the following simultaneously: A C B C C A So essentially they are able to do simultaneous sampling. (The time difference between sample pairs is 40 nanoseconds). Thanks Jerry! --Randy
> > Jerry > -- > Engineering is the art of making what you want from things you can get.
I'm sorry if this is too basic and too redundant but just in case 
there's just one worthwhile nugget:

As I read the data sheet for the 2809 (for the first time), I get this:

- 12.5 MHz sample rate max.
- Dual S/H units which implies simultaneous samples but I couldn't 
confirm that....
- Input MUX but I couldn't confirm a switching time so apparently it 
will switch fast enough to switch channels between samples at 12/5MHz?
- and, I couldn't see where the S/H inputs were simultaneous +/- x nsec.
- Single-ended inputs ref to analog ground.

Because the inputs are single-ended anyway then you'll be measuring each 
wire relative to analog ground and no other.  And, you'll be computing 
the wire-wire differences (as needed) post-ADC.

So, if one were to sample at the max rate, one could grab one pair of 
wires every 80nsec.  Is that right?

I'd be tempted to start with the idea of sampling wire pairs this way. 
So, for wires A,B,C,N:
Sample A and B simultaneously and then sample C and N simultaneously.
for a total sampling time frame of 160 nsec and a maximum phase 
difference of 80 nsec between any two wire samples (if you don't care 
which one is first).
This results in a worst-case phase difference of 0.0001728 degrees at 
60Hz between sequential samples.

You can decimate the samples to beat heck after grabbing the bunch of 4. 
  Or, you might just grab bunches of 4 as above and then wait 10usec if 
you're sure about the 100kHz you've chosen.

If these assumptions are correct, then I think that the small delay is 
negligible because I doubt you have a 6Mhz analog bandwidth to begin 
with.  Heck, you've already decided that 100kHz sample rate is good 
enough, right?  So this is at least 10X better than that - but it does 
deal with the phase differences and not just the bandwidth.

If this works *in principle* then maybe something better comes out by 
taking fewer samples or samples spaced further apart for some practical 
implementation reason that isn't immediately obvious to me.

I hope this helps .. even a little.

Fred





>On May 9, 5:41=A0am, Randy Yates <ya...@ieee.org> wrote: >> On 05/08/2011 11:33 PM, Jerry Avins wrote: >> >> >> >> >> >> >> >> >> >> > On May 8, 8:34 pm, Randy Yates<ya...@ieee.org> =A0wrote: >> >> Hello comp.dsp >> >> >> My current client has a requirement to obtain the the line-line >> >> voltages of a three-phase power source inside a DSP given the >> >> line-neutral inputs. He's thinking of doing it in the analog domain >> >> using opamps to do the differencing, and feeding the resulting >> >> line-line into the ADC (we're using the 2809, BTW). >> >> >> Further, there are at least two opamp architectures under
consideratio=
>n. >> >> One is the standard difference amplifier between each of A-B, A-C,
and=
> B-C. >> >> The other uses just three opamps to determine A-B and B-C, then
relies=
> on the >> >> fact that A-C can be derived from those two. >> >> >> The other alternative is to just input the line-neutral voltages
direc=
>tly >> >> (after appropriate voltage dividers) into the ADC. >> >> >> I'd be curious to learn what folks here think the "best" method would
=
>be >> >> given considerations of 1) noise, and 2) common-mode (the 3-phase
cent=
>er >> >> isn't necessarily the same as the ADC / opamp circuit ground). >> >> > Draw the phasor diagrams and you will see that knowledge of phase is >> > critical. Phase is implicit with independent ADCs making simultaneous >> > measurements. Assunptions about phase symmetry are useless. If they >> > held, a single line-to-neutral RMS or peak amplitude would suffice. >> >> I agree. How is this relevent? > >You can't get good "simultaneous" measurements with a single ADC. >There's more spread than just the sampling time; you need to wait for >the MUX to settle. In my limited experience (two instruments) we found >it necessary (and had the time) to use RMS readings computed over a >full cycle.
As stated earlier, you can get simultaneous measurements with the single ADC in the C2000 devices. They have a pair of sample of holds for that very purpose.
>I don't know what you plan to do, but it needs to be carefully thought >through. Good luck. > >Jerry
Steve
On 05/08/2011 05:34 PM, Randy Yates wrote:
> Hello comp.dsp > > My current client has a requirement to obtain the the line-line > voltages of a three-phase power source inside a DSP given the > line-neutral inputs. He's thinking of doing it in the analog domain > using opamps to do the differencing, and feeding the resulting > line-line into the ADC (we're using the 2809, BTW). > > Further, there are at least two opamp architectures under consideration. > One is the standard difference amplifier between each of A-B, A-C, and B-C. > The other uses just three opamps to determine A-B and B-C, then relies > on the > fact that A-C can be derived from those two. > > The other alternative is to just input the line-neutral voltages directly > (after appropriate voltage dividers) into the ADC. > > I'd be curious to learn what folks here think the "best" method would be > given considerations of 1) noise, and 2) common-mode (the 3-phase center > isn't necessarily the same as the ADC / opamp circuit ground).
This is actually a good question for a circuits group. The pertinent trade-off is between whether you should invest your resources in software vs. hardware. My inclination in cases like this is to put the least amount of analog hardware in the chain that I can. Difference amplifiers, in particular, need to be carefully (read: expensive) implemented if you want to avoid problems with common-mode gain messing up your difference. Some of these issues (most notably channel to channel gain matching) still exists if you measure your channels independently and then do the work in software. But I still feel that simplifying the stuff that's hard to change, and putting the complexity in the stuff that's good at dealing with complexity is the way to go -- and it's really hard to change the basic architecture of an analog circuit with a download. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On 05/09/2011 02:27 PM, Tim Wescott wrote:
> On 05/08/2011 05:34 PM, Randy Yates wrote: >> Hello comp.dsp >> >> My current client has a requirement to obtain the the line-line >> voltages of a three-phase power source inside a DSP given the >> line-neutral inputs. He's thinking of doing it in the analog domain >> using opamps to do the differencing, and feeding the resulting >> line-line into the ADC (we're using the 2809, BTW). >> >> Further, there are at least two opamp architectures under consideration. >> One is the standard difference amplifier between each of A-B, A-C, and B-C. >> The other uses just three opamps to determine A-B and B-C, then relies >> on the >> fact that A-C can be derived from those two. >> >> The other alternative is to just input the line-neutral voltages directly >> (after appropriate voltage dividers) into the ADC. >> >> I'd be curious to learn what folks here think the "best" method would be >> given considerations of 1) noise, and 2) common-mode (the 3-phase center >> isn't necessarily the same as the ADC / opamp circuit ground). > > This is actually a good question for a circuits group. The pertinent trade-off is between whether you should invest your resources > in software vs. hardware. > > My inclination in cases like this is to put the least amount of analog hardware in the chain that I can. Difference amplifiers, in > particular, need to be carefully (read: expensive) implemented if you want to avoid problems with common-mode gain messing up your > difference. Some of these issues (most notably channel to channel gain matching) still exists if you measure your channels > independently and then do the work in software. But I still feel that simplifying the stuff that's hard to change, and putting the > complexity in the stuff that's good at dealing with complexity is the way to go -- and it's really hard to change the basic > architecture of an analog circuit with a download.
I like your reasoning, Tim. Thanks for the input. -- Randy Yates % "Watching all the days go by... Digital Signal Labs % Who are you and who am I?" mailto://yates@ieee.org % 'Mission (A World Record)', http://www.digitalsignallabs.com % *A New World Record*, ELO
On 05/09/2011 12:15 PM, Fred Marshall wrote:
> I'm sorry if this is too basic and too redundant but just in case there's just one worthwhile nugget: > > As I read the data sheet for the 2809 (for the first time), I get this: > > - 12.5 MHz sample rate max. > - Dual S/H units which implies simultaneous samples but I couldn't confirm that.... > - Input MUX but I couldn't confirm a switching time so apparently it will switch fast enough to switch channels between samples at > 12/5MHz? > - and, I couldn't see where the S/H inputs were simultaneous +/- x nsec. > - Single-ended inputs ref to analog ground. > > Because the inputs are single-ended anyway then you'll be measuring each wire relative to analog ground and no other. And, you'll be > computing the wire-wire differences (as needed) post-ADC.
Well, that is the question: is inputting the single-ended (line-neutral) phases to the ADC and computing the line-line differences in the digital domain better than performing the line-line differences in analog and inputting the result to the DSP?
> So, if one were to sample at the max rate, one could grab one pair of wires every 80nsec. Is that right?
I think so...
> > I'd be tempted to start with the idea of sampling wire pairs this way. So, for wires A,B,C,N: > Sample A and B simultaneously and then sample C and N simultaneously. > for a total sampling time frame of 160 nsec and a maximum phase difference of 80 nsec between any two wire samples (if you don't > care which one is first). > This results in a worst-case phase difference of 0.0001728 degrees at 60Hz between sequential samples.
That's pretty much what we're doing now, only there is no need for sampling N (that I can see), since it drops out.
> You can decimate the samples to beat heck after grabbing the bunch of 4. Or, you might just grab bunches of 4 as above and then wait > 10usec if you're sure about the 100kHz you've chosen. > > If these assumptions are correct, then I think that the small delay is negligible because I doubt you have a 6Mhz analog bandwidth > to begin with. Heck, you've already decided that 100kHz sample rate is good enough, right? So this is at least 10X better than that > - but it does deal with the phase differences and not just the bandwidth. > > If this works *in principle* then maybe something better comes out by taking fewer samples or samples spaced further apart for some > practical implementation reason that isn't immediately obvious to me. > > I hope this helps .. even a little.
Well, it helps to re-examine why the current scheme is acceptable (re: phase differences). Thanks for responding Fred. -- Randy Yates % "Watching all the days go by... Digital Signal Labs % Who are you and who am I?" mailto://yates@ieee.org % 'Mission (A World Record)', http://www.digitalsignallabs.com % *A New World Record*, ELO
On 05/09/2011 12:15 PM, Fred Marshall wrote:
> I'm sorry if this is too basic and too redundant but just in case there's just one worthwhile nugget: > > As I read the data sheet for the 2809 (for the first time), I get this: > > - 12.5 MHz sample rate max. > - Dual S/H units which implies simultaneous samples but I couldn't confirm that.... > - Input MUX but I couldn't confirm a switching time so apparently it will switch fast enough to switch channels between samples at > 12/5MHz? > - and, I couldn't see where the S/H inputs were simultaneous +/- x nsec. > - Single-ended inputs ref to analog ground. > > Because the inputs are single-ended anyway then you'll be measuring each wire relative to analog ground and no other. And, you'll be > computing the wire-wire differences (as needed) post-ADC. > > So, if one were to sample at the max rate, one could grab one pair of wires every 80nsec. Is that right? > > I'd be tempted to start with the idea of sampling wire pairs this way. So, for wires A,B,C,N: > Sample A and B simultaneously and then sample C and N simultaneously. > for a total sampling time frame of 160 nsec and a maximum phase difference of 80 nsec between any two wire samples (if you don't > care which one is first). > This results in a worst-case phase difference of 0.0001728 degrees at 60Hz between sequential samples. > > You can decimate the samples to beat heck after grabbing the bunch of 4. Or, you might just grab bunches of 4 as above and then wait > 10usec if you're sure about the 100kHz you've chosen. > > If these assumptions are correct, then I think that the small delay is negligible because I doubt you have a 6Mhz analog bandwidth > to begin with. Heck, you've already decided that 100kHz sample rate is good enough, right? So this is at least 10X better than that > - but it does deal with the phase differences and not just the bandwidth. > > If this works *in principle* then maybe something better comes out by taking fewer samples or samples spaced further apart for some > practical implementation reason that isn't immediately obvious to me. > > I hope this helps .. even a little. > > Fred > > > > >
-- Randy Yates % "Watching all the days go by... Digital Signal Labs % Who are you and who am I?" mailto://yates@ieee.org % 'Mission (A World Record)', http://www.digitalsignallabs.com % *A New World Record*, ELO
On 5/14/2011 4:45 PM, Randy Yates wrote:

> > That's pretty much what we're doing now, only there is no need for > sampling N (that I can see), since it > drops out.
Randy, I think that Tim, Jerry and others pointed out that maybe "N" doesn't (always) drop out. It may not seem necessary but I'd suggest that it is either that or "highly recommended". That's because one doesn't always know what it's doing relative to some "ground truth". It's not a lot of overkill to do it - or is it? ... but then I don't know the end application. If sensing anomalies is part of it then I'd measure N for sure. And, to be practical, NOT measuring N may be OK for what you're doing. e.g. I'm thinking if you don't have the connection set up and it's a large hassle to add it. If you do measure N then you can always look at it. And, you can compare A-N to A. If the result is boring then that's a good sign that everyone "understands" what's going on, eh? But what if it isn't? So, that's a conservative engineering approach. Then, I would add: "better is the enemy of good enough". :-) Fred
On 05/15/2011 12:44 PM, Fred Marshall wrote:
> On 5/14/2011 4:45 PM, Randy Yates wrote: > >> >> That's pretty much what we're doing now, only there is no need for >> sampling N (that I can see), since it >> drops out. > > > Randy, > > I think that Tim, Jerry and others pointed out that maybe "N" doesn't (always) drop out.
They may have stated or intimated it, but I don't see why. I've done a pencil and paper analysis of the scenario Rune proposed (re: the insulation coming off one of the phases and a resulting connection to ground) and I don't see a problem in that scenario with deriving the last L-L from the first two L-Ls. (Whether current is flowing through the ground-to-neutral impedance or not, the voltage of neutral w/r/t ground falls out when you do A-B and B-C (or whatever).) Moreover I've dispelled an assertion by Clay Turner on the phone in which he stated there was a problem.
> It may not seem necessary but I'd suggest that it is either that or > "highly recommended".
If it isn't necessary, then why do it? Don't misread me: I do appreciate everyone's input, but I am not willing to attempt to prove others' assertions, even if they may be right. The time required to do so is too extreme, and there is too great of a risk of throwing my time away since there seems to be a lot of confusion and misunderstanding. If someone is asserting that there is a problem, they ought to be able to explain (_precisely_) why.
> If you do measure N then you can always look at it. And, you can > compare A-N to A. If the result is boring then that's a good sign > that everyone "understands" what's going on, eh? But what if it > isn't?
Whoa!!! A-N to A? No, no no no!! We'd be comparing [(A-N) - (B-N)] to (A-B)!. -- Randy Yates % "Watching all the days go by... Digital Signal Labs % Who are you and who am I?" mailto://yates@ieee.org % 'Mission (A World Record)', http://www.digitalsignallabs.com % *A New World Record*, ELO