🦾 Industrial Robot Work Cell: Joint Trapezoids, Torque and Cycle Time

What you are seeing

Four stations (pick, weld, paint, place) are visited in a loop. The arm solves inverse kinematics for each station, then both joints move together on a synchronised trapezoidal velocity profile. Raise speed and acceleration to cut cycle time, but watch the orange torque curve: a heavy payload with fast accelerations pushes the shoulder gear past its rating (the readout turns red).

Controls

Live readouts

Numerical checks

Compares IK with forward kinematics, integrates the velocity profile, and checks torque against a hand calculation.
The science

Planar two-link arm, link lengths L1 = 0.6 m, L2 = 0.5 m. Forward kinematics: x = L1 cos q1 + L2 cos(q1+q2), z = L1 sin q1 + L2 sin(q1+q2). Inverse: cos q2 = (x²+z²−L1²−L2²)/(2 L1 L2), elbow-up branch, q1 = atan2(z,x) − atan2(L2 sin q2, L1+L2 cos q2). At full stretch q2 = 0 (a singularity: the arm loses a degree of freedom).

Each move is joint-interpolated with a trapezoidal velocity profile: if d > v²/a the time is d/v + v/a, otherwise 2·sqrt(d/a). All joints share the slowest joint's profile so they arrive together.

Torque = gravity term + inertia·acceleration, with uniform links (8 kg, 5 kg), 1 kg gripper plus payload. Simplifications: the Coriolis/coupling terms, friction, gear elasticity and controller lag are ignored, the arm moves in a vertical plane, and the 180 N·m gear rating is an illustrative figure. Real cells add tool-path (Cartesian) interpolation, jerk limits and collision checking.