Dead simple frequency counter is too simple? - Page 1
Forum section: electronics / projects

author: BiOzZ
author_rank: Regular Contributor
timestamp: August 27, 2013, 07:34:25 am
content: i was working on a GPS tamed oven controlled oscillator where a high speed CPLD would count the number of pulses from an OCXO against a Motorola UT timing GPS and adjust the OCXOi got a cold and with a ton of free time for some messing around i realized .... what if i just counted the number of pulses between the 1PPS of the timing GPS and have a dead simple, highly accurate frequency counter?hell you can do this with high speed logic .. just some triggering circuitry, counters and 7 segment displays ... this seems way too simple and cheap when i look at the cost of GPS tamed frequency counterswhy would this not be a feasible option? im guessing its not or else all frequency counters would be under $200!

author: ve7xen
author_rank: Super Contributor
timestamp: August 27, 2013, 08:11:00 am
content: This works and is a typical FLL technique. Most (all?) commercial GPSDO use PLL as their main control loop as it will remove the constant offset inherent in FLL and I believe offers other benefits as well. The cost of a GPSDO is mostly in R&D, not hardware. While it's not quite that simple, there's not all that much to it. You need a good phase detector and a good highly linear DAC and lots of loop tuning.Try asking on the time-nuts list, or browsing the archives. I don't fully understand the control theory involved.

author: BiOzZ
author_rank: Regular Contributor
timestamp: August 27, 2013, 08:22:00 am
content: Quote from: ve7xen on August 27, 2013, 08:11:00 ambut why would such things be that necessary in a frequency counter when you're simply counting the number of pulses at a specified trigger point between a specified point of time?i feel like im missing something big

author: Dr. Frank
author_rank: Super Contributor
timestamp: August 27, 2013, 08:45:16 am
content: Quote from: BiOzZ on August 27, 2013, 07:34:25 amHi,first of all, it's called a GPSDO, i.e. a GPSdisciplinedOscillator (or OCXO).That's the reason, why those Time-Nuts let their Thunderbolt GPSDO be disciplined by Lady Heather, that's either that dominatrix from CSI, or a monitoring program written by several of the Time-Nuts..Then, you would simply use the disciplined OCXO output of 10MHz to get an ultra-stable time base.Your description is unclear to me, especially how you want to measure another frequency source.The resolution of a classical counter depends on the measuring technique. You would set up an calculating period counter, also called reciprocal counter, i.e. measure the divided period time of your signal, divider set so that at least 1sec of measuring time is used, and then determine the frequency by calculating the inverse of the period.But this will give a resolution of 1e-7*sec onlyIf you strive for high accuracy (which the OCXO posses inherently), you also need higher resolution within 1 or 10 sec measuring time.So you need a time interpolator, to increase resolution by a factor of let's say 1000.With 10sec measuring time, you would enter the 1e-11 resolution AND accuracy regime.It's not so easy to build a high accuracy counter.You may study the HP papers AN200 and AN200-3 about the different counter principles first.Perhaps you look for vintage devices as an HP5345A, HP 5335A, or an HP5370, or newer models, which appear sometimes for a bargain on the bay.Instead, there are also several phase-comparison techniques, if you only want to measure precisely another 10MHz source.Such phase comparators can be found on Time-Nuts, but that's also not trivial, if you want to achieve high resolution.At least, it's necessary also, to determine phase or time difference in the ps region.Frank

