[time-nuts] Mains Frequency -again

Andy Talbot andy.g4jnt at gmail.com
Wed Feb 24 09:49:10 UTC 2021


My monitor uses a 16F628A PIC device clocked from a 10MHz TCXO.   50Hz
mains is fed to the  capture/compare module which is set to measure the
number of periods of the prescaled clock in every fourth cycle of the
mains.  A simple integer division and the answer is the mains frequency in
milliHz units..  I only measure to about 0.002Hz resolution as the
variation is so wide (~~ 0.2Hz RMS) this is quite enough .
Completely separately, a four bit counter is incremented by this divided
mains signal every 80ms, and also decremented every 80ms by the divided
down clock.   Software is written so that increment and decrement cannot
clash.

The result is a 32 bit twos-complement count, to 80ms resolution, of mains
timing difference from that of the TCXO.   A bit of arithmetic and the
answer can be shows as a timing discrepancy in seconds on the display.

It would be a matter of just a few minutes of extra code writing to add a
serial output to transfer data to a logger .   Which I may yet do, but that
would require getting an old laptop out of storage and leaving it on 24/7
to do the logging - don't keep my main PCs on continuously.

Not sure this list passes-through attachments;  if not the oicture is here
http://www.g4jnt.com/DropF/img2783.JPG

Andy
www.g4jnt.com



On Sun, 21 Feb 2021 at 15:03, Tom Van Baak <tvb at leapsecond.com> wrote:

> Andy G4JNT,
>
>  > And I wouldn't trust integration over such extended periods to derive
> timing error.
>
> Exactly right. Always measure phase and derive frequency, frequency at
> your chosen tau.
>
> ----
>
> There are several ways to monitor mains phase:
>
> 1) Use a ZCD, convert to digital, divide by 50, and then time the 1PPS
> using existing time nuts methods; either period or time interval or
> timestamp. A calibrated OCXO is sufficient; you don't need to resort to
> Rb or Cs or GPS for this application, but a GPSDO is convenient. You get
> one sample every *mains second*.
>
> 2) Use a dual channel ADC to capture mains and a 90 degree delayed
> mains. Trigger the ADC with a GPS/1PPS. Post-process the data with atan2
> to obtain mains phase and frequency. You get one sample every *UTC second*.
>
> 3) Use a ZCD, count cycles using a PC running NTP. Snapshot the cycle
> counter and PC precise time every 10 seconds. You get one sample every
> 10 *UTC seconds*. In the US each sample typically covers 599, 600, or
> 601 cycles. Ask Hal Murray for details. Example:
>
> https://users.megapathdsl.net/~hmurray/time-nuts/60Hz/60Hz-2019.png
>
> 4) Synchronize a mains "kitchen" clock and let it run. Take a photo of
> it exactly every 15 minutes or an hour. Example:
>
> http://leapsecond.com/pages/tec/mains-clock-ani.gif
>
> 5) Use a transformer to step down mains to a few volts, skip the ZCD and
> divider, and drive a 10 MHz picPET (or equivalent). You will get one
> sample per cycle. That's a couple million per day. PC's are fast, it's
> easy to reduce the data. Example:
>
> http://leapsecond.com/pic/
> http://leapsecond.com/pic/pp06.htm
>
> ----
>
> All methods should give you identical plots. In fact, if this is your
> first time with mains phase, I recommend you use two independent methods
> (because it's easy to make errors when timing mains). Alternatively,
> find someone in your grid who is also measuring phase and compare your
> data to theirs. I've done that here in Washington against Hal in
> California and Kevin in New Mexico. Though thousands of miles apart our
> results agree to the microsecond because we are on the same US West
> grid. For this data I used a picPET. See:
>
> http://leapsecond.com/pages/mains-cv/
>
> Finally, here are some older time nuts threads with additional info:
>
> "[time-nuts] Building a mains frequency monitor"
> https://www.febo.com/pipermail/time-nuts/2016-April/097091.html
>
> "[time-nuts] Recommendations for Mains Power Monitor / Logger"
> https://www.febo.com/pipermail/time-nuts/2018-March/109360.html
>
> /tvb
>
>
> On 2/21/2021 3:02 AM, Andy Talbot wrote:
> > Since building my real time mains monitor, I've noticed just how far the
> > mains timing drifts, for days at a time.   Friday evening last week (10
> > days ago)  timing was running at [plus] +50 seconds, and was slowly
> dragged
> > back over the weekend to about +7s on teh Monday.  Over the week it
> wobbled
> > around, but on a slow downward trend.  By Friday evening (2 days ago) it
> > was -17s  and I watched it drop further.  Now, Sunday morning, it is -56
> > seconds
> >
> > So in the space of eleven days the mains timing has drifted a total of
> > nearly two minutes.
> >
> > There doesn't seem to be, anywhere,   a long term record of mains timing
> > error.  You can download frequency from the Gridwatch site, but not
> > timing.   And I wouldn't trust integration over such extended periods to
> > derive timing error.
> > perhaps it's time to add a serial output to my monitor and couple up an
> old
> > obsolete laptop
> >
> > Andy
> > www.g4jnt.com
> > _______________________________________________
> > time-nuts mailing list -- time-nuts at lists.febo.com
> > To unsubscribe, go to
> http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
> > and follow the instructions there.
> >
>
>
> _______________________________________________
> time-nuts mailing list -- time-nuts at lists.febo.com
> To unsubscribe, go to
> http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
> and follow the instructions there.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMG-2783.JPG
Type: image/jpeg
Size: 2388903 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20210224/c6ee8cdd/attachment.jpe>


More information about the Time-nuts_lists.febo.com mailing list