You are on page 1of 13

Table of Contents

Abstract 2
Introduction 2
Discussion of the Program 3
Results 4
Discussion of Results 7
Sources of Error and Problems Encountered 8
Conclusion 8
References 9
Appendix 9

1
Abstract

The team was tasked to perform conveyor servicing in this lab session using a vision
system in conjunction with an EPSON Pro Six PS3. To work with the EPSON Pro Six PS3, the
group had to learn how to calibrate the vision system. Setting up the camera, preparing a
calibration plate, designing a vision sequence to find calibration reference targets, and
developing a calibration scheme were all part of the calibration procedure. The calibration cycle
started when the system had been taught the reference points, and it then found the target points.
To confirm that the calibration was successful, this process was repeated. To carry out the
conveyor service operation, a program was created. The goal for this lab was to create a program
that will command the robot to pick up the acceptable (soccer) and unacceptable (football) discs
from the conveyor and put them in different rows, one for the acceptable discs and the other for
the unacceptable discs. The robot was able to locate and identify the acceptable/unacceptable
discs on the conveyor belt with the help of the vision system. The code contained instructions for
the conveyor to move the discs to the pick-up area while the robot completes the load/unload
duty, similar to labs 2 and 4. Using an IR sensor, the conveyor belt's motion was controlled. The
conveyor receives a signal to stop the belt when the IR sensor detects an object. This process was
repeated until all the discs were picked up from the conveyor and sorted into groups based on the
type of disc (soccer or football).

Introduction

The goal of this lab is to service a conveyor and carry out automated part inspection using
a vision system and the EPSON ProSix PS3. The conveyor will be programmed by the group to
index each new object into the pickup position while the robot performs its operation. The vision
system will locate and inspect the object and the EPSON ProSix PS3 robot will be programmed
to pick up the acceptable and unacceptable objects from the conveyor and arrange them in
separate groups. Similar to lab 4, the team will learn how to calibrate the vision system but the
difference is the objective of its function is to locate the object on the conveyor belt and inspect it
to confirm what group the object belongs to. Based on the results obtained by the vision system,
the robot will be able to perform its task. This experiment will assist the team in furthering their

2
understanding of how to use the vision system in tandem with the robot and other automation
equipment and sensors.

Discussion of the Program

The requirements of this lab were to generate code to create automated part inspection
using the vision system for the Epson ProSix PS3 to successfully pick up and sort between
acceptable and rejected discs. A total of 6 discs are to be sorted for a total of 3 acceptable discs
(soccer balls) and 3 rejected discs (footballs). The acceptable discs are to be grouped together
and spaced along a row 50mm apart from one another. The rejected discs will be grouped
together and spaced along a row 50mm apart from one another as well. A sketch of the system is
shown in Figure 1.

It was required to manually teach the Epson ProSix PS3 points P1 and P2, which are the
drop off location of the acceptable disc row and the rejected disc row.

Figure 1: Schematic of Point P1 and P2

The discs were to be placed on the conveyor belt in random locations and orientations.
The conveyor belt uses the IR sensor to detect when a disc reaches the pickup window and will

3
automatically shut the conveyor off when the disc is detected. The vision camera will then
identify whether the disc is acceptable or rejected. With the use of the vision camera, it detected
the exact locations and orientations of the discs within the pickup window for the robot to
successfully pick up the discs, no matter where it was within that window.

Additionally, the robot was taught to start the operation at point P0 which was a random
location at a height above the table. Initializing the process at point 0 ensured the operation ran
smoother, quicker and safer.

Results

After taking into account the requirements of the program, the code was generated [Appendix 1].

Line 1 indicates the beginning of the program. Lines 2 through 4 are required at the
beginning of the code because it is defining and initializing important parameters to the Epson
ProSix. Line 2 resets the robot, line 3 initializes the robot, and line 4 sets the robots motors to
low power. It was required to run the robot on low power so that the movements of the robot
were slower to reduce the chances of unforeseen crashing/ damages.
Line 5 executes a task simultaneously to allow for multitasking. In this case, the conveyor
belt function is set to run simultaneously to the Epson ProSix robot. On line 6, Pulse 0,0,0,0,0,0
moves the robot to its home position, which zeros its coordinates of orientation. Line 7 instructs
the robot to move to P0. In line 8, disco, cisco, and bisco are being defined as an integer, which
means the index will be only a whole number and not a fraction or decimal. Line 9 defines the
real variables used for the conveyor pickup window and can be broken down as follows;
● x: Defines the real variable represented in the x coordinate of the disc.
● y: Defines the real variable represented in the y coordinate of the disc.
● u: Defines the real variable representing the angular position of the disc.
● found: is a boolean variable that represents whether the soccer ball disc was found
by vision camera within the pickup window
● found2: is a boolean variable that represents whether the football disc was found
by vision camera within the pickup window

