Ikine 4 DOF arm

Hi all,

This topic is about anyone who is interested in inverse kinematics.
I always wanted to draw a straight line with my robot (linear motion).
I finally solved the inverse kinematics for this 4 DOF robot.
To test this linear motion I tried to draw a square.
You can see the result here:

cid-976b52dad42d0a1e.skydrive.li … otics?uc=1

In this video you see that the lines are almost straight.
This difference is because that the SES arm is not a real robotic arm.
It is just a toy robot. But the mathematics are correct !

I also placed the solutions of the inverse kinematics in a PDF file.

All I get with your avi files is sound and no video. Maybe youtube would be a better video site.

Here they are on youtube:

youtube.com/watch?v=ZF83QZSm7NY

youtube.com/watch?v=IhifK-zbaG4

youtube.com/watch?v=62Y5zJgHueg

Nice videos! So the accuracy is not on par with light industrial robotic arms, but look at the repeatability! Awesome! 8)

Nice work

On the left hand side of the front view you can see the limitations of the servo resolutions as you have a “saw tooth” line. If you could increase the servo angular resolutions then you should be able to get straighter lines.

What servos are you running in your arm?

Andy

Hi Andy,

I also noticed this problem.
The servos that I used where the standard ones from Lynxmotion.
All the servo’s are working on maximum resolution.

The problem here has to do with the base servo.
The base servo should have a much higher resolution than the other servo’s.
What I mean here is higher resolution than 0.09 degrees/step (=180/2000 degrees/steps).

But maybe you are also right. The software range of the base servo is in -90,90] degrees (res=0.09). So if I narrow this to -45,45] you become a better resolution (res=0.045).
And for the square in this case, it should give a better result… 8)

On the other hand, the purpose is that you once set the range of all the servo’s. Once this is done, you know the workspace of the robot. In this workspace the accuracy should be everywhere the same. :wink:

Just a few questions more :slight_smile:

Do you control the servos from using positional control? As it looks like bigger than a 0.09 deg step although the further your arm operates from the base the wider this step is (arch opening up). How often are the commanded points on each line? Do you use just 4 points? as this may cause the step.

If you used velocity control instead you should be able to get smooth lines.

You may find this helpful next time you have to do lots of matrix multiplcations wxMaxima is a free symbolic maths tool. Once you’d set up your transformation matrices you can multiple them and it generates your result.

Andy

All of the hobby servos have roughly the same resolution. Some are better than others, but the maximum for a perfect servo is 0.09°. There is no better resolution servo to put into the base. Probably the area to improve the arm performance would be to add mechanical dampening. It’s sort of impossible to add mechanical dampening to the shoulder which has two servos operated in tandem. But the four new arms we are developing use a large scale servo in the shoulder position. This allows our mechanical dampening disks to be used instead of a ball bearing on the shoulder axis. Of course we are using the disks on the elbow as well. We will duplicate the “draw a box” idea with the new arms as soon as we are able. This should fix the jagged lines. Here is a view of the top secret AL5D-KT. Shown without the new light weight wrist rotate option.

Here is an image of the light weight wrist rotate bracket on the new AL5C-KT (old SES arm). It uses an HS-85 for the axis.

Below is some previous discussion on real world servo resolution. If you ever see the insides of the pot used in standard servos, it is pretty amazing they do as well as they do.

lynxmotion.net/phpbb/viewtop … 2&start=45

hi nowis,

The videos are cool. Great work!
Have you determined the IK using Denavit hartenberg principle, i.e using DH-tables? or through the geometric approach?

Thanks,
umar

It might be interesting to draw a series of verticle lines starting in a center position and progressivly moving to the right and left and redrawing the lines. This would show if the loss of precision is consistant or if it might be a rough place on the pot wiper surface. Very accurate all things considered.

Hi pyrrhicpk
If you follow the link in the first post you can see his calculations in a PDF.
He’s used the D-H configuration of the arm to derive the transformation matrix for each joint. Then using matrix maths you can do the forward and inverse kinematics for the arm. Once you’ve solved the problem analytically the calculations can be pretty much be reduced to a line of code per joint.

Regards
Andy

Hi andy,
Thanks for the response. Actually i tried looking into the details in that pdf, but am unable to understand it thoroughly. Still i will give it another look. I am also deriving the equations for FK and IK using DH tables. here are my findings

lynxmotion.net/viewtopic.php?t=4115&start=90

FK is complete, but i am stuck with some IK equations, thats why i wanted someone to look into my details or to look into someone’s. Do give them a look if you get some spare time :slight_smile:

Thanks
umar

Hi all,

Sorry for the late reply. I have been busy :wink:

I will try to answer all the questions.

question 1: Do you use positional control or velocity control ?

I use positional control. But the data that is used makes sure that all the movements are smooth. You can check the data (squaredat) here:
cid-976b52dad42d0a1e.skydrive.li … otics?uc=1

I also put some comments there. This reads more easily. As you see there are enough datapoints (±600 points). So there is no way that there is loss of accuracy in the software. Like I said, the mathematics are correct.

I also put an excel file “Cubic Segments” to show this principle of smoothness. This smoothness is based on a differential equation of the second degree. So you have to give 4 conditions: the start and end angle. And the speed of this start and end angle. This macro calculates a smooth path between those points according to the 4 conditions. The whole software uses this principle.

question 2: Do you use matrix calculations ?

Yes, because the DH transformations are matrices. The forward tranformations are just DH matrices multiplied after each other. All the datapoints are also stored in matrices. I programmed this robot with Visual Basic 6. I made a class matrix. With these matrices I can do addition, multiplication, determinant and inverse calculations.

