{"id":204,"date":"2010-05-05T23:32:09","date_gmt":"2010-05-06T03:32:09","guid":{"rendered":"http:\/\/ammonsengineering.com\/blog\/2010\/05\/first-inversion-try\/"},"modified":"2010-05-05T23:32:09","modified_gmt":"2010-05-06T03:32:09","slug":"first-inversion-try","status":"publish","type":"post","link":"https:\/\/ammonsengineering.com\/blog\/2010\/05\/first-inversion-try\/","title":{"rendered":"First inversion try"},"content":{"rendered":"<p>I worked a little more on the model, and decided it is probably close enough.\u00a0 I got tired of waiting and decided to just try the current algorithm on the actual pendulum.<\/p>\n<p>I added the control code to the existing pendulum interface, which wasn&#8217;t too difficult to do.\u00a0 I started running the program and immediately discovered a problem.\u00a0 The gains I had selected, which worked fine on the ideal model, were way too high for the real system.\u00a0 The noise in the signals\u00a0made the cart chatter while just trying to maintain a hanging position.\u00a0 Moving to a new hanging position made the cart go crazy.\u00a0 For a quick solution, I reduced the gains to about 1\/4 their original value, and it seemed okay.\u00a0 The chatter went away, but the pendulum wasn&#8217;t really staying still.\u00a0 I could move to different positions without too many problems.<\/p>\n<p>After getting the hanging controls in reasonable shape, I decided to try the swingup and had more problems.\u00a0 It seems like nothing works as easily on a real system as it does in simulation, not that I am surprised.\u00a0 In my swingup logic, I was using the angular position of the pendulum to make some decisions on control.\u00a0 In the simulation, looking at the sign of the angle worked great.\u00a0 The sign was always either +1 or -1.\u00a0 However, on the real system the encoder makes it possible to have an angle of exactly zero, which gives a sign of zero.\u00a0 My swingup kept moving in one direction and never reversed directions.\u00a0 That just doesn&#8217;t work if you want to swing up the pendulum.\u00a0 I did a quick fix that started the pendulum swinging, but the quick fix only worked until the pendulum was halfway up.\u00a0 I will have to do a more permanent fix to handle the zero angle situation.<\/p>\n<p>It was nice to see the pendulum doing something other than a sinusoid, even though I didn&#8217;t have a lot of success on my first try.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I worked a little more on the model, and decided it is probably close enough.\u00a0 I got tired of waiting and decided to just try the current algorithm on the actual pendulum. I added the control code to the existing pendulum interface, which wasn&#8217;t too difficult to do.\u00a0 I started running the program and immediately [&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-204","post","type-post","status-publish","format-standard","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/posts\/204","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=204"}],"version-history":[{"count":0,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/posts\/204\/revisions"}],"wp:attachment":[{"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/media?parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/categories?post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ammonsengineering.com\/blog\/wp-json\/wp\/v2\/tags?post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}