{"id":214,"date":"2014-10-21T09:43:43","date_gmt":"2014-10-21T15:43:43","guid":{"rendered":"http:\/\/www.kv6o.com\/wordpress\/?p=214"},"modified":"2014-10-21T10:28:15","modified_gmt":"2014-10-21T16:28:15","slug":"strange-dreams-about-vfo-drift","status":"publish","type":"post","link":"https:\/\/www.kv6o.com\/wordpress\/2014\/10\/21\/strange-dreams-about-vfo-drift\/","title":{"rendered":"Strange dreams about VFO drift."},"content":{"rendered":"<p>I have strange dreams. \u00a0I often awake with new ideas on something that I am working on, which really isn&#8217;t all that strange, but when I try to explain my dreams to my wife, well&#8230;. they&#8217;re <em>strange.<\/em><\/p>\n<p>Yesterday morning I woke up thinking about other things I could do with the DG5 shield, and one of the things I dreamed about was making VFO drift measurements. \u00a0Using the DG5 emulator and the USB communications with the computer, I could log the calculated VFO frequency over time, and see how my VFO drifted during warmup. \u00a0This was pretty straight forward, instead of scanning thru three frequencies to measure, I just locked the board to the VFO and increased the gate time to 1 second, and took a measurement every 6 seconds. \u00a0I printed these results to the serial port and captured them with my computer.<\/p>\n<p>Now, there&#8217;s another source of drift in this setup, and that&#8217;s the crystal oscillator on the Arduino itself. \u00a0The crystal&#8217;s I have used for other ATMega328 based project boards are rated at 20ppm at 16Mhz &#8211; the clock frequency the Arduino uses. 20ppm works out to be +\/- 320 Hz = quite a bit of potential measurement error! \u00a0But crystals don&#8217;t usually drift all over the place in short periods of time, with relativity stable temperatures. \u00a0I had the Arduino and the shield powered up overnight with the TS-520S off, so I figured it would be pretty stable for a measurement of the TS-520S VFO drift during warm-up.<\/p>\n<p><a href=\"http:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Uncorrected-VFO-drift-at-warmup.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-219\" src=\"http:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Uncorrected-VFO-drift-at-warmup-1024x651.jpg\" alt=\"Uncorrected-VFO-drift-at-warmup\" width=\"625\" height=\"397\" srcset=\"https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Uncorrected-VFO-drift-at-warmup-1024x651.jpg 1024w, https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Uncorrected-VFO-drift-at-warmup-300x190.jpg 300w, https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Uncorrected-VFO-drift-at-warmup-624x397.jpg 624w, https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Uncorrected-VFO-drift-at-warmup.jpg 1329w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>Here&#8217;s the drift plot over about 3 hours of warmup. \u00a0I suspect most of the calculated drift is the TS-520S VFO, and not the Arduino. But we can actually eliminate the Arduino&#8217;s error using one of the DG5&#8217;s other inputs.<\/p>\n<p>By using an external frequency reference, we can eliminate the Arduino as a source of the error. \u00a0The DG5 emulater can select from 3 inputs for measuring (2 direct, 1 prescaled by a divide by 8 counter), so I used my HP 8924C as an external frequency reference. It uses an OCXO (Oven Controlled Crystal Oscillator) for it&#8217;s frequency source, which is much better than the $0.39 Arduino crystal. I don&#8217;t have the spec&#8217;s in front of me, but if I remember correctly, it&#8217;s something like 0.05 ppm or better. \u00a0I have used it to obtain sub 1 Hz measurements in the ARRL Frequency Measurement Test (http:\/\/www.b4h.net\/fmt\/fmtresults201404.php), so it&#8217;s pretty good at these frequencies.<\/p>\n<p>This time I had the program select the VFO input, make a measurement, then select the external frequency reference (which was set to 5.000000 Mhz) , and make another measurement, Since we know the input frequency is 5.000000 Mhz we can calculate the error, then apply that error to the measured VFO frequency. \u00a0The data of the Arduino looks like this:<\/p>\n<p>VFO,REF,ERROR,FREQUENCY,Millis<br \/>\n5000064,4999944,-56,5000008,10043<br \/>\n5000064,4999945,-55,5000009,15044<br \/>\n5000064,4999944,-56,5000008,20045<br \/>\n5000064,4999945,-55,5000009,25046<br \/>\n5000064,4999944,-56,5000008,30047<br \/>\n5000065,4999945,-55,5000010,35048<br \/>\n5000064,4999945,-55,5000009,40049<br \/>\n5000064,4999945,-55,5000009,45050<br \/>\n5000064,4999944,-56,5000008,50051<br \/>\n5000064,4999945,-55,5000009,55052<br \/>\n5000064,4999944,-56,5000008,60053<br \/>\n5000064,4999945,-55,5000009,65054<\/p>\n<p>That&#8217;s the fist minute or so of data out of the Arduino. \u00a0The columns are VFO (the raw measured frequency), the Ref (the 5 Mhz reference frequency as measured by the Arduino), The calculated error (REF &#8211; 5,000,000), the corrected VFO frequency (Measured VFO + ERROR), and lastly the millis() function out of the Arduino which gives us the Millis counter value &#8211; how many milliseconds we&#8217;ve been running.<\/p>\n<p>Put this in to Excel, and we get this:<\/p>\n<p><a href=\"http:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Arduino-Measurement-Error.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-220\" src=\"http:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Arduino-Measurement-Error-1024x727.jpg\" alt=\"Arduino-Measurement-Error\" width=\"625\" height=\"443\" srcset=\"https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Arduino-Measurement-Error-1024x727.jpg 1024w, https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Arduino-Measurement-Error-300x213.jpg 300w, https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Arduino-Measurement-Error-624x443.jpg 624w, https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/Arduino-Measurement-Error.jpg 1273w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>Here&#8217;s the calculated error in Hz over about 7 1\/2 hours (I left it running overnight). \u00a0Looks like the Arduino is -59.512 Hz low on average, but drifted only about 5Hz during the test. \u00a0Not bad, and perhaps I should add a frequency error compensation factor in the DG5 code.<\/p>\n<p>Here&#8217;s the corrected VFO drift over 7 1\/2 hours:<\/p>\n<p><a href=\"http:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/CorrectedVFOfrequencydrift.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-218\" src=\"http:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/CorrectedVFOfrequencydrift-1024x736.jpg\" alt=\"CorrectedVFOfrequencydrift\" width=\"625\" height=\"449\" srcset=\"https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/CorrectedVFOfrequencydrift-1024x736.jpg 1024w, https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/CorrectedVFOfrequencydrift-300x215.jpg 300w, https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/CorrectedVFOfrequencydrift-624x448.jpg 624w, https:\/\/www.kv6o.com\/wordpress\/wp-content\/uploads\/2014\/10\/CorrectedVFOfrequencydrift.jpg 1080w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Even after running all day, the TS-520S&#8217;s VFO continues to drift appreciably &#8211; about 40Hz over this time frame. \u00a0No big deal &#8211; it&#8217;s amazingly stable for the technology &#8211; but it&#8217;s sure nice to be able to characterize it!<\/p>\n<p>Points learned:<\/p>\n<ul>\n<li>It looks like the Arduino frequency stability is about 10x better than the TS-520&#8217;s VFO in this setup, which is good since we&#8217;re looking to the Arduino to measure the VFO.<\/li>\n<li>I have only measured the VFO so far, I&#8217;ll probably do a similar exercise with the BFO (which mixes with the VFO to obtain the IF frequency) and the Hetrodyne oscillator (HET) to see how stable they are.<\/li>\n<\/ul>\n<p>The DG5 shield can be a useful tool as well as a frequency display!<\/p>\n<p>Steve<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have strange dreams. \u00a0I often awake with new ideas on something that I am working on, which really isn&#8217;t all that strange, but when I try to explain my dreams to my wife, well&#8230;. they&#8217;re strange. Yesterday morning I woke up thinking about other things I could do with the DG5 shield, and one [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-214","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2NQIK-3s","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/posts\/214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/comments?post=214"}],"version-history":[{"count":5,"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/posts\/214\/revisions"}],"predecessor-version":[{"id":223,"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/posts\/214\/revisions\/223"}],"wp:attachment":[{"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/media?parent=214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/categories?post=214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kv6o.com\/wordpress\/wp-json\/wp\/v2\/tags?post=214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}