I was looking at the PEP spreadsheet from zenta and trying to work out the equations. One thing which didn’t make sense to em was the femur angle calculation. Why is the femur angle IkA1 + Ika2 ? They seem to be on the opposite sides isn’t it or am I missing something. Can someone please respond?
It’s been a while since I worked on that part… You see, the IK section I used on the PEP sheet comes from the spreadsheet from Mike Keesling. I only rotated the graph 90 deg. I think that would explain everything. The A1 is the angle between the line from femur servocenter and the foot(tars) and the ground (now shifted 90 deg on the graph) and the A2 is the angle between the femur and the same line described above. Therefore the femur angle should be the sum of A1 and A2.
Wishing you a very happy new year !! First of all thanks a lot for replying to my question! I have been a big fan of your work. Its just awesome to be able to talk tot you . I am trying to understand the IK being done for the hexapod. This attached picture is what i was able to come up with. From what you have mentioned is my understanding for the angles correct ? Is that the ground you are referring to ? I am sure I will be having a lot of questions going forwards. Thanks again!!
Wishing you a very happy new year !! Thank you so much for your reply. As said above I am trying to understand and learn the IK implementation. Your diagram is of utmost importance. I can’t thank you enough on you sending this here. I had come to the same conclusion as well as you can see based on my diagram attached above.
One question though why are final femur and tibia angles adjusted by adding 90 to it? Rest is pretty much clear but, I am sure I will have more questions. Thanks again !!
yes, this is ground bro. my opinion, don’t using Theta from fermur angle. just find alpha 1 and alpha 2 to calculation of fermur angle. Sr for my Eng :))
I have got as far as understanding and doing by hand all the calculations regarding the above angles. However, the piece of the puzzle I am trying to understand is how are the final angles calculated before sending to the servo. Femur angle is alpha1 + alpha2 and tibia angle is beta by calculations based on the above diagram.
However, then in the diagram attached by @lequocchi97 there is alpha = alpha1 + aplha2 - 90 and beta = 90 - theta and then there are the final angles which are calculated as FemurAngle = alpha + 90 and TibiaAngle = beta + 90
If I then substitute I alpha and beta in above equations we get
madmax. in my picture. you can see the orange line from fermur and tibia servo. you need control the orange line run 0 to 180 degree from the standard servo MG996R. that the point you need to focus. Just think alot bro, focus the orange line
Thanks for your reply. I am not a student I work as a software engineer , just trying to understand the IK and other aspects and making it from scratch rather than using arduino libraries. Best way to learn in my opinion. I am from UK. Mind if I ask the same about you?
I think part of my confusion is coming for the fact that I am trying to do some sort of python script as a first step to see that on the screen first. I will attach it in the next post. The idea is you click on the graph and the legs should go there.
That doesn’t seem to work when the y coordinate goes positive. The origin is placed at the coxa servo. Hence, was trying to understand.
I think that the formula for the calculation of alpha1 above would change if the y_input is positive. Isn’t it? Consider that alpha is 90 so the femur is perpendicular to the x axis pointing up and also consider tibia is perpendicular to the femur. In that case cos(alpha1) = adjacent /hypotenuse which is alpha = x_input/HF which is not reflected anywhere. Is my understanding correct?
I am sure I am going to have a lot of questions. Thanks again for your help, time and patience.
I will make it explicit as to what I am after.
Refer the following figure
alpha1 (in red) which the angle between the Y axis(or a line parallel to y axis at an offset of coxalength) and the StoW line is obtained by the formula shown when in this configuration.
However, what happens when the configuration is like below ???
What is alpha1 in this case. I think this is where I am going wrong in my python script.
In the PEP sheet from @zenta it seems it always uses antan2(x_cordinate/y_cordinate )of the tip and gets the correct answer, However, I cant seem to correlate it with the 2nd diagram that I have drawn. May be it is some stupid mistake on my part but any help to understand this would be appreciated.
Please point out any mistake in my notation of angles if I have not got it correctly.
It’s been years since I worked with the IK code. So far it looks ok. But are you using arctan2, not arctan? If I recall correctly, negative Y is upward in the PEP/Phoenix code. What values do you get when Y are shifting sign? The angle shouldn’t change much… ref graph of arctan2 from Wiki