METR4202 Lab 1 v1.1
METR4202 Lab 1 v1.1
Notes
Questions will be in blue, and similar questions may be asked on your quizzes
throughout the semester.
Some exercises have been adapted from Quanser’s exercises.
You can find the content here.
Topics Covered
• Configuration Space
• PWM Control
• Position Control
• Quanser Software Introduction
Prerequisites
• Simulink and MATLAB (2019 or above)
• Understanding of DOF and Configuration Space
Objective
The objective of this laboratory is to familiarise yourself with the robotics simu-
lation software we will be using this semester: QLabs Robotics by Quanser.
For the first set of practicals we will be using a simulation of the QArm, which
is a 4-DOF serial robotic manipulator. Additionally, we will be covering the
basic theory behind robotic configurations, e.g. DOF and configuration space.
1
Lab 1 METR4202 - Robotics & Automation
1 Background
1.1 Serial Manipulators
The QArm robot is a serial manipulator, so we will need to understand what a
serial manipulator is, as well as the functions it can do.
We can break down a serial manipulator into a number of components:
• Joints
• Links
• Base
• End Effector
(P1-Q1)
Describe the purpose of each of the components above.
(P1-Q2)
Draw a simple diagram illustrating a manipulator, with components labelled.
Lab 1 METR4202 - Robotics & Automation
xA , xB , xC
This will limit us to one of two points, but with the constraint
(P1-Q3)
List some ways we can represent a rigid body’s configuration in 3D.
• 3D Position + Euler Angles
•
•
(P1-Q4)
Describe some issues with certain representations of a configuration.
(E.g. problems with Euler Angles).
Lab 1 METR4202 - Robotics & Automation
1.3.1 Joints
There are a number of types of joints which can restrict the motion of the links.
Figure 1: Joints
Source: Modern Robotics by Kevin M. Lynch and Frank C. Park
The two types joints that will be focused on in this course are:
• Prismatic (Linear Motion ↔ Translation, 1-DOF)
• Revolute (Circular Motion ↔ Rotation, 1-DOF)
(P1-Q5)
How many degrees of freedom does the following manipulator have?
2 In-lab Exercise
Task 0: Setup
The aim of this task is to setup the QLabs environment, which you will be using
alongside Simulink. You can complete some of these steps before the practical.
1. Make sure you have MATLAB version 2019 or newer.
2. Download the QLabs Software here.
3. Open up the QLabs Software (Quanser Interactive Labs).
Task 1: PWM
Recall that PWM (Pulse Width Modulation) can be used to deliver variable
power by altering the duty cycle.
In this application, PWM is used to control the actuation of the four joints on
the QArm.
1. In the Simulink model BasicIO pwm mode.slx, run the simulation with
QLabs open to the QArm Workspace.
2. In QLabs, make sure that PWM mode is on, in the settings.
3. Have a go toggling the various switches and changing the duty cycle on
the Simulink model and see the effect that this has on the movement of
the QArm.
4. Try toggling the gripper command.
5. Discuss how this sort of control system might be implemented with electric
motors, and an MCU.
Task 2: Position
We can control the positions of the configuration, which in this case are the
joint angles for the base, shoulder, elbow and wrist.
You can change the angles for each of the joints by changing the respective
square wave blocks.
1. In the Simulink model BasicIO position mode.slx, run the simulation
2. Make sure that position mode is on.
3. Play around with the joint angles
3 Q&A
Feel free to ask the tutors any questions about the practical, or about the course
content.
We can also go through questions relevant to the mini-quizzes, especially from
the textbook.
Lab 1 METR4202 - Robotics & Automation
4 Mini-quiz Preparation
Some extra questions are provided below, as additional preparation for the mini-
quizzes.
(1)
For each of the following
i) Describe the topology of the configuration space.
ii) State the DOF.
iii) Describe the workspace topology, i.e. the reachable workspace.
(Assume no constraints)
iv) Describe any singular configurations (for manipulators)
————————————————————————————
a) A BB (ball-ball) serial manipulator.
(2)
1. Write out the matrix representation of a 2D counter-clockwise rotation.
(3)
Show that