Sync funtion generator to mains frequency - Page 1
Forum section: electronics / beginners

author: aagw
author_rank: Newbie
timestamp: October 04, 2021, 06:32:39 pm
content: HiI would like to generate sine waves on my Siglent SDG 2042X which sync with the mains frequency.I guess one approach is to make a kind of 50Hz to 10MHz converter.Where do I start? Is there any commercial alternatives.Thanks

author: xrunner
author_rank: Super Contributor
timestamp: October 04, 2021, 06:55:20 pm
content: Quote from: aagw on October 04, 2021, 06:32:39 pmDo you have a scope? At least on mine (Rigol DS1054Z) the trigger source can be the AC line. If I select that, all I had to do was connect to the trigger output on the side of the scope and presto I have a trigger output synced to the line freq. You can use that for your sig. generator trigger.

author: aagw
author_rank: Newbie
timestamp: October 04, 2021, 10:03:43 pm
content: Ok, powered up my scope, a SDS 1104X-E and got the function generator triggered.I used the burst mode with 1 cycle and external trigger, the waveform from the generator align perfect, but I need a continuous output.The problem is that the mains frequency is relatively unstable and the signals start to drift immediately.I am not sure the SDG 2042X is capable to trig the output for every 50Hz mains cycle.Maybe there are other generators that does?

author: xrunner
author_rank: Super Contributor
timestamp: October 04, 2021, 10:18:17 pm
content: Quote from: aagw on October 04, 2021, 10:03:43 pmOh I see, you want to generate a higher multiple of the mains freq. regardless of whether it's exactly 50 Hz. You want it to follow whatever the mains is continuously. You basically need to make a phase locked loop. If you aren't familiar with those you can Google them.Maybe another forum member has a better solution too, let's see.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 04, 2021, 10:47:05 pm
content: What is the underlying problem you want to solve with this?Maybe it is an option for you to turn it around:Derive a 50Hz frequency from your function generator, push that to an audio amplifier and use that as your "mains voltage" equivalent.It is even possible to put a transformer in between, to get 230Vac output. You can for example use a 230Vac to 24Vac transformer "in reverse". A problem with this approach is that most mains voltage rated transformers work relatively close to their core saturation. Using a transformer that is designed for 400Vac ->24Vac and using that in reverse keeps you away from saturation.An added advantage is that your "230Vac mains voltage" is also isolated.You also have control over both voltage and frequency output, so you can also test how your circuit reacts to 60Hz inputs.

author: ledtester
author_rank: Super Contributor
timestamp: October 04, 2021, 11:29:58 pm
content: Quote from: Doctorandus_P on October 04, 2021, 10:47:05 pmThis is the approach that TheHWCave uses in this video to test the accuracy of an AC power meter:- How accurate is the Peacefair PZEM-004T AC Comms Module? - TheHWCavehttps://youtu.be/j0_y8dPfpKc

author: bdunham7
author_rank: Super Contributor
timestamp: October 04, 2021, 11:36:38 pm
content: Quote from: aagw on October 04, 2021, 10:03:43 pmThat will be an issue no matter how you do it, even with a PLL. If your PLL tracks slowly, you'll be in and out of phase, quickly and your output frequencies will be all over the place. Could you tell us the story of what it is you are actually doing?

author: aagw
author_rank: Newbie
timestamp: October 05, 2021, 06:16:42 am
content: Ok, I should have been more detailed.What I want to achieve is to control a track relay like this (used in train detection):https://assets.new.siemens.com/siemens/assets/api/uuid:e142d8e1-a1d0-48da-a7ab-052c04a675c3/vt-1-relay-0003997.pdfAnd do some testing with the relay to see how reacts to different phase shift, voltage and noise applied.It seems like an audio amplifier with a transformer is a good place to start.

author: radiolistener
author_rank: Super Contributor
timestamp: October 05, 2021, 02:41:52 pm
content: Quote from: aagw on October 04, 2021, 06:32:39 pmyou can use 10 MHz VCXO for that. Divide it's output by 200000 to get 50 Hz, XOR it with mains 50 Hz, add low pass filter on the XOR output and use result as a control voltage for VCXO tune. After some period of time VCXO frequency and phase should be synchronized with mains.You will needs to play with low pass filter cut-off frequency. Lower cut-off leads to more stable control voltage for VCXO, but at the same time it leads to a slower synchronization. So you're needs to find optimal low pass filter cut-off frequency. For 50 Hz it may needs high dumping factor and synchronization may take a long time.