MEAM.Design - MEAM 520 - **PUMA Light Painting: IK**

Now that you have your team, it's time to get to work on project 1. This assignment is due by **5:00 p.m. on Tuesday, October 16**. Your team must submit this assignment and get it to work correctly before you will be allowed to do the next part of the project. Submissions after the deadline will be penalized, but not as harshly as for individual homework assignments.

The final goal of this project is to create a beautiful light painting by taking a long-exposure video and photo of the PUMA moving an LED around in the air. As an intermediate step toward that goal, you and your teammates must solve the inverse kinematics of the robot, so that you can later safely move its end-effector wherever is needed for your artwork.

**LED Location**

The center of the LED is located at approximately [0" 0.125" 1.25"]' in frame 6. The position and orientation of frames 0 and 6 are specified in the image at right, as are the positive directions for all the joints. These conventions match what was specified in Homework 3, except that the values of b and d have been slightly corrected to the right numbers (sorry for the discrepancy).

**Joint Angle Limits**

θ1 (waist) range = 290 deg , lowerlimit = -180 deg , upperlimit = 110 deg

θ2 (shoulder) range = 315 deg , lowerlimit = -75 deg , upperlimit = 240 deg

θ3 (elbow) range = 295 deg , lowerlimit = -235 deg , upperlimit = 60 deg

θ4 (wrist) range = 620 deg , lowerlimit = -580 deg , upperlimit = 40 deg

θ5 (bend) range = 230 deg , lowerlimit = -120 deg , upperlimit = 110 deg

θ6 (flange) range = 510 deg , lowerlimit = -215 deg , upperlimit = 295 deg

**PUMA 260 Simulator**

At some point soon, we will publish a full forward kinematics simulator for the PUMA 260 robot. It will have the same software interface as our real PUMA robot. You may find it useful to use the simulator to verify your forward kinematics and inverse kinematics solutions. More details will be posted about the simulator after everyone has turned in Homework 3.

**Task 1: PUMA Forward Kinematics Function**

Talk about the forward kinematics of the PUMA 260 with your teammates. Compare the DH parameters and animations that you each created for Homework 3, and figure out any discrepancies between your solutions. Then work together to complete the `puma_fk_team00.m`

starter function provided in the zip file of starter code. Change the name of the file and the name of the function on the file's first line to include your team's two-digit number, as defined on the teams page. This function takes the robot's six joint angles in radians and returns the four-by-four homogenous transformation representing the pose of frame 6 in frame 0. The position part of this transformation should be in meters (different from before). If needed, you are welcome to create other functions in separate files (following the same team naming convention) or as subfunctions within your FK function. You may find this function useful in the following steps.

**Task 2: PUMA Inverse Kinematics Function**

Derive a full inverse kinematics solution for the PUMA 260, remembering the concept of kinematic decoupling. Here the goal is to find the values of the joint angles (theta1 to theta6, in radians) that put the robot's LED end-effector at a certain position and orientation that are specified relative to frame 0. Note that there are generally eight possible solutions to the PUMA's IK. To start, you should focus on finding one valid solution. Once you get that working, add in code to handle the constraint that the selected solution should be close to the robot's current configuration; the robot's current joint angles can be optionally passed into the function as th1now to th6now. If no valid solution exists, your function should return NaN (not a number) for all six joint angles. Complete the `puma_ik_team00.m`

starter function provided in the zip file below, again entering your team number where needed.

**Task 3: Script to Test PUMA Inverse Kinematics**

To help you assess the quality of your inverse kinematics function, you must also create a script that does thorough IK testing. At a minimum, it should compute two scores, both from 0 (worst performance) to 100 (perfect performance). One score is for finding inverse kinematics solutions without worrying about the robot's current configuration, and the second score is for finding inverse kinematics solutions close to the current joint angles of the robot. It is up to you to figure out what should be in this file to make it a reasonable test of the code. Make sure to test end-effector poses that are not reachable due to joint limits or other constraints. Complete the `test_puma_ik_team00.m`

starter script provided in the zip file below, again entering your team number where needed.

**Submission**

- Start an email to meam520@seas.upenn.edu
- Make the subject
*PUMA IK: Team 00*, replacing 00 with your team number. - Attach all of your correctly named MATLAB files to the email. They should be
`puma_fk_teamXX.m`

,`puma_ik_teamXX.m`

, and`test_puma_ik_teamXX.m`

, where XX is your team number, plus any additional files you may have created, also named according to this convention. - In the body of the email, explain the status of your submission. What works well? What challenges are you facing?
- Send the email. Every team should submit what they have before the deadline.

Please come talk to the teaching team or post questions on Piazza if you get stuck on any part of this assignment.