Walking – IK

This is an overview of my approach to implement a static gait for Felix.  I’ll be explaining the needed concepts in a series of posts, but if you want to speed things up you can grab all the Arduino sketches from my repo (https://github.com/Traverso/Felix/tree/master/ARDUINO). 

Felix is a four legged robot, each leg has two actuators. To control the position of the feet, I need to provide a rotation angle to the servos controlling the hip and the knee of each leg. But thinking  in terms of rotation angles is too complicated, it could be much easier  if we could set the angles according to where we want to position the feet.

To do that we can use inverse kinematics. Calculating the inverse kinematics for complex systems can be quite daunting, but in our case we have a simple planar two link setup, so we can use basic law of cosines and Pythagoras to calculate the two angles.

Even though Felix legs consists of three links, we can still consider it a two link system, because due to the parallel linkage constraining the pastern, the relation between the endpoint of the shin (the hock in dog anatomy) and the foot is one of relative displacement.

There are a number of references on the web explaining inverse kinematics for this type of systems:
http://www.engineer-this.com/IK.shtml
http://www.oliverjenkins.com/blog/2012/9/inverse-kinematics-and-robot-arms
http://www.learnaboutrobots.com/inverseKinematics.htm
http://www.lorenzonuvoletta.com/simple-inverse-kinematics/

When trying to understand this method I spend some time implementing it in Processing.
Processing is great for this sort of thing because you can quickly “see” if your calculation is working.  Processing shares some common ground with Arduino, so it’s relative easy to move code between the two systems. In my repo you can find a simple Processing sketch implementing a simple IK solver for two links (https://github.com/Traverso/Felix/tree/master/Processing/InverseKinematics).

If you prefer to play with the same sketch online, you can do it here:

IK FIDDLE

http://jsfiddle.net/ronaldxavier/Et4Vj/embedded/result/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s