cgxeiji / CGx-InverseK

Inverse Kinematic Library for Arduino for a three link-arm system with a rotating base.
GNU General Public License v3.0
63 stars 12 forks source link

Clarification #8

Closed ghost closed 7 months ago

ghost commented 1 year ago

Hello, i am currently trying to use your library in a school projet and i would have some questions for your library if possible...

firstly, what are the limits for x,y,z? like, the closest to the ground would be 0 for z i assume, but then maximum would be attained only if x/y are 0?

secondly, what is the angle representing? an image with what angle it is would really help me, because i don't know from what plane is this angle meseasured.

thirdly, the link lengths in your example, could it be they are not the same for every Braccio Arm? my arm have link lengths of 0,125,125,50 instead of the 0,200,200,270 you put down.

thank you

cgxeiji commented 9 months ago

Hi Fred,

Regarding your questions, the limits for x, y, and z are the physical limits of your arm. In the case of your arm, if all servos move so all the links are stretched, then the total radius will be 0+125+125+50=300. Then, your x, y, and z limits will be a sphere of radius 300 from the base of your arm. The kinematic solver will return false if it couldn't find a proper solution or if it is out of range.

The angle is the rotation from one link to another. For example, if all your servos are aligned such as if all of them are 90 degrees, then the arm will be stretched out, setting the forearm to 0 degrees will make the arm bend at a right angle to one side.

Now, you will need to offset or compensate the angles you get from the kinematic solver to your actual physical servos. Each arm might be configured differently (e.g. instead of 0 to 180 degrees servo, you use -90 to 90 degrees).

At the time I made this library, those were the measurements of the arm I used. Feel free to adapt them if you need to.

I hope this answers your questions.

cgxeiji commented 7 months ago

I am closing this issue now, feel free to reopen it if you have more questions!

Tyler-Curnow commented 7 months ago

When you say that the arm is "stretched out" when all servos are at 90 degrees do you mean that the arm will be standing straight up? Why is it that all joint angles would be 90 degrees? Would it not be 90 degrees for the base with 0 degrees for the remaining angles (ie upperarm, forearm, wrist)?

cgxeiji commented 7 months ago

The actual angles depend on how you assembled your arm. If you have your servos attach so that 90 degrees to the left is 0, stretched out is 90, and 90 degrees to the right is 180, then the range of your joint will be 0-180, with 90 degrees in the middle.