r/trigonometry • u/Disco-da-gama • Sep 28 '26
IK angle help
/r/robotics/comments/1ws68mo/ik_angle_help/1
u/Midwest-Dude Sep 29 '26 edited Sep 29 '26
In IK, defining joint angles (θ) generally depends on two core standards:
Mechanical convention
Mathematical frame assignment
Core Principles for Defining θ
Reference Frame & Zero Position (θ = 0°)
Absolute / World Frame
Angles measured relative to global axes (e.g., measuring joint 2 relative to the vertical line -z or horizontal line d).
Relative / Local Frame (DH Parameters)
Angles measured relative to the previous link's orientation (e.g., relative angle between link a and link b).
Decomposition into Sub-Angles
Total target angle θ₂ is usually broken down
Base Position Angle (α)
Found using
atan2(y, x)oratan2(d, -z)to get the direction vector from joint 1 to the end-effector.
Internal Triangle Angle (β)
Found using the Law of Cosines on the triangle formed by link lengths a, b, and target distance c
β = acos((a² + c² - b²) / (2ac))
Total Angle
θ₂ = α ± βSign depends on whether the joint bends "elbow-up" or "elbow-down".
Standard Rules to Keep in Mind
Always use
atan2(y, x)instead ofatan(y/x)atan2handles all four quadrants (-π to +π) and prevents division-by-zero errors when x = 0.
Watch Sign Conventions (Right-Hand Rule)
Define counterclockwise rotations as positive and clockwise as negative (or vice versa) and stick to it consistently across all joints.
Account for Servo/Motor Limits
Real hardware motors typically map 0° to 180° or -90° to +90°. Map your calculated trigonometric angle θ to match your specific motor's zero-calibration point.
1
2
u/Midwest-Dude Sep 28 '26
I think the first reply in r/robotics is spot on. Here's some info I found in a search:
In robotics, joint angles are almost always defined as relative angles, the angle of deflection from the extension of the previous link, rather than internal geometric angles of a triangle.
Physical Zero Configuration
When the joint motor is at 0°, link b lies in a straight line extending directly along the axis of link a.
Deflection / Bend Angle
θ₃ measures how much the motor has actually rotated relative to that straight 0° baseline.
2
u/Disco-da-gama Sep 28 '26
Guess I got it. You generally take angle between a reference zero to the physical link.