Accurate frequency 50/60Hz power.

Anything not specifically related to NBTV, but at least of some technical nature that might be of interest to NBTV members. Items for sale and links to retailers do not belong here.

Moderators: Dave Moll, Steve Anderson

Accurate frequency 50/60Hz power.

Postby Steve Anderson » Thu Feb 03, 2022 4:44 pm

Now why would anyone want accurate frequency 50/60Hz mains power? Really the only application is mains powered synchronous clocks. The old sort many of us used to have in our kitchens and elsewhere around the house. These days superseded by crystal-based oscillator versions driven by a 1.5V AA cell. Generally they do an 'OK' sort of job, but it's annoying to have to adjust them every so often as they drift.

In most of Europe, the US and many other countries the mains frequency is held to very tight tolerances long-term. Where this isn't the case and you want to run an old synchronous clock there isn't much you can do except adjust the clock as often as needed. Many rural areas here and on some of the islands the power is derived from local diesel generators which aren't time-locked. A clock could easily gain or lose 30 minutes a day! It only requires a 2% error in frequency to get that result! i.e 51Hz or 49Hz for a nominal 50Hz supply.

This also will apply to more modern electronic clocks that derive their timebase from the mains frequency (e.g. bedside clock radios/alarms). Though admittedly they are few these days.

One source is a Temperature Compensated Crystal Oscillator. Not expensive and the few 32.768kHz versions I have tried are pretty good, say within around five seconds a month.

Of course the ultimate is your own Cesium or some form of Atomic clock, no, I can't afford that either. In the context of this GPS (or more correctly, GNSS) is the answer - unless you're in extreme polar regions. Though that is being/has been addressed.

This all started with this item on Rod Elliot's web-site...

https://sound-au.com/

The site is 99% about audio and more than a few other things, but Rod also has an interest in preserving old clocks. It's worth a look around, I've no connection with the site - yet, maybe in the future though, via contributed items.

The item that created an interest was this...

https://sound-au.com/clocks/freq-changer.html

This device changes your (accurate) 50Hz to 60Hz, or vice-versa...but what if your 50/60Hz isn't accurate as I mentioned above?

Now, I have no idea how accurate time-wise my local mains is here, so I intend to measure it first to find out.

Updates as and when...

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5357
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Accurate frequency 50/60Hz power.

Postby Steve Anderson » Thu Feb 03, 2022 5:43 pm

Initial concept below. Measures local mains frequency over a month or so, alternatively generates 50/60Hz referenced to GPS/GNSS.

It will require some simple additions to this, some filtering, power amplifier(s), power supply, and a GPS/GNSS receiver with a 1PPS output as a minimum. But nothing complex, and no exotic parts...the design is still in development, and as the circuit says, DO NOT BUILD....yet.

Steve A.

P.S. Pre-programmed and burnt-in microcontrollers will be made available...the items below in blue are only if you wish to program the devices yourself....
Attachments
GPS 50-60Hz Reference v1.00.gif
GPS 50-60Hz Reference v1.00.gif (17.85 KiB) Viewed 6074 times
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5357
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Accurate frequency 50/60Hz power.

Postby Harry Dalek » Fri Feb 04, 2022 7:18 pm

My initial thought Steve is its good and well measuring it mechanically derived power is always going to be off but i see your point on those things that used the AC frequency for timing .
I have monitored my mains power as voltage it can be 10 15 volts off checking the output on a old valve mains transformer secondary but always swinging never 100% stable ,i would think if the voltage is dropping swinging back to the wanted set point voltage the frequency is also changing ? but something i have never checked .
Must effect older AC Synchronous Motor record players also and mains mechanical clocks as you mentioned but these days not to much else i can think of where its a problem perhaps more older gear that may use it for timing ...i would think your project idea would record a long term swing showing better and worse cases different times of the day with the amount of power usage perhaps ?
The electromagnetic spectrum has no theoretical limit at either end. If all the mass/energy in the Universe is considered a 'limit', then that would be the only real theoretical limit to the maximum frequency attainable.
User avatar
Harry Dalek
"Fester! Don't do that to 'Thing'"
 
Posts: 5363
Joined: Fri Sep 26, 2008 4:58 pm
Location: Australia

Re: Accurate frequency 50/60Hz power.

