collapse

Welcome!



Welcome to Robot Rebels, an online robot maker community.

Register today to post your projects, ask questions, share knowledge and meet like-minded people from around the world.


The RobotRebel.org Community

Author Topic: Gait Creation Using Excel  (Read 166 times)

BaldwinK

  • Member
  • ****
  • B
  • Posts: 11
Gait Creation Using Excel
« on: June 08, 2017, 01:41:11 PM »
This is a tricky subject to put words around so let’s start with a diagram:

 Gait1.JPG
*Gait1.JPG (8.21 kB . 225x213 - viewed 26 times)

This is a ‘stick figure’ representation of a robot hind leg. Perhaps a cat with thigh, shin and elongated foot controlled by three servo motors at the hip, knee and heel. If we know the three motor angles and the three ‘bone’ lengths then we could calculate and somehow display the diagram.

Excel is good at processing lots of maths and can easily graph most things but I didn’t realise it could also draw this. It was right under my nose all the time calling itself a scatter chart to compare x,y pairs.

So easy then to set up a spreadsheet to compute and display how high the bot will ride and where ground contact will be made. Thigh length times the sine of the hip angle gives the x co-ordinate at the knee etc.

The attached .xls file sheet “Steps” shows how this can produce a series of frames. The macro ‘spinner button’ will step through one pace of a walking gait pattern that I prepared earlier.

Of course I had to enter each angle and make adjustments until the height and ground contact were exactly right for each ‘frame' of the sequence. During the ‘driving phase’ the contact point will be on the ground. Starting in front of the hip it will move smoothly backwards to propel the bot forward. Then it will lift off the ground and move forward ready to start the process again.

Later perhaps, it is seen to be riding too high to be stable so the height needs to be reduced by a couple of centimetres and the process re-worked.

Only 60 angles to redo!

Wouldn’t it be nice if the spreadsheet could do this for us?

Surely we already have the definition of the system: the segment lengths, angles and their limits, the shape with the knee at the front and not behind etc. We have what might be called the ‘kinematics’ of the system.

What we really want is to turn the answer into the question. If the ground contact is 44mm in front of the hip and bot rides 173mm above the ground then what are the three angles?

Inverse Kinematics

Learned papers are written on this subject. It would take a lot of coffee before I could attempt to follow the maths of rapidly and efficiently calculating how best to reach the ‘target’ location.

So what. Excel isn’t going to do it in real time anyway so perhaps we can just try something and see what happens.

The sheet titled “IK” has the same equations and the same graph plus a macro button. To view the macro code use Alt F11 and note that it is version 2003.

The leg arrangement is a sort of ‘Z’ shape which can raise and lower the toe position without moving backwards or forwards. So the angle p would mainly influence the target x position whilst angles h and k between them would mainly influence the target y position. A good starting point then is to hover with the toes in line with the hip.

The macro then decides if the angles must be increased or decreased by one degree at a time. Angles h and k are changed alternately. A test is made to see if the new calculated x,y position is within range of the target. Within 1.5mm seems to work.

The process iterates until either the target value or a servo limit is reached. The bot height is still a variable so we could knock 2cm off the height and recompute now with no effort. The y-axis can be altered to put the hip at the right height to display the toes on zero.

The principles used within these tools should help with other leg shapes too.

Making It More Fun (or just more complicated)

I tend to stretch things (including me) to find their limits so the third sheet defines the question in this form:

 Gait2.JPG
*Gait2.JPG (4.93 kB . 238x74 - viewed 24 times)

Here we see the cyclic movement of the toes, on the ground pushing backwards then arcing up and forward ready to start on the ground again.

This time the macro takes each toe position x,y pair in turn and computes the leg parameters to achieve it. These are displayed as a moving sequence of frames allowing us to see what our bot might do even before we make anything. Use Escape then End to stop the display.

The output values are calculated once and placed at the right. The CSV strings are prepared in two parts to copy and paste into a lookup table.

The display is 2D but there seems no reason why the macro should not compute movement in the z plane. A cat will place a paw under the body centre line to keep balance. A motor angle at the hip for adduction can be included in the computation but the 3D display is more challenging.

And for homework: link four (or more) leg calculations in the correct phase then plot the footfall, highlighting where the COM falls outside a triangle of support.

*Gait Creation.xls

 

* Search


* Recent Topics

PI tray by jinx
[October 14, 2017, 07:19:30 AM]


24byj48 based delta robot - fail by mogul
[October 08, 2017, 02:24:55 AM]


My scope focuser upgrade by jscottb
[October 07, 2017, 07:57:43 PM]


3Dimsen by viswesh
[September 26, 2017, 01:17:04 PM]


Antique (fun) stuff by MEgg
[September 23, 2017, 09:26:34 AM]


win a smoothie board by jinx
[September 21, 2017, 02:21:45 AM]


Parallax CR Servo with Built-In Encoder by erco
[September 19, 2017, 10:50:01 PM]


Re-writing robotics by MEgg
[September 17, 2017, 06:01:03 AM]


Saturn pics anyone by ossipee
[September 16, 2017, 05:46:24 PM]


Kitronik :MOVE mini buggy kit by craighissett
[September 14, 2017, 08:12:20 PM]


Third 3D printer recommentation by Deity
[September 14, 2017, 06:43:00 AM]


Android Adware by Impala
[September 13, 2017, 03:24:01 PM]


Plantoid Robot's on Kickstarter. by ossipee
[September 09, 2017, 04:29:54 PM]


rewound PLA filament by jinx
[September 03, 2017, 10:30:51 AM]


corexy test by jinx
[September 02, 2017, 05:30:46 AM]

* Recent Posts

PI tray by jinx
[October 14, 2017, 07:19:30 AM]


24byj48 based delta robot - fail by mogul
[October 08, 2017, 02:24:55 AM]


Re: My scope focuser upgrade by jscottb
[October 07, 2017, 07:57:43 PM]


Re: My scope focuser upgrade by jscottb
[October 06, 2017, 07:47:22 AM]


Re: My scope focuser upgrade by jinx
[October 06, 2017, 05:00:15 AM]


Re: My scope focuser upgrade by jscottb
[October 05, 2017, 10:37:05 PM]


My scope focuser upgrade by jscottb
[October 05, 2017, 06:53:55 PM]


Re: 3Dimsen by viswesh
[September 26, 2017, 01:17:04 PM]


Re: 3Dimsen by Bajdi
[September 26, 2017, 05:42:36 AM]


Re: 3Dimsen by Deity
[September 25, 2017, 07:49:30 AM]


Antique (fun) stuff by MEgg
[September 23, 2017, 09:26:34 AM]


3Dimsen by mogul
[September 23, 2017, 08:59:05 AM]


win a smoothie board by jinx
[September 21, 2017, 02:21:45 AM]


Parallax CR Servo with Built-In Encoder by erco
[September 19, 2017, 10:50:01 PM]


Re: Re-writing robotics by MEgg
[September 17, 2017, 06:01:03 AM]