# Thread: Let's Discuss Kinematics, Shall We?

1. ## Let's Discuss Kinematics, Shall We?

I want to open up a whole new thread to talk about Kinematics and its principles applied to Hexapods (Crustcrawler, Phoenix, *H3-R, etc.). This thread is aimed more mathematics and not the modeling of it in software. Although, if you want to express your point of view with software, it's ok as well...

My first question I want to throw out there, perhaps for those of you who are gurus in kinematics, can help me understand it better:

Given a successive rotation about all three of the axis in three-space, how do you truly determine which is of the 6 is the correct order to use?

For instance:

B = matrix for a successive rotation

Ay,beta = rotation matrix of angle beta about the y-axis
Ax,gamma = rotation matrix of angle g about the x-axis
Az,alpha = rotation matrix of angle alpha about the z-axis

So

B = Ay,beta * Ax,gamma * Az,alpha

Euler proved that twelve independent triple rotation can be had for any combination of alpha, beta, and gamma with any of the three axis... So essentially, there's a total of 12 different "B" matrices depending on the order of rotation...

Each of the twelve combination yields a different matrix. When do we know which order to use for say, hexapod? Perhaps I just don't understand when to use which order...

2. ## Re: Let's Discuss Kinematics, Shall We?

Don't worry this isn't going to be a very helpful response.

Maybe I just don't get it, but I don't look at kinematics the same way. (OK...not maybe).

A couple of things. Lets take a three degree of freedom leg. First of all non of the servos have continuous rotation. For most this limits us to a 180 degree swing at each joint. Also, the shoulder or coxa is fixed to the body. I generally see the coxa as my X. The hight of the foot, or angle of the leg in relation to the ground as Y, and the length of the leg, or the distance between the shoulder and the foot as Z.

Given that, sure Z has to change as X changes, and also as Y changes...so then I try to figure out a relationship between a change in either x or Y coupled with the limitation of Z....

I guess what I'm getting at is that for me it works better if you start out at the same end of the leg. If you know either X or Z and where you need to get to, the rest seams to fall into place.

Then again, Maybe I'm just exposing my clear and total lack of understanding.

DB

3. ## Re: Let's Discuss Kinematics, Shall We?

(Warning: I am NOT an expert in Kinematics)

Am I correct to assume that you are doing Body Forward Kinematics? That is, you are rotating the body about 3-axis and need to find the translation of the point at which the leg attaches to the body? Might just be that I'm being dense, but I just can't see how this would apply to the leg kinematics, since the order of application of the rotations is set by the way your servos are connected to the body....

If you are doing Body Kinematics, then I think the "correct" order depends on how you want the body to move. Any of the 6 is "valid" in that it will give you a result, but of course those results may not correspond very closely to what you intended. If we assume fixed axis, then I would think that the order would be roll, pitch, then rotation about the vertical axis last, as this causes the least distortion from what I would think was the expected value?

EDIT: I'm also assuming here that our fixed axis go through the center of the robot's body. The roll-axis is horizontal and stays parallel to the ground, pointing in the direction of "forward" motion. The pan-axis is vertical, perpendicular to the ground and the roll-axis. The pitch axis therefore is therefore found by the right-hand rule, and would be horizontal and perpendicular to the roll-axis.

-Fergs
Last edited by lnxfergy; 08-20-2009 at 12:28 PM.

4. ## Re: Let's Discuss Kinematics, Shall We?

Fergs, you hit the nail right on the head. Yes, I'm referring to a body (global) to local (legs) translation. I was experimenting with my rotation kinematic functions yesterday and just racking my brains out trying to figure out why my single rotation doesn't match my successive rotation, when the successive rotation is set where two of the three angles are "0" (no rotation), and the third angle is set...

In theory,

Br = B * Gr

is equivalent to

Br = Ay,beta * Gr

Where B is your successive matrix, Br is your local coordinate, Gr is your global, Ay,beta is your rotation matrix angle beta about the y-axis, for alpha = 0, gamma =0, for any beta

Am I totally off in my thought process here?

darkback:

What you describe are the leg movements. I found out that you really don't need Inverse kinematics, just an over-glorified simple trig to solve for the leg movement. However, you will need kinematics if you want to yaw, pitch, roll your body and also to account for the "offset" legs at the four corners of a hexapod!

EDIT:
-----

Regarding programming in general, all hail the ser_out, printf, and any other print to terminal functions for debugging!!!

5. ## Re: Let's Discuss Kinematics, Shall We?

