{"id":129,"date":"2010-01-28T23:58:49","date_gmt":"2010-01-29T04:58:49","guid":{"rendered":"http:\/\/ammonsengineering.com\/blog\/2010\/01\/current-spikes-with-inductors\/"},"modified":"2010-01-29T00:33:46","modified_gmt":"2010-01-29T05:33:46","slug":"current-spikes-with-inductors","status":"publish","type":"post","link":"https:\/\/ammonsengineering.com\/blog\/2010\/01\/current-spikes-with-inductors\/","title":{"rendered":"Current spikes with inductors"},"content":{"rendered":"<p>I ended up ordering\u00a0a 220 uH inductor and a 470 uH inductor.\u00a0 They arrived today so I tried them out.\u00a0 I tried each inductor separately, then combined them to get 690 uH.\u00a0 I saved graphs at 5, 25, 50, and 75%.\u00a0 I plotted the original curve (white), a smoothed curve (red) and the mean value (green).\u00a0 The graph for the 470 uH inductor at 25% duty cycle is shown below.\u00a0 For those that are interested in seeing all the graphs, here are the\u00a0<a href=\"http:\/\/ammonsengineering.com\/blog\/wp-content\/uploads\/2010\/01\/Current-Waveform-Inductor-Results.zip\">Current Waveform Inductor Results (zipped)<\/a>.<\/p>\n<div id=\"attachment_133\" style=\"width: 578px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/ammonsengineering.com\/blog\/wp-content\/uploads\/2010\/01\/Current-waveform-25-percent-duty-cycle-470-inductor.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-133\" class=\"size-full wp-image-133 \" title=\"Current waveform, 25% duty cycle, 470 uH inductor\" src=\"http:\/\/ammonsengineering.com\/blog\/wp-content\/uploads\/2010\/01\/Current-waveform-25-percent-duty-cycle-470-inductor.png\" alt=\"Current waveform, 25% duty cycle, 470 uH inductor\" width=\"568\" height=\"310\" srcset=\"https:\/\/ammonsengineering.com\/blog\/wp-content\/uploads\/2010\/01\/Current-waveform-25-percent-duty-cycle-470-inductor.png 946w, https:\/\/ammonsengineering.com\/blog\/wp-content\/uploads\/2010\/01\/Current-waveform-25-percent-duty-cycle-470-inductor-150x81.png 150w, https:\/\/ammonsengineering.com\/blog\/wp-content\/uploads\/2010\/01\/Current-waveform-25-percent-duty-cycle-470-inductor-300x163.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/a><p id=\"caption-attachment-133\" class=\"wp-caption-text\">Current waveform, 25% duty cycle, 470 uH inductor<\/p><\/div>\n<p>The graphs still look nothing like the behavior that was predicted on the NI discussion forums.\u00a0 The folks at NI predicted a rising current when it was on and a dropping current when it was off, creating a sawtooth waveform.\u00a0 They figured sampling\u00a0in the middle of the on portion of the cycle would give you a\u00a0good estimate of the average current.\u00a0 Obviously, that wouldn&#8217;t work in this case.\u00a0 From the different graphs, I was able to make a number of useful observations.<\/p>\n<ul>\n<li>There is still a spike at the beginning of the on cycle.\u00a0 It isn&#8217;t as large, but it still makes the first 100 counts of data unusable.\u00a0 This region should always be avoided when measuring\u00a0current.<\/li>\n<li>The high frequency oscillation is due to the rotation of the motor.\u00a0 I assume the resistance varies as the motor rotates.\u00a0\u00a0As the inductance increases, the amplitude of these oscillations decreases.\u00a0 At 5% duty cycle, the motor did not rotate and the graphs are very smooth.<\/li>\n<li>The inductors introduced a large amplitude oscillation in the current.\u00a0 As the inductance increases, the amplitude decreases and the frequency decreases.\u00a0 With a very large inductance, the oscillations would go away.<\/li>\n<li>Ignoring the motor oscillations, these graphs are very repeatable.\u00a0 They shift up and down as the load is changed but do not change shape at all, indicating that selecting a point where the smoothed curve crosses the mean should always give the correct current value.<\/li>\n<\/ul>\n<p>With the 220 uH inductor, the graphs seem more uneven and erratic.\u00a0 With the two larger inductances, I get very similar results.\u00a0 For now, I plan on going with the 470 uH inductor.\u00a0 I haven&#8217;t examined the motor performance yet, but I suspect it will work just fine.\u00a0 It seems just as zippy as ever, so any effects should be minor.<\/p>\n<p>Since I can&#8217;t easily predict when the best time to read the current is, I plan on building a lookup table that tells me when to sample based on the pulse width.\u00a0 To create the table, I can locate the intersection between the smooth curve and the mean curve\u00a0for each pulse width.\u00a0 It shouldn&#8217;t be too difficult to automate the process.\u00a0 For small pulse widths, I plan on preventing rotation to eliminate the small pulses until the current gets too high.\u00a0 For larger pulse widths, the smoothing works very well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ended up ordering\u00a0a 220 uH inductor and a 470 uH inductor.\u00a0 They arrived today so I tried them out.\u00a0 I tried each inductor separately, then combined them to get 690 uH.\u00a0 I saved graphs at 5, 25, 50, and 75%.\u00a0 I plotted the original curve (white), a smoothed curve (red) and the mean value [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-129","post","type-post","status-publish","format-standard","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":3,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/posts\/129\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}