Shop OBEX P1 Docs P2 Docs Learn Events
Robot Limb Servo angles calculated by P2 using inverse cosine via CORDIC — Parallax Forums

Robot Limb Servo angles calculated by P2 using inverse cosine via CORDIC

RaymanRayman Posts: 14,633
edited 2023-07-22 23:48 in Propeller 2

Could have posted here: https://forums.parallax.com/discussion/175423

But, this is kind of generic to robotic arm motion, where you want P2 to calculate the servo angles for motion and/or position.

Turns out you need inverse cosine (AKA arccosine) to do this.
Need for that has probably been worked out a million times and is described here:
https://appliedgo.net/roboticarm/

Fortunately, the P2 has a CORDIC engine designed to make this calculation much faster that would be on P1, for example.

Also, fortunate that @DiverBob has already dived into this and posted a solution here:
https://forums.parallax.com/discussion/173046

Anyway, here are the slides from my analysis, a spreadsheet to check against SolidWorks reported angles, and example code that seems to be calculating the angles correctly to within 1 degree.

Comments

Sign In or Register to comment.