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 65 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 14 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 12 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

Encoders Really? by DangerousThing
[Today at 05:37:59 AM]


Blockchains, Ethereum, and a Safer SkyNet by jinx
[June 26, 2017, 01:17:32 PM]


Z motor mount by jinx
[June 26, 2017, 04:05:25 AM]


Spinny Flowers by Impala
[June 25, 2017, 06:24:33 PM]


Automobile drag coefficient by Impala
[June 23, 2017, 01:18:46 AM]


Arduino fork by ossipee
[June 20, 2017, 03:20:37 PM]


ghetto compressor revisited by 1 what
[June 19, 2017, 04:07:09 AM]


Don Quixote Re-loaded by Gareth
[June 18, 2017, 07:10:39 AM]


Spammers by MEgg
[June 16, 2017, 11:11:26 AM]


5 min meeting timer by mogul
[June 16, 2017, 04:55:08 AM]


Picture Topic by Impala
[June 14, 2017, 05:17:43 PM]


Bluetooth Low Energy in JavaScript by Ladvien
[June 10, 2017, 05:10:21 PM]


Gait Creation Using Excel by BaldwinK
[June 08, 2017, 01:41:11 PM]


Which micro motor solution would be the strongest ? by programer786
[June 07, 2017, 02:50:31 PM]


Fun Fact by jinx
[June 07, 2017, 03:08:01 AM]

* Recent Posts

Re: Encoders Really? by DangerousThing
[Today at 05:37:59 AM]


Re: Blockchains, Ethereum, and a Safer SkyNet by jinx
[June 26, 2017, 01:17:32 PM]


Z motor mount by jinx
[June 26, 2017, 04:05:25 AM]


Spinny Flowers by Impala
[June 25, 2017, 06:24:33 PM]


Re: Blockchains, Ethereum, and a Safer SkyNet by mogul
[June 23, 2017, 01:53:15 AM]


Re: Automobile drag coefficient by Impala
[June 23, 2017, 01:18:46 AM]


Blockchains, Ethereum, and a Safer SkyNet by mtriplett
[June 22, 2017, 11:47:08 AM]


Re: Automobile drag coefficient by Impala
[June 21, 2017, 09:45:12 PM]


Re: Arduino fork by ossipee
[June 20, 2017, 03:20:37 PM]


Re: Arduino fork by mogul
[June 20, 2017, 02:28:32 PM]


Arduino fork by ossipee
[June 20, 2017, 01:35:33 PM]


Re: ghetto compressor revisited by 1 what
[June 19, 2017, 04:07:09 AM]


Re: Don Quixote Re-loaded by Gareth
[June 18, 2017, 07:10:39 AM]


Re: Spammers by MEgg
[June 16, 2017, 11:11:26 AM]


Re: 5 min meeting timer by mogul
[June 16, 2017, 04:55:08 AM]