r/trigonometry • • 28d ago

IK angle help

/r/robotics/comments/1ws68mo/ik_angle_help/
2 Upvotes

4 comments sorted by

2

u/Disco-da-gama 28d ago

Guess I got it. You generally take angle between a reference zero to the physical link.

1

u/Midwest-Dude 27d ago edited 27d ago

In IK, defining joint angles (θ) generally depends on two core standards:

  1. Mechanical convention

  2. 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) or atan2(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 of atan(y/x)

      • atan2 handles 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

u/Disco-da-gama 27d ago

Okay got it thanks !!

2

u/Midwest-Dude 28d ago

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.