I'm currently employing a much easier solution to this problem. So I have my leg movements all set, sort of independent of the body movements...So I know that isn't exactly as easy as I'm suggesting, but think of it this way. Each servo setting has an offset input that is either positive or negative. So I can lower/contract the front legs and extend the back legs, or side legs, or twist of the body, independently of the actual leg movements...I'll try to get it fully up and running and post a video in the next couple of days.

DB

6. ## Re: Let's Discuss Kinematics, Shall We?

Can't wait to see if Che...

7. ## Re: Let's Discuss Kinematics, Shall We?

Originally Posted by tom_chang79
Fergs, you hit the nail right on the head. Yes, I'm referring to a body (global) to local (legs) translation. I was experimenting with my rotation kinematic functions yesterday and just racking my brains out trying to figure out why my single rotation doesn't match my successive rotation, when the successive rotation is set where two of the three angles are "0" (no rotation), and the third angle is set...
....

Am I totally off in my thought process here?
I'd suggest posting your code (and the output trace),so we might see what's going on, that sounds like a bug to me, not the underlying math...

-Fergs

8. ## Re: Let's Discuss Kinematics, Shall We?

Originally Posted by darkback2
I'm currently employing a much easier solution to this problem. So I have my leg movements all set, sort of independent of the body movements...So I know that isn't exactly as easy as I'm suggesting, but think of it this way. Each servo setting has an offset input that is either positive or negative. So I can lower/contract the front legs and extend the back legs, or side legs, or twist of the body, independently of the actual leg movements...I'll try to get it fully up and running and post a video in the next couple of days.

DB
DB -
The real point to IK is to be exact (smooth), and allow positioning the end effector anywhere inside the (near) infinite range (obviously, due to resolution issues, it's not entirely a continous and infinite range, its much more discrete than that). Obviously, if you only need to put an effector in a few positions, poses work nicely. When you want to go beyond that, you're describing a parameterization of the base pose, where your offset is a parameter. There are a few problems with that though:

• First, a linear rotation about a single axis does not create a linear movement at the end effector (it swings on an arc). This is why Issy was SO violent when walking at RG. When he only moved the horizontal thrust servo (commonly called the Coxa servo), the end points of his legs are swinging through an arc, and have to shift the entire weight of his body as they do so (and are fighting the legs on the opposite side). His new IK code will walk much smoother (which means less wear and tear on the servos, and most importantly less heat)
• Second, if you do end up moving multiple servos in a leg to try and offset this arc issue, you end up being half way to IK.

The actual IK required for posing a 3DOF leg is quite simple. On a leg such as those on Issy or the Phoenix, a single function (atan2) can give you the horizontal thrust (coxa) position off of the X,Y offset of the end effector (I'm using the X and Y axis to define the floor). Then the remaining 2 servos are in a plane (which is parallel to the Z axis, and goes through the origin and the end effector X,Y points) and you can quickly solve them using the law of cosines (see tutorial on 2DOF here: http://www.learnaboutrobots.com/inverseKinematics.htm).

-Fergs

9. ## Re: Let's Discuss Kinematics, Shall We?

Hi,

Originally Posted by tom_chang79
Euler proved that twelve independent triple rotation can be had for any combination of alpha, beta, and gamma with any of the three axis... So essentially, there's a total of 12 different "B" matrices depending on the order of rotation...

Each of the twelve combination yields a different matrix. When do we know which order to use for say, hexapod? Perhaps I just don't understand when to use which order...

When it comes to the order of rotation you have to decide what order you want to use yourself. The following rotation are always affected by the next, so you have to priority in what order you want them. For the time I'm working with a powerpoint presentation about hobby robotics. My boss asked me if I could hold a little course/show about my hobby. I'm not going very deep in the code but I did mention the rotation part.

This is the page I made about rotation kinematics:
(Sorry for the bad picture quality)

I did a fast translation from Norwegian, maybe if some of you are interested I could translate the whole presentation and share it. Its pretty basic though.
This is the matrix I used in Xan's code, pay attention to the Y and Z axis (switched place).

And this is the front page

-Zenta

10. SK.
Quantum Gate
Join Date
Jul 2009
Location
Posts
93
Rep Power
34

## Re: Let's Discuss Kinematics, Shall We?

When talking about kinematics Denavit Hartenberg conventions should probably be mentioned. In industry robots these are the standard for modelling kinematic chains. Every link/joint is described by 4 parameters and there are some rules as how to come up with them systematically.
There´s a learning curve at the beginning though and it might be overkill for a chain with few joints.

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•