From: Tim Wescott on
On 08/02/2010 07:24 AM, john1987 wrote:
> Hi,
> I think my question got buried in the discussion so I am putting my
> question out there again. Please be patient.
>
> I am attaching two new drawings to show what I want. I do not know
> about accuracy but i would as say as much as accurate as possible.
>
>
> First link is as follows
> http://img828.imageshack.us/i/scan0001j.jpg/
>
>
> Second link is as follows
>
>
> http://img299.imageshack.us/i/scan0002db.jpg/
>
>
> I want to sample the peak value of the sine wave by using ADC
> (sampling rate 200ksps). I want to sample the peak value of the sine
> wave at the rising edge or the falling edge of the square wave that
> you can see in the diagram. The edges will trigger the ADC and ADC
> will sample that edge. The ADC can not sample the negative values as
> shown in the diagram. I did not mention the circuitry that can add
> offset to the input signal and make it all positive.
>
>
> The questions are
>
>
> 1. Is there any way other than RC circuit to get the peak sample of
> the sine wave at the rising and falling edge?

Tons of them, but most are more complicated. Why don't you want to use
an RC circuit? If it's complication, you're barking up the wrong tree.

> 2. Whats the difference between in this case between using the High
> pass and low pass filter?

A low-pass filter will have a much less noisy output, but will really
only find the peak for a repetitive sine wave over a narrow frequency
range. A high-pass filter will, in theory, find the peak perfectly
every time. In reality it'll be very noise sensitive and may well find
lots and lots of "peaks" that you're not interested.

> 3. How a PLL can help in this case?

_If_ you're trying to sample the peaks of a repetitive wave at steady
frequency, and _if_ it is symmetrical about the peaks, then a PLL will
average out tons of noise. It satisfies the exceedingly vague "no RC
circuit" requirement, but since you've never (that I've seen) elaborated
on _why_ you don't want an RC circuit I have no idea if it'd be better
or worse.

> 4. Any advice about choosing the right ADC?

You have given absolutely positively not enough information. I'd
suggest starting another thread for that.

> 5. I tested the suggested high pass filter using the 220pF and
> 7.6kOhm
> resistor and found that the edge is occuring at the right spot in
> pspice than the low pass filter.

Add in a noise source, and see how you like it.


--

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
From: John Larkin on
On Mon, 2 Aug 2010 07:24:24 -0700 (PDT), john1987
<conphiloso(a)hotmail.com> wrote:

>Hi,
>I think my question got buried in the discussion so I am putting my
>question out there again. Please be patient.
>
>I am attaching two new drawings to show what I want. I do not know
>about accuracy but i would as say as much as accurate as possible.
>
>
>First link is as follows
>http://img828.imageshack.us/i/scan0001j.jpg/
>
>
>Second link is as follows
>
>
>http://img299.imageshack.us/i/scan0002db.jpg/
>
>
>I want to sample the peak value of the sine wave by using ADC
>(sampling rate 200ksps). I want to sample the peak value of the sine
>wave at the rising edge or the falling edge of the square wave that
>you can see in the diagram. The edges will trigger the ADC and ADC
>will sample that edge. The ADC can not sample the negative values as
>shown in the diagram. I did not mention the circuitry that can add
>offset to the input signal and make it all positive.
>
>
>The questions are
>
>
>1. Is there any way other than RC circuit to get the peak sample of
>the sine wave at the rising and falling edge?
>2. Whats the difference between in this case between using the High
>pass and low pass filter?
>3. How a PLL can help in this case?
>4. Any advice about choosing the right ADC?
>5. I tested the suggested high pass filter using the 220pF and
>7.6kOhm
>resistor and found that the edge is occuring at the right spot in
>pspice than the low pass filter.
>
>
>Thanks
>John
>


If, as I think, you are generating the sine wave, why do you need to
derive its peak time from the signal itself?

And if, as I think, you are intending to make an RLC meter, why do you
want to measure the peak?

John

From: john1987 on
On Aug 2, 11:49 am, John Larkin
<jjlar...(a)highNOTlandTHIStechnologyPART.com> wrote:
> On Mon, 2 Aug 2010 07:24:24 -0700 (PDT), john1987
>
>
>
>
>
> <conphil...(a)hotmail.com> wrote:
> >Hi,
> >I think my question got buried in the discussion so I am putting my
> >question out there again.  Please be patient.
>
> >I am attaching two new drawings to show what I want. I do not know
> >about accuracy but i would as say as much as accurate as possible.
>
> >First link is as follows
> >http://img828.imageshack.us/i/scan0001j.jpg/
>
> >Second link is as follows
>
> >http://img299.imageshack.us/i/scan0002db.jpg/
>
> >I want to sample the peak value of the sine wave by using ADC
> >(sampling rate 200ksps). I want to sample the peak value of the sine
> >wave at the rising edge or the falling edge of the square wave that
> >you can see in the diagram. The edges will trigger the ADC and ADC
> >will sample that edge. The ADC can not sample the negative values as
> >shown in the diagram. I did not mention the circuitry that can add
> >offset to the input signal and make it all positive.
>
> >The questions are
>
> >1. Is there any way other than RC circuit to get the peak sample of
> >the sine wave at the rising and falling edge?
> >2. Whats the difference between in this case between using the High
> >pass and low pass filter?
> >3. How a PLL can help in this case?
> >4. Any advice about choosing the right ADC?
> >5. I tested the suggested high pass filter using the 220pF and
> >7.6kOhm
> >resistor and found that the edge is occuring at the right spot in
> >pspice than the low pass filter.
>
> >Thanks
> >John
>
> If, as I think, you are generating the sine wave, why do you need to
> derive its peak time from the signal itself?
>
> And if, as I think, you are intending to make an RLC meter, why do you
> want to measure the peak?
>
> John- Hide quoted text -
>
> - Show quoted text -

