{"id":551,"date":"2013-03-30T21:31:52","date_gmt":"2013-03-31T01:31:52","guid":{"rendered":"http:\/\/projecthexapod.com\/blog\/?p=551"},"modified":"2013-03-30T21:31:52","modified_gmt":"2013-03-31T01:31:52","slug":"battling-subtle-negative-damping","status":"publish","type":"post","link":"http:\/\/projecthexapod.com\/blog\/2013\/03\/battling-subtle-negative-damping\/","title":{"rendered":"Battling Subtle Negative Damping"},"content":{"rendered":"<p>Hello, robot enthusiasts!<\/p>\n<p>I&#8217;m going to detail a subtle problem we <a href=\"http:\/\/projecthexapod.com\/blog\/improvements-in-gimpy-rowing\">hinted at a few months ago<\/a>. To understand the problem one needs a basic understanding of the system layout and a few key concepts, so I will quickly review.<\/p>\n<p><iframe loading=\"lazy\" width=\"640\" height=\"360\" src=\"http:\/\/www.youtube.com\/embed\/3Xa7xfJTLJY\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p><!--more--><\/p>\n<p>Each actuator in the leg has <a href=\"http:\/\/www.hydraforce.com\/proport\/Prop_html\/2-112-1_SP10-47C\/2-112-1_SP10-47C.htm\">a control valve<\/a> attached to it. The control valve is opened by an electric current. In an ideal world, a constant electric current will result in a constant size orifice through which hydraulic fluid will flow.\u00a0 The simplified topology is displayed below.<\/p>\n<p><a href=\"http:\/\/projecthexapod.com\/blog\/wp-content\/uploads\/2013\/03\/Image-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-575\" title=\"Image 1\" src=\"http:\/\/projecthexapod.com\/blog\/wp-content\/uploads\/2013\/03\/Image-1.png\" alt=\"\" width=\"681\" height=\"503\" srcset=\"http:\/\/projecthexapod.com\/blog\/wp-content\/uploads\/2013\/03\/Image-1.png 681w, http:\/\/projecthexapod.com\/blog\/wp-content\/uploads\/2013\/03\/Image-1-300x221.png 300w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/a><\/p>\n<p>The symptom is very interesting and counter-intuitive; when a control valve to an actuator is opened with a constant electric current, the system goes in to a self sustaining oscillation. This can be extremely dangerous since the oscillation in question is a 350 lb leg swinging around!<\/p>\n<p>It took us a while to figure out exactly what was causing the oscillations.  A poorly tuned control loop in software can easily cause similar symptoms, so a lot of time went in to tuning our control loops trying to get the oscillations to stop happening before we discovered the oscillations were implicit to the system and occurred even with constant valve command.<\/p>\n<p>Why does this happen? One would naively expect that a constant current to the valve would result in a constant orifice, which should give a smooth motion at a constant speed at the actuator. When you turn the handle of your faucet, you open a constant size orifice from the water mains to your sink, and a constant flow results. You would be surprised if you turned on your sink and the water came out in spurts.<\/p>\n<p>There are two concepts you need to understand to grasp these oscillations. The first is the concept <a href=\"http:\/\/en.wikipedia.org\/wiki\/Resonance\"><strong>resonance<\/strong><\/a>, the second\u00a0<strong><a href=\"http:\/\/en.wikipedia.org\/wiki\/Damping\">resistance or damping<\/a>.\u00a0 <\/strong>Click on the words if you want the wikipedia articles, but I&#8217;ll try to give a shorter, application specific explanation below.<\/p>\n<h4>Resonance<\/h4>\n<p>How many of you have played with one of those little springy doorstops?<\/p>\n<p><iframe loading=\"lazy\" width=\"640\" height=\"360\" src=\"http:\/\/www.youtube.com\/embed\/KRv5foS4uDc\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>In the mechanical paradigm, a resonance is created whenever a mass is attached to a spring.\u00a0 The mass and spring are both forms of energy storage &#8211; the mass stores kinetic energy in its motion, the spring stores potential energy in its deflection.\u00a0 The resonance is simply the mass and spring passing the energy back and forth to each other.\u00a0 All mechanical resonances behave this way &#8211; from guitar strings to pendulums to swaying bridges (gravity provides the spring in pendulous cases).<\/p>\n<h4>Resistance\/Damping<\/h4>\n<p>Why does that little springy doorstop stop moving?\u00a0 The doorstop has many forces acting on it, but for the sake of simplicity let&#8217;s pretend only air resistance is acting on it.\u00a0 When you move through the air, the air pushes against you.\u00a0 If you move forward, air pushes backwards.\u00a0 So the air is always pushing against the motion of the door spring, taking a little bit of energy out of it every cycle as the end swishes through the air.\u00a0 The air acts as a damper on the doorstop.\u00a0 Since the air is taking energy <em>out<\/em> of the doorstop resonance, we would say it is a <em>positive<\/em> resistance\/damper.<\/p>\n<p>Changing the amount of resistance changes the behavior of the resonator.\u00a0 Let&#8217;s say we raised the resistance on the doorstop by putting it underwater&#8230; the doorstop would probably swing back and forth far fewer times, as energy leaves the system much faster.\u00a0 What if we put the doorstop in a vat of syrup?\u00a0 The doorstop would probably not resonate at all, it would just slowly swing back to the center position.\u00a0 These are both cases of increasing the resistance.<\/p>\n<p>What would happen if we changed the resistance from positive to negative?\u00a0 That is, instead of the air pushing <em>against<\/em> velocity, it pushed <em>with<\/em> velocity.\u00a0 It&#8217;s a contrived example, but you can intuit what the behavior would be &#8211; instead of the oscillations diminishing over time, they would grow until some other factor started limiting them.\u00a0 In the doorspring case, this might be when the end of the spring starts hitting the walls.\u00a0 The controls guy would say &#8220;the door spring has entered a<a href=\"http:\/\/en.wikipedia.org\/wiki\/Limit_cycle\"> limit cycle<\/a>&#8220;.<\/p>\n<h4>What&#8217;s this have to do with the Protoleg shaking?<\/h4>\n<p>This is oversimplifying somewhat, but think of the Protoleg like a giant springy doorstop.\u00a0 It has mass (about 350lb of it) that can store energy in its motion.\u00a0 It has a spring at its base (the natural springiness of the steel, the expansion of the hydraulic hoses&#8230;) that can store energy in its deflection.\u00a0 That combination of mass and spring creates a natural resonance.\u00a0 This resonance also has inherent damping (mechanical friction).\u00a0 If the system is just sitting there and you shove the foot in one direction, the foot will bounce off its joint stop, bounce back off the other joint stop and settle.\u00a0 The natural resonance dies out after 1-2 cycles.\u00a0 The controls guy might say &#8220;in this regime, the leg is positively damped&#8221;.<\/p>\n<p>If the valve just acted like a small hole through which fluid flowed, it would still be a positive resistance in the system, pressure opposing flow.\u00a0 But the valve is more complex than that and has a flow profile that looks like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"Pressure vs. Flow for our valves\" src=\"http:\/\/www.hydraforce.com\/proport\/Prop_html\/2-112-1_SP10-47C\/SP10-47C_Perf_Chrt2.gif\" alt=\"\" width=\"254\" height=\"268\" \/><\/p>\n<p>This is a chart from the valve manufacturer showing flow (y axis) vs pressure (x axis) when the valve is commanded with a constant electrical current.\u00a0 Notice that for a large portion or the graph, the slope is <em>negative<\/em>.\u00a0 This means that in those portions of the graph, more pressure you put across the open valve, <em>the less flow you get through it<\/em>.\u00a0 This creates a large negative resistance that causes leg oscillations to amplify until they enter a limit cycle.  Yikes!<\/p>\n<h4>How can we fix it?<\/h4>\n<p>Engineering is all about tradeoffs.\u00a0 If we had infinite money we would probably just replace our valves with a much more expensive type that doesn&#8217;t have an implicit negative resistance.  But (a) we don&#8217;t have infinite money and (b) super expensive solutions are antithetical to the mission of Project Hexapod.  The simplest, cheapest and fastest solution for us is to just add a positive resistance in to the hydraulic circuit to cancel out the negative resistance.\u00a0 This can be accomplished by just sticking a <a href=\"http:\/\/www.hydraforce.com\/Acc-hous\/Acc_html\/8-460-1_Orifice_Discs\/8-460-1_Orifice%20Discs.htm\">small hydraulic orifice<\/a> in the circuit.\u00a0 We&#8217;ve been using orifice disks mounted in the bottom of our valves, but we&#8217;ve had problems with them floating out of place since we mount our valves upside-down, so we are switching to <a href=\"http:\/\/www.parker.com\/portal\/site\/PARKER\/menuitem.de7b26ee6a659c147cf26710237ad1ca\/?vgnextoid=fcc9b5bbec622110VgnVCM10000032a71dacRCRD&amp;vgnextfmt=default&amp;vgnextdiv=&amp;vgnextcatid=2638886&amp;vgnextcat=XHX7%20TUBE%20EXTENDER\/ORIFICE%20CONNECTOR%20STEEL\">orifice fittings that go on the end of our hoses <\/a>that can&#8217;t float out of place.<\/p>\n<p><a href=\"http:\/\/projecthexapod.com\/blog\/wp-content\/uploads\/2013\/03\/Image-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-576\" title=\"Image 2\" src=\"http:\/\/projecthexapod.com\/blog\/wp-content\/uploads\/2013\/03\/Image-2.png\" alt=\"\" width=\"681\" height=\"503\" srcset=\"http:\/\/projecthexapod.com\/blog\/wp-content\/uploads\/2013\/03\/Image-2.png 681w, http:\/\/projecthexapod.com\/blog\/wp-content\/uploads\/2013\/03\/Image-2-300x221.png 300w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/a><\/p>\n<p>This has the down side of reducing the maximum output power of the joint, but it&#8217;s a relatively small price to pay for a more controllable system.  The video below shows some preliminary testing with and without an orifice in place.  Note that the orifice is slightly undersized in this video.<\/p>\n<p><iframe loading=\"lazy\" width=\"640\" height=\"360\" src=\"http:\/\/www.youtube.com\/embed\/3Xa7xfJTLJY#t=26s\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>Thanks for reading, and thanks again to our sponsors at HydroAir and HydraForce who have sent us several rounds of hardware to help us experiment with solutions to this problem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, robot enthusiasts! I&#8217;m going to detail a subtle problem we hinted at a few months ago. To understand the problem one needs a basic understanding of the system layout and a few key concepts, so I will quickly review.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-551","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":10,"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":604,"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions\/604"}],"wp:attachment":[{"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/categories?post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/projecthexapod.com\/blog\/wp-json\/wp\/v2\/tags?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}