Postby Klaas Robers » Sat Feb 05, 2022 5:57 am

I had this problem a few years ago in a completely different context......
I bought myself from the USA a Heathkit SB-630, belonging to my Heathkit SB-line shortwave station. It is called a "Station console" and it contains a.o. a mechanical digital synchronous clock, for 110 volt, 60 Hz of course. Now how to run that clock here in NL on the 50 Hz mains?

SB-630.jpg

I happened to have a program for an 8-pins PIC 12F683 that generates very pure CTCSS-tones. I had the source code and changed it such that it gave a pure 60 Hz from the PIC running on 20 MHz. However for a clock it should be very, very close to the correct frequency. So I should adjust the X-tal oscillator of the PIC to its precise frequency. A trimmer capacitor will do that job. The output sine wave is sent then to an integrated AF-amplifier for car radio, which output is transformed up to 100 V AC.

Schema 60Hz-bron.gif
Schema 60Hz-bron.gif (11.09 KiB) Viewed 6034 times

And then I realised that you cannot make 60 Hz from a precise 20 MHz. There is a 3 in the 60, and not in the 20. So I calculated the strange algorithm as close as it could come and recalculated the 20 MHz clock frequency. I found out that it should be 20 000 032 Hz to give a true 60 Hz. That is wide well the range of the trimming capacitor.

It should be possible to measure the exact crystal frequency without detuning the oscillator. To do that I added a divide by two circuit that is continuously connected to the oscillator. Now the half oscillator frequency should be 10 000 016 Hz. In practice the clock runs within one second per month. That is good enough for me. Any way I have to readjust the clock twice a year, for summer time and for winter time.
User avatar
Klaas Robers
"Gomez!", "Oh Morticia."
 
Posts: 1655
Joined: Wed Jan 24, 2007 8:42 pm
Location: Valkenswaard, the Netherlands

Re: Accurate frequency 50/60Hz power.

Postby Steve Anderson » Sat Feb 05, 2022 12:37 pm

Harry, indeed, the mains voltage isn't that stable, it suffers from volts drop from the generator to your house (including transformers, switchgear etc.) - basically Ohms Law. However synchronous motors generally are locked to the supply frequency as long as the voltage is nearly correct and the mechanical load not excessive. I admit I forgot about turntables and simpler tape recorders.

Klaas, I chose a 12.00MHz crystal simply as it's divisible by 50 or 60. 6.00MHz or 18.00MHz would be usable too. However the crystal isn't the actual timekeeping component. The GPS/GNSS receiver is. The micro generates either 50 or 60 cycles of sine-wave as required, then is stopped or restarted prematurely with the 1PPS signal. The 1PPS could be very slightly late or early relative to the absolute frequency of the crystal/oscillator. Even if the oscillator is as much as 100ppm in error this results in a very minor glitch when the sine-wave is restarted. Once passed through a moderately narrow bandpass filter of 50 or 60Hz it's as good as invisible. It's unlikely that a synchronous motor would complain about that. It's only a handful of degrees in 360.

The sine-wave is generated via the PWM module within the micro so requires very little, almost no filtering.

I admit I have yet to build this or write the code, updates as and when.

I forgot about daylight saving, we don't use it here, most countries within or near the tropics don't.

Steve A.

This could have been made simpler using the same 8-pin micro as Klaas. But wishing to also measure the incoming mains frequency required a micro with more I/O pins.

If the GPS/GNSS receiver is a 3.3V device it is possible to lower the supply to the micro to 3.3V also, though this will limit the oscillator frequency to 6MHz or 12MHz, the latter is the absolute maximum for 3.3V.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5357
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Accurate frequency 50/60Hz power.

Postby Klaas Robers » Sun Feb 06, 2022 3:18 am

Wow, that is a crude method, but it will work. Choose the start/stop position at the top (or bottom) of the sine wave and you will not see it.

If you want to see how the sine wave is generated, look at http://www.vederfonds.org/PIC-60Hz, where you find the source code. I hope that you can read the Dutch explanation, it is not too different from English. Tip: read it loudly and listen to what you say.

