{"id":2422,"date":"2015-08-08T12:14:38","date_gmt":"2015-08-08T12:14:38","guid":{"rendered":"http:\/\/www.richardmudhar.com\/?p=2422"},"modified":"2018-05-02T12:06:52","modified_gmt":"2018-05-02T12:06:52","slug":"measuring-paramagnetism-3-a-portable-instrument","status":"publish","type":"post","link":"https:\/\/www.richardmudhar.com\/blog\/2015\/08\/measuring-paramagnetism-3-a-portable-instrument\/","title":{"rendered":"Measuring paramagnetism 3 &#8211; a portable instrument"},"content":{"rendered":"<p>In <a href=\"http:\/\/www.richardmudhar.com\/blog\/2015\/07\/measuring-paramagnetism-2-a-new-sensor\/\">Part 2<\/a> I described a flat coil sensor which changes inductance according to the magnetic susceptibility of what is in front of it. To make this useful in the field I need something to display the change.<\/p>\n<figure id=\"attachment_2471\" aria-describedby=\"caption-attachment-2471\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082271.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2471\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082271-550x310.jpg?resize=550%2C310\" alt=\"the field instrument\" width=\"550\" height=\"310\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082271.jpg?resize=550%2C310&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082271.jpg?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082271.jpg?resize=624%2C352&amp;ssl=1 624w\" sizes=\"auto, (max-width: 550px) 85vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2471\" class=\"wp-caption-text\">the field instrument. The black button stores the calibration frequency with no sample, the red button takes the reading and displays the result after 4 seconds<\/figcaption><\/figure>\n<p>I was going to count the high-frequency microcontroller clock over, say 500 periods of the low-frequency sensor signal. That turns out to be a terrible way to do this. I don&#8217;t have the gear to measure it, but I suspect the jitter from slicing the 1.5kHz sensor signal is too high. The result is that the third significant digit twitters a lot. By counting changes in the sliced sensor signal (thus doubling the frequency) over a fixed period I get the twitter down to one part in &gt;12000 counts<sup id=\"fnref-2422-1\"><a href=\"#fn-2422-1\" class=\"jetpack-footnote\">1<\/a><\/sup> over a four-second signal acquisition time. <!--more--><\/p>\n<p>I can live with that. Since<\/p>\n<p><em>\u03c7<sub>m<\/sub><\/em> = (f1\u00b2-f2\u00b2)\/(f1\u00b2 \u00d7 4 \u03c0)<\/p>\n<p>an error of one part in 12000 gives me an error of 13 \u00b5CGS (12000\u00b2-11999\u00b2)\/(12000\u00b2 \u00d7 4 \u03c0) = 13\u00b5CGS. In practice since my coil will only ever intercept about half the effective susceptibility of the target I will take an error of about 25CGS &#8211; I imagine the correction factor for the effective susceptibility would be about 2 or more. Callahan&#8217;s scale seems to indicate less than 100 was poor, 100 to 300 was good, so I&#8217;m in the right ballpark on accuracy. I can use exactly the same rig for a lab version where the sample is enclosed in a solenoid and integrate over a longer time at a lower frequency, but for field use a 4 second integration time is about right.<\/p>\n<p>The MCU clock frequency is 1MHz, and the timer rolls over at 65536, which is kind of inconvenient. If I set it to roll over at 50000 and prescale by 2 I get 0.1sec resolution, which is easier to get a frequency from. Although I used a PIC 16F628 the nonexistent maths support is a pain, and an Arduino is probably the right sort of price\/performance. On the PIC I used <a href=\"http:\/\/justanotherlanguage.org\/\" target=\"_blank\" rel=\"noopener\">JAL<\/a> which only does integer maths, and to try and keep within the limited dynamic range of integer maths was a bear. In the end I gave up and transformed the maths to get rid of those mahoosive squares and get it within the capacity of sdwords (-2,147,483,648 to 2,147,483,647)<\/p>\n<p><em>\u03c7<sub>m<\/sub><\/em> = (f1\u00b2-f2\u00b2)\/(f1\u00b2 \u00d7 4 \u03c0)<\/p>\n<p>Substitute f2=f1+D<\/p>\n<p>where D is the difference between the integer frequencies such that D=f2-f1<\/p>\n<p><em>\u03c7<sub>m<\/sub><\/em> = (f1\u00b2-(f1+D)(f1+D))\/f1\u00b2<\/p>\n<p>= (f1\u00b2 &#8211; f1\u00b2 &#8211; 2f1D- D\u00b2)\/ f1\u00b2<\/p>\n<p>= &#8211; (2f1D- D\u00b2)\/ f1\u00b2<\/p>\n<p>Now assuming D &lt;&lt; F1 we can lose the\u00a0 D\u00b2 term in the noise<\/p>\n<p>\u2245-2D\/f1<\/p>\n<p>which is much more tractable in integer maths. I simulated the difference between this and the exact equation in Excel<\/p>\n<figure id=\"attachment_2424\" aria-describedby=\"caption-attachment-2424\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_chart.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2424\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_chart-550x495.png?resize=550%2C495\" alt=\"cart showing frequency (versus a 1500Hz reference) and the resulting X value - the blue is hte correct value and the greeny line is the straight-line approximation\" width=\"550\" height=\"495\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_chart.png?resize=550%2C495&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_chart.png?resize=624%2C562&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/07\/1507_chart.png?w=731&amp;ssl=1 731w\" sizes=\"auto, (max-width: 550px) 85vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2424\" class=\"wp-caption-text\">cart showing frequency (versus a 1500Hz reference) and the resulting X value &#8211; the blue is hte correct value and the greeny line is the straight-line approximation<\/figcaption><\/figure>\n<p>Of note is that I&#8217;m only 3% off at the 10,000 \u00b5CGS level &#8211; there is less range of negative values because diamagnetic effects are weak unless you run into a superconducting rock&#8230; I start to reach a 10% error at the 20,000 \u00b5CGS level. Callahan seems to think soils top out at 2,000\u00b5CGS, at which I&#8217;m less than 1% off by cheating using a linear approximation. This will not be my greatest source of error \ud83d\ude42<\/p>\n<p>When I build the lab version of this I will use Arduino and the power of C and floating-point maths to do this right, because the solenoid sensor can enclose the sample so the effective susceptibility will be much larger. But for a hand-held survey machine the beauty of the PIC is that it&#8217;s low-power compared to that static 7mA drag of an Arduino doing nothing &#8211; my PIC machine draws about 6mA, so I would get a battery life of over a week from 1300 mAh NiMH batteries.<\/p>\n<h4>Results &#8211; there is no significant paramagnetic rock in East Anglian soils<\/h4>\n<p>well, the ones I measured near Ipswich. This puzzles me as East Anglia is the breadbasket of Britain but there we go. There is no significant presence of rock in East Anglia, but I would have thought the glacial erosion would have brought some paramagnetic material (which tends to be associated with igneous rock) in the soils, but if it has then it&#8217;s at too low a proportion for me to detect, the soils would classify as poor on Callahan&#8217;s scale.<\/p>\n<figure id=\"attachment_2472\" aria-describedby=\"caption-attachment-2472\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082270.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2472\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082270-550x370.jpg?resize=550%2C370\" alt=\"flint is not paramagnetic\" width=\"550\" height=\"370\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082270.jpg?resize=550%2C370&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082270.jpg?resize=624%2C420&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2015\/08\/1508_paramag_P8082270.jpg?w=867&amp;ssl=1 867w\" sizes=\"auto, (max-width: 550px) 85vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2472\" class=\"wp-caption-text\">flint is not paramagnetic<\/figcaption><\/figure>\n<p>Indeed the only significant amount of stone, flint, which are petrified sponges, is not paramagnetic. This is not a particularly earth-shattering discovery as flint is a form of quartz. Since one LSB count is 25uCGS and <a href=\"http:\/\/gravmag.ou.edu\/mag_rock\/mag_rock.html\" target=\"_blank\" rel=\"noopener\">quartz is <\/a>diamagnetic, about -1E-6 CGS I&#8217;m not going to pick the signal up.<\/p>\n<p><a href=\"http:\/\/www.richardmudhar.com\/blog\/tag\/paramagnetism\/\" target=\"_blank\" rel=\"noopener\">Measuring paramagnetism<\/a> series<\/p>\n<p><a href=\"http:\/\/www.richardmudhar.com\/blog\/2015\/07\/measuring-paramagnetism-2-a-new-sensor\/\" target=\"_blank\" rel=\"noopener\">part2<\/a><br \/>\n<a href=\"http:\/\/www.richardmudhar.com\/blog\/2015\/07\/measuring-paramagnetism\/\" target=\"_blank\" rel=\"noopener\">part1<\/a><\/p>\n<p>&nbsp;<\/p>\n<div class=\"footnotes\">\n<hr \/>\n<ol>\n<li id=\"fn-2422-1\">\nthe operating frequency is ~1500 Hz so counting transitions gives me 2 x 1500 * 4 = 12000 counts in four seconds&#160;<a href=\"#fnref-2422-1\">&#8617;<\/a>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In Part 2 I described a flat coil sensor which changes inductance according to the magnetic susceptibility of what is in front of it. To make this useful in the field I need something to display the change. I was going to count the high-frequency microcontroller clock over, say 500 periods of the low-frequency sensor &hellip; <a href=\"https:\/\/www.richardmudhar.com\/blog\/2015\/08\/measuring-paramagnetism-3-a-portable-instrument\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Measuring paramagnetism 3 &#8211; a portable instrument&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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},"jetpack_post_was_ever_published":false},"categories":[57],"tags":[309],"class_list":["post-2422","post","type-post","status-publish","format-standard","hentry","category-electronics","tag-paramagnetism"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5aOO7-D4","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts\/2422","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=2422"}],"version-history":[{"count":14,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts\/2422\/revisions"}],"predecessor-version":[{"id":3476,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts\/2422\/revisions\/3476"}],"wp:attachment":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/media?parent=2422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/categories?post=2422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/tags?post=2422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}