Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser...

10
INSTRUCTOR WORKBOOK Quanser Robotics Package for Education for MATLAB /Simulink Users Developed by: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser CAPTIVATE. MOTIVATE. GRADUATE. Quanser educational solutions are powered by:

Transcript of Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser...

Page 1: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

INSTRUCTOR WORKBOOKQuanser Robotics Package for Education

for MATLAB /Simulink Users Developed by:

Amir Haddadi, Ph.D., QuanserPeter Martin, M.A.SC., Quanser

CAPTIVATE. MOTIVATE. GRADUATE.

Quanser educational solutions are powered by:

Page 2: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

COURSEWARE SAMPLE

Quanser Robotics Package for Education

©2015 Intellectual property of Quanser. Do not reproduce without written permission.

QUANSER.COM +1-905-940-3575 [email protected] Page 1 of 8

PREFACE Preparing laboratory experiments can be time-consuming. Quanser understands time constraints of teaching and research professors. That’s why Quanser’s control laboratory solutions come with proven practical exercises. The courseware is designed to save you time, give students a solid understanding of various control concepts and provide maximum value for your investment.

Quanser Robotics Package for Education courseware materials are supplied in a format of the Instructor and Student Manuals.

This courseware sample is prepared for users of The MathWorks’s MATLAB/Simulink software in conjunction with Quanser’s QUARC real-time control software.

The following material provides an abbreviated example of lab experiments for the Quanser Robotics Package for Education. Please note that the examples are not complete as they are intended to give you a brief overview of the structure and content of the course materials you will receive with the plant.

Page 3: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

COURSEWARE SAMPLE

Quanser Robotics Package for Education

©2015 Intellectual property of Quanser. Do not reproduce without written permission.

QUANSER.COM +1-905-940-3575 [email protected] Page 2 of 8

TABLE OF CONTENTS

PREFACE .................................................................................................................................. PAGE 1

INTRODUCTION TO QUANSER ROBOTICS PACKAGE FOR EDUCATION

COURSEWARE SAMPLE ........................................................................................................... PAGE 3

INSTRUCTOR WORKBOOK TABLE OF CONTENTS ................................................................... PAGE 3

PRE-LAB PREPARATIONS: BACKGROUND – SAMPLE ............................................................. PAGE 5

PRE-LAB PREPARATIONS: PRE-LAB EXERCISE – SAMPLE ....................................................... PAGE 6

IN-LAB EXERCISE – SAMPLE .................................................................................................... PAGE 7

Page 4: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

COURSEWARE SAMPLE

Quanser Robotics Package for Education

©2015 Intellectual property of Quanser. Do not reproduce without written permission.

QUANSER.COM +1-905-940-3575 [email protected] Page 3 of 8

1. INTRODUCTION TO QUANSER ROBOTICS PACKAGE FOR EDUCATION

COURSEWARE SAMPLE

Quanser courseware provides step-by-step pedagogy for a wide range of control challenges. Starting with the basic principles, students can progress to more advanced applications and cultivate a deep understanding of studied theory. Quanser Robotics Package for Education courseware covers topics, such as:

• manipulator kinematics • manipulator inverse kinematics • manipulator Jacobian • trajectory planning

2. INSTRUCTOR WORKBOOK TABLE OF CONTENTS

The full Table of Contents of the Quanser QBot 2 for QUARC courseware is shown here: Experiment 1 – Manipulator Kinematics

1. PRE-LAB PREPARATIONS 1.1. BACKGROUND

1.1.1. COORDINATE FRAME ASSIGNMENT AND DH PARAMETERS 1.1.2. FORWARD KINEMATICS USING DH PARAMETERS

1.2. PRE-LAB EXERCISE 2. IN-LAB EXERCISE

2.1. SIMULATION 2.2. EXPERIMENT

Experiment 2 – Manipulator Inverse Kinematics 1. PRE-LAB PREPARATIONS

1.1. BACKGROUND 1.1.1. SOLVABILITY 1.1.2. EXISTENCE OF SOLUTIONS 1.1.3. GEOMETRIC SOLUTION

1.2. PRE-LAB EXERCISE 2. IN-LAB EXERCISE

2.1. SIMULATION 2.2. EXPERIMENT

Page 5: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

COURSEWARE SAMPLE

Quanser Robotics Package for Education

©2015 Intellectual property of Quanser. Do not reproduce without written permission.

QUANSER.COM +1-905-940-3575 [email protected] Page 4 of 8

Experiment 3 – Manipulator Jacobian 1. PRE-LAB PREPARATIONS

