INV 11 – Robot Arm Wrestling – Leaf 2,3

Attrib: Aralani

Leaf 2 – Sally Meets Ferdinand

“Hello, I saw you watching me wrestle with the robot over there, just then” , Ferdinand said.

“Hi, yes, I saw it”, she said looking away for a bit.

“Wasn’t smart enough,… or quick enough”, said Ferdinand

“mmm, … perhaps I will need to to reprogram it.. thoughtfully “, said Sally

“OK,  lets get a drink, Let me get you one, lets talk over the next steps..”, said Ferdinand

“Well, thats kind of you, but, ok meet me here again Monday night, it’s getting late, I got to go.. sorry..  Whats your name ?” asked Sally

“I’m Freddo, ” said Ferdinand

“Thats got to be not for real..”, said Sally

“Nickname, my mum gave me back home in Oz, apparently Dad had something for St Ferdinand, patron saint of engineering etc… so mum just called me Freddo” said Ferdinand.

“Anyway – my name is Sally, Sally Jo, but it’s a bit Southern, so I just say Sally”

“Here’s to robot arm wrestling Sal”, said Freddo, raising his nearly empty glass of beer..

“Monday then”, said Sally.

Leaf 3 – Sally and Ferdinand… in the local pub..

So Ferdinand  found a reasonably nice quiet part of that same bar, on Monday evening.  He only had one more week in that town, but this bar had been a useful place to come in the evenings, while he was around.

Ferdinand had his laptop open and was working on a problem relating to something totally mundane, and just had to be done,,  a discusion topic for one of his internal meetings.., something about the new digital standards in control, not too heavy.

Sally walked in and looked around for a bit, she finally found Ferdinand, the only guy in a busy pub with his laptop open, and a beer of some sort, looked like a shiner, but anyway she walked over to meet him.

“Hello Mr Ferdinand”, “Hi Ms Sally, Thanks for coming” , they greeted each other.

Sally took a seat…

… “so how were you able to beat my robot arm ?” she asked.

“you must’ve been counting on the force being with you,  the logic in your robot arm seemed to be, I will always use a restoring force proportional to the angle the arm is from its correct position.  This was your ARM rule.  Then you had another rule which was your timer rule.  This was, from the time the arm selection is made, and the arm is grasped, the correct arm position is vertical.  Then sometime later the robot would give a warning of 30 seconds, which I think I correctly presumed meant that the correct position or setpoint would be adjusted to 85 degrees or so, which would then cause the ARM controller to move the arm to the winning position.”  said Ferdinand

“It really wasn’t 30 seconds”, said Sally, “it was only 15 seconds, and then it was programmed to shift the setpoint over at 5 degrees per second. Not too fast, not too slow, but just enough time for the punter to realise he was going to lose, and kind of get to laugh about it as it happened. I found that if the robot arm won too quickly, people just woudn’t play again.  This way they would play over and over and lose but then keep coming back, sure they could win eventually.”

Ferdinand, took some beer, and carefully looked through the glass, it was an ordinary glass, but he was thinking about stuff..

“You see, the weakness of the design of proportional control, is that it is ok as a basic regulator, with enough gain and feedback, but too much gain and it goes unstable, and not enough gain, you get too much error.   Since I was strong, and I got it all the way over to 45 degrees, your program simply doubled the gain and therefore doubled the force per degree error.  This actually worked in my favor later on.”, said Ferdinand.

“Yes you are right, It was a way of kind of compensating for the strength of the player holding the arm.” said Sally.

“Yes, you are figuring on a simple change to cope with each new situation the controller is facing. Controllers are generally tuned to the situation, which in most cases is fixed, not changing, but now with this arm, each player is a different situation. You will have to improve on the controller and the strategy perhaps, keeping in mind, as you have, safe operation, and player appeal.” Said Ferdinand.

“You see, by your increasing the gain, I was able to exploit the weakness by means of providing abnormal expected behaviour.  You set this thing up so that it expects to control against a counter force at all times.  Not a problem, since the idea is to wrestle the robot arm.  But by actually pulling the robot arm in the direction of its target prematurely, it allowed me to use its force in addition to my force, and the momentum of the arm, to overcome it and win.”

The jukebox was playing a song Ferdinand had selected some time back in the queue.  It was the Bluesbreakers’  with Eric Clapton, “Have you heard”….. Ferdinand loved the brilliant mix of Hammond Organ, Guitar, but mostly the wonderful saxophone, right at the start of the piece… an honest blowing style full of blues and promise.  He liked the way it sounded like New Orleans, and a kind of slow march start with just like… anyway… he kind of hoped Sally would like it as well.

“… and ok,  I get the idea,..” said sally.  “So you had trouble pushing further  than the first 45 degrees, I mean you were stuck there for a bit.  It is when it stops that I get the robot to increase the gain.” she added.