author: ve7xen
author_rank: Super Contributor
timestamp: August 27, 2013, 08:48:35 am
content: You could certainly use the 1PPS from the GPS as gate for a traditional counter, I was thinking you meant to use it to discipline your own clock. Its stability won't be as good as a properly done GPSDO, or even a (decent) standalone OCXO. The problem is that on the short term, GPS is actually outperformed by good traditional standards. You do get good confidence in the absolute accuracy, but the stability isn't that amazing. Over a single 1 second period, the jitter is relatively high, and the quality of the GPS's own clock dominates. Remember that the output PPS is derived from the GPS's clock (usually a TCXO), and the time solution is usually only calculated periodically, so over a period as short as a second, the TCXO can't be corrected and the GPS doesn't do you much good, other than getting the absolute value very close to 1.0000000s.What GPS is good for is disciplining an oscillator with good short term performance, like a good OCXO, to get the long term advantage of the continually calibrated and extremely stable constellation of atomic clocks in orbit, but it only really works on time constants measured in minutes to hours. On short time scales like you'd use to gate a counter, if you don't want to discipline, you're better off setting an OCXO against GPS once in a while (use a lot of averaging), rather than actually using the GPS as your reference. If you don't have or want an OCXO though, the naive approach you've suggested should get you quite good results, but you'll obviously be constrained to a >= 1s gate, which can be pretty annoying, and this is not a reciprocal counting design, so won't be useful for non RF frequencies; your resolution is tied to the input frequency and gate time directly. To make a reciprocal counter, you need a high frequency clock to time the signal (and usually some form of interpollator to establish where the edge wasbetweenclock cycles), so we're back where we started - you need to discipline an internal clock if you want to use GPS.The reason test gear doesn't go this route is because installing GPS antennas, distribution amps and etc. in your industrial lab can be very expensive or impossible. Probably in pretty much any case, it's much more expensive than using a good OCXO and calibrating regularly, and only actually provides a benefit if used in a GPSDO. So that's what you get from the metrology community - GPSDOs. They're expensive because of R&D, low volume, and high build/engineering quality, like most test equipment is. The components are a tiny fraction of the price (though the OCXO won't be cheap). The benefit is that once you have one, you can use it to clock pretty much any test instrument that can make use of a time reference.

author: Dr. Frank
author_rank: Super Contributor
timestamp: August 27, 2013, 08:54:26 am
content: Quote from: ve7xen on August 27, 2013, 08:48:35 amGPSDOs as the Trimble Thunderbolt commonly already have a good OCXO inside, and the time constant of the feedback loop determines the 10MHz short term stability.But you are right, an external high quality OCXO, or a Rb clock, both running free have much better short term (Allan-) stability.Exactly there starts the Time-Nuttery..Frank

author: BiOzZ
author_rank: Regular Contributor
timestamp: August 27, 2013, 09:02:32 am
content: Thanks for clearing this up guys, i was just curious and it was not a planned project of mine ... i still need a good OCXO frequency counter but thats another story ... when you start playing around with OCXO and timing GPS units you start to wonder such things and one option is build one up on a collage kids budget and see why it wont work or ask you guys and i think asking you guys would save me some time and money!thanks guys i learned allot!

author: ve7xen
author_rank: Super Contributor
timestamp: August 27, 2013, 09:22:47 am
content: Buy a cheap OCXO on eBay and try using your CPLD to discipline it to GPS. You won't get into 'real' GPSDO territory, but it's a good learning project. You can implement a counter like you've described (10MHz vs 1pps) to measure the OCXO against GPS. Average this, and figure out how far out the OCXO is, and use that value to control an output voltage into the OCXO's tuning port. This is FLL, not PLL, so it'll only get you so far, and you might make things worse if you tune it wrong, but it's worth playing with.Or maybe it's best if you stay away from time-nuttery, it will eat your wallet and life.

author: BiOzZ
author_rank: Regular Contributor
timestamp: August 27, 2013, 10:01:32 am
content: Quote from: ve7xen on August 27, 2013, 09:22:47 amfunny enough thats exactly what im doing that got me thinking about this frequency counter... i spent about $40 on the timing GPS and $40 on the OCXO (both off ebay) and $30 making PCBs and getting the hardware in place ... already more money than an ebay rubidium standard XD

author: BiOzZ
author_rank: Regular Contributor
timestamp: August 27, 2013, 10:07:01 am
content: and i only have a 25mhz scope and basic tools of my own to work with ... ill stay away from advanced timing until i can at least afford to eat something other than grilled cheese and ramen for dinner XDi really do need to at some point start trading and selling stuff and get a higher bandwidth scope, frequency counter and a good adjustable power supply and maybe one day a spectrum analyzer XD... or build one

author: PA4TIM
author_rank: Super Contributor
timestamp: August 27, 2013, 11:24:50 am
content: I made a very simple but rather accurate counter that uses a 1 pps from for instance my Thrimble (I use a watch crystal and divider for 1 pps in this situation but I could use my Trimble if I want. I did not wright the arduino software. A friend came up with the idea and wrote it, I did the hardware part. It counts up to 2 GHz with a supprizing high accuracy.The cheapest way is an old 50 MHz counter and build a prescaler. That is very simple. Can be done just dead bug.http://www.pa4tim.nl/?p=2662Down the page is the counter because it is just a small part from a bigger project

author: tnt
author_rank: Regular Contributor
timestamp: August 27, 2013, 11:45:48 am
content: The "count edges between two 1PPS" approach works fine (well, great even) for high frequency signals. But when you have low frequency ones, no so much (like trying to measure the line frequency accurately). You'd need to either count for several seconds, or the better approach for low freq is to start counting 10 MHz cycles between N cycles of your input signal.

author: bingo600
author_rank: Super Contributor
timestamp: August 27, 2013, 06:15:37 pm
content: Quote from: Dr. Frank on August 27, 2013, 08:45:16 amHeyyy ...I just bought a 5370A to support my (expensive) T-Nut addiction.Well the price of 142€ (+ 50€ ship) and in EU (no VAT) .....Didn't leave me any option but to buyNow i just need the "Ear Protection - I heard those sounds like a F16 Jet" and a private powerplant (they use 200W/hr)Well the 20pS measurement circuits made with ECL logic requires a lot of power & cooling.I'm going to use it with my Tbolt , and as a supplement to my PM6680 counter./Bingo - T-Nut beginner

author: bingo600
author_rank: Super Contributor
timestamp: August 27, 2013, 06:38:42 pm
content: Afaik right now the cheapest (Lady Heather supported) GPSDO is this one (uses 48v) :*bay # 300933951405You could build a simple diy one with your OCXO and this receiver (The 10Khz output is needed) , but $65 to close to the real one above*bay # 300951184254 (Auction)*bay # 260790984470 (Buy)Diy Url.http://www.jrmiller.demon.co.uk/projects/ministd/frqstd0.htmDiy with a PLLhttp://g4jnt.com/SimpleGPSDO.pdfEven simpler one - Use a uC instead of the 3 dividers , and Xor instead of the PLL (Like the Miller)http://g4jnt.com/EvenSimplerSimplestGpsdoPossible.htmMore on topic , there is a usable freq counter design here (GPS Stabilized) ... Use google translate German->Englishhttp://www.mikrocontroller.net/topic/241150#2458079http://www.mino-elektronik.de/fmeter/fm_software.htm#bsp2I "think" the above design might originate from this code , all though the above uses doubles and not integershttp://www.mikrocontroller.net/topic/186801#newhttp://www.mshopf.de/proj/avr/freq_meter.html/Bingo

author: Dr. Frank
author_rank: Super Contributor
timestamp: August 27, 2013, 07:22:00 pm
content: Quote from: bingo600 on August 27, 2013, 06:15:37 pmCongratulations!But sorry, the 5370A has been produced between 1978-1983, i.e. over 30 years ago.If you don't call THAT 'vintage'..If yours is still working ok, then it's really a bargain...but presumably w/o an OCXO?10811 OCXO also are still available for a few bucks.The first thing I did on my "B" unit was to replace the fan by a new one, from papst, I think.Still loud enough, but not annoying any more.And the repaired 10811 sits fixed at +3e-10 for over one year.Frank

author: bingo600
author_rank: Super Contributor
timestamp: August 27, 2013, 08:03:33 pm
content: Quote from: Dr. Frank on August 27, 2013, 07:22:00 pmWell its younger than me ... so are you implying i'm vintage .....Quote from: Dr. Frank on August 27, 2013, 07:22:00 pmSeller wrote it passes selftest ... So i have to hope ...Afaik. there was an older maybe even more stable OCXO type used in the 5370A's , i can hope there's one in mine when i get it.....Quote from: Dr. Frank on August 27, 2013, 07:22:00 pmI have already ordered a 12v Papst ... & some rubber fasteners.I'm just wondering if i should power it via the built in 10v (as Mark Simms does) or put a small switcher in (fed from the unreg. 20v)Quote from: Dr. Frank on August 27, 2013, 07:22:00 pmWhat was the problem with your 10811 ?Ohh ... Nice RB/T-Bolt case ....Are you using a LPRO ? (C-Field adjust)I have a X72 (nice little one) and 4 x FEI 5080A (Got them when they were cheap)/Bingo

author: Dr. Frank
author_rank: Super Contributor
timestamp: August 27, 2013, 08:26:20 pm
content: Quote from: bingo600 on August 27, 2013, 08:03:33 pmYou have to face the sad truth.. we both are...Quote from: bingo600 on August 27, 2013, 08:03:33 pmDoes it work at your place, or not?Nope, the 5370A normally comes with an ordinary XTAL.Perhaps yours contains a 10544, but the 10811, which was standard in the 5370B, is more stable.Didn't you open your unit, already?Quote from: bingo600 on August 27, 2013, 08:03:33 pmI got the nearly original 110V type, so it was no problem..Quote from: bingo600 on August 27, 2013, 08:03:33 pmThe 100k NTC inside was intermittent, depending on temperature, so the regulation was first unstable, then completely broken. 30 years old ceramic piece..I had to disassemble the whole oven.. The NTC was epoxied in the alu frame, drilled it out first, then assembled the new NTC from epcos using thermal paste.Works perfectly, seems to be much more stable than before. Obviously, those old NTCs age a lot..Quote from: bingo600 on August 27, 2013, 08:03:33 pmCurrently, it's an EFRATOM FRS, but that's not stable any more.Ignites perfectly, very clean/stable signal, but then continuously drifts out of the trim range after 2 weeks or so.Obviously, the bulb has to be rejuvenated, or some resistors inside have to be replaced...Dunno the reason yet. Currently, I'm more Volt-Nutting.Otherwise, the LPRO spare part will go in..Also bought it, when available cheap in China.Frank

author: bingo600
author_rank: Super Contributor
timestamp: August 27, 2013, 08:47:38 pm
content: Quote from: Dr. Frank on August 27, 2013, 08:26:20 pmDamm i had hoped the 10544, was standard in the 5370AWonder if there's any diy sites for fitting a OCXO inside.Else i just have to use the X72 Rubi on the Ext 10MhzSorry i might have written the last message wrong ... I'm still waiting for the unit, it's hopefully close now (GLS)Quote from: Dr. Frank on August 27, 2013, 08:26:20 pmI got a 12v as the guyzz on T-Nut implied it was newer and more silent.Quote from: Dr. Frank on August 27, 2013, 08:26:20 pmYdrfff i have seen picts of desoldering the 10811 Can ...Quote from: Dr. Frank on August 27, 2013, 08:26:20 pmI was also bitten by the Volt-Nut Bug, but not as bad as you "LTZ" guyzz.Currently i "only" have a LM399 ref , a Geller SVR + A SVR-T (from april)But i have ended up with a HP 3478A , an Agilent 34401A , a Keithley 2015-THD , and the "newest" is a HP 3457A with a 8-chan scannerboard (The 3457A is going for Cal. soon)Unfortunately my budget isn't for a 3458A .....I have just finished a 4 channel Atmel USB-AVR based DS18B20 temperature logger.Now i can log temp in the lab, and around the Volt-ref's along with using the 8-chan scanner of the 3457A to measure the refs./Bingo

author: Dr. Frank
author_rank: Super Contributor
timestamp: August 27, 2013, 09:00:26 pm
content: Quote from: bingo600 on August 27, 2013, 08:47:38 pmWell, good luck..normally those units work fine, or can be repaired, you know, the problems with those IC sockets..I think, the assembly of the OCXO is just plug'n play.. the manuals are online, the 5370A version on the net might be my scan..Well, the 10811 was no problem, it is the most simple version, a single stage oven only, so nothing to desolder, just screws to open, and then easy goin'.In my age, I only needed strong glasses, and a loupe later.You've also got nice Volt-Nuts gear..Frank

author: Unknown
author_rank: Unknown
timestamp: August 27, 2013, 09:10:26 pm
content: Gerry Sweeney recently did ablog and videoabout adding a DIY OCXO to a more modern HP counter (probably 10811 compatible).The reason why those fancy counters are offered with those lousy oscillators is because many of them will end up being connected to an external frequency reference (eg. GPSDO) for the rest of their lives. So paying extra for a fancy OCXO doesn't make much sense in those cases.

author: Dr. Frank
author_rank: Super Contributor
timestamp: August 28, 2013, 06:49:12 am
content: Quote from: alm on August 27, 2013, 09:10:26 pmWell, here in our company, all of the dozens of 54131 counters on the bench have the XTAL option only, and are not running on external reference. So they only have 6 digit uncertainty and stability, "wasting" 4-5 digits.The only reason is the high price (hp) of the oven, and that the engineers don't really need that high accuracy.For the 5370A/B, an OCXO really makes sense, as it also has much better short term stability (5e-12) than the simple XTAL.And not everybody wants to use the counter together with a 2nd device.So I'll recommend buying a 10811, sometimes costs less than 100 bucks on the bay.Watch out for the different versions of the 10811; the -60111 of the 5370B is mostly sufficient.Frank

author: bingo600
author_rank: Super Contributor
timestamp: August 30, 2013, 04:35:31 pm
content: I got my 5370A , and it has the 10544 OCXO in it.Started a new topic if anyone has tipshttps://www.eevblog.com/forum/projects/my-%27new%27-5370a-shows-err-02//Bingo