4
Line 10 defines the height that the end effector should be in when picking up the discs
from the conveyor. Line 11 sets bisco to 1, indicating the first accepted disc set. Line 12 sets
cisco to 1, indicating the first rejected disc set. Line 13 is required to ensure the robot's gripper is
in the open position. The 0.5 represents the time the pneumatic will operate for. In this case the
pneumatic stays on for 0.5 seconds.
Line 14 is the beginning of a for loop. A For loop executes one or more statements for a
specific count [spel+ manual]. In this case the specific count is disco which is being set from 1
through 6 because there are 6 discs to pickup and place. Line 15 signifies the IR sensor to wait
until a disc is found by the vision camera, or when line 16 and 17 are satisfied. When a disc is
found within the pickup window via the vision camera, either found or found2 will be set to
false. Once found or found2 is false, the code proceeds to the while loop in line 18. Line 18
begins a while loop depending on if found is false and if found2 is false. Line 19 runs the vision
sequence created when calibrating the vision camera to find the discs within the pickup window.
Once a disc is located within the pickup window either line 20 or 21 are executed depending on
whether a soccer ball or football is detected in the pickup window, which gets the x and y
coordinates along with the angular position, u, of each disc in the window. Line 22 ends the
while loop once the location and orientation of the disc is found by the vision camera. Line 23
tells the robot to go and position itself according to the disc within the pickup window, but 50mm
above the disc. This is to ensure the robot does not hit the conveyor system. At line 24 the robot's
end effector is ready to pick up the disc. Line 25 closes the gripper and engages the pneumatic
system for 0.5 seconds. Once the gripper is closed, the robot is ready to drop off the disc at the
desired dropoff location. Line 26 states that if found is false then go to line 27, and if it is not it
will go to line 29. Line 27 is a jump 3 statement which instructs the robot to go to the drop off
location and can be broken up as follows;
● Jump3: Jump 3 executes the approaching, departing, and destination of the robotic arm
when moving to pick up the package from the conveyor belt. It consists of three specific
coordinates for the robot to move to
● P* +Z(50): This is the first coordinate point in the Jump3 statement. P* is defining a
parameter at a point and +Z(50) is telling the Epson ProSix to raise 50mm in the
z-direction. A 50 mm height is to ensure that the robot clears the obstruction of the
conveyor belt so that it does not crash into it while moving to the drop off location.

5
● P2 +Z(150)+X(cisco * 50): This is the second coordinate point in the Jump3 statement. It
is calling on the robot to position to the drop off location, P4. The +Z(150) is stating that
the Epson ProSix will be 150 mm above the drop off location. The +X(cisco * 50) is the
offset to place the rejected discs in the x direction. For example, if cisco is 1 then X=1x50
= 50mm. If dropping off the third rejected disc then cisco is 3 then X=3x50 = 150mm
offset.
● P1 +X(cisco * 50): This is the third coordinate point in the Jump3 statement. At this
point the end effector of the Epson ProSix is at the exact position it needs to be to drop
off the disc.
Line 28 is a counter, which takes the current cisco value and adds +1 to indicate the next
rejected disc. Line 29-32 is similar to lines 26-28, except for the accepted discs and is only
satisfied if found does not equal false. Line 33 opens the gripper for 0.5 seconds and the disc is
officially placed in its location. Line 24 tells the robot to raise to a height of 150mm. Line 35
loops the code back to line 14 for the next disco which will be the next accepted or rejected disc.
This section of the code will keep looping until disco equals 6 (the 6th disc).

Lines 36-39 will only occur at the end of the For loop when disco equals 6 (after the 6th
disc is placed at the drop off location). Line 36 quits the conveyor belt function and goes in hand
with line 37, which stops operation of the conveyor belt. Line 38 calls the robot to go to a point,
which is to move 50 mm in the Z direction. Line 39 does the same operation as line 6, which
brings the robot to its home position and zeros its orientation. Line 40 indicates the end of the
function.