question 3: how are the IK calculated ?

The IK is done like Andy said. I use DH transformation to do the forward kinematics.
The inverse kinematics are done with the formula’s in the PDF file. I derived them myself. You can look at these as an exercise :wink:
The last page of the PDF file is what this is all about.
I have put them for those who are interested to program it yourself.
You can just use these formula’s in your application 8)

The forward kinematics are the easy part. :wink: This is just matrix multiplication. The real stuff is in the inverse kinematics :smiling_imp: . Because here you have multiple solutions of the robot configuration for each point in space…
But all this, is a lot to explain. I would rather refer to the following book where I learned all this stuff.

Robotics: Basic Analysis and Design
William A. Wolovich
Brown University

ISBN: 0-03-006119-9
This is really a great book because it starts from zero. Each chapter has some
exercises.

So this was it. I hoped helping you all out.
Let me know if there are more questions :wink:

hey nowis
thank you very much for the study on 4-dof. I think it’s gonna be real helpful. I’ve also been studying on 4-dof construction. but mainly on dynamics. I2m just gonna print your pdf and study on it too. you’ve done for me something real good:-)

wish you success…

Hi kalimeras61 ( and also other enthousiasts !! )

Thank you all on your positive feedbacks :wink:
On this quest I have spent about 2 years of hobby time
in the making of my robot program.

On the inverse mathematics alone I did about a month to figure these things out :bulb:
I am not a robot specialist. I am just an automation engineer.

I am happy that my information is useful and that other people can further dig out their hobby 8)

yeah, I do like the motion of your robot. that speed control while drawing the rectangle is about the counters or you have something else to slove the servos down? I also programmed lynx 6 with my own servo drive card, but it moves too fast (meanwhile, I used PIc to program it). so far, no solution for sloving the servos down is existant in my work:-(

I like to ask you something else nowis, I printed your inverse kinematics files, but it’s sometimes hard to read them. do you have a copy of these codes that is writeen in computer environmetn, such as word etc.? I2m planning to create a MATLAB code to control the motion of a 4-dof robot arm. but I have no time to extract the calculations for inverse kinematics formulation. because I2m already busy with my master degree thesis stuff. so, if you don’t mind, I’d like to use your codes. But the thing is, I’m really having trouble to read and understand:-((

Hi kalimeras61,

For the speed of the servo’s I used that differential equation of the second order. All the necessary code is in that excel file: Cubic Segments.
I will explain the principle here for 1 servo.

Suppose you want a servo to move from [X1] 20 degrees to [X2] 70 degrees.
In the normal case you start (20 degr) with standstill and you stop (70 degr) with a standstill.
So the speed of the startangle and the endangle is zero [V1]=[v2]=0.

When this is defined, you have to declare how long the duration is of this movement (here 50 degrees). In the Excel file I have a start- and a stoptime. But you can take Tstart always zero. So Tstop is the duration of your movement. I took 1 sec as duration. But that is just a variable.

The last and most important thing is the timestamp of the data that is going to be logged.
I have put a value of 0,01 sec or every 10 ms.
So for a duration of 1 sec you have 100 datapoints (0,01sx100=1sec). These datapoints are sent to your servo.
So when you have these datapoints, you only have to make sure that these points are sent every 10 ms to your servo. Otherwise the theory and the practice are not the same !!

So the next question is then: how are these datapoints calculated ?
In my excel file you don’t have to know. Just press the button and it is all done for you. When this is pressed the excel macro generates 3 columns.
column I: timestamp
column J: actual servo angle
column K: actual servo speed
The result of these data is also shown in the two charts: position and speed.
In the position chart you see that you start with 20 and build up to 70 degrees.
In the speed chart you see that you start with zero speed, accelerate to a max and then decelerate down to zero speed again.

It is very important that you understand this principle. Because everything is based on this. Once you completey understand this, you can look inside the macro to see what the code behind is.

For that other question about the inverse kinematics I must refer to the book. It is really too complex to explain this here. The book has very good examples and exercises.
I can give you the code (vb6). It is just a rar file. You just mail me your mailadres.
But you must understand the principles of ikine first.
Because otherwise the code will be too complex and disturbing.

Greetings and hoped helping you out.

thank you very much for your explanation nowis. Currently I’m trying to stabilize the basic idea of servo speed calculation. besides, I’d really apprecate if you could send me the vb6 code of IK calculation. I’d like to see how you managed the combinations of robot positions. you can email me at: [email protected]
please also give me the name of that refer book you mentioned.
thanks a lot for the help.

dear nowis, thank you very much for the codes. it’s gonna help a lot…
since I do not have sufficient knowledge of vb6, I like to ask if you can explain what the codes you use for callculating the theta3 and theta2 mean! you can just explain them linguistically. and I will try to find an equivalent form of that code in MATLAB.

I tried to use your codes you gave in that pdf in your hotmail account. but when you use them directly, it always give an inconsistent result and usually gives an imaginary result error while calculating the theta3. so, it’s no use to use these formulas without any boundary conditions. so, I need your help about what those codes you use for calculating theta3 and theta2 mean, if you don’t mind.

meanwhile, as you typed in your calculations, we use atan2(Py/Px) command to calculate the base roll value. but in your vb6 codes, such an equation is not used. rather, some temporaryMat and putValueMatrix commands are used. are those command about assigning values for theta1 instead using atan2 function or you claculated theta1 in some other sections???

I hope I’m not taking your time so much. thanks a lot…