1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

GPSDO project

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by throbscottle, Aug 31, 2017.

  1. throbscottle

    throbscottle Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,777
    Likes:
    113
    Location:
    Nuneaton, Warwickshire, UK
    I'm trying to find the best way to cheaply build a gps disciplined oscillator to use as a calibration-free reference. This is so I can calibrate an old second hand frequency counter I haven't got yet... And also Other Stuff. Apart from which it's just interesting anyway.
    So far I have (on the slow boat from China):
    10MHz VCOCXO
    NEO7 GPS module.

    I'm seeing a small number of methods to implement this on the 'net, based on either the GPS's 1pps output and a micro-controller, or using a different module with a 10KHz output and locking with a PLL, and a couple using u-Blox modules on their own with the 1pps output programmed to a frequency, which is accurate but not stable.

    So I've been thinking what to do?
    The NEO7 has a programmable output so it can output a frequency rather than 1pps. Needs a battery to not forget its setting if not powered for a couple of hours though.
    Timepulse suffers from jitter, if programmed to a frequency it is much better when an integer fraction of 48MHz, eg 8MHz
    So I believe I can use a PLL to improve the jitter, or one of these: http://ww1.microchip.com/downloads/en/DeviceDoc/JitterBlocker.pdf though I'm not sure it's appropriate in this case (if I can even obtain one!)

    How hard is it to phase lock a 10MHz signal with an 8MHz one? Divide the 10MHz signal by 5 and the 8MHz signal by 4, is my first guess. PLL generates the control voltage for the oscillator. I don't know if programming the module to 8MHz and dividing externally by 4 is any better than just programming it to 2MHz. Still an integer fraction of 48.

    I've also seen one where the 1pps is divided by 16. Confusing...

    I was thinking also, instead of this, I could use a "fastest finger first" system. So the 1pps signal is used, and the 10MHz oscillator is also divided down to 1pps, and the difference in time between them is used to give the oscillator a gentle nudge in the right direction. It would need additional syncing so the pulses start off in the right place. Very slowly done, so the effect of GPS 1pps wander doesn't have the oscillator all over the place. Don't know how I'd do this but it's an attractive idea. Some kind of integration of the time between the two pulses?

    The other way to do it is with a micro, AFAICT, it would need to measure the interval between each 1pps pulse and generate an output equal to the average pulse timing. This led me to thinking it wouldn't be a very stable average because the micro's own clock isn't truly stable, and THEN I thought, hang on, I've got a 10MHz OCXO on board, use that for the micro's clock instead, and I THINK that as it's frequency is adjusted this will affect the average in a negative feedback kind of way so it won't go racing off to the upper or lower limit. But I was driving when I did that thought experiment so that may be completely wrong.

    With a micro on the board it is also possible for other things to be done. Haven't thought much about this, mainly just getting info from the GPS, status info, fluff and stuff.

    Time for bed, said Zebedee...
     
  2. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,253
    Likes:
    961
    Location:
    Loveland, CO USA
    I use WWV that transmits at 2.5, 5, 10, 15, and 20 MHz. My frequency counter has a 10mhz ref and I use a short wave radio to hear WWV at 10mhz. If the reference was at 10,000,100 hz then I can hear the 100 hz difference on the radio. As I get the reference down to 10hz off I can't hear the 10hz but the signal strength meter will vibrate at 10hz. Usually I can set my reference down to where it takes 10 seconds to go through one cycle. (10,000,000.1hz or 9,999,999.9hz)

    I don't know if I explained well. With a radio you can hear the difference between two signals. I use 10mhz from radio "WWV" and 10mhz from my frequency counter. The difference can be heard and seen on the signal strength meter.

    Probably GPS is everywhere and WWV can only be heard at night or if the clouds are just right.
     
    • Informative Informative x 1
  3. throbscottle

    throbscottle Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,777
    Likes:
    113
    Location:
    Nuneaton, Warwickshire, UK
    That's a really good point about being able to hear the difference or see it on an analogue meter, certainly a way for an easy life!
    I don't think we have WWV in this country, and apparently the Rugby clock transmitter either has been or will soon be closed down. I believe we have one station which can be used as a frequency standard, BBC radio 4 at 96MHz I think. TBH I'd forgotten all about it, but then I doubt if FM is a good starting place really...
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. throbscottle

    throbscottle Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,777
    Likes:
    113
    Location:
    Nuneaton, Warwickshire, UK

    Ok here's a block diagram of the PLL version. I think this would not be as good as the 1pps averaging version, but easier and quicker to make because there's no need to program a micro and deal with a dac. It would be usable more quickly after switch on too. Comments, anybody?
     

    Attached Files:

  6. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,645
    Likes:
    246
    Location:
    North west UK
    The rugby transmitter has been closed down, but the 60kc time signal is now trasmitted from Anthorn in Cumbria and is as strong as ever, a good portion of the Uk relies on it.

    I have built frequency standards that use Radio4 on Lw, Msf on 60 Kc, GPS and I'm now working on one that uses the Loran 100Kc naviagtion signal which is now broadcast again in the Uk.

    Radio 4 suffers from both modulation and skywave reflections, and Msf suffers from skywve reflections too, both these affect accuracy, which can be as bad as a uS.
    Using a Pll with a very slow loop time constant, in the order of minutes, and a voltage controlled crystal oven combats this to an extent, I get about 1 x 10-9 during the day and 1 x 10 - 7 accuracy at night.
    Loran overcomes the skywave reflection issue by transmitting 200uS pulses and only using the first 3 cycles for oscillator sync, this means you only use the signal before the first reflection comes in, accuracy is nearly as good as the cesium resonator at Anthorn.

    GPS if you can get it is the easiest way, allthough loran is as or nearly as good.
    My GPS system uses the Neoblox7 too, its setup to o/p 10Kc, the vcoxo is also divided down to 10Kc, and the 2 go into a Pll which generates the loop voltage control for the vcxo, its handy to have a meter for the loop voltage, and also if you use a 4046 Pll with phase comparator 2 then pin 1 outputs a logic level thats high when the phases dont match, this makes an Led slowly ramp up & down in brightness with the phase difference, a similar effect to beating an S meter, and you can see the thing sync on power on, but this isnt much use at 1 x 10-9 accuracy as the Led goes on & off in over 100 seconds!
    1 PPS works ok, however a higher frequency will respond to errors quicker, and filter artefacts are simpler to remove, with 1 PPS its tricky to remove 1 Hz noise from the system, this is also an issue with Msf as the carrier is switched off every second.

    There are several projects on the net for GPSDO's, from a 4046 to digital methods with arduino's, there are 1 or 2 that use the osccal register to sync the built in osc.

    Heres my thread on my radio4 and Msf standard:
    http://www.electro-tech-online.com/threads/frequency-standard-radio-4-or-msf.138301/#post-1147060

    And heres my recent thread on the loran standard I'm working on:
    http://www.electro-tech-online.com/threads/eloran-frequency-standard.151815/#post-1304238
     
    Last edited: Sep 2, 2017
  7. throbscottle

    throbscottle Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,777
    Likes:
    113
    Location:
    Nuneaton, Warwickshire, UK
    Interesting reading. There's a lot of projects by various people and Q's and A's on the timenuts forum which are quite useful.
    I didn't imagine there were so many options for radio based references. But it looks like GPS is much easier...
    I need to learn more about PLL's. I hardly know next to nothing about them. I see there are a few different types. Is it best to stick with the 4046 or choose a more modern one?
    Neo pps output needs to be set to an integer fraction of 48MHz or it's very jittery, hence 2MHz. It didn't occur to me until now that sub MHz frequencies are also integer fractions - just large ones!
    I need to read the docs more carefully, but I think the Neo modules can be locked to one satellite. Maybe at some point I'll add a micro to send commands to it for things like that, rather than keep plugging in the flaptop.
    I like your phase match indicator, think I'll use that! I saw mention of 4046 "options" in one of the articles I read - didn't understand what it meant so I guess it's what you mention.
    Other status LED's would be nice. I think I can set up "ready" and "alarm" indicators based on the oven current - ready when it's stable and alarm if it's too stable. Or maybe if the VC goes to it's limit. A lock indicator for the GPS would be good too, it doesn't provide that so another job for a micro I think. Since a backup battery for the frequency setting is needed I'll be putting a low battery indicator to activate when it's powered on.
    That diode in the block diagram btw will be a p-type mosfet connected in reverse (with gate to gnd). Slow, but you get a very low effective Vf. I'm assuming the 3v will actually be high enough for it to turn on.
    I see in your MSF standard you used one of those lovely chunky Piezo OCXO's. I nearly got one of those, the chassis mounting is very attractive, but then I read the later Trimble ones are better. Also I decided I wanted sine out, then I can have sine out on the finished reference and I can always square it if needed.
    In another thread Mosaic mentions he picked up a very good deal on a rubidium oscillator. Looks very good. I also read you can now get chip-sized caesium clock modules. Amazing. I didn't look at prices...
     
  8. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,645
    Likes:
    246
    Location:
    North west UK
    Yes there are a few off air frequencies, a couple others from russia are 4.996 9.996 and 14.996 mc's.

    Yor right GPS is nice & easy, and your right integers of 48 mc's are cleaner from neo's, but thats not very significant if you have a slow loop filter, besides 2 mc's is a high frequency for a slow loop filter, something more in the audio range might be better for high value caps.
    A moremodern version of the 4046 is guess what a 74hc4046, you have a choice of 3 phase comparators, there are other Pll's, choose which is best for you dont be too concerned about 'Old'.
    Forgot what they call it now, however more than one sat can be a good thing frequency wise.
    The datasheet for the 4046 shows a good lock indicator it uses a nand I think, and only lights up if there are next to no mismatch pulses.
    My Piezo is a sine wave o/p, and it does have an 'oven ready' indicator.
    For the arduino have a look at glib, its a library to control neo modules, there are others too, if you put a bigger battery on the neo module then you can set it up one time on a pc using ublox studio(free) and it will retain its settings.
    3v wont turn on your average fet, check the datasheets, you might be able to get 3.3v ones.
    Take care with rubidium modules cheap from china, I suspect these are high hour, they have a lamp inside and this eventually wears out, there might be a run time register internally, I've heard some people have found theres a frequency generator internally to these and they can be used pretty much as a dial in your freq dds generator.
     
  9. Diver300

    Diver300 Well-Known Member

    Joined:
    Oct 19, 2007
    Messages:
    3,063
    Likes:
    101
    Location:
    England
    I've got an old GPS frequency standard that you can have for free if you want. It didn't get a lock the last time I tried it, and I couldn't get the serial communications on it to work either. I put it on sale before but when it wouldn't work properly, there was no interest. http://www.electro-tech-online.com/threads/hp-zc8301a-gps-frequency-standard-for-sale.117172/

    For calibrating a frequency counter, I found that just setting it to read the frequency of the 1 pps signal gives a good way to adjust it manually. Good counters will measure period and show it as frequency, but you can just measure period, and adjust the counter until it shows 1 s.

    I did some work on a GPSDO a few years ago, and that just used the 1 pps signal, and measured how many clock cycles of the 10 MHz oscillator there were between 1 pps pulses. It is important to make sure that the capturing is to the nearest clock cycle. Also you need to let the oven warm up and the GPS to get a lock before making corrections.

    The frequency corrections are very slight and very slow, so it seems that dividing to low frequencies is a good idea. However if you do compare at very low frequencies, you have to compare frequencies, not phase.
     
  10. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,645
    Likes:
    246
    Location:
    North west UK
    You have first refusal throbs as Diver offered it you, however if you dont want it throbs can I have second dibs Diver?
     
  11. Diver300

    Diver300 Well-Known Member

    Joined:
    Oct 19, 2007
    Messages:
    3,063
    Likes:
    101
    Location:
    England
    Yes, no problem.

    I know that Throbscottle lives not far from me, and I have met him once, so I knew that he would be able to collect the frequency standard if he wants it. I will have to charge for postage if I do end up sending the frequency standard to you as it weighs a few kg.
     
  12. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,645
    Likes:
    246
    Location:
    North west UK
    Course no problem, I'd cover p&p.
     
  13. throbscottle

    throbscottle Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,777
    Likes:
    113
    Location:
    Nuneaton, Warwickshire, UK
    Well hello there! I'd forgotten you were, erm, you ;) (The psu is working very well now btw even though nearly 3 years on still unfinished!)
    I think I'll let the HP pass, but thank you very much for the offer Diver. I'll continue down the home-brew route, since it's a good learning experience and I may not have the time/means/ability to sort out the locking issue on the HP.
    Looks like I need to read more about PLL's. I was looking at an article about selecting the loop filter but I don't really know what it does...
    I read the opposite thing about number of satelites. GPS's designed for timekeeping lock onto just one, eventually and are limited to high elevation ones.
    Trying to take in a lot of information on new subjects in between work, dogs, tv, missus, grandkids, eating - not easy!
     
  14. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,645
    Likes:
    246
    Location:
    North west UK
    The loop filter in a Pll is complex, there are books on the subject.
    But heres a couple of interesting sites based on Dcf77, these explain some of the detail in the loop filter.
    The first article I pinched the loop filter out of for my Msf standard, it takes 20 mins to settle, but the oven takes that anyway.
    Notice the osc is very similar to the one I used.
    I cannot use Dcf as if I look out the window I can see Hms Inskip, a very powerfull 81Kc transmitter, Dcf is completely wiped out.

    http://www.simonsdialogs.com/2014/12/dcf77-frequency-reference-a-resonably-accurate-10-mhz-source/

    http://www.qsl.net/dl4yhf/dcf77_osc/index.html
     
  15. schmitt trigger

    schmitt trigger Active Member

    Joined:
    May 24, 2009
    Messages:
    885
    Likes:
    84
    ONLINE
    Throbs;
    The 4046 is such a versatile building block, that it remains a fully viable component even today.

    But don't go for the plain CD4046. Use a modern device like the 74HC4046.

    Not only it is faster, but it has a new phase comparator (PC3) instead of the useless zener regulator, and the VCO's control voltage is now properly buffered with an opamp instead of single Mosfet.

    The following app note from TI is very useful:
    And please keep us posted on the project's progress!
     

    Attached Files:

    • Agree Agree x 1
  16. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,645
    Likes:
    246
    Location:
    North west UK
    In my latest project I'm thinking of using a 'hc4046, however I need to be able to force phase comp 2 o/p to go high impedance regardless of its inputs, messing with the inputs is the only way I can think of doing it.
     
  17. throbscottle

    throbscottle Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,777
    Likes:
    113
    Location:
    Nuneaton, Warwickshire, UK
    This is my first draft of the design. Quite a few of the component values are placeholders because I don't have much info about the OCXO, or just haven't got round to working them out yet.

    I designed it after post #13 but have only just seen #14 - that app note is exactly what I've been needing (and failing) to find so I'll be making some changes no doubt. Thanks for that S/T. I'd already chosen 74HC4046 because CD4046 won't go to 2MHz. 7046 is expensive!

    I couldn't understand why there is a 22K and 1000u in series in his loop filter: http://www.simonsdialogs.com/2014/12/dcf77-frequency-reference-a-resonably-accurate-10-mhz-source/ otherwise I would have copied it wholesale. I didn't copy his lock detector until I've understood it either, but that app note makes it a lot clearer, I see what he's doing now.

    The battery will be a small 3v rechargeable. I'm going for about 180mAH NiMh, should give about a year between needing plugging in. It's needed so the Neo7 doesn't forget it's supposed to output 2MHz on the PPS output instead of 1PPS (as well as other settings I think I can set)

    I didn't know if it was better to just use the PLL's output directly to control the OCXO or try to incorporate it's reference (shame not to use it!), which is what I've done but that transistor should be an emitter follower and I've a feeling I've chosen the worst way of doing it anyhow.

    At some point I'll put in micro to read the GPS info so it can tell when it's got a satellite lock.

    It's got 1MHz, 5MHz and 10MHz TTL outputs and a 10MHz sine output. Doubtless that rudimentary output amp could be vastly improved. I was going to put another tranny in series with Q2 emitter / R5 so the gain can be controlled with a DC voltage but it starts looking ugly very quickly... I didn't know if it was worth making R7 be 51R and removing C4, so it's a 50 ohm output - but maybe there's more to it than that, I don't know?

    (edit - better copy uploaded)
     

    Attached Files:

    Last edited: Sep 10, 2017
  18. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,645
    Likes:
    246
    Location:
    North west UK
    Looks Ok as a ball park, except Q4, that doesnt look right, you could just connect the chip direct to the ocxo, the demod out is a low impedance op amp output.
    A couple of things to note, without any biasing the Pll will have to charge up the loop filter cap to 1/2 Vcc (assuming you want the osc control voltage to run at 1/2 Vcc) this will mean a long start up.
    The other thing is the loop filter is only single pole, it'll work but will overshoot & ring for a few cycles after power up, maybe taking nearly an hour before a really good lock is made.
    That said I'm not knocking your design its further on than my gpsdo was when I started to assemble it, chuck it together and see.

    I'm working on my loran based standard, so far I have the receiver done, and the demod circuit, it outputs 2 batches of 8 accurate 1mS pulses.
    It also is going to be arduino controlled, the 'duino has an input for a 10Mc ocxo, and an input for the loran 1mS pulses, using timer1 it counts the 10Mc pulses and compares them to the 1mS pulses from loran, if the osc is low or high it will generate a 16 or possibly 24 bit value to go to a dac which generates the vcoxo control voltage, so far its going to be a frequency locked loop not phase, however that might change, might do both sort of course & fine.
     
  19. throbscottle

    throbscottle Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,777
    Likes:
    113
    Location:
    Nuneaton, Warwickshire, UK
    Yeah I realised about Q4 afterwards. It just seems a shame not to use the OCXO's reference voltage. I don't actually know what the control voltage range needs to be, or what the reference is, until I've got the oscillator - it's still on a boat somewhere. I'm hoping it's the same boat as the Neo7. If it's around the 5-6v mark it might be a good idea to use it as the PLL's supply voltage instead of Vcc. There's hardly any information about the OCXO so I'll just have to hook it up and take measurements.

    Loop filter is still dark magic - I'm learning slowly. I just went for a really long time constant. I may yet switch to using the P3 comparator.
     
  20. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,645
    Likes:
    246
    Location:
    North west UK
    The osc control voltage will only be as stable as the loop filter, so I spose a reference isng going to be a whole load of use, unless you make some kind of circuit that generates a ratio, 0-5v in and 0-xtal osc reference out, but that will only be as good as the Pll's supply voltage anyways, so dont worry about it.
    You could if you really want a clean voltage for the phase comparator o/p have a seperate reg for the 'hc4046, or maybe construct your own reg using the ovens reference.

    If you think you have a long loop filter time constant have a look at this, 100 meg ohms in series with 40 mic's:
    http://www.g4jnt.com/msfmk2.pdf
    Heres the Mk1:
    http://www.g4jnt.com/MSFPart1.pdf & http://www.g4jnt.com/MSFPart2.pdf

    The above Mk1 is effectively what I'm doing with loran, only using a micro you can get around the 1 second artifacts in the output, using a Ne567 wasnt a good idea, the device switches the compare analogue switch part way along a cycle causing the glitch.
    If he'd used the 1 second duration and detected the 60kc sooner it would have been much better.
     
  21. schmitt trigger

    schmitt trigger Active Member

    Joined:
    May 24, 2009
    Messages:
    885
    Likes:
    84
    ONLINE
    It is loop damping, and I would suggest that you add it, in series with your C7.
    Start with a resistor value 1/20 or 1/10 the value of the main loop resistor.
     

Share This Page