Similar to lab 3, lines 41-48 defines the conveyor belt function with the IR sensor. Line
41 is defining the conveyor belt as a function. Line 42 begins a while loop if the following
conditions are true. Line 43 is an if statement and is checking the status of the IR sensor. The IR
sensor produces a value of 0 (false) or 1(true). If the IR sensor equals 1, then the code runs to
line 44, which turns off the conveyor belt. Line 45 is an else statement, which goes in hand with
line 46 and indicates to turn on the conveyor belt if the IR sensor in line 43 is producing a status
of 0. Line 47 ends the if statement, which is the code from lines 43-46. Line 48 ends the while

6
loop when the conditions are satisfied and returns to the beginning of the while loop. Line 49
indicates the end of the function.

Discussion of Results

To begin, the vision camera was calibrated for a fixed downward calibration. Refer to the
appendix for the document of the steps taken to calibrate the vision system. Two sequences had
to be created, 1 for the accepted discs (soccer ball) and another for the rejected disc (football).
Once completed, points P1 and P2 were taught to the Epson Pro Six, which would be the
drop-off location of the accepted disc row and the rejected disc row. Next, the height at which the
end effector would be at the pickup point was found by manually moving the robot to the pickup
window where it would pick up a disc from the conveyor. Next, OpenGripper, CloseGripper and
the conveyor belt were set as outputs in the I/O editor, while the IR sensor was set up as an input.
The soccer ball and football discs were then placed on the conveyor belt at random locations and
orientations. The code was uploaded to the RC+ Robot Controller and the Epson ProSix was
performing the task. The vision system successfully distinguished between the acceptable and
unacceptable discs by displaying either a green pickup window or a red pickup window. It
successfully picked up each disc off of the conveyor belt with randomized locations and
orientations. This indicated that the vision system was successfully working, providing the robot
with the real coordinates of each disc that made its way to the pickup window. While the robot
was dropping off each disc in its respective location, the conveyor belt and vision system worked
simultaneously. This means that as the robot was dropping off each disc, the conveyor belt was
preparing the pickup of the next disc at the same time, while the vision camera would identify
whether the disc was acceptable or unacceptable. This was successfully repeated for all 6 discs,
and each disc was successfully spaced 50mm apart from one other at the drop-off location.

7
Sources of Error and Problems Encountered

The team had to make minor tweaks to the code that was developed for the pre-lab. For
example, found was being used for both the soccer ball and football discs, but the football discs
require their own found variable, which was changed to found 2. Another adjustment made was
creating separate integers for the soccer ball disc row and the football disc row to properly count
the number of discs within each row. There were also equipment errors experienced in the lab.
When the gripper closed and attempted to pick up the initial disc, the disc fell out of the gripper
immediately. It was then determined that the grip pads on the gripper were worn down due to the
snug fit of the calibration tool. The lab TA replaced the grip pads on the gripper. When the
program was restarted, it successfully picked up and sorted 2 discs until the same issue occurred
as the previous attempt. This time it was noted that one of the plastic parts of the gripper was
bent outwards and no longer parallel to the other resulting in little to no clamping force. The lab
TA then replaced one side of the gripper. Once the program was restarted, the Epson ProSix
successfully picked up, sorted, and placed the accepted discs (soccer balls) and the rejected discs
(footballs) in their respective locations.

Conclusion

The team learnt how to operate a conveyor and execute automated part inspection using a
calibrated vision system and the EPSON ProSix PS3 robot. Using the Jog and Teach function,
the robot was first instructed to learn where the holes were. Blobs were then created as the next
step to estimate where the holes were. The workspace was then established following the given
grid. The reference boundary for the objects' placement was this workspace. After completing
the calibration process, the soccer ball and football discs were placed at random positions on the
conveyor belt; the robot was able to execute its task and placed the acceptable and unacceptable
discs into their respective location. To run the operation successfully, the group had to make
some alterations in the pre-lab code such as adding another boolean variable found 2 to locate
and identify the football discs. Another change was to create distinct integers for the soccer ball
disc row and the football disc row to measure the number of discs within each row correctly.
After the lab TA fixed the robot’s end effector defect, the Epson ProSix effectively collected,