Hi,

I want to measure the peak because I want to control the peak to peak
sine wave amplitde using PWM. So, if the peak changes the micro will
use the PWM to control the voltage and keep it stable at the peak that
I mention in the diagram.

John
From: john1987 on
On Aug 2, 11:44 am, Tim Wescott <t...(a)seemywebsite.com> wrote:
> On 08/02/2010 07:24 AM, john1987 wrote:
>
>
>
>
>
> > Hi,
> > I think my question got buried in the discussion so I am putting my
> > question out there again.  Please be patient.
>
> > I am attaching two new drawings to show what I want. I do not know
> > about accuracy but i would as say as much as accurate as possible.
>
> > First link is as follows
> >http://img828.imageshack.us/i/scan0001j.jpg/
>
> > Second link is as follows
>
> >http://img299.imageshack.us/i/scan0002db.jpg/
>
> > I want to sample the peak value of the sine wave by using ADC
> > (sampling rate 200ksps). I want to sample the peak value of the sine
> > wave at the rising edge or the falling edge of the square wave that
> > you can see in the diagram. The edges will trigger the ADC and ADC
> > will sample that edge. The ADC can not sample the negative values as
> > shown in the diagram. I did not mention the circuitry that can add
> > offset to the input signal and make it all positive.
>
> > The questions are
>
> > 1. Is there any way other than RC circuit to get the peak sample of
> > the sine wave at the rising and falling edge?
>
> Tons of them, but most are more complicated.  Why don't you want to use
> an RC circuit?  If it's complication, you're barking up the wrong tree.
>
> > 2. Whats the difference between in this case between using the High
> > pass and low pass filter?
>
> A low-pass filter will have a much less noisy output, but will really
> only find the peak for a repetitive sine wave over a narrow frequency
> range.  A high-pass filter will, in theory, find the peak perfectly
> every time.  In reality it'll be very noise sensitive and may well find
> lots and lots of "peaks" that you're not interested.
>
> > 3. How a PLL can help in this case?
>
> _If_ you're trying to sample the peaks of a repetitive wave at steady
> frequency, and _if_ it is symmetrical about the peaks, then a PLL will
> average out tons of noise.  It satisfies the exceedingly vague "no RC
> circuit" requirement, but since you've never (that I've seen) elaborated
> on _why_ you don't want an RC circuit I have no idea if it'd be better
> or worse.
>
> > 4. Any advice about choosing the right ADC?
>
> You have given absolutely positively not enough information.  I'd
> suggest starting another thread for that.
>
> > 5. I tested the suggested high pass filter using the 220pF and
> > 7.6kOhm
> > resistor and found that the edge is occuring at the right spot in
> > pspice than the low pass filter.
>
> Add in a noise source, and see how you like it.
>
> --
>
> Tim Wescott
> Wescott Design Serviceshttp://www.wescottdesign.com
>
> Do you need to implement control loops in software?
> "Applied Control Theory for Embedded Systems" was written for you.
> See details athttp://www.wescottdesign.com/actfes/actfes.html- Hide quoted text -
>
> - Show quoted text -

hi,

what info you need to advice regarding choosing the ADC. I have
following info.,

1. peak to peak voltage 2volts.
2. frequency 100khz
3 monotonic sine wave.

Please let me know

Thanks
John
From: Michael Kellett on

"john1987" <conphiloso(a)hotmail.com> wrote in message
news:0d127c25-1f4e-4912-8547-524f47eb4fa0(a)u31g2000pru.googlegroups.com...

> I want to measure the peak because I want to control the peak to peak
> sine wave amplitde using PWM. So, if the peak changes the micro will
> use the PWM to control the voltage and keep it stable at the peak that
> I mention in the diagram.

> John

Now it gets easy - if you are generating the sine wave from some PWM thing
then you can arrange to sample synchronously at at least three times the
sine wave frequency.
Since it is a sine wave the average, RMS and peak are all related so if you
know one then you know all the others. To get the RMS just square, sum and
take the square root of the three or more samples. If you just want to
control the peak amplitude you can control the sum of the squares of the
samples. So long as your samples are equally spaced (in time), the same
number per sine wave cycle and at least three samples per cycle it doesn't
matter where in the sine wave you sample.

Michael Kellett