Date post: | 23-Dec-2015 |
Category: |
Documents |
Upload: | elfreda-daniel |
View: | 222 times |
Download: | 0 times |
Programming Epson Robots – Part 2
ME 4135 – Fall 2012Dr. R. Lindeke
Overview
Safety and Movement Developing A First Program Some Cool Tools
– Pallets– SubRoutines– Etc.
Proofing w/ the Simulator Running the Robots
Language Constructs
Pallet: – can be a statement which defines the geometry
of the pallet Pallet #, pos1, pos2,pos3, [pos4], 5,5 # is 1 to 15 Posi’s define the corners of a pallet 5,5 define the array of positions on the pallet
– Can be a function that defines one of the “indexes” or row x column positions on a previously defined pallet (can be used with motion commands)
Pallet (#, Index) Pallet (#, row, column)
Pallet Example:
Pallet Example 2:
Allowed by the “Outside” Qualifier
Pallet Geometry as defined by the Pallet Statement
Final Example – combining Pallet Statement and Function
Row x Column positions seen as indices and jump
to an index
Select … Send
This is a case statement One set of a series of statements will be
executed depending on the value of an “expression”
Each of the series of potential statements for execution is identified as a numbered ‘Case’ which will be executed if the expression equals that case value
Typically a ‘default series’ of statements is built in case the expression is not one ‘expected’
Select … Send Example:
Select … Send
The expression source can be external! It can be from a set of Physical Inputs It can be from a set of Memory Inputs It can be From a READ statement It can be from an INPUT statement This is a very powerful logic flow
construct!
By the way:
Subroutines
Use structure: – GOSub (Label)– …– Label:
Series of Statement Ends in Return Statement
SubRoutine Example:
Function … Fend
A function is a series of statements that are executed upon calling (like sub-routine) but can return a value to the CALL (xqt) statement
The return variable type is specified during Function Definition
A argument list (set of variables) can be passed into a function from the “Calling” function
Sub-routines can be built inside (nested) of a function if needed
The Syntax:
Examples:
Do … Loop
Is a ‘struct’ that repeats a series of instruction While or Until a condition becomes true
It is typically used as an overall “Wrapper” to assure that a program will continue indefinitely as long as the operation is needed
Do … Loops can be exited early using conditional ‘EXIT Do’ statements (usually approached with If … Then tests)
Do … Loop Syntax:
Add note, Condition is Optional if an ‘Infinite’ loop is
desired!
For … Next
Essentially a “Counted Do Loop” A series of statements are executed a
predetermined number of time as set by code or input value
Requires a countable variable to record repetitions
Counter limits can be variables too
For … Next Syntax
If … Then … Else … Endif
Always available – and always helpful! Uses the results of a logical test and
Then does something (if true) … or something Else (if false and else
is defined) Also allow an IfElse Clause for a
second (or more) true statement Requires an EndIf to complete the
construct Thus it is seen as a primitive Select
Send construct
If … Then … Else Syntax
Continuing
Input Print Read Output On Off In or In SW Lots to explore and use … so see the
SPEL+Ref .pdf for full exposure
Using the Simulator
Can add object to the workspace– Spheres, cylinders, boxes, planes, walls– Can import CAD objects– Can add tooling to end-of-arm
Simulation it is designed to check:– Timing of programs to explore optimal path
control– Collisions in space between robot and objects– Operation of the arm and end effectors
It is possible to capture video of the simulation for demonstration and off-line study