1.1. BACKGROUND 1.1.1. LINEAR AND ANGULAR VELOCITY 1.1.2. VELOCITY PROPAGATION FOR SERIAL LINK MANIPULATORS AND MANIPULATOR JACOBIAN 1.1.3. STATIC FORCES 1.1.4. MANIPULATOR SINGULARITIES

1.2. PRE-LAB EXERCISE 2. IN-LAB EXERCISE

2.1. SIMULATION 2.2. EXPERIMENT

Experiment 4 – Trajectory Planning 1. PRE-LAB PREPARATIONS

1.1. BACKGROUND 1.1.1. PATH DESCRIPTION AND GENERATION 1.1.2. CUBIC VS. QUINTIC POLYNOMIAL TRAJECTORY PLANNING 1.1.3. PRE-LAB EXERCISE

2. IN-LAB EXERCISE 2.1. SIMULATION 2.2. EXPERIMENT

Page 6: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

COURSEWARE SAMPLE

Quanser Robotics Package for Education

©2015 Intellectual property of Quanser. Do not reproduce without written permission.

QUANSER.COM +1-905-940-3575 [email protected] Page 5 of 8

3. PRE-LAB PREPARATIONS: BACKGROUND - SAMPLE Experiment 4 -Trajectory Planning In the context of robotics, Trajectory refers to a time history of position, velocity and acceleration for each degree of freedom, whether in the joint space or Cartesian space. In various robotics application, the end-user cannot be involved in determining complicated functions for the robot motion. Therefore, the robot program should be able to provide the motion of the robot with some limited information such as the desired goal pose (position and orientation) of the robot end-effector or the attached tool or multiple way points (or via points) along the desired path. In this laboratory you will learn how robot trajectories can be computed, represented, generated and applied to the robots. Path Description and Generation As mentioned earlier, the end users of robot manipulators mostly concern about the motion of the tool frame of the robot, attached to the end-effector, relative to the base or station frame. Therefore, in this lab we focus on the Cartesian-space trajectory planning although the methods can be directly applied to joint-space schemes. The motion of the robot includes both position and orientation. Since we are dealing with a 4 DOF robotic manipulator, if we want to control the position of the robot end-effector in space, we require three degrees of freedom. We use the rotation of the last joint (wrist) of the robot as the remaining degree of freedom of the robot. In most cases, it is necessary to specify the movements of the robot in more details. Consider a factory in which a robotic arm has to reach a part without touching other objects around it. Therefore, the user wishes to provide a sequence of way points (or via points), i.e., intermediate points between the initial and final points. Depending on the design scheme, each way point includes different information. In Cartesian scheme, each way points describes the position and orientation of the robot. In joint-space scheme, each way point represents all joint angles. Along these spatial constraints each way point usually contains some temporal attributes, i.e., the time elapsed between the way points. Also, having a smooth motion is usually another constraint. Usually, a trajectory function that is continuous and has continuous first derivative is a smooth trajectory. For a minimum jerk trajectory, a continuous second order derivative is desirable. Minimum jerk motions minimize wear on the robot mechanisms and is desirable for many applications such as accurate image analysis for robotic vision inspections.

Page 7: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

COURSEWARE SAMPLE

Quanser Robotics Package for Education

©2015 Intellectual property of Quanser. Do not reproduce without written permission.

QUANSER.COM +1-905-940-3575 [email protected] Page 6 of 8

4. PRE-LAB PREPARATIONS: PRE-LAB EXERCISE - SAMPLE Experiment 1 -Manipulator Kinematics Using the procedure outlined in the background section for attaching coordinate frames to robotic manipulators, assign appropriate coordinate frames to the schematic of the MICO robotic manipulator in Figure 1.2 (some axes are shown for simplicity). The base and end-effector of the arm are shown with red dots and all other joints are shown with green dots.

Figure 1.2: Schematic of the 4 DOF MICO robotic manipulator

Answer The coordinate frames should be assigned according to Figure Ans.1.1.

Figure Ans.1.1: Schematic of the 4 DOF MICO robotic manipulator with coordinate frames assigned to all links

Page 8: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

COURSEWARE SAMPLE

Quanser Robotics Package for Education

©2015 Intellectual property of Quanser. Do not reproduce without written permission.

QUANSER.COM +1-905-940-3575 [email protected] Page 7 of 8

5. IN-LAB EXERCISE - SAMPLE Experiment 2 - Manipulator Inverse Kinematics Simulation The QUARC model for this exercise is "MICO_Inverse_Kinematics_Simulation.mdl", a snapshot of which is shown in Figure 2.1

