CPP Bahr IntroRobotics
CPP Bahr IntroRobotics
ME 5711
Fall 2018
Tuesday and Thursday 4:00-5:15 PM Rm 9-241
COURSE OUTLINE:
A system engineering approach to robotics, science and technology. To familiarize
students with the mechanical design and control of the manipulators (Robots). Topics
including kinematics, trajectory planning, control, programming of manipulators and
simulation, along with introduction to artificial intelligence and computer vision. The
students are required to design and do theoretical analysis of an innovative project in
robotics, along with some hands-on-experience with the Universal (UR-3).
INSTRUCTOR:
Dr. Behnam Bahr, Professor
Mechanical Engineering Department
California State Polytechnic University, Pomona
Office 9-127A
Phone (909) 869-2440
e-mail: [email protected]
PREREQIUSITE
Graduate Student in Engineering, knowledge of linear –Algebra, and programming languages such
as Matlab. And control system.
OFFICE HOURS:
3:00pm- 4:00pm Th,, 5:00pm- 6:00pm, Th, and by appointment
REQUIRED TEXT:
John J. Craig, “Introduction to Robotics Mechanics and Control,” Addison-Wesley, 4th
Edition.
* The Project can be experimental or theoretical, and should be a publishable quality work.
Students are encourage to publish their work in the conference proceedings. Therefore, you
need to start your project as soon as possible.
HOMEWORK:
Are assigned from lecture and reading assignments and are collected on a weekly basis. Assigned
Problems and computer programs are also part of the homework.
EXAMS:
The exams will be comprehensive, open book, notes and handouts
Final Project:
The final project report is accepted electronically.
SAFETY:
Adhere to safe practices while doing any experiment. Always wear safety glasses
When using shop equipment. Never work on live electronic circuitry, and always work in a group.
Operation:
No late homework can be accepted for grading.
No make-up Exam will be given without prior consent of the instruct
Objective 2
Equipment 2
Theory 2
Results 3
Procedure 4
Startup 4
Tool Setup 5
Programming 7
Edit Motion Type 13
Running a Program 14
Saving a Program 15
Process 1 Pattern Tracing 18
1
Objective:
Establish an understanding of the UR3 robotic arm features, capability and terminology.
Learn the basic functionality of the arm through creating and running a process program.
Equipment:
- 6 DOF robotic arm
- Control box
- Teach pendant
Theory:
The UR3 is a 6 degree of freedom robotic arm with +/- 360 degrees of rotation on all
joints (other than wrist 3, which has infinite rotation). The maximum payload of the arm is 3kg.
The arm is capable of detecting collisions which will engage a protective stop.
The teach pendant is the human to machine interface on which the robot can be
programmed and controlled. PolyScope is the software used by the teach pendant to control
the robot. Once a program is opened, the left pane of the display shows the program tree,
which lists sequence of commands that will be executed.
The control box houses the processor and power hardware for the robot. Peripherals
such as sensors or tooling can interface with the Input/Output channels within the box.
Additionally, ports for USB and ethernet are available from the bottom of the control box.
For every program, the controller needs information on the tool being used: The center
of gravity, tool center point, and tool mass. The TCP of the tool is where the tool will interact
with its environment (eg: contact points of a gripper, end of a nozzle, ect.). The relative distance
from the TCP to the tool mounting flange needs to be entered into the program.
The robot has three types of motion between waypoints: MoveL, MoveJ, and MoveP
MoveL: Linear motion between waypoints. Use when the path of the TCP is
important, or in confined space to avoid collision.
MoveJ: Joint move between waypoints. This is a nonlinear path which provides
the fastest motion type. Use when path of TCP is not important, or in free space.
MoveP: Process move between waypoints. This moves the TCP linearly between
waypoints while maintaining the TCP at a constant velocity. Use in applications
such as welding or gluing. This move rounds each vertex with a blend radius,
which can be adjusted in the program. This motion type also includes
2
CircleMove, which creates a three point arc. The waypoints to be defined are the
via point, which is any point on the arc, and the arc endpoint.
The work envelope is the range that the robotic arm can perform in. Each degree of
freedom contributes to the total envelope. While moving within this envelope, there are
trajectories in which the commanded acceleration of a joint will approach infinity. These are
known as singularities, and typically occur when arm joints align with each other or when
approaching the extremes of the work envelope. Since the physical robot cannot match these
commands, the arm will typically oscillate excessively as it approaches the singularity, then the
emergency stop will halt the program.
Though the robot can detect physical collisions when they occur, it cannot preemptively
determine that it will collide with the outside world, or itself. Care should be taken that the
trajectories avoid these situations.
Results:
1) Start up the UR3
2) Configure the TCP
3) Create programs for the Pattern or Bearing Module Processes
4) Save the program internally or externally to a USB drive
3
Procedure:
Startup:
- Click the power button on the teach pendant and allow the robot to power up (~1 min.)
- Ensure the E-stop button is disengaged (rotate clockwise until in up position)
- Click “Go to initialization screen” then click the “ON” button to enable power to the
joints
4
Tool Setup:
- From the “Program Robot” page, click the “Installation” tab at the top left of the screen
5
Figure 4: TCP Configuration
- If needed, input the distance from the tool flange to the center of gravity in the CX, CY,
and CZ fields
• Not necessary for using the metal rod attachment
- Click the “Set as default” to save the TCP configuration
6
Programming:
- From the main page of the teach pendant, click “Program Robot” then select “Empty
Program”
7
- On the Program Structure Editor page, select “Move”. A motion MoveJ and waypoint
Waypoint_1 are added to the program tree
8
• The TCP position can input directly and the arm will move the TCP to the new
location
• The Freedrive button (one on the screen, one on the back of the teach pendant can
be held down and the arm can be physically moved to a new location
9
Figure 12: FreeDrive Button
- Once the arm is in the desired location and orientation, select “OK” at the bottom right
hand corner of the screen to save the waypoint
10
Figure 14: Add Waypoint After Location
- Repeat these instructions until all the needed waypoints are set.
- When the program is played, the arm will move through the waypoint in order from top
to bottom of the Robot Program tree
• By default, the robot will use MoveJ to move efficiently between waypoints. To
change the move type being used, reference the Edit Motion Type instructions
below
11
Figure 15: Waypoints in Program Tree
12
Edit Motion Type:
- In the Robot Program Tree, select the motion to be edited.
- Select the “Command” tab, then click the pulldown in the top right corner
- Select the new move type
• Details on the various move types and on which to select can be found in Theory
- The Robot Program Tree will automatically update the current move type
13
Running a Program:
- Navigate to the “Program” tab. The controls for running a program are located at the
bottom of the screen.
- Select a speed for the arm to run at. Speeds are chosen as a percentage of fastest TCP
velocity (150mm/s by default)
- Select the start icon at the bottom of the screen
- Press and hold “AUTO” until the arm reaches the first waypoint. Press “OK”
- Press the play icon again. The program will begin to run.
14
Saving a Program:
- Once a robot program has been completed, it can be saved internally or externally.
• To save internally (on the robot PC):
o Click “File” then “Save As”
15
• To save externally (to a USB drive):
o Insert a USB drive into the port on the right side of the teach pendant
16
Figure 22: “Save As” Location
o Select the “Current Directory” pull down, and navigate to the USB Drive
location
o Enter the name to save the file as, and “.urp” as the file type
o Click “Save”
17
START/END 4
Process 1: Pattern
Tracing
1 3
18
19
UR3 Robotic Arm: Bearing Module
1
Procedure:
Using the instructions from Introduction to UR3 Robotic Arm, create a program using the teach
pendant.
- Choose an initial waypoint in space in which the tool is away from all physical objects,
and the arm is in a configuration which all joints are not approaching singularities
o After the program completes, the arm will MoveJ back to this waypoint
- The next important position requires the tool to be aligned concentric with the bearing
to be picked up
2
Figure 3: Tool Position to unload bearing from hopper
- Move the tool to retrieve the bearing out of the hopper. This can be accomplished using
either a linear move or a rotation of wrist 2 if the plane of the joint is in a vertical
orientation
3
- The bearing is then placed on the lower track, and oriented to that the bearing is
horizontal
4
Figure 7: Movement of bearing along lower track
- The next step is to move the bearing up the ramp with a linear move
5
Figure 9: Reloading bearing into hopper
6
UR3 Robotic Arm Lab - GPIO
Objective 2
Equipment 2
Theory 2
Results 4
Procedure 4
1
Objective:
In this lab, you will interface with the General Purpose Input/Output (GPIO) of the UR3
Robotic Arm through hardware and programming using the teach pendant. A switch will
provide an input to the UR3 to start a program, and an output will turn on a LED signifying the
completion of the program.
Equipment:
- UR3 robotic arm
- Control box
- Teach pendant
- Microswitch
- 24v Led
Theory:
GPIOs are useful for enabling the UR3 to interact with other hardware and sensors
during operation. For example, break-beam sensors can provide an input signal to the arm to
denote when a part is ready to be picked up, and an output signal can be used to control the
position of a gripper tool mounted to the end of the arm. The GPIO is accessible inside the
control box of the UR3 arm, and consist of Configurable, Digital, and Analog Inputs/Outputs. For
the UR3 arm, the Input pin logic is considered LOW between 0-5v, HIGH between 11-24v, and
take a maximum input current of 15mA. Output pins are available to sink to ground, which can
carry a maximum current of 1A. For this lab, we will be interfacing with the Digital
Inputs/Outputs, denoted by the grey plugs:
2
Figure 1: GPIO within UR3 Control Box
Within the software on the teach pendant, the I/O tab provides a real time display of the current
states of the GPIO, with a blue circle indicating HIGH, and a grey circle indicating LOW:
3
Results:
Create a program which starts once a switch is pressed. After the program
completes, a LED should turn on. The program should once again wait for the input
signal from the switch before running again.
Procedure:
1) Wire a switch between 24v and DI1 on the grey digital input plug as shown:
2) Wire a 24v tolerant LED between 0v and DO1 on the grey digital output plug as
shown:
4
Figure 4: Wiring schematic of output LED
3) Start up and calibrate the UR3 arm using procedures from the Introduction to the
UR3 Robotic Arm lab.
4) Generate a program with at least 3 waypoints. First and last waypoint should be the
same location and orientation. The remaining waypoints can be arbitrary. These will
be the program that will run between our input command and output signal.
5) Once a program has been created, select the first MOVE in the program structure
tree, and from the structure tab add a SET command underneath the waypoint.
Select the command tab to edit the action:
5
Figure 5: The Set command page on the teach pendant
Set the Digital Output DO1 to LOW. This ensures the LED is turned off before the
program begins.
6
6) Next, from the structure tab, add a WAIT command directly under the SET command
that was just created. Under the command tab, you can adjust the functionality:
7
Palletizing with UR3 Robotic Arm
A Pallet structure is inserted in the program tree. In the Pattern folder, the type of
pattern and number of positions in the pallet is set. In the Pallet Sequence folder, the
sequence of movements that occur for each position is set. This includes how to
1
approach a workpiece, how to place a workpiece, and how to exit agin from each
position once a workpiece has been placed.
- Click the “Pattern” folder in the program tree, then the “Command” tab.
Here you can select the pattern to be used. For this lab, select “Line.”
- A “StartPos_1” and “EndPos_1” are added to the Pattern folder of the program tree.
Enter the number of times to iterate the pattern in the “Point 1 to 2 interval count”
textbox.
2
- Select the “StartPos_1” waypoint in the program tree, then “Specify the Position”
- Using the teach pendant controls or free drive, set the end effector to the starting
position of the pattern, and press “OK.”
- Select the “EndPos_1” waypoint in the program tree, and assign it the location of the
last position of the pattern, then press “OK.”
- The array of positions can visually be verified by selecting the “Graphics” tab
3
- Select “Approach_1” in the PalletSequence folder of the Program Tree. This waypoint is relative
to StartPos_1 and establishes how the arm will move to each position of the pallet pattern.
Place this waypoint a few inches above StartPos_1.
- Similarly, “Exit” is a waypoint that the arm will move to after each pallet position. It is created
relative to StartPos_1. Place this waypoint a few inches above StartPos_1 as well.
- “PatternPoint_1” represents the first waypoint of each pattern. Additional waypoints can be
added to create the movements necessary at each pattern position.
- Select the “Set” action in the program tree. This action is performed at each position of the
pallet pattern. It can be an action such as actuating a gripper to let go of an item. For this lab,
select “No Action.”
4
- Select the “Wait” action from the program tree. This action is used to allow the robot to dwell
while the Set action is being performed. Set the robot to wait for 1 second.
- The sequence created will apply to each position of the pallet pattern. Once the robot
has ran through every position, it will return to the first position and iterate again. To
stop the robot from looping:
5
o Select “Robot Program” from the top of the Program tree, then the “Structure”
tab.
o Select the “Structure” tab, then the “Advanced” button, then the “Loop” button.
A loop is added to the top of the program tree.
o Select “Loop” at the top of the program tree, then set “Loop __ times” to the
number of pattern positions
o Select the “Structure” tab again, highlight the “Pallet” folder in the program tree,
then select “Cut.”
o Select “Loop” in the program tree, then the “empty” field below the loop folder,
then select “Paste” to move the folder into the loop.
o Select “Loop” in the program tree, then the “Structure” tab, the “Popup” button,
then the “Command” tab.
o In the text box, type in a message that will show up once the pallet sequence is
finished.
- The program is ready to run, click the play button to start it.
6
Pallet Pattern 1
7
Simulation of UR3 Robotic Arm
1
Figure 2: RoboDK Environment (Globe icon opens Online Library)
2
Figure 4: UR3 Loaded into Environment
3) In tree > right click UR3 > add TCP > modify translation and rotation values of TCP
3
Figure 6: TCP tool options
4
6) In Options Panel, adjust translation and rotation values to orient the module
5
Figure 9: Reference Frames Removed
7) Select a vertex on the Module with a right click > Extract Curve Points
6
Figure 11: All Necessary Curve Points Extracted
9) Program > Program Linear Instruction
7
Figure 13: Linear Move Added to Tree
10) Hold ALT > click and drag on arrows to orient to a initial starting waypoint
8
Figure 15: Move to Target
9
Figure 17: Teach Target(s) on Surface
10
Figure 19: Successfully Creating a New Target
Note: It may be beneficial again to right click targets as you go and unclick “visible” to declutter
the environment
11
13)Repeat step 12 for all points to be used in program
12
Figure 22: Adding a Linear Move
15) In the program tree > right click the newly added move > Target Linked > choose
appropriate target
13
16) Repeat process for each waypoint in the program tree
14
Right click program > run
15
21) To Output Program:
a. Right click program > Generate robot program… > save to destination as a
.SCRIPT file
16
Sample Program
def Prog1():
# Default parameters:
global accel_mss = 3
end
Prog1()
17