Lab 4 - Drawbot

Mini-lecture - Inverse Kinematics

3D illustration of motor angles, directions of positive rotation, and relevant geometry.

  • Video: Available soon

Lab instructions

Step 1. Implement and test a inverse kinematics function

  1. Program a function that takes in a BLA::Matrix<3> vector of the desired cartesian coordinates and outputs a BLA::Matrix<3> of the corresponding joint angles.

  2. Test function in Platformio against our test data [todo. figure out platformio tests]

Step 2. Check against forward kinematics

  1. Come up with some reasonable (i.e. leg configurations you might see on the robot) cartesian end-effector positions

  2. Pass those positions to your inverse kinematics function to get joint angles

  3. Sanity check the joint angles yourself

  4. Pass those joint angles into your forward kinematics function to get predicted cartesian position

  5. Check the predicted cartesian position against the cartesian positions you started with

  6. If they don’t match, but you think your code is correct, think about if your initial cartesian point is compatible with how we derived the inverse kinematics.

  7. Remember that for every cartesian point in space, there are two sets of joint angles that will you get there. However, we programmed our inverse kinematics to find a specific one.

Step 3. Program a drawing pattern

  1. Come up with an easy shape to draw (lines, circles, etc)

  2. Program a function that maps time to where, in cartesian coordiantes, the pen should be to draw that shape

  3. Dry-run the drawing function by printout out the coordinates and joint angles without commanding the actuators.

  4. Do it for real.