1One leg, three joints
Three joints per leg: hip yaw, femur, knee. Angles to foot is forward; foot to angles is inverse, which is what a walking robot needs.
Inverse · move the foot, the angles follow
2Why there are two solutions
The knee sits where two circles cross, so there are two solutions: knee up (the robot's choice) or knee down. No crossing means the foot is out of reach.
The real CAD leg, side-on, follows the same target.
3Reach and limits
A foot can only land in a ring around the femur pivot: at most cm out, at least cm in. Joint limits trim it further.
Top: joint angles by distance. Bottom: degrees per mm of foot travel (capped at ), which spikes at both edges.
4The maths
Forward chain and inverse formulas (for the curious)
Forward: write the leg as a chain of matrices
Each joint is a rotation and each link a translation. Multiply them in order, from the hip down to the foot:
cos, sin depend on a joint anglebracket_offset, hip_drop, femur_length, tibia_length are fixed link sizes
rotation about z
translation: out and down to the femur pivot
rotation about y
translation along the femur
rotation about y
translation along the tibia
The last column of that product is the foot position, in terms of the joint angles.
Show the foot-position equations (last column of the product)
Inverse: the angles from the foot position
Solving for the angles gives the robot’s formulas:
Show the algebra
± is knee up or knee down. If A² + B² − D² is negative, the foot is out of reach.
Background: Modern Robotics.