Figure 2.1: Snapshot of the controller model "MICO_Inverse_Kinematics_Simulation.mdl"

Compile and run the model. The Quanser 3D Viewer window should open, showing a visualization of the robot. Go through the following steps and answer the corresponding questions.

1. Set the x,y and z values of the P0 input command to 0,0 and 0.7 m respectively (use the slider gains highlighted in yellow). Observe the outputs "Solution 1" and "Solution 2" and verify your pre-lab calculations. Compare the pose of the robot with the schematic from Question 3 in the Pre-Lab Exercise.

Answer 2.1 (a) Solution 1: 𝜃1 = 0, 𝜃2 = −131.6°, 𝑎𝑛𝑑 𝜃3 = −5.53° (b) Solution 2: 𝜃1 = 0, 𝜃2 = −48.37°, 𝑎𝑛𝑑 𝜃3 = −174.47° These values are consistent with pre-lab calculations. The 3D Viewer shows the robot in a configuration similar to Figure Ans. 1.1

□ □ □ 2. How is the y axis of the end-effector frame oriented with respect to the global (or base) frame? Hold

down the middle mouse button, and move the mouse to rotate the camera view of the 3D Viewer. Describe the orientation of the robot in relation to the rotation matrix.

Answer 2.2 y axis is along -y of the global frame. This is obvious from the second column of the rotation matrix (R).

□ □ □

Page 9: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

COURSEWARE SAMPLE

Quanser Robotics Package for Education

©2015 Intellectual property of Quanser. Do not reproduce without written permission.

QUANSER.COM +1-905-940-3575 [email protected] Page 8 of 8

Experiment The QUARC model for this exercise is "MICO_Inverse_Kinematics_Experiment.mdl'' the snapshot of which shown in Figure 2.2. Make sure that the manual switch is set to zero (MICO is disabled). Turn on the robot and manually move it to a desired pose (arbitrary). Make sure that the robot is not too close to the ground.

Figure 2.2: Snapshot of the controller model "MICO_ Inverse_Kinematics_Experiment.mdl''

1. Set 𝑥, 𝑦, and 𝑧 values of the P0 input command to 0, 0, and 0.7 m respectively (use the slider gains

highlighted in yellow). Observe the outputs "Solution 1'' and "Solution 2'' and verify the values by comparing them to the ones you observed from the previous section. Compare the pose of the robot with the pose of the virtual robot you observed in the previous section. Enable the robot motion and observe the robot moving to P0.

Answer 2.6 (a) Solution 1: 𝜃1 = 0, 𝜃2 = −131.6°, 𝑎𝑛𝑑 𝜃3 = −5.53° (b) Solution 2: 𝜃1 = 0, 𝜃2 = −48.37°, 𝑎𝑛𝑑 𝜃3 = −174.47° These values are consistent with virtual robot observations.

□ □ □

2. What is the actual position of the robot end-effector (the output P from the forward kinematics block highlighted in blue). What is the error between the commanded position and the output position? What do you think is the source of error?

Answer 2.7 𝑃 = [−0.003 − 0.000008 0.7003], 𝑒 = 𝑃 − 𝑃0 = [−0.003 − 0.000008 0.003] (Ans.2.1) Note: These values could be different depending on the initial pose of the robot. The source of error is related to control error, as well as measurement error. Other sources of error, such as model error, do not affect the measured P. If we used other tools to measure the end-effector position, then the model error (e.g. error in the length os the links) would have an effect.

□ □ □

Page 10: Amir Haddadi, Ph.D., Quanser Peter Martin, M.A.SC., Quanser€¦ · COURSEWARE SAMPLE Quanser Robotics Package for Education ©2015 Intellectual property of Quanser. Do not reproduce

Solutions for teaching and research. Made in Canada.

[email protected] +1-905-940-3575 QUANSER.COM

Solutions for teaching and research in robotics and autonomous systems

With Quanser robotic systems, you can introduce control concepts related to stationary and mobile robotics, from vibration analysis, resonance and planar position control to sensors, computer, vision-guided control to unmanned systems control. All of the experiments/platforms are compatible with MATLAB®/Simulink®.

©2015 Quanser Inc. All rights reserved.

2 DOF Robot 2 DOF Gantry 2 DOF Inverted Pendulum

2 DOF Serial Flexible Joint 2 DOF Serial Flexible Link2 DOF Planar Robot

QBot 2

QBall 2 Unmanned Vehicle Systems Lab

6 DOF Denso Open Architecture Robot