{"id":2382,"date":"2015-07-20T15:29:44","date_gmt":"2015-07-20T15:29:44","guid":{"rendered":"http:\/\/www.richardmudhar.com\/?p=2382"},"modified":"2018-05-02T09:33:58","modified_gmt":"2018-05-02T09:33:58","slug":"measuring-paramagnetism-2-a-new-sensor","status":"publish","type":"post","link":"https:\/\/www.richardmudhar.com\/blog\/2015\/07\/measuring-paramagnetism-2-a-new-sensor\/","title":{"rendered":"Measuring paramagnetism 2 &#8211; a new sensor"},"content":{"rendered":"<p><a href=\"http:\/\/www.richardmudhar.com\/2015\/07\/measuring-paramagnetism\/\">Part 1<\/a><\/p>\n<p>Since I will be taking the sensor to the rock I&#8217;m going to temporarily give up on getting an absolute measurement, and take a leaf out of Bartington&#8217;s book <a href=\"http:\/\/www.richardmudhar.com\/2015\/07\/measuring-paramagnetism\/\">from last time<\/a> and use a flat coil. I will never be able to contain the sample in the magnetic field<sup id=\"fnref-2382-1\"><a href=\"#fn-2382-1\" class=\"jetpack-footnote\">1<\/a><\/sup> as I might be able to in a solenoid, to the effective susceptibility will always be lower than 1. One day I may be able to calibrate this and find a fixing factor, but for now I will look for relative differences.<\/p>\n<p><!--more--><\/p>\n<p>I want a 2&#8243; diameter coil so I cut some end-cheeks from acrylic. One day it would be nice to have a lathe, but this I did with a saw and spinning the work in a drill and sanding, which is how the cracks got into the lower disc.<\/p>\n<figure id=\"attachment_2384\" aria-describedby=\"caption-attachment-2384\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/DSCN2742.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2384\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/DSCN2742-550x413.jpg?resize=550%2C413\" alt=\"flat coil bobbin. All hardware needs to be plastic...\" width=\"550\" height=\"413\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/DSCN2742.jpg?resize=550%2C413&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/DSCN2742.jpg?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/DSCN2742.jpg?resize=624%2C468&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/DSCN2742.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 550px) 85vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2384\" class=\"wp-caption-text\">flat coil bobbin. All hardware needs to be plastic including the screws and nuts&#8230;<\/figcaption><\/figure>\n<p>Initially I figured I&#8217;d use a 4046 PLL and swipe a technique from the tesla coil community which I&#8217;ve seen used in a paper on measuring paramagnetic nanoparticles, (which is a common non-weird agriculture\u00a0 application \ud83d\ude09 ) US <a href=\"http:\/\/patentimages.storage.googleapis.com\/pdfs\/US7241630.pdf\" target=\"_blank\" rel=\"noopener\">patent 7241630<\/a> describes the idea and <a href=\"http:\/\/uzzors2k.4hv.org\/index.php?page=ihpll1\" target=\"_blank\" rel=\"noopener\">Uzzors&#8217; PLL induction heater driver<\/a> shows the principle in action. I implemented this<\/p>\n<figure id=\"attachment_2397\" aria-describedby=\"caption-attachment-2397\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_pll_direct1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2397\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_pll_direct1-550x218.png?resize=550%2C218\" alt=\"PLL - with frequency divider to bring VCO frequency up to 512kHz from the sensor resonance of 1kHz\" width=\"550\" height=\"218\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_pll_direct1.png?resize=550%2C218&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_pll_direct1.png?resize=624%2C248&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_pll_direct1.png?w=836&amp;ssl=1 836w\" sizes=\"auto, (max-width: 550px) 85vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2397\" class=\"wp-caption-text\">PLL &#8211; with frequency divider to bring VCO frequency up to 512kHz from the sensor resonance of 1kHz<\/figcaption><\/figure>\n<p>with a 2^9 divider to run the VCO at 512kHz.<\/p>\n<p>The trouble is the phase shift across the tank circuit doesn&#8217;t actually vary that fast. Simulating the tank damped by the 6k8 resistor shows the phase shift varies \u00b120\u00b0 between 1.025k and 1.03k, so the amount of frequency change is a combination of where the PLL VCO voltage wants to sit and the output of the phase detector, which locks in a range between 0 and 180 degrees (to acquire the signal in the first place experience shows this usually wants to be within \u00b190\u00b0, though it depends on the characteristics of the loop filter)<\/p>\n<figure id=\"attachment_2388\" aria-describedby=\"caption-attachment-2388\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202241.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2388\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202241-550x445.jpg?resize=550%2C445\" alt=\"phase shift at one end of range\" width=\"550\" height=\"445\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202241.jpg?resize=550%2C445&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202241.jpg?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202241.jpg?resize=624%2C505&amp;ssl=1 624w\" sizes=\"auto, (max-width: 550px) 85vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2388\" class=\"wp-caption-text\">phase shift at one end of range<\/figcaption><\/figure>\n<figure id=\"attachment_2389\" aria-describedby=\"caption-attachment-2389\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202242.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2389\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202242-550x444.jpg?resize=550%2C444\" alt=\"and at the low end\" width=\"550\" height=\"444\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202242.jpg?resize=550%2C444&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202242.jpg?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_P7202242.jpg?resize=624%2C503&amp;ssl=1 624w\" sizes=\"auto, (max-width: 550px) 85vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2389\" class=\"wp-caption-text\">and at the low end<\/figcaption><\/figure>\n<p>So the whole thing is a bit lacking in Q. I&#8217;m using the VCO and not sweating the tank circuit Q to clean the signal up. The circuit works fine and tracks the frequency, but the PLL is noisy and as a result the 5th and sixth digits twitter on the frequency display. I tuned a scanner to the 512kHz frequency and stuck 10cm of wire as an aerial &#8211; the note is rough<\/p>\n<figure id=\"attachment_2390\" aria-describedby=\"caption-attachment-2390\" style=\"width: 329px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_fft.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2390\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_fft.png?resize=329%2C462\" alt=\"FFT of the scanner audio showing the spurs\" width=\"329\" height=\"462\" \/><\/a><figcaption id=\"caption-attachment-2390\" class=\"wp-caption-text\">FFT of the scanner audio showing the spurs close to the fundamental<\/figcaption><\/figure>\n<audio class=\"wp-audio-shortcode\" id=\"audio-2382-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/pll_hash_LS102003.mp3?_=1\" \/><a href=\"http:\/\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/pll_hash_LS102003.mp3\">http:\/\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/pll_hash_LS102003.mp3<\/a><\/audio>\n<h4>Back to radio ways?<\/h4>\n<p>The PLL probably wanted optimisation and a second order filter, but I just didn&#8217;t feel I was going in the right direction here. In general, you want to couple the sensor as lightly as possible so changes in inductance can shift frequency in a clear way, unmuddied by resistive damping. What I need is a regular variable frequency oscillator (VFO).<\/p>\n<p>I was hankering after the elegant simplicity of the <a href=\"http:\/\/www.richardmudhar.com\/2015\/07\/measuring-paramagnetism\/\">Colpitts oscillator in part 1<\/a>. It also occurred to me that I could dispense with the PLL &#8211; although it takes more than 10 seconds of cycle counting to get 5 digit resolution at 1000 Hz because you need 10,000 cycles to get that precision, I could also count 1024 cycles of the unknown roughly 1 kHz cycles, and start a timer counting CPU clock in the microcontroller and stop it after I have, say, 1024 cycles. I would have bucketloads of clean signal from a VFO so the slicing threshold shouldn&#8217;t vary too much over a second (which would otherwise give me a noise error in the analogue domain, which a PLL loop filter would take out).<\/p>\n<p>Because it&#8217;s a differential measurement spaced over a couple of seconds, the poor long-term stability and temperature drift of a VFO aren&#8217;t an issue. Time for a rethink. The trouble with the Colpitts oscillator is that the capacitive divider halves the value of capacitance possible &#8211; I am using 1\u00b5F mylar, and I don&#8217;t have anything bigger. Observing that gain is easily to be had at 1kHz points me at a lightly coupled oscillator, something like the <a href=\"http:\/\/www.robkalmeijer.nl\/techniek\/electronica\/radiotechniek\/hambladen\/radcom\/1994\/11\/page60\/index.html\" target=\"_blank\" rel=\"noopener\">Franklin oscillator<\/a>, with op-amps<sup id=\"fnref-2382-2\"><a href=\"#fn-2382-2\" class=\"jetpack-footnote\">2<\/a><\/sup><\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_2398\" aria-describedby=\"caption-attachment-2398\" style=\"width: 492px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_franklin.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2398\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_franklin.png?resize=492%2C295\" alt=\"Franklin oscillator with dual opamp\" width=\"492\" height=\"295\" \/><\/a><figcaption id=\"caption-attachment-2398\" class=\"wp-caption-text\">Franklin oscillator with dual opamp<\/figcaption><\/figure>\n<p>It would be possible to do this with one opamp, but I wanted to use U1B unity gain to monitor the sensor loaded as little as possible and without nonlinearity. There&#8217;s a convenient squarewave on the output of U1A, the risetime is limited by the slew rate of U1A to about 32\u00b5s.<\/p>\n<figure id=\"attachment_2399\" aria-describedby=\"caption-attachment-2399\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_franklin_P7212243.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2399\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_franklin_P7212243-550x439.jpg?resize=550%2C439\" alt=\"Waveform at the output of the buffer stage (top) and the driving stage\" width=\"550\" height=\"439\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_franklin_P7212243.jpg?resize=550%2C439&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_franklin_P7212243.jpg?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_franklin_P7212243.jpg?resize=624%2C498&amp;ssl=1 624w\" sizes=\"auto, (max-width: 550px) 85vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2399\" class=\"wp-caption-text\">Waveform at the output of the buffer stage (top) and the driving stage<\/figcaption><\/figure>\n<p>Measuring the frequency shows the 5th digit is stable on my frequency meter which is the best it can do on the 10s range &#8211; using a better counter shows the .01 digit is stable over the few seconds a measurement would take, this is a short-term (ie period of measurement of ~ 1sec)\u00a0 stability of better than 1 part in 100,000. This will not be my greatest source of error.<\/p>\n<h4>Counting MCU clock cycles rather than low-frequency cycles<\/h4>\n<p>I can lose the PLL by using a PIC or an Arduino &#8211; and using one of the internal timers to count, say, 500 cycles of the 1kHz (taking half a second) while at the same time counting MCU clock cycles over the same period. From part 1<\/p>\n<p><em>\u03c7<sub>m<\/sub><\/em> is (L2-L1)\/(L1 \u00d7 4 \u03c0)<\/p>\n<p>where L1 is the initial empty inductance and L2 is the inductance in the presence of the sample. Since the frequency is proportional to the square root of inductance I can transform this to<\/p>\n<p><em>\u03c7<sub>m<\/sub><\/em> = (f1\u00b2-f2\u00b2)\/(f1\u00b2 \u00d7 4 \u03c0)<\/p>\n<p>where f1 and f2 and the initial empty frequency and the frequency in the presence of the sample, Since I will be measuring the period times a constant which is proportional to the reciprocal of frequency, if C1 and C2 are the counts corresponding to f1 and f2 I get<\/p>\n<p><em>\u03c7<sub>m<\/sub><\/em> = (C2\u00b2-C1\u00b2)\/(C2\u00b2 \u00d7 4 \u03c0)<\/p>\n<div class=\"footnotes\">\n<hr \/>\n<ol>\n<li id=\"fn-2382-1\">\nunless I grind a slot in the rockface and put the coil into it I suppose :)&#160;<a href=\"#fnref-2382-1\">&#8617;<\/a>\n<\/li>\n<li id=\"fn-2382-2\">\nafter designing this I came across Irving Gottlieb&#8217;s <a href=\"https:\/\/books.google.co.uk\/books?id=e_oZ69GAuxAC&amp;lpg=PA163&amp;ots=vZkK-nkX9r&amp;dq=Franklin%20oscillator&amp;pg=PA164#v=onepage&amp;q=Franklin%20oscillator&amp;f=false\" target=\"_blank\" rel=\"noopener\">Practical Oscillator Handbook<\/a> in Google Books which implies running open-loop. My innovation is observing opamps can do non-inverting, which the valve or transistor stage can&#8217;t do in a discrete-component Franklin, hence the need for a second stage. I need R2 &#8211; else U1A rams itself up against the single supply rail after a few cycles.&#160;<a href=\"#fnref-2382-2\">&#8617;<\/a>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Part 1 Since I will be taking the sensor to the rock I&#8217;m going to temporarily give up on getting an absolute measurement, and take a leaf out of Bartington&#8217;s book from last time and use a flat coil. I will never be able to contain the sample in the magnetic field1 as I might &hellip; <a href=\"https:\/\/www.richardmudhar.com\/blog\/2015\/07\/measuring-paramagnetism-2-a-new-sensor\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Measuring paramagnetism 2 &#8211; a new sensor&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2385,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"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":[57],"tags":[309],"class_list":["post-2382","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronics","tag-paramagnetism"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/DSCN2746.jpg?fit=1280%2C960&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5aOO7-Cq","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts\/2382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/comments?post=2382"}],"version-history":[{"count":18,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts\/2382\/revisions"}],"predecessor-version":[{"id":3475,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts\/2382\/revisions\/3475"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/media\/2385"}],"wp:attachment":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/media?parent=2382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/categories?post=2382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/tags?post=2382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}