Milk Bowl Inverse Kinematics
Explanation
The user interface should be click on screen, i.e. x/y coordinates.
But the robotic system is all rotation based -
the outer ring rotates, and the pipette arm rotates side-to-side.
This is a visualisation of the inverse kinematics (IK) algorithm to calculate the angles from the x/y target.
The key insight is that it's an “intersection of two circles” problem:
1. Assume fixed pipette arm length 'r' (AB).
2. The main robot body must be located exactly 'r' from the centre A, and from the target point B.
3. The rest is simple trigonometry!
See the code here