by Ipek Emekli
Calculation of motor angles based on x-pos and y-pos of robot arm end-effector.
Things to keep in mind/tips and tricks
The trig and math for the angle sign correction can get complicated with all four quadrants involved, so you may consider building your robot so that its motion is physically limited to the first two quadrants.
When you’re testing the robot, you can notice that there are two possible motor positions for each given end effector position (see figure below), thus, the “alpha” variable can be taking random negative or positive values. This would cause theta1 (theta1=alpha+beta) to be very off. To solve this issue, you may want to sketch out different cases and determine the correct angle sign corresponding to each case.
Make sure you’re using radians or degrees consistently throughout the assignment — with your calculations and code. (See the "Angular Conversions" for Python Math module.)
Helpful video tutorial that walks through the steps with visual aids (note usage of q instead of theta and a instead of L): Inverse Kinematics for a 2-Joint Robot Arm Using Geometry