Robotic and Automation Lab Manual
Robotic and Automation Lab Manual
Faculty of Engineering
Department of Mechatronics engineering
Automation and
Robotic Laboratory
Safety Rule
|P a g e 1
Safety Rules
**General:
1- Students must only work on the station under the supervision of an instructor.
2- Observe the data in the data sheets for the individual components, in particular all
notes on safety.
3- When the machine working you must be out of work area.
**Electrics
1- Electrical connections are to be wired up and disconnected only when power is
disconnected.
2- Use only low voltage of up to 24 V dc.
**Pneumatics:
1- Do not exceed the permissible pressure of 6 bars.
2- Do not switch on compressed unit you have established and secured all tubing
connections.
3- Do not disconnect air line under pressure.
4- Particular care is to be taken when switching on the compressed air. Cylinder may
advance on retract as soon as the compressed air is switched on.
**Mechanics
1- Securely mount all components on the plate.
2- No manual intervention unless the machine is at reset.
|P a g e 2
Experiment 1
Distributing Station
|P a g e 3
Experiment 1 Distributing Station
1. Introduction:
The Festo Didactic Learning System for Automation and Technology is designed to meet a number of
different training and vocational requirements. The systems and stations of the Modular Production System
(MPS®) facilitate industry-orientated vocational and further training and the hardware consists of
didactically suitable industrial components.
The Distributing station provides you with an appropriate system for practice-orientated tuition of the
following key qualifications
• Social competence,
• Technical competence and
• Methodological competence
Moreover, training can be provided to instill team spirit, willingness to cooperate and organizational skills.
Actual project phases can be taught by means of training projects, such as:
• Planning,
• Assembly,
• Programming,
• Commissioning,
• Operation,
• Maintenance and Fault finding.
|P a g e 4
Experiment 1 Distributing Station
|P a g e 5
Experiment 1 Distributing Station
**Note
The end positions of the rotary drive need to be adjusted depending on the
downstream station selected.
2.5 Sensors:
2.5.1Proximity sensor (Stack magazine, ejecting cylinder):
The proximity sensors are used for end position sensing of the cylinder. The proximity sensor is sensitive to
a permanent magnet mounted on the piston of the cylinder.
|P a g e 6
Experiment 1 Distributing Station
3. Circuit Diagram:
3.1Sensors:
3.2 Actuators:
|P a g e 7
Experiment 1 Distributing Station
|P a g e 8
Experiment 2
Testing Station
|P a g e 9
Experiment 2 Testing Station
1. Introduction:
The Festo Didactic Learning System for Automation and Technology is designed to meet a number of
different training and vocational requirements. The systems and stations of the Modular Production System
(MPS®) facilitate industry-orientated vocational and further training and the hardware consists of
didactically suitable industrial components.
The Testing station provides you with an appropriate system for practice-orientated tuition of the following
key qualifications
• Social competence,
• Technical competence and
• Methodological competence
Moreover, training can be provided to instill team spirit, willingness to cooperate and organizational skills.
Actual project phases can be taught by means of training projects, such as:
• Planning,
• Assembly,
• Programming,
• Commissioning,
• Operation,
• Maintenance and
• Fault finding.
| P a g e 01
Experiment 2 Testing Station
Sequence
1. Determine the color and material of the workpiece
2. Lifting cylinder to be raised
3. Measurement of the workpiece height
Testing result OK
4. Switch on the air cushioned slide
5. Ejecting cylinder to advance
6. Ejecting cylinder to retract
7. Switch off the air cushioned slide
8. Lifting cylinder to be lowered
9. Initial position Testing result not OK
10.Lifting cylinder to be lowered
11.Ejecting cylinder to be advanced
12.Ejecting cylinder to retract
13.Initial position
| P a g e 00
Experiment 2 Testing Station
**Note
Red and silver workpieces are 2.5 mm higher than black workpieces
| P a g e 01
Experiment 2 Testing Station
2.8 Sensors:
2.8.1Capacitive proximity sensor 6.3 (Recognition, detection of workpiece):
The capacitive proximity sensor is used for detection of workpieces. The workpiece changes the capacity of
a capacitor build in the sensor head. Workpieces are detected independent of color and material.
| P a g e 01
Experiment 2 Testing Station
3. Circuit Diagram:
3.1Sensors:
3.2 Actuators:
| P a g e 01
Experiment 2 Testing Station
| P a g e 01
Experiment 3
Processing Station
| P a g e 61
Experiment 3 Processing Station
1. Introduction:
The Festo Didactic Learning System for Automation is designed to meet a number of different training and
vocational requirements. The systems and stations of the
Modular Production System (MPS®) facilitate industry-orientated vocational and further training and the
hardware consists of didactically suitable industrial components.
The Processing station provides you with an appropriate system for practice orientated tuition of the
following key qualifications
• Social competence,
• Technical competence and
• Methodological competence
Moreover, training can be provided to instill team spirit, willingness to cooperate and organizational skills.
Actual project phases can be taught by means of training projects, such as:
• Planning,
• Assembly,
• Programming,
• Commissioning,
• Operation,
• Maintenance and
• Fault finding.
| P a g e 61
Experiment 3 Processing Station
**Note
The station uses exclusively electrical actuators.
Initial position
• Rotary indexing table positioned
• Checking solenoid plunger raised
• Drilling machine in raised position
• Drilling machine motor is switched off
• Clamping device retracted
• Electrical branch not actuated
Sequence
1. The rotary indexing table is rotated by 60°, if a workpiece is detected in the workpiece retainer 1 and the
START pushbutton is pressed.
2. The solenoid plunger moves downwards and checks whether the workpiece is inserted with the opening
facing upwards. The rotary indexing table is rotated by 60° if the result of the check is OK.
3. The clamping device clamps the workpiece. The motor of the drilling machine is switched on. The linear
axis moves the drilling machine downwards.
4. When the drilling machine has reached its lower position, it is moved to its upper stop again by the linear
axis.
5. The motor of the drilling machine is switched off and the clamping device is retracted. The rotary
indexing table is rotated by 60°.
6. The electrical sorting gate passes on the workpiece to a subsequent station.
This sequence describes the passage of one workpiece through the Processing station. The workpiece is in
the transfer position to a downstream station. The processing cycle can be started again, once a workpiece is
inserted in the workpiece retainer 1.
| P a g e 61
Experiment 3 Processing Station
2.6 Sensors:
2.6.1 Capacitive proximity sensor (Rotary indexing table, detection of workpiece):
The capacitive proximity sensor is used for detection of workpieces. The workpiece changes the capacity of
a capacitor build in the sensor head. Workpieces are detected independent of color and material.
**Note
Capacitive proximity sensors are used in the positions material input, testing and drilling.
| P a g e 61
Experiment 3 Processing Station
3. Circuit Diagram:
3.1Sensors:
| P a g e 02
Experiment 3 Processing Station
3.2 Actuators:
| P a g e 06
Experiment 3 Processing Station
| P a g e 00
Experiment 4
Handling Station
| P a g e 32
Experiment 4 Handling Station
1. Introduction:
The Festo Didactic Learning System for Automation is designed to meet a number of different training and
vocational requirements. The systems and stations of the Modular Production System (MPS) facilitate
industry-orientated vocational and further training and the hardware consists of didactically suitable
industrial components.
The Handling station provides you with an appropriate system for practice-orientated tuition of the following
key qualifications
• Social competence,
• Technical competence and
• Methodological competence
Moreover, training can be provided to instill team spirit, willingness to cooperate and organizational skills.
Actual project phases can be taught by means of training projects, such as:
• Planning,
• Assembly,
• Programming,
• Commissioning,
• Operation,
• Maintenance and Fault finding.
| P a g e 32
Experiment 4 Handling Station
Initial position
• Linear axis in position “upstream station”
• Lifting cylinder retracted (gripper is raised)
• Gripper is open
Sequence
1. The lifting cylinder advances if a workpiece is detected in the receptacle and the Start pushbutton is
pressed.
2. The gripper is closed. The color identification “workpiece black” or “workpiece non black” is executed.
3. The lifting cylinder is retracted.
| P a g e 32
Experiment 4 Handling Station
2.6 Sensors:
2.6.1 Diffuse sensor (Receptacle, detection of workpiece):
The diffuse sensor is used for detection of the workpieces. A fibre optic cable is connected to a fibre optic
unit. The fibre optic unit emits visible red light. The diffuse sensor detects the light reflected by the
workpiece Different surfaces or colors changes the amount of reflected light.
| P a g e 32
Experiment 4 Handling Station
3. Circuit Diagram:
3.1Sensors:
3.2 Actuators:
| P a g e 32
Experiment 4 Handling Station
| P a g e 32
Experiment 5
Sorting Station
| P a g e 92
Experiment 5 Sorting Station
1. Introduction:
The Festo Didactic Learning System for Automation is designed to meet a number of different training and
vocational requirements. The systems and stations of the Modular Production System (MPS®) facilitate
industry-orientated vocational and further training and the hardware consists of didactically suitable
industrial components.
The Sorting station provides you with an appropriate system for practice-orientated tuition of the following
key qualifications
• Social competence,
• Technical competence and
• Methodological competence
Moreover, training can be provided to instill team spirit, willingness to cooperate and organizational skills.
Actual project phases can be taught by means of training projects, such as:
• Planning,
• Assembly,
• Programming,
• Commissioning,
• Operation,
• Maintenance and Fault finding.
| P a g e 03
Experiment 5 Sorting Station
Initial position
• Stopper advanced
• Branch 1 retracted
• Branch 2 retracted
• Conveyor motor off
Sequence
1. Workpiece detected
2. Conveyor motor On
3. Color/material identification
| P a g e 03
Experiment 5 Sorting Station
2.5 Sensors:
2.5.1 Diffuse sensor (conveyor belt, detection of workpiece):
The diffuse sensor is used for detection of the workpieces. A fibre optic cable is connected to a fibre optic
device. The fibre optic device emits visible red light. The diffuse sensor detects the light reflected by the
workpiece Different surfaces or colors changes the amount of reflected light.
| P a g e 09
Experiment 5 Sorting Station
3. Circuit Diagram:
3.1Sensors:
| P a g e 00
Experiment 5 Sorting Station
3.2 Actuators:
| P a g e 03
Experiment 6
Pick and Place Station
| P a g e 53
Experiment 6 Pick and Place Station
1. Introduction:
The Festo Didactic Learning System for Automation and Technology is designed to meet a number of
different training and vocational requirements. The systems and stations of the Modular Production System
(MPS®) facilitate industry-orientated vocational and further training and the hardware consists of
didactically suitable industrial components.
The Pick & Place station provides you with an appropriate system for practice orientated tuition of the
following key qualifications
• Social competence,
• Technical competence and
• Methodological competence
Moreover, training can be provided to instill team spirit, willingness to cooperate and organizational skills.
Actual project phases can be taught by means of training projects, such as:
• Planning,
• Assembly,
• Programming,
• Commissioning,
• Operation,
• Maintenance and Fault finding.
| P a g e 53
Experiment 6 Pick and Place Station
• PLC programming
– Programming of an operational mode
– Programming of a RESET sequence
– Programming of an EMERGENCY-STOP function
• Optimizing cycle time
Initial position
• Separator extended
• Belt drive switched off
• Mini slide up
• Mini slide retracted
• Vacuum off
Sequence
1. The conveyor belt motor switches on if a workpiece is detected. The workpiece is transported to the
separator.
2. The conveyor belt motor is switched off, if the workpiece is detected by the diffuse sensor in front the
separator.
3. A workpiece insert is picked up at the slide an inserted into the housing.
4. The separator is reversed and the conveyor belt motor is switched on.
5. The complete workpiece is detected at the end of the conveyor belt. The conveyor belt motor is switched
off.
| P a g e 53
Experiment 6 Pick and Place Station
2.5Slide module:
The Slide module is used to transport or store the workpieces. This module can be
applied universally thanks to its variably adjustable inclination and height.
6 workpiece inserts can be accommodated on the slide.
2.6 Sensors:
2.6.1 Proximity sensor (Pick &Place, mini slides):
The proximity sensors are used for end position sensing of the mini slides. The proximity sensor is sensitive
to a permanent magnet mounted to the mini slide.
| P a g e 53
Experiment 6 Pick and Place Station
3. Circuit Diagram:
3.1Sensors:
| P a g e 53
Experiment 6 Pick and Place Station
3.2 Actuators:
| P a g e 04
Software Program
STEP 7 V5.5
| P a g e 14
STEP 7 v5.5
1. Introduction:
The Step7 v5.5 program use for programming PLC that use to control MPS Station and this program
especially for Siemens PLC 300 and 400 families.
STEP 7 is the basic programming and configuration software for SIMATIC. It is made up of a series of
applications, each of which does a specific job within the scope of programming an automation task, such as:
The basic package can be extended by a range of optional packages, for example, additional programming
language packages such as SCL, S7 Graph, or HiGraph.
The graphic user interface provided for these tasks is known as the SIMATIC Manager. The SIMATIC
Manager collects all the data and the settings necessary for an automation task together in a project. Within
this project the data are structured according to their function and represented as objects.
Objects:
In a similar way to the directory structure used in the Windows Explorer containing folders and files, a
STEP 7 project is divided up into folders and objects. Objects which can contain other folders and objects
are known as folders, for example, an S7 program which contains the folders "Blocks" and "Source files"
and the object "Symbols."
2.Starting STEP 7:
When you start Windows, you will find an icon for the SIMATIC Manager, the starting point for the STEP 7
software on the Windows interface.
The quickest method to start STEP 7 is to position the cursor on the icon and doubleclick. The window
containing the SIMATIC Manager is then opened. From here you can access all the functions you have
installed for the standard package and any optional packages.
Alternatively you can also start the SIMATIC Manager via the "Start" button in the taskbar of the operating
system. You will find the entry under "Simatic".
| P a g e 14
STEP 7 v5.5
SIMATIC Manager
The SIMATIC Manager is the basic application for configuring and programming. You can perform the
following functions in the SIMATIC Manager:
Set up projects
Configure and assign parameters to hardware
Configure hardware networks
Program blocks
Debug and commission your programs
Access to the various functions is designed to be object oriented, and intuitive and easy to learn.
You can work with the SIMATIC Manager in one of two ways:
| P a g e 14
STEP 7 v5.5
2- After that the windows above will appear.
5- Select the Project 1 right click of mouse and chose Insert New Object SIMATIC300
| P a g e 11
STEP 7 v5.5
6- After that expend Project 1 and Double click at Hardware to make hardware configuration.
| P a g e 14
STEP 7 v5.5
Hardware configuration:
7- After double click at Hardware the window above will appear.
8- Expand the SIMATIC 300 choose RACK-300 and double click at Rail and the window
above will appear.
| P a g e 14
STEP 7 v5.5
8- Write the series that written at the cover of PLC in Find box (313-5BF03-0AB0)
9- Choose V2.6 and drag it and drop in UR row 2 as shown in window above.
| P a g e 14
STEP 7 v5.5
10- Double click DI24/DO16 this window will appear.
11- Choose Addresses and remove tick at System default in Input and output and write 0 in Start box in
input and output click at OK
12-After that from the main menu chooses Station Save and Compile or (Ctrl + S)
| P a g e 14
STEP 7 v5.5
13- After that we return to SIMATIC manager
14- Choose CPU313C from expand SIMATIC300 (1) S7 Program (1) Blocks and choose
OB1 (Organization Block) to make the initial block of program and make your program.
| P a g e 14
Experiment 7
Pick and Place with Sorting Basing on
Gripper Size
| P a g e 05
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
O BJECTIVES :
In this activity the student will learn the following:
The basic robotic system components
Introduction to RoboCell simulation software
Initialization of the robot and robot workspace
Move the robot manually to a given position
Picking and placing an object
Record various positions of the robot
Write a basic program for the robot basing on the previously recorded positions
Determine the size of the object using gripper-opening sensor as a feedback.
Using gripper-opening distance in sorting basic objects: small cube, medium cube, big
cube, and cylinder.
A CTIVITY :
At the end of this experiment the student should be able to sort 3 different cubes according to
their sizes, picking them from known different locations. The big cube should be on the
ground.
I NSTRUMENTS
R OBOTIC S YSTEM C OMPONENTS
Figure (1) shows elements of a typical robot system. The robot system includes a
manipulator arm, an end effector (the gripper or tool connected to the end of the arm), a
controller and a computer. Other devices such as a hand-held control pendant or camera may
also be included.
| P a g e 05
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
Some robot systems contain internal feedback devices (such as encoders), and may include
external sensing devices (such as a vision system).
E N D E F F E C TO R
A robot must be properly equipped for the kind of task it is to perform. The end effector of
the ER 4u is a gripper that can be used for grasping and picking up objects. In other robotic
systems the end effector may be a tool, such as a welding gun, a spray gun for painting, or a
grinding tool for milling.
M AN I P UL A TO R ( AR M )
A manipulator is a mechanical arm that moves (manipulates) the end effector to the required
positions and orientation. The manipulator arm must be strong enough to carry the specified
payload and flexible enough to perform the required movements with the required level of
accuracy.
| P a g e 05
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
C O N T RO L L E R
The controller controls the power supplied to the motors that drive the arm. The controller's
microprocessors simultaneously perform many functions during robot program execution:
The controller calculates the motion required of each axis to produce the proper arm
movement.
The controller monitors the motion of the axes and sends commands to the motors in
order to control the speed and correct positioning errors.
The controller reads input data from sensors and sends output signals that activate
grippers, tools and other devices.
The controller receives commands from the computer or the control pendant and transmits
status messages to the operator.
S E N S O RS
Most robotic arms have internal sensors that provide data on the position or motion of the
arm joints. These sensors help the controller to position the arm accurately.
Some robotic systems include external sensors, which provide data on objects in the robot's
vicinity. Without these sensors the robot might not know when and where objects are to be
handled or avoided.
| P a g e 05
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
SCORBASE
SCORBASE, shown in Figure (3), is a robotics control software package, which provides a
user-friendly tool for robot programming and operation.
| P a g e 00
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
When the SCORBASE program is executed, the virtual robot will move within the defined
workcell, according to the program positions and commands.
Redirect Camera - allows the user to define a position that will be in the center of
the image.
Zoom In/Zoom Out - zooms in and out of the image by pressing the right mouse
button and moving it forward or backward.
Rotating the Image - rotates the view of the image by pressing the right mouse
button and moving it to the right/left.
Moving the Camera Up/Down - use the window’s scroll bar to adjust the viewing
angle of the image.
| P a g e 05
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
| P a g e 05
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
Search
Search Home for all axes
Home
Control On Enables servo control of the axes.
Disables servo control of the axes. When control is off, axes cannot
Control Off
be moved.
Pause Stops program execution after the current line is executed.
Charts Opens the Charts window.
Displays list of commands and options at introductory level.
Level 1
Commands related to higher level are disabled.
Displays list of commands and options at advanced level.
Level 2
Commands related to higher level are disabled.
Displays list of commands and options at professional level. At this
Pro
level, all options and commands can be activated.
3D I MAGE T OOLBAR
| P a g e 05
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
E XPERIMENTAL PROCEDUR E :
R UNNING R OBO C EL L AND O PENING THE D EMO 3D MODEL F ILE
1. Turn on the computer.
2. Run RoboCell by doing one of the following:
| P a g e 05
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
3. Every SCORBASE program is part of a project, which can also include the user-defined
positions, project data and 3D model files. In order to write your first SCORBASE
program, you must open a new project.
To open a new project, do one of the following:
Select File | New Project.
Click on the New Project icon.
Press [Ctrl] + N.
The RoboCell screen now appears as shown Figure (8).
| P a g e 55
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
| P a g e 55
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
Open the cell CLASS 1.3DC (the cell may be any other as provided by yours
instructor).
A 3D image opens, displaying the SCORBOT-ER 4u robot centered on a table with 3
cubes of different colors and sizes placed in front of it.
| P a g e 55
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
You now need to arrange the windows in positions optimal for viewing the 3D Image
and teaching/recording positions. Select Window | Simulation & Teach to arrange
the windows.
You screen should now look like Figure 2-12.
| P a g e 55
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
R ECORDING P OSITIONS
1. Move the robot to the positions shown in Figure (12) and record them.
8 5 2
9 6 3
1 7 4
0
Note that positions (3, 6, & 9) are just above the cubes. You can record them relative to
positions (4, 5, & 10) 40 mm above as follows:
2. Move the robot to position 4 and record it. Be aware of the orientation of the gripper.
| P a g e 55
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
3. Change programming level to level 2 . You should be able to click Expand on Teach
Positions window.
5. Now you can record position 5 relative to position 4, which will be 40 mm above it (in the
z-direction).
| P a g e 50
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
Note that if you click on Get Position you will obtain the position of each point and
you will know whether this position is absolute or relative.
7. Repeat the previous steps for all the other positions. Record positions (2, 5, & 8) relative
(3, 6, & 9) 50 mm above.
2. Change the level to Professional to be able to use new commands from Workspace |
Commands window
3. In the Workspace | Commands window go to AXIS CONTROL |
SetVariableToGripperSensor… and double click on it.
| P a g e 55
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
4. Set Variable Name to SIZE (for example). This creates the variable SIZE which measures
the gripper opening distance at any position.
5. In the Workspace | Commands window go to PROGRAM FLOW |
PrintToScreenLog… and double click on it.
| P a g e 55
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
O
u
t
p
u
t
o
n
8. If we run the program from the first line a new window appears displaying the output:
t
h
e
o
u
t
p
9. If,
u
for some reasons, this window does not appear, it can be opened from View |
t
Messages menu.
As
w can be seen, the size of the cube is displayed and equals 50 mm.
i
n
d
o
w
| P a g e 55
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
2. At any instant the user can end the program using End command from the same
Command window group.
| P a g e 55
Experiment 7 Pick and Place with Sorting Basing on Gripper Size
3. Also the label can be placed at any position of the program using the Label command in
the previous figure. If double clicked the following window appears:
4. After some modifications the resulted program is shown in the next figure:
| P a g e 55
Experiment 8
Pick and Place on I/O Experimental
Table Using Loops and If Statement
| P a g e 17
Experiment 8 Experimental Table Using Loops and If Statement
O BJECTIVES :
In this activity the student will learn the following:
Picking and placing an object
Record various positions of the robot
Write a basic program for the robot basing on the previously recorded positions
Use the I/O experimental table.
Use loops and if statement in robot programming
A CTIVITY :
At the end of this experiment the student should be able program the robot to take an object
from the I/O table when this object is placed on it. Depending on its position on the table the
robot decides where to place it.
E XPERIMENTAL PROCEDU RE :
R UNNING R OBO C EL L AND O PENING THE D EMO 3D MODEL F ILE
1. Turn on the computer.
2. Run RoboCell by doing one of the following:
Click Start | Programs | RoboCell for ER 4u | RoboCell for ER 4u.
Click on the RoboCell for ER 4u icon.
The opening screen appears.
| P a g e 17
Experiment 8 Experimental Table Using Loops and If Statement
I/O
Experimental
table
2
1 Lamp
3
4 Buzzer
Figure (3). 3D cell model. Where buttons (1, 2, 3, & 4) are input micro-switches used to detect an object.
You now need to arrange the windows in positions optimal for viewing the 3D Image
and teaching/recording positions. Select Window | Simulation & Teach to arrange
the windows.
R ECORDING P OSITIONS
1. Move the robot to the positions shown in Figure (4) and record them.
2
4 6 8
3 7 9
5
2. Make sure that positions (2, 4, 6& 8) are on the same level (z-axis), do the same for
positions (7 & 9) and (3 & 5).
3. For more information about recording positions, refer to Activity 1 document.
| P a g e 17
Experiment 8 Experimental Table Using Loops and If Statement
View | Dialog Bars | Digital Outputs
| P a g e 17
Experiment 8 Experimental Table Using Loops and If Statement
3. In the Workspace | Commands window go to INPUTS & OUTPUTS |
TurnOnOutput#_... and double click on it.
Activate == on
Deactivate == off
In this Cell, Output number 1 is connected to the Light. And Output number 2 is
connected to the buzzer.
4. After selecting the desired output the following command will be added to the program
file:
| P a g e 17
Experiment 8 Experimental Table Using Loops and If Statement
U SE INPUT SIGNAL S FRO M THE I/O TABLES
5. The principal command used to determine the state of a given sensor (on/off) is the
IfInput#_OnJump in Workspace | Commands window go to INPUTS & OUTPUTS |
IfInput#_OnJump
7. Select the number of the input desired to be measured and in the Jump to Label write the
label that corresponds to the commands related to the activity of this sensor. Refer to
Activity 1 form more information about how to create a label.
8. After inserting the previous command it appears in the program window as follow:
| P a g e 11
Experiment 8 Experimental Table Using Loops and If Statement
U SING IF STATEMENT AN D LOOP TO WAIT FOR S IGNAL FROM A GIVEN S ENSOR :
9. In order to wait for a sensor to be activated a loop must be constructed using the
JumpTo… command from Workspace | Commands window | PROGRAM FLOW |
IfJump as introduced in Activity 1.
10.In the loop it is recommended to use the Wait… command in order to lower the number
of times this loop is being executed. This affects the CPU usage.
11.See the previous Figure for the final contents of the if statement and the loop.
After this introduction the student should be able to program the task
assigned by his instructor.
| P a g e 17
Experiment 9
Conveyor Belt with Sensor
If Statements, Loops and Counters
| P a g e 97
Experiment 9 Conveyor Belt with Sensor If Statements, Loops and Counters
O BJECTIVES :
In addition to previous concepts given in previous activities, such as picking and placing
an object and recording various robot positions, in this activity the student will be
introduced to the following new concepts:
Use the conveyor belt and the related sensor.
Program the robot to work with the conveyor belt. To pick the object from the conveyor
belt and place it in the correct location basing on its size.
Use a counter in programming, to place the object in new locations, automatically.
A CTIVITY :
Initially, the student will learn how to move the conveyor belt manually in both directions at
different speeds. On the conveyor three objects are placed on different locations. When an
abject passes in front of the photoelectric sensor the student will observe that the led at the
rear edge of the sensor turns on, indicating that this object is in the detection range of the
sensor. Also, as this sensor is connected, virtually in the simulation or actually in the real
robot, to the control unit to a given digital input location. The student will notice that the
corresponding digital input led turns on, indicating that an input signal/command is being
received.
After this introduction to the conveyor belt and the sensor, the student will be introduced to
the related commands used in the program. Such as moving the conveyor belt, using the if
statement in a loop that, when the sensor detects an object, breaks and the program continues
with the rest of commands that includes: stopping the conveyor belt, moving the robot to
pick the detected object and to place it in a predefined location, and returning it to the initial
location waiting for the next object detection in a similar way. In order to repeat the previous
procedure for all the objects on the conveyor belt a global loop (jump to command) is used.
Also in order to place the next object on the top of the previous one automatically the student
will learn how to use a variable (counter), that represents the dynamic location of the new
object, that changes its value in each global loop.
Note that in the previous procedure the conveyor can be started only just after that robot
returns to its initial position after placing the object in its location. The mention if-statement
inside the loop programmed to stop the conveyor when the sensor detects an object cannot be
| P a g e 08
Experiment 9 Conveyor Belt with Sensor If Statements, Loops and Counters
activated unless the robot has been stopped. As a result, the conveyor cannot be started
unless the robot has been stopped. This represents a deficiency in the program, time is being
wasted, as simultaneous activation of the conveyor and the robot cannot be achieved.
To solve this time deficiency of the program the student will use input interrupt related
commands that enable the activation of both the robot and the conveyor belt simultaneously.
In addition, at the end of this activity the student will be requested to program the robot to do
picking several objects from the conveyor and placing them in two different locations basing
on its size. This task will be explained in more detail at the end of this report.
E XPERIMENTAL PROCEDUR E :
R UNNING R OBO C EL L AND O PENING THE D EMO 3D MODEL F ILE
1. Turn on the computer.
2. Run RoboCell by doing one of the following:
Click Start | Programs | RoboCell for ER 4u | RoboCell for ER 4u.
Click on the RoboCell for ER 4u icon.
The opening screen appears.
| P a g e 08
Experiment 9 Conveyor Belt with Sensor If Statements, Loops and Counters
Figure (3). 3D cell model that contains robot, conveyor belt and sensor.
You now need to arrange the windows in positions optimal for viewing the 3D Image
and teaching/recording positions. Select Window | Simulation & Teach to arrange
the windows.
R ECORDING P OSITIONS
1. Move the robot to the positions shown in Figure (4) and record them.
3 5
2 8
6
4
| P a g e 08
Experiment 9 Conveyor Belt with Sensor If Statements, Loops and Counters
2. Position (2) is recorded such that when the box reaches the sensor the conveyor stops. The
robot is moved to catch it where position (2) is recorded. The robot holds the box to
position (4) where it is placed just above the table.
3. Make sure that positions (3) is 50mm above position (2), position (6) 40mm above (4),
and so for position (8) relative to (6). Position (5) is 50mm above position (8). For more
information refer to Activity 1.
4. Observe that axis # 7 in the Manual Movement window, which corresponds to conveyor
axis control. See the next Figure:
Conveyor belt
axis control
5. Also open the dialog input dialog bar from View | Dialog Bars | Digital Inputs.
6. Move the conveyor right/left by clicking on 7/U, shown in Figure (5), manually. When an
object reaches the sensor the rear led illuminates and also does the corresponding digital
input. See the figure:
Figure (6). The sensor detects an object, hence input #1 turns on.
C O N VE Y O R BE L T C O M M AN D S :
The main programming commands related to the conveyor belt are the following:
1. Starting and Stopping the conveyor:
In the Workspace | Commands window go to AXIS CONTROL | StartConveyor... or
StopConveyor...
| P a g e 08
Experiment 9 Conveyor Belt with Sensor If Statements, Loops and Counters
In both figures the axis represents to which control axis in the control unit the conveyor
belt is connected. Note that two axes in the control unit are available: axis #7 and axis #8.
Here, in this experiment the conveyor is connected through axis #7. Also, as appears in
the figure on the left, the student can select the direction and the speed at which the
conveyor moves.
After clicking OK on any of the previous figures, the following commands appear in the
program window
| P a g e 08
Experiment 9 Conveyor Belt with Sensor If Statements, Loops and Counters
Note that (1) is the input # of the control unit to which the sensor is connected, see
Figure (6).
| P a g e 08
Experiment 9 Conveyor Belt with Sensor If Statements, Loops and Counters
USING A CO UN TE R I N T H E P RO G R AM
The objective of a counter in this activity is to place the object in a new location different
than the previous location automatically. Like, appending cubes one on the top of the other,
automatically. This can be done as follows:
3. Create a variable in the program:
In the Workspace | Commands window go to PROGRAM FLOW |
SetVariableToComputation... the following window appears
Write the variable name and value. Here we used POSITION1 as variable name at its
value is 4. This creates the following command in the program window:
4. Change its value automatically inside a loop using the same command
SetVariableToComputation
1
Variable name is arbitrary.
| P a g e 09
Experiment 9 Conveyor Belt with Sensor If Statements, Loops and Counters
The previous procedure changes the value of the variable POSITION to 6 and then to 8 in
each loop.
T HE PROGRAM :
This program collects the boxes from conveyor belt. And places them on the table one on the
top of the other. The conveyor stops when the sensor detects a box. If no box is detected the
robot is at standby mode at position (3). When the robot catches the box at position (2) it
moves to position (3) and then the conveyor is restarted.
P R O G R AM S E Q UE N CE :
5. Initially, the robot is in standby mode at position (1) (see Figure (4)).
6. The conveyor is started and the robot is moved to position (3) and waits with the gripper
open.
7. When the box reaches the sensor, the conveyor is stopped and then the robot moves to
position (2).
8. The gripper is closed and then the robot returns to position (3).
9. The conveyor is restarted
10.The robot takes the box to position (5) then position ( POSITION) – the created variable –
which value, initially, is 4.
11.The gripper is opened. The robot moves to position (5) and then to (3).
12.At any time if the sensor detects a box the conveyor is stopped. And the process is
repeated automatically in a loop.
13.When the number of appended boxes =3 the program is ended and the robot moves to
position (1).
| P a g e 00
Experiment 9 Conveyor Belt with Sensor If Statements, Loops and Counters
P R O G R AM S T R UC T U RE I N RoboCell:
Note that program sequences presented in Section (0) are not followed exactly in the
ROBOCELL program, Figure (7). The student should made any necessary modifications
including some self improvement as needed.
Note also the subroutine created at the end of the program, Figure (7), for stopping the
conveyor. It is called when the sensor detects a box using the command:
| P a g e 07
Experiment 10
Creating a Robotic Cell Using Cell
Setup
| P a g e 09
Experiment 10 Creating a Robotic Cell Using Cell Setup
O BJECTIVES :
Introduce the student to CELLSETUP program and its main components, and creating a
Robotic Cell (ROBOCELL) that includes:
ER 4u Robot
Table
Objects (boxes)
Conveyor belt
Input/output experimental table with sensors, light, and buzzer.
General sensor
CELLSETUP PROGRAM:
CellSetup W INDOW
Figure (1) shows an existing workcell in the CellSetup window. The window comprises:
A Menu Bar containing all command menus and options.
A Toolbar containing icons for the most commonly used options.
Working area containing the workcell objects.
A Status Bar displaying RoboCell status messages.
In the next sections brief details are provided about the main components in the program
menu.
| P a g e 09
Experiment 10 Creating a Robotic Cell Using Cell Setup
M E N U B A R (F I L E MENU)
Cell data is stored in a *.3DC file. The File menu contains the
usual Windows functions that allow the student to load and save 3DC
files, and to exit the software.
In addition, you can open the most-recently opened workcell files
from this menu.
TOOLBAR
N E W O B J E C TS M E N U
Clicking on New Object icon the following menu is opened, see Figure (2, A&B). This
menu contains the most general Cell components.
| P a g e 09
Experiment 10 Creating a Robotic Cell Using Cell Setup
A CTIVITY :
In this activity the student will be able to create a new virtual workcell. A workcell created
using CellSetup can be theoretical or a replica of actual robotic installations.
After creating a workcell, the student can open it in RoboCell, where he can define positions,
write programs and run them. If a controller and a robot are connected to the computer, the
student can switch RoboCell to On-Line, and run the virtual robot in the virtual cell, together
with the real robot in the real cell.
| P a g e 09
Experiment 10 Creating a Robotic Cell Using Cell Setup
O PEN THE PROGRAM
Click on the following icon to open the CellSetup program , the following window
opens:
Click on the new icon in the program toolbar, see Section (0) for more information about
program toolbar. the following window opens:
Figure (4)
In this window select the type of the robot. Which is, in our case, ER 4u. At this step the
program is ready to create a Cell.
ADDING A N E W RO B O T
From Robots submenu, Figure (2, A), add a robot. As can be seen, only ER 4u robot appears
in this submenu. Double click on it the following window appears:
| P a g e 09
Experiment 10 Creating a Robotic Cell Using Cell Setup
Select No Slidebase as a stationary (fixed to ground) robot will be used. And then click on
OK.
A robot will be inserted in the center of the window as shown:
D
r
a
g W
i
3 n
D d
o
F
w
r
a
m S
Figure (6). A robot
e in the center of the window.
l
i
C H AN GE T HE VI E W PO I N T AN D Z O O M d
To change the viewpoint move the slider on the right of e
the window of the previous figure.
r
The position of entire cell click on the Drag 3D Frame icon shown in the previous figure.
Also you can change the orientation of the entire cell and/or zooming in/out the view by
right-click anywhere in the cell and moving the mouse right/left and/or up/down.
| P a g e 09
Experiment 10 Creating a Robotic Cell Using Cell Setup
ADDING A T A BL E BE L O W T H E R O B O T
In the New Object menu double-click on General submenu and then double-click on Table,
the following window opens, where you can change the color of the table and its size.
Click on OK in the previous figure. Click approximately where to position the table a
table will be added to the Cell. You can change its position later by clicking on Drag Object
Icon in the main toolbar introduced in Section (0).
ADD A CO N VE Y O R I N F RO N T O F TH E RO B O T
The conveyor can be added clicking on Peripheral Axes submenu in New Object menu and
double-click on Conveyor Belt… the following window appears:
| P a g e 09
Experiment 10 Creating a Robotic Cell Using Cell Setup
Select the text in the previous figure (Conveyor Belt…) and drag it to a vacant
port/connector (could be 7 or 8). As in the RoboCell program this conveyor will be moved
using this port (axis). After finishing and clicking on OK the program is waiting for clicking
the position of this conveyor. Place it near the robot in front of it. The following arrangement
will be obtained.
| P a g e 09
Experiment 10 Creating a Robotic Cell Using Cell Setup
A D D I N G C U BE S TO THE CELL
In the New Object menu double-click on Materials submenu and then double-click on
Cube, the following window opens, where you can change the color of the cube, material
and its size.
After selecting the needed specifications of the Cube, press OK and then the program asks
the student to indicate its location. Select an appropriate location within the robot workspace.
Note that the Cube can also be placed on the conveyor.
Similarly, the student can add different objects to the Cell as needed.
ADDING A SENSOR
The Sensor can be added from the New Object menu. Double-click on I/O Devices submenu
and then double-click on Sensor, the following window opens, where you can change
characteristics of this Sensor.
| P a g e 09
Experiment 10 Creating a Robotic Cell Using Cell Setup
As can be observed from the previous figure the sensor can be general that detects all colors
and material or can be used for specific material/color. Also in the size option, the height of
the sensor can be changed. Use 110mm height to align the sensor next to the conveyor.
Besides, it may be necessary to rotate it, as done in section 0, to make it detect objects on the
conveyor.
It is important to define the input channel to which the sensor is connected. When this
channel receives a signal, this means that the sensor has detected an object. Input channel is
defined pressing icon (controller setup) in the main toolbar window, which opens the
following window:
As can be observed from the previous figure, the controller has eight input channels. Click
on the sensor and drag it to a free channel. Remember the selected channel number to use it
in RoboCell program.
| P a g e 00
Experiment 10 Creating a Robotic Cell Using Cell Setup
ADDING AN E X PE RI M E N T AL T A BL E
The RoboCell Experimental Table contains four input sensors and two outputs (Buzzer and a
light). It can be inserted the New Object menu. Double-click on I/O Devices submenu and
then double-click on “Experimental Table”, the following window opens, to define the input
channel for each sensor, as done previously.
When pressing OK in the previous figure the Experimental Table is ready to be placed on the
table, click any position on it.
To define the output channels presses on (controller setup) and select the output tab.
Then, similarly, drag each output to the considered channel.
| P a g e 999
Experiment 10 Creating a Robotic Cell Using Cell Setup
At this instant, the created cell is ready to be used in RoboCell program. The student may
self-study more options or different object combinations in the Cell as needed.
After this introduction the student should be able to program the task
assigned by his instructor.
| P a g e 999