From: raza tauseef on
On Aug 2, 1:28 pm, Tim Wescott <t...(a)seemywebsite.com> wrote:
> On 08/02/2010 08:57 AM, john1987 wrote:
>
>
>
>
>
> > 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.
>
> Or, if you're doing this in a micro, just measure the sine wave at four
> arbitrary points in the waveform and calculate the mean squared value --
> that'll be a constant no matter what the phase relationship is, as long
> as it stays a nice clean sine.
>
> --
>
> 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 I understood is as follows

I do not need RC circuit to find the peak of the sine wave because I
am generating the sine wave using a PWM generating microcontroller.
So,micro will generate the sine wave and also calculate the mean
squared value but the confusion is that it will read back the sien
wave using ADC and I still do need to tell ADC when to sample and what
to sample. So, I guess I do need the peak value of the sine wave and
then again I do need the RC circuit.

John
From: Tim Wescott on
On 08/02/2010 01:09 PM, raza tauseef wrote:
> On Aug 2, 1:28 pm, Tim Wescott<t...(a)seemywebsite.com> wrote:
>> On 08/02/2010 08:57 AM, john1987 wrote:
>>
>>
>>
>>
>>
>>> 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.
>>
>> Or, if you're doing this in a micro, just measure the sine wave at four
>> arbitrary points in the waveform and calculate the mean squared value --
>> that'll be a constant no matter what the phase relationship is, as long
>> as it stays a nice clean sine.
>>
>> --
>>
>> 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 I understood is as follows
>
> I do not need RC circuit to find the peak of the sine wave because I
> am generating the sine wave using a PWM generating microcontroller.
> So,micro will generate the sine wave and also calculate the mean
> squared value but the confusion is that it will read back the sien
> wave using ADC and I still do need to tell ADC when to sample and what
> to sample. So, I guess I do need the peak value of the sine wave and
> then again I do need the RC circuit.

Find the sum

(sin(theta))^2 + (sin(theta + pi/2))^2 + (sin(theta + pi))^2 + sin(theta
- pi/2)^2.

Then tell me how that depends on theta.

_Then_ tell me that you need a phase reference to measure the amplitude
of a sine wave, with a straight face.

--

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: whit3rd on
On Aug 2, 9:57 am, Jim Thompson <To-Email-Use-The-Envelope-I...(a)On-My-
Web-Site.com> wrote:
> On Mon, 2 Aug 2010 08:57:45 -0700 (PDT), john1987

> >I want to measure the peak because I want to control the peak to peak
> >sine wave amplitde using PWM.

> Comparator with +1V reference.  Use comparator output to
> pump-up/pump-down PWM control... whatever that might be ;-)

Assume the comparator is HIGH when the input is below reference.

Just to elaborate on this, a +/- 2V signal will excite such a
comparator
to a duty cycle of 2/3, so you'd run the comparator's averaged
output voltage into the ADC and if it's over (2/3 * Vout) the PWM is
set too
low.

Another way is (assuming the CPU speed supports it) to make a timed
determination at the phase = 30 degree time, if the comparator is high
the amplitude is too low... that approach will constantly dither the
setpoint, of course, and inject jitter in the process.
From: john1987 on
On Aug 2, 4:31 pm, Tim Wescott <t...(a)seemywebsite.com> wrote:
> On 08/02/2010 01:09 PM, raza tauseef wrote:
>
>
>
>
>
> > On Aug 2, 1:28 pm, Tim Wescott<t...(a)seemywebsite.com>  wrote:
> >> On 08/02/2010 08:57 AM, john1987 wrote:
>
> >>> 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.
>
> >> Or, if you're doing this in a micro, just measure the sine wave at four
> >> arbitrary points in the waveform and calculate the mean squared value --
> >> that'll be a constant no matter what the phase relationship is, as long
> >> as it stays a nice clean sine.
>
> >> --
>
> >> 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 I understood is as follows
>
> > I do not need RC circuit to find the peak of the sine wave because I
> > am generating the sine wave using a PWM generating microcontroller.
> > So,micro will generate the sine wave and also calculate the mean
> > squared value but the confusion is that it will read back the sien
> > wave using ADC and I still do need to tell ADC when to sample and what
> > to sample. So, I guess I do need the peak value of the sine wave and
> > then again I do need the RC circuit.
>
> Find the sum
>
> (sin(theta))^2 + (sin(theta + pi/2))^2 + (sin(theta + pi))^2 + sin(theta
> - pi/2)^2.
>
> Then tell me how that depends on theta.
>
> _Then_ tell me that you need a phase reference to measure the amplitude
> of a sine wave, with a straight face.
>
> --
>
> 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 I understood is as follows

I do not need RC circuit to find the peak of the sine wave because I
am generating the sine wave using a PWM generating microcontroller.
So,micro will generate the sine wave and also calculate the mean
squared value but the confusion is that it will read back the sien
wave using ADC and I still do need to tell ADC when to sample and
what
to sample. So, I guess I do need the peak value of the sine wave and
then again I do need the RC circuit.

If you confirm that I am on the right track that it will be easier for
me to proceed.

Thanks
John


From: Tim Wescott on
On 08/03/2010 09:18 AM, john1987 wrote:
> On Aug 2, 4:31 pm, Tim Wescott<t...(a)seemywebsite.com> wrote:
>> On 08/02/2010 01:09 PM, raza tauseef wrote:
>>
>>
>>
>>
>>
>>> On Aug 2, 1:28 pm, Tim Wescott<t...(a)seemywebsite.com> wrote:
>>>> On 08/02/2010 08:57 AM, john1987 wrote:
>>
>>>>> 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.
>>
>>>> Or, if you're doing this in a micro, just measure the sine wave at four
>>>> arbitrary points in the waveform and calculate the mean squared value --
>>>> that'll be a constant no matter what the phase relationship is, as long
>>>> as it stays a nice clean sine.
>>
>>>> --
>>
>>>> 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 I understood is as follows
>>
>>> I do not need RC circuit to find the peak of the sine wave because I
>>> am generating the sine wave using a PWM generating microcontroller.
>>> So,micro will generate the sine wave and also calculate the mean
>>> squared value but the confusion is that it will read back the sien
>>> wave using ADC and I still do need to tell ADC when to sample and what
>>> to sample. So, I guess I do need the peak value of the sine wave and
>>> then again I do need the RC circuit.
>>
>> Find the sum
>>
>> (sin(theta))^2 + (sin(theta + pi/2))^2 + (sin(theta + pi))^2 + sin(theta
>> - pi/2)^2.
>>
>> Then tell me how that depends on theta.
>>
>> _Then_ tell me that you need a phase reference to measure the amplitude
>> of a sine wave, with a straight face.
>>
>> --
>>
>> 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 I understood is as follows
>
> I do not need RC circuit to find the peak of the sine wave because I
> am generating the sine wave using a PWM generating microcontroller.
> So,micro will generate the sine wave and also calculate the mean
> squared value but the confusion is that it will read back the sien
> wave using ADC and I still do need to tell ADC when to sample and
> what
> to sample. So, I guess I do need the peak value of the sine wave and
> then again I do need the RC circuit.
>
> If you confirm that I am on the right track that it will be easier for
> me to proceed.

If you compute the mean squared value then you don't have to be lined up
with the peak of the sine wave. I've told you this already, you don't
seem to want to believe it. When you reiterated your obsession with
lining your measurements to the peak of the sine wave, I gave you an
exercise that -- had you done it -- would have shown you that you don't
need to line your measurements up to the peak of the sine wave.

No one. No one at all. Ever, anywhere, can help you if you don't listen.

--

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