The algoritm is rather strange, using several prime numbers to avoid replication of rounding errors. The harmonics are well above 20 kHz, because this was developped to generate a sub audio tone that would be added in the audio of an FM transmitter on 145 MHz. It should be not audible, also not the harmonics. For a synchronous motor this is not needed, but why do it worse?
User avatar
Klaas Robers
"Gomez!", "Oh Morticia."
 
Posts: 1655
Joined: Wed Jan 24, 2007 8:42 pm
Location: Valkenswaard, the Netherlands

Re: Accurate frequency 50/60Hz power.

Postby Steve Anderson » Sun Feb 06, 2022 9:05 pm

Yes, it is a bit 'brute force and ignorance', but as you say it should work. At 50Hz with the crystal oscillator being 100ppm in error, (quite poor), results in a 'jump' of 1.8 degrees of 50Hz each second. A simple bandpass or low-pass filter should smooth that out...along with the inductance of the motor/transformer combination. There's only one way to find out!

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5357
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Accurate frequency 50/60Hz power.

Postby Steve Anderson » Mon Feb 07, 2022 2:50 pm

I may change the micro to a PIC18F14K50 for two reasons, I already have nine of them in stock (no idea why!), and here the PIC16F690 is on a one-year lead time! I could order from overseas but that comes with a hassle factor sometimes.

Also it has selectable hysteresis (on/off) for the comparators. Between a 3.0V and 5.5V supply the oscillator can operate up to 48MHz (12MHz Xtal + PLL) and doesn't require all that pesky bank-switching of the PIC12/16 series. It's still in a 20-pin DIL package too. It also has a USB 'engine', but I won't be using that.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5357
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Accurate frequency 50/60Hz power.

Postby Steve Anderson » Thu Feb 10, 2022 2:47 pm

The micro has now been changed as mentioned above. This results in the ability of the micro's supply voltage in most cases being able to match the GPS receiver supply voltage. This results in just one logic power supply and no buffer being required between the receiver and the micro.

There are many GPS receiver modules available, most appear similar to that shown, around 30mm square. The requirement is that it has a 1PPS output, the NMEA data output is optional (but also useful) though not used here. Most require 3.3 or 5V at around 30mA or so. Some require up to 100mA upon start-up and satellite acquisition for a few seconds. The 1PPS output won't appear until the module has resolved a fix, that can take up to a minute or so, though usually faster.

The receiver requires a clear view of most of the sky with no metal obstructions, e.g. steel-framed buildings are a no-go usually. Indoors in a domestic house is usually quite OK, here I'm using the roof/loft space, that eliminates the requirement for a weatherproof outdoor housing. Most of these modules are specified to operate over more extreme temperature variations than the usual domestic 0-70 celcius range, mostly -25 to +85. Similar to vehicle-based electronics.

Steve A.

08975-00.jpg
08975-00.jpg (50.16 KiB) Viewed 5916 times
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5357
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Accurate frequency 50/60Hz power.

Postby Klaas Robers » Thu Feb 10, 2022 6:41 pm

Steve, if you change my manually adjustable trimmer capacitor by a variable capacitance diode, you can adjust the precise frequency automatically. To do that you detect at each second pulse if the sine wave had to be set back or advanced.

This information then is used to count up or down a number in your program. That number can be used to generate an analogue voltage, that is sent to the varicap. After quite some second pulses the number counts up-down-up-down and so on. Then the crystal frequency is correct.

You can use that 12 MHz crystal frequency to calibrate your frequency counter, as is is now GPS controlled stable.
User avatar
Klaas Robers
"Gomez!", "Oh Morticia."
 
Posts: 1655
Joined: Wed Jan 24, 2007 8:42 pm
Location: Valkenswaard, the Netherlands

Re: Accurate frequency 50/60Hz power.

Postby Steve Anderson » Fri Feb 11, 2022 5:11 pm

Yes Klaas, entirely possible, establishing the loop timing might become tricky as it has become a Phase Locked Loop with a long time-constant. But it's certainly worth a try. I've seen others do something very similar too.

I'll 'give it a go' as it is currently, then try the PLL modification later. It would require altered software and a minor change in components.

Steve A.

However, this and quite a few other things are going to have to wait. I have long-term 'real-work' contract has landed in my lap...it'll keep me occupied for some time...
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5357
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand


Return to Off Topic

Who is online

Users browsing this forum: No registered users and 3 guests

cron