8
sorted, and arranged the acceptable discs (soccer balls) and rejected discs (footballs) in their
appropriate positions once the program was relaunched.

References

[1] EPSON RC+ User's Guide, 1st ed. EPSON, 2021.

[2] Nokleby S., (2006. Laboratory Project 2: Conveyor Servicing Using the Epson ProSix PS3.
Oshawa; Ontario Tech University.

[3] EPSON, (2005, June 1st. EPSON SPEL+ Language Reference. Oshawa; Ontario Tech
University.

[4] EPSON, (2005, March 1st. Vision Guide 4.0 Properties and Results Reference. Oshawa;
Ontario Tech University.

Appendix

Lab Code:
1. Function Main ‘beginning of the program

2. Reset ‘resets the robot


3. Motor On ‘turns the robot motors on
4. Power Low ‘sets the operating speed of the robot to low

5. Xqt belt_F 'executes multitask function named belt


6. Pulse 0, 0, 0, 0, 0, 0 ‘robot goes to home position
7. Go P0 ‘robot moves to declared point P0
8. Integer cisco, disco, bisco 'name given to discs & defined as whole number
9. Real x, y, z, u, found, found2 ‘defines the real variables used for the conveyor pickup;boolean variable
used
10. z = 288.272 ‘height of the pickup obtained manually
11. bisco = 1 'acceptable part
12. cisco = 1 'rejected part
13. On GripperOpen, 0.5 ‘robot's gripper is in the open position

9
14. For disco = 1 To 6 'performing a for loop for six discs

15. Wait Sw(IR) ‘signals IR sensor function to wait until disc is located by camera
16. found = False ‘boolean variable set to false
17. found2 = False ‘boolean variable set to false
18. While found = False And found2 = False ‘performs while loop if found and found 2 is false
19. VRun Lab5G1 'run the vision sequence to find discs
20. VGet Lab5G1.Soc.RobotXYU, found, x, y, u ‘gets first coordinate values for x, y, u
21. VGet Lab5G1.Foot.RobotXYU, found2, x, y, u ‘gets second coordinate values for x, y, u
22. Wend ‘ends while loop
23. Go XY(x, y, z + 50, u, 180, 0) ‘robot moves to 50 mm above pick up position obtained from vision system
24. Go XY(x, y, z, u, 180, 0) ‘robot moves to pick up position obtained from vision system
25. On GripperClose, 0.5 ‘robot's gripper is in the close position
26. If found = False Then ‘if loop initiated
27. Jump3 P* +Z(50), P2 +Z(150) +X(cisco * 50), P2 +X(cisco * 50) 'P2 is rejected disc area
28. cisco = cisco + 1 ‘cisco values increases by one
29. Else ‘disc is acceptable and moves to accepted area
30. Jump3 P* +Z(50), P1 +Z(150) +X(bisco * 50), P1 +X(bisco * 50) 'P1 is accepted disc area
31. bisco = bisco + 1 ‘bisco values increases by one
32. EndIf ‘ends if statement
33. On GripperOpen, 0.5 ‘robot's gripper is in the open position
34. Go P* +Z(150) ‘robot rises by 150mm above current position

35. Next disco ‘loop continues and robot moves to next disc

36. Quit belt_F ‘stops conveyor function


37. Off belt ‘turns off conveyor
38. Go P* +Z(50) ‘robot raises by 50 mm above current position
39. Pulse 0,0,0,0,0,0 ‘robot goes to home position

40. Fend ‘program function end

41. Function belt_F ‘starting another function defining the conveyor

42. While True ‘performs while loop if condition is true

43. If Sw(IR) Then ‘return a 1 or true value if IR sensor is blocked


44. Off belt ‘turns off conveyor
45. Else ‘return a 0 or false value if IR sensor is not blocked
46. On belt ‘turns on conveyor

10
47. EndIf ‘ends if statement
48. Wend ‘ends while loop

49. Fend ‘program function end

Pre-lab Code:
1. Function Main ‘beginning of the program

2. Reset ‘resets the robot


3. Motor On ‘turns the robot motors on
4. Power Low ‘sets the operating speed of the robot to low

5. Xqt belt_F 'executes multitask function named belt


6. Pulse 0, 0, 0, 0, 0, 0 ‘robot goes to home position
7. Go P0 ‘robot moves to declared point P0
8. Integer disco 'name given to discs & defined as whole number
9. Real x, y, z, u, found ‘defines the real variables used for the conveyor pickup;boolean variable used
10. z= ‘height of the pickup obtained manually
11. On GripperOpen, 0.5 ‘robot's gripper is in the open position

12. For disco = 1 To 6 'performing a for loop for six discs

13. Wait Sw(IR) ‘signals IR sensor function to wait until disc is located by camera
14. found = False ‘boolean variable set to false
15. While found = False ‘performs while loop if found is false
16. VRun Lab5G1 'run the vision sequence to find discs
17. VGet Lab5G1.Soc.RobotXYU, found, x, y, u ‘gets coordinate values for x, y, u
18. Wend ‘ends while loop
19. Go XY(x, y, z + 50, u, 180, 0) ‘robot moves to 50 mm above pick up position obtained from vision system
20. Go XY(x, y, z, u, 180, 0) ‘robot moves to pick up position obtained from vision system
21. On GripperClose, 0.5 ‘robot's gripper is in the close position
22. If found = False Then ‘if loop initiated
23. Jump3 P* +Z(50), P2 +Z(150) +X(disco * 50), P2 +X(disco * 50) ‘P2 is rejected disc area
24. Else ‘disc is acceptable and moves to accepted area
25. Jump3 P* +Z(50), P1 +Z(150) +X(disco * 50), P1 +X(disco * 50) ‘P1 is accepted disc area
26. EndIf ‘ends if statement
27. On GripperOpen, 0.5 ‘robot's gripper is in the open position
28. Go P* +Z(150) ‘robot rises by 150mm above current position

11
29. Next disco ‘loop continues and robot moves to next disc

30. Quit belt_F ‘stops conveyor function


31. Off belt ‘turns off conveyor
32. Go P* +Z(50) ‘robot raises by 50 mm above current position
33. Pulse 0,0,0,0,0,0 ‘robot goes to home position

34. Fend ‘program function end

35. Function belt_F ‘starting another function defining the conveyor

36. While True ‘performs while loop if condition is true

37. If Sw(IR) Then ‘return a 1 or true value if IR sensor is blocked


38. Off belt ‘turns off conveyor
39. Else ‘return a 0 or false value if IR sensor is not blocked
40. On belt ‘turns on conveyor
41. EndIf ‘ends if statement
42. Wend ‘ends while loop

43. Fend ‘program function end

Vision System Calibration Document:

12
The fixed downward calibration vision sequence must locate nine calibration targets. It uses a
target plate or sheet that contains 9 targets. Two methods consist of;
1. Creating an object for each target, for a total of 9 objects
2. Use multi result objects (Blob or Correction) to return 9 results.
Procedure was developed with the assistance of reference [4]:
Step 1: Mount the camera
- Mount the camera so that it looks down into the robot envelope. Be sure robot clears the
camera
Step 2: Make a calibration plate (Assuming its already made)
- Make a plate or sheet with 9 holes or 9 target marks that span the field of view of the
camera
Step 3: Create Vision sequence to find calibration reference targets
a) Create a sequence to locate the calibration targets. An object for each target can be
created or create 1 object to find all 9 targets provided the target can return multiple
results “Blob” and “Correction Recognition”.
b) After sequence is created, test to see that it finds all 9 points
Step 4: Create a Calibration Scheme

a) Click “New Calibration” on the Vision Guide toolbar or from the vision menu. Enter
a name for the new scheme
b) Set the “TargetSequence” property
c) If required, set the “Lamp” property
d) Set the “RobotArm”, “RobotLocal”, “RobotNumber”, and “RobotTool” properties
Step 5: Teach Points
a) In the “Vision Guide Calibration” tab click “Teach Points”. The “Teach Calibration
Points” dialog will open.
b) Follow the instructions in the message box near the bottom of the dialog and teach each
reference point. You will be prompted to teach the point and then turn the U axis 180 o to
teach the point again.
NOTE: Skip turning the U axis 180o if using a tool. Then click “Next” to move to the
next step.
Step 6: Calibrate
- In the “Vision Guide Calibration” tab, click “Calibrate” to start the calibration cycle. The
software will locate the 9 targets and then locate them again to verify successful
calibration.

13

You might also like