Ferdinand explained. “Classically, you could have avoided the gain change to reduce the error by including reset control.  It’s a way of integrating the error, adding more force, without changing the gain, which basically compensates for the error, so that 45 degrees would have been reduced back to vertical by means of reset action.  Each time step, take a proportion of the error at that time, and then just add it to the output of the ARM.”  There are a couple of ways to do it. But this means your proportional band does not get too strange by increasing the gain too much and making it too reactive.”

[10 minutes passed…]

“Well thanks Freddo, let me make some adjustments” Sally said.

“OK we will see how you do then” Ferdinand said.  “Listen, I will be leaving at the end of the week, but you can keep in touch by email if you like.” Ferdinand gave his email address, on the back of a beer coaster.

“Thanks, .. Ok Bye” said Sally

INV 11 – Robot Arm Wrestling – Leaf 1 – Proportional Control

Courtesy Aralani

Blogubarra – May ’11

OK Computer – I admit that i am writing this post today, inspired to write this down having seen all sorts of my colleagues come to grief after a few seconds of fun riding mechanical bulls.  These bulls seem to be all the rage in Texas at least.  I’ve just got back from there, and lets face it, felt a bit more than afraid of getting on one, putting myself in the hands of some kind of cowboy operator with a manual  controller, with the crowd screaming:-

“Make it go faster”

And the poor guy falling off after around 3 seconds.  Mechanical bull riding seems all about the embarrassment of novices rather than, actually having fun on the bull..  never mind. !

So this innovation is hypothetical, how would you create an unbeatable robot controller, which could not be beaten at arm wrestling, which was evenly matched in brain and brawn to it’s contestant, man or woman, with a beer in hand.

So innovation 11 is a cautious step down this pathway…

Mark I iRobot wrestler has a strong arm, a hand, and a controller managing the arm and it’s own winning strategy.  The initial controller is just a proportional controller, or servo regulator, and has a strategy relating to the setpoint or angle of the arm from the vertical.

I step up to the arm, have beer, see the lighted buttons, and plan to select “Right ARM” which is the hand I will use to wrestle the robot.

“Got any change mister ?” says the robot

“Sure”, I say

“Up for a challenge then… bet you can’t beat my arm !” says the robot.

“No worries mate, I wrestle tractors all the time, downunder.  You have no chance.” I say.

I sit down, adjust my Akubra, and then just put in the money, select right arm fast, grab the arm and see what happens.

The robot arm instantly starts humming and pushes up to the vertical position.  I let it, ‘cos I want to see what it does.  So the arm is just sitting there at vertical.  I push left, the restoring force on the arm increases directly proportional to the force I use to push it over.  The more I push, the more the robot arm leans over, but the more force I have to apply to get it to lean over.

At about 45 degrees to the left, the robot says ” ah I see you are stronger than I thought, I must apply more effort. ”

“No worries I say, go for it ”

The robot arm strategy engine figures that its proportional gain may not be enough since I got it over to 45 degrees, and I challenged it with “No Worries Mate”, something the robot didn’t understand.  But correctly guesses it had something to do with confidence, purely by the tone.

So suddenly the force increased and it had pushed my arm back to 22 degrees from centre.

I figured ok, proportional control being used here, because I can just keep on pushing and the robot can never win. I wondered what other tricks it had up it’s sleeve.

after 1 minute the robot says impatiently “Look buddy, I don’t have all day, so I am going to finish this off in about 30 seconds”

I quickly think, 30 seconds, the robot must be going to change the setpoint to 90 degrees against me.  So I have 30 seconds to figure out how to defeat this.

I figure, since the robot is currently set to drive the arm to the vertical before the ‘coup de grace’ all I have to do it trick it into driving the arm my direction, and then suddenly I can win.

“Hey Robot, I exclaim, in 10 seconds you will be defeated!”

Before the robot has time to reply, I gradually relax my arm and the robot arm pushes it to vertical, right up in the middle, and at that point there is no force from either me or the robot. I suddenly pull the robot arm past vertical to the point where it is about 10 degrees from winning, I move fast so that the momentum of the arm moving helps move it further before the restoring force catches up.  Since it is proportional control, and the robot hasn’t changed the setpoint, the robot controller immediately applies a restoring force to push the arm back to vertical, i.e. going my way, with full force.  I suddenly reverse direction and both the robot controller and I are both pushing the arm at full force in my direction.

“Geronimo” I exclaim, the robot arm moves rapidly past vertical in my direction and the momentum of the heavy arm and my force push it over further and further until it hits the table.

“Uncle !” says the robot.. – who taught this thing language ? who the hell is “Uncle” ?

“Mate !.. see thats how it is done. Cheers “.

Proportional Control

In proportional control, the controller generates an output or restoring force proportionally equal to the difference between the setpoint and the actual position multiplied by some gain factor.

Generally speaking proportional control is kind of ok, but depending on the disturbance pushing the controlled variable away from the setpoint, you will always have an error, since it is the error which creates the control output.  No error, equals no output.