{"id":103,"date":"2010-01-19T22:10:06","date_gmt":"2010-01-20T03:10:06","guid":{"rendered":"http:\/\/ammonsengineering.com\/blog\/?p=103"},"modified":"2010-01-20T21:29:57","modified_gmt":"2010-01-21T02:29:57","slug":"software-begins","status":"publish","type":"post","link":"https:\/\/ammonsengineering.com\/blog\/2010\/01\/software-begins\/","title":{"rendered":"Software begins"},"content":{"rendered":"<p>This begins phase two of the project &#8211; the software.\u00a0 Actually, I&#8217;ve been working on the software on and off for a few weeks, but I haven&#8217;t had anything to test it on until now.<\/p>\n<p>I wrote the motor control and current measurement routines using samples from NI and modified them based on several discussions on the NI forums.\u00a0 It is fairly simple &#8211; output a pulse width modulated signal, avoid a few specific duty cycles, and measure the current at the best point in the cycle.\u00a0 The trick is figuring out the best time in the cycle to read the current so that it represents the average current for the cycle.<\/p>\n<p>My first test was running the motor at different duty cycles, making sure it works, and seeing if the current measurements look reasonable.\u00a0 I propped up the cart so the gear doesn&#8217;t engage with the rack.\u00a0 I tried several speeds, and the motor runs great.\u00a0 At low speeds, the gears don&#8217;t make any noise at all.\u00a0 At high speeds, they make a little noise as they mesh.\u00a0 The current measurement is kind of weird, though.\u00a0 At any duty cycle over 5 percent, the current reads about 10-20 units, which is about what you expect when there is no load other than motor friction.\u00a0 However, under 5 percent the current reads around 600 units, which is ridiculously large.\u00a0 I suspect I am reading a peak value and should read some other time in the cycle.\u00a0 My plan is to write a routine that will sample the current at a different time in the duty cycle each time through the loop.\u00a0 I should be able to build a complete current waveform after many loops at constant speed.\u00a0 It may not be perfect, but it will give me an idea of what is going on with the current and when the best time to measure it is.<\/p>\n<p>I did run the cart back and forth on the rack a few times at different speeds.\u00a0 It works great at low and medium speeds, but I don&#8217;t dare run it at high speeds until I have the limit switches ready to stop it before it hits the ends.\u00a0 The travel is nice and smooth, so I don&#8217;t expect any problems in that area.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This begins phase two of the project &#8211; the software.\u00a0 Actually, I&#8217;ve been working on the software on and off for a few weeks, but I haven&#8217;t had anything to test it on until now. I wrote the motor control and current measurement routines using samples from NI and modified them based on several discussions [&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-103","post","type-post","status-publish","format-standard","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/posts\/103","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=103"}],"version-history":[{"count":3,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/posts\/103\/revisions\/105"}],"wp:attachment":[{"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/media?parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/categories?post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/tags?post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}