Searching \ for 'Any good ideas for detecting zero crossing?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=any+good+ideas+detecting
Search entire site for: 'Any good ideas for detecting zero crossing?'.

Truncated match.
PICList Thread
'Any good ideas for detecting zero crossing?'
1998\05\13@164501 by John Bellini

flavicon
face
I'm not sure, but this may already have come up on the list.  If so
please direct me to the archive and I will look there.  However, any
ideas would be great full.  

What I will be having to do is synchronize to the incoming AC.  To do
this I will have to detect RMS voltage, Detect the zero crossing,
generate the sine wave reference and then synchronize to the line.  

Any ideas on detecting the zero crossing?À  I want to do it software not
hardware.  I've already done it in hardware using 2 pins on the micro.
I want to do it with 1 pin now.

John Bellini
Product Development, Firmware Technologist

1998\05\13@165550 by Harrison Cooper

flavicon
face
               How about this....run the thing as fast as you can.
Count the number of tics between cycles, then divide in half.  Or does
the PIC detect at the 90 phase?  If I remember right, it looks at the
full cycle.  In fact, you should be able to calculate the number of tics
(knowing the clock and the frequency of the AC), and find a edge and
count the number of clocks till you get there.

                               ----------
                               From:  John Bellini
[SMTP:spam_OUTJBelliniTakeThisOuTspamSTATPOWER.COM]
                               Sent:  Wednesday, May 13, 1998 2:40 PM
                               To:  .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
                               Subject:  Any good ideas for detecting
zero crossing?

                       I'm not sure, but this may already have come up
on the list.  If so
                       please direct me to the archive and I will look
there.  However, any
                       ideas would be great full.  

                       What I will be having to do is synchronize to
the incoming AC.  To do
                       this I will have to detect RMS voltage, Detect
the zero crossing,
                       generate the sine wave reference and then
synchronize to the line.  

                       Any ideas on detecting the zero crossing?À  I
want to do it software not
                       hardware.  I've already done it in hardware
using 2 pins on the micro.
                       I want to do it with 1 pin now.

                       John Bellini
                       Product Development, Firmware Technologist

1998\05\13@171201 by John Bellini

flavicon
face
I almost get it but...

What do you mean by 'tics between cycles'?  The AC will be both 50 and
60 Hz.

John Bellini
Product Development, Firmware Technologist


> {Original Message removed}

1998\05\13@221934 by Scott Dattalo

face
flavicon
face
Harrison Cooper wrote:
>
>                 How about this....run the thing as fast as you can.
> Count the number of tics between cycles, then divide in half.  Or does
> the PIC detect at the 90 phase?  If I remember right, it looks at the
> full cycle.  In fact, you should be able to calculate the number of tics
> (knowing the clock and the frequency of the AC), and find a edge and
> count the number of clocks till you get there.

The only problem with this approach is that you're somewhat susceptible
instantaneous deviations in the voltage. However, you can average
consecutive runs to help filter this kind of noise.

A digital phase lock loop is (sometimes) a better approach. Perhaps
someone else will care to explain digital PLL's in more detail?
Essentially though, you vary your sample rate until the tone you're
sampling matches the frequency of an internally generated tone. In my
experience (not on a PIC), you have to be VERY careful on how you vary
the sampling rate. I'm sorry for being vague, but this is not a very
easy subject (for me) to explain.

You may want to check out

http://www.interstice.com/~sdattalo/technical/theory/dtmf.html

to get some ideas on how to do tone decoding.

Scott

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...