# Battling Subtle Negative Damping

Hello, robot enthusiasts!

I’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.

Each actuator in the leg has a control valve 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.  The simplified topology is displayed below.

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!

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.

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.

There are two concepts you need to understand to grasp these oscillations. The first is the concept resonance, the second resistance or dampingClick on the words if you want the wikipedia articles, but I’ll try to give a shorter, application specific explanation below.

#### Resonance

How many of you have played with one of those little springy doorstops?

In the mechanical paradigm, a resonance is created whenever a mass is attached to a spring.  The mass and spring are both forms of energy storage – the mass stores kinetic energy in its motion, the spring stores potential energy in its deflection.  The resonance is simply the mass and spring passing the energy back and forth to each other.  All mechanical resonances behave this way – from guitar strings to pendulums to swaying bridges (gravity provides the spring in pendulous cases).

#### Resistance/Damping

Why does that little springy doorstop stop moving?  The doorstop has many forces acting on it, but for the sake of simplicity let’s pretend only air resistance is acting on it.  When you move through the air, the air pushes against you.  If you move forward, air pushes backwards.  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.  The air acts as a damper on the doorstop.  Since the air is taking energy out of the doorstop resonance, we would say it is a positive resistance/damper.

Changing the amount of resistance changes the behavior of the resonator.  Let’s say we raised the resistance on the doorstop by putting it underwater… the doorstop would probably swing back and forth far fewer times, as energy leaves the system much faster.  What if we put the doorstop in a vat of syrup?  The doorstop would probably not resonate at all, it would just slowly swing back to the center position.  These are both cases of increasing the resistance.

What would happen if we changed the resistance from positive to negative?  That is, instead of the air pushing against velocity, it pushed with velocity.  It’s a contrived example, but you can intuit what the behavior would be – instead of the oscillations diminishing over time, they would grow until some other factor started limiting them.  In the doorspring case, this might be when the end of the spring starts hitting the walls.  The controls guy would say “the door spring has entered a limit cycle“.

#### What’s this have to do with the Protoleg shaking?

This is oversimplifying somewhat, but think of the Protoleg like a giant springy doorstop.  It has mass (about 350lb of it) that can store energy in its motion.  It has a spring at its base (the natural springiness of the steel, the expansion of the hydraulic hoses…) that can store energy in its deflection.  That combination of mass and spring creates a natural resonance.  This resonance also has inherent damping (mechanical friction).  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.  The natural resonance dies out after 1-2 cycles.  The controls guy might say “in this regime, the leg is positively damped”.

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.  But the valve is more complex than that and has a flow profile that looks like this:

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.  Notice that for a large portion or the graph, the slope is negative.  This means that in those portions of the graph, more pressure you put across the open valve, the less flow you get through it.  This creates a large negative resistance that causes leg oscillations to amplify until they enter a limit cycle. Yikes!

#### How can we fix it?

Engineering is all about tradeoffs.  If we had infinite money we would probably just replace our valves with a much more expensive type that doesn’t have an implicit negative resistance. But (a) we don’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.  This can be accomplished by just sticking a small hydraulic orifice in the circuit.  We’ve been using orifice disks mounted in the bottom of our valves, but we’ve had problems with them floating out of place since we mount our valves upside-down, so we are switching to orifice fittings that go on the end of our hoses that can’t float out of place.

This has the down side of reducing the maximum output power of the joint, but it’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.

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.

## One thought on “Battling Subtle Negative Damping”

1. Jason says:

Keep posts like this one coming! Great exposition.