QArm - Lab 2 - Lab Procedure
QArm - Lab 2 - Lab Procedure
Workspace Identification
Setup
1. It is recommended that you run this lab individually.
2. Launch MATLAB and browse to the working directory for Lab 2 – Workspace Identification.
Forward Kinematics
1. Open the ForwardKinematics.slx model via MATLAB. This will be used to implement and validate
your forward kinematics formulation. The ‘Task Space’ section will display the position and the
orientation matrix of the end-effector frame with respect to the base frame corresponding to the
static joint configurations described in the ‘Joint Space’ section, as shown in Figure 1.
3. Using the transformations from Table 1.2 in the Workspace Identification Concept Review, complete
lines 20-24 and 27-30 in the qarmForwardKinematics function. Note that 𝑙1, 𝑙2 and 𝑙3 correspond to
𝜆1 , 𝜆2 and 𝜆3 . Also, change lines 33-37 to correctly convert joint angles from phi to theta.
4. Complete the DH Table below for the QArm manipulator based on the schematic in Figure 1 from
the Workspace Identification Concept Review document.
𝑖 𝑎𝑖 𝛼𝑖 𝑑𝑖 𝜃𝑖
1
2
3
4
5. Use the DH table from step 4 to complete lines 42 to 45 in the qarmForwardKinematics function.
Note that the quanser_arm_DH function call is described in line 41. Lastly, leave the theta parameter
in lines 42 to 45 as 𝑡ℎ𝑒𝑡𝑎(𝑖) where 𝑖 corresponds to the correct index 1 to 4.
6. Before you proceed, you must complete the quanser_arm_DH function. You can find the function
definition within qarmForwardKinematics at line 61. This function calculates and returns the
1
homogenous transform 𝑇𝑖 given the DH parameters 𝑎𝑖 , 𝛼𝑖 , 𝑑𝑖 and 𝜃𝑖 as input parameters.
𝑖−1
Complete the correct definitions for T_R_z, T_T_z, T_T_x, and T_R_x in terms of the inputs 𝑎,
𝑎𝑙𝑝ℎ𝑎, 𝑑 and 𝑡ℎ𝑒𝑡𝑎. Lastly, multiply the four individual transformations in the correct order to
find the return transform 𝑇.
7. Now that you have completed quanser_arm_DH, lines 42 to 45 will be functional. Complete lines 47,
48 and 49 to correctly calculate T02, T03 and T04 in terms of T01, T12, T23 and T34. Note that TAB in
MATLAB code corresponds to 𝐴𝑇𝐵 .
8. Lastly, complete lines 54 and 57 to extract the correct elements of the T04 transform.
9. Close qarmForwardKinematics. Press the Run button to run your model. With the Joint
Space set to [0 0 0 0]𝑇 , the end-effector position and orientation in the Task Space
section should display the following
0.45 0 0 1
0
𝑝4 = [ 0 ] , 𝑅4 = [0 −1 0] (1)
0.49 1 0 0
Verify the position parameters from the schematic 1 in the Workspace Identification Concept Review.
Workspace Identification
1. Copy the qarmForwardKinematics function that you have completed. Ensure that you keep a copy
of your files for future use. Close ForwardKinematics.slx and open WorkspaceIdentification.slx.
Replace the qarmForwardKinematics function with the completed version.
2. With the QArm in the rest position, turn the power ON using the switch at the rear end of the platform.
It should hold its position. Prior to running the model, open the model’s Configuration Parameters
and verify that they are configured as follows:
3. Ensure that the area around the manipulator is clear of any obstacles. Stay well outside the reach of
the manipulator. Build and deploy the model using the Monitor & Tune action. Once started, the
manipulator should remain at rest.
4. Hold the manipulator by hand and move it so as to capture workspace characteristics, such as
extremes, joint limits, collision points, etc.
Note: The arm is set to a PWM mode with 0 command. Although the back-emf in the actuators
should provide resistance to motion, this dampens the response of the arm to your manipulation,
making it safe to interact with the manipulator.
5. Move the manipulator back to the rest position and stop the model.
6. In MATLAB, right-click visualize_data.m and click run, which will spawn two plots.
The first plot (Figure 1: QArm Workspace) provides a 3D plot of the end-effector trajectory. It draws
the end-effector trajectory of the manipulator in 3D to help you visualize the end-effector motion
2
and its extremes. Rotate the 3D plot using the tool at the top right of the plot. Take note of the
workspace limits, and take screenshots of the X vs Y, Y vs Z, and X vs Z planes.
The second plot (Figure 2: End-effector Trajectory) displays the Task Space trajectories that the end-
effector went through. Find the maximum 𝑥, 𝑦, and 𝑧 ranges of the manipulator’s end-effector. Take
note of these extremes.
7. Do your figures match the provided workspace boundaries in the Workspace Identification Concept
Review.
8. In the MATLAB Workspace, select the variables t, x, y, and z. Right-click and then select ‘Save As…’.
Save the data as myData.mat for future use.
10. Turn OFF the power to the manipulator using the switch in the rear end of the base. Ensure that the
manipulator is in the rest position.