Post on 14-Dec-2015
Lesson Topic: Handshaking Process-narrated version-
HandshakingHandshaking
The process of interfacing and coordinating the milling machine and the robot arm to work together to manipulate and manufacture a part.
What you should know...
Programming and Control of the Robot Arm
Programming and Control of the Milling Machine and Vice
Objectives
Identify G&M codes used to sense and control inputs/outputs (CNC)
You will be able to...
Identify process and decision statements associated with inputs/outputs (Robot Arm)
Explain how signals are interpreted between the CNC and the Robot Arm
Give examples of Robot Arm and CNC positioning for safe operations
G&M Codes
G-codes wait for a changeG25 - Wait until TTL output #1 goes onG26 - Waits until TTL output #1 goes offG35 - Wait until TTL output #2 goes onG36 - Waits until TTL output #2 goes off
These G-codes behave like decision statements. If the condition is met, the program will drop to the next line. If the condition is not met, the program will wait until the proper output state is changed.
The actions of the CNC mill can be controlled by the state of the outputs…as opposed to the Robot Arm, whose actions can be controlled by the state of the inputs.
M25 - Sets input #1 to offM26 - Sets input #1 to onM35 - Sets input #2 to offM36 - Sets input #2 to on
M-codes cause a change
These M-codes are used to turn the Robot Arm on and off.Typically used in combination with a pause in between to “unlock” the robot’s input “door”…give the robot time to act…and then “lock” the input “door”.
N10 M25 ; Turn input #1 to offN11 G04 F2 ; 2 second pauseN12 M26 ; Turn input #1 to onN13 G25 ; Wait for output #1 on
Example...
Scorbase Programming
If Input 1 on jump to Some_LabelIf Input 1 off jump to Some_Label
Decision Statements
These decision statements are used mostly in “dead” loops. If the condition is met, the program will jump to a new location and start a series of actions.
If the condition is not met, the program will continue to loop until the proper input is changed.
The actions of the Robot Arm can be controlled by the state of the inputs…as opposed to the CNC Mill, whose actions can be controlled by the state of the outputs.
Turn on output 1Turn off output 1
Process Statements
These statements are used to manipulate the CNC by controlling the output.Typically used in combination with a pause in between to “unlock” the CNC’s output “door”…give the CNC time to act…and then “lock” the output “door”.
26: Turn on output 128: WaiT 10 (10 ths of seconds)30: Turn off output 132: WAIT_2
Example...
HandshakingThe
Process
#3
#3
“home” position #1
#1
#2
#2
#4
#4
#6
#6
#5
#5
#6
#6
#4
#4
#5
#5
#3
#3
#2
#2
“home” position #1
#1
Individual Steps
Step #1 …CNC to “Load”
Step #2 …Loading the Part
Step #3 …Milling the Part
Step #4 …Unloading the Part
How they “Talk”
Flowchart
G&M Code
Scorbase Program
“State of Activity”
Input #1 Output #1
(default state)ON
Input #1 Output #1
“State of Activity”
2: WAIT_1 3: IF Input #1 off jump to START_1 6: Jump to WAIT_1
7: START_1
Scorbase...
(default state)ON
Input #1
“State of Activity”
N1 M5 ; Turn Spindle OffN2 G90 ; Absolute Coordinate ModeN3 G20 ; Inch Mode N4 M10 ; Open the Vise
CNC Mill...
ON
Step #1…CNC to “Load”
Output #1
ONOFF
Input #1 Output #1
“State of Activity”
N4 M10 ; Open the Vise N5 G00 X10.2003 Y2.7850 Z1.3 ; LoadN6 M25 ; Turn Input #1 OffN7 G04 F2 ; 2 Second Pause
Step #1…CNC to “Load”
N4 M10 ; Open the Vise N5 G00 X10.2003 Y2.7850 Z1.3 ; LoadN6 M25 ; Turn Input #1 OffN7 G04 F2 ; 2 Second Pause
CNC Mill...
OFF
Input #1 Output #1
“State of Activity”
2: WAIT_1 3: IF Input #1 off jump to START_1 6: Jump to WAIT_1
7: START_1
Scorbase...
2: WAIT_1 3: IF Input #1 off jump to START_1 6: Jump to WAIT_1
7: START_1
Input #1 Output #1
“State of Activity”
10: Turn off output 113: Go to Position 1 fast 14: Open Gripper 15: Go to Position 2 fast
Scorbase...
OFFONOFF
Step #2…Loading the Part
ONOFF
Input #1 Output #1
OFF
N7 G04 F2 ; 2 Second Pause N8 M26 ; Turn Input #1 OnN9 G25 ; Wait for Output #1 On
CNC Mill...
ON
N7 G04 F2 ; 2 Second Pause N8 M26 ; Turn Input #1 OnN9 G25 ; Wait for Output #1 On
Step #2…Loading the Part
“State of Activity”
ON
Input #1 Output #1
“State of Activity”
16: Go Linear to Position 3 speed 517: Close Gripper 18: Go Linear to Position 2 fast
19: Go Linear to Position 4 fast
Scorbase...
OFF
20: Go Linear to Position 5 fast21: Go Linear to Position 6 speed 5 22: Open Gripper 23: Go Linear to Position 5 fast
24: Go Linear to Position 4 fast26: Turn on output 1 28: WaiT 10 (10 ths of seconds)
ON
Step #2…Loading the Part
24: Go Linear to Position 4 fast26: Turn on output 1 28: WaiT 10 (10 ths of seconds)
Input #1
“State of Activity”
CNC Mill...
N7 G04 F2 ; 2 Second Pause N8 M26 ; Turn Input #1 OnN9 G25 ; Wait for Output #1 On
ONON
Output #1
Step #3…Milling the Part
ON
28: WaiT 10 (10 ths of seconds)30: Turn off output 1 32: WAIT_2
33: If Input 1 off jump to START_2
ONON
Input #1
Scorbase...
“State of Activity”
30: Turn off output 1 32: WAIT_2
33: If Input 1 off jump to START_2 35: Jump to WAIT_2
Step #3…Milling the Part
OFF
Output #1
ON
Input #1 Output #1
“State of Activity”
N10 M11 ; Close the Vise N11 G00 X0 Y0 Z.25 ; Cutter Above BlockN12 M3 S3000 ; Spindle OnN13 G01 Z-.02 F5 ; Milling the Block
CNC Mill...
N14 G01 Y2 F20N15 X3N16 Y0 N17 X0
N18 G00 Z1N19 M47 ; Recycle to Beginning
N1 M5 ; Turn Spindle Off
OFF
Step #3…Milling the Part
N2 G90 ; Absolute Coordinate ModeN3 G20 ; Inch ModeN4 M10 ; Open ViseN5 G00 X10.2003 Y2.7850 Z1.3 ; Unload
ON
Input #1 Output #1
“State of Activity”
CNC Mill...
OFF
N6 M25 ; Turn Input #1 OffN7 G04 F2 ; Pause for 2 SecondsN8 M26 ; Turn Input #1 OnN9 G25 ; Wait for Output #1 On
OFF
N6 M25 ; Turn Input #1 OffN7 G04 F2 ; Pause for 2 SecondsN8 M26 ; Turn Input #1 OnN9 G25 ; Wait for Output #1 On
Step #3…Milling the Part
OFF
Output #1
“State of Activity”
Scorbase...
32: WAIT_2 33: If Input 1 off jump to START_2
35: Jump to WAIT_2 36: START_2
OFF
Input #1
Step #4…Unload the Part
Input #1 Output #1
OFF
CNC Mill...
“State of Activity”
N6 M25 ; Turn Input #1 OffN7 G04 F2 ; Pause for 2 SecondsN8 M26 ; Turn Input #1 OnN9 G25 ; Wait for Output #1 On
Step #4…Unload the Part
OFFON
N6 M25 ; Turn Input #1 OffN7 G04 F2 ; Pause for 2 SecondsN8 M26 ; Turn Input #1 OnN9 G25 ; Wait for Output #1 On
ON
Input #1
“State of Activity”
OFFON
Step #2…Loading the Part
Scorbase...
36: START_2 40: Go Linear to position 5 fast 41: Go Linear to position 6 speed 5
42: Close Gripper
Step #4…Unload the Part
43: Go Linear to position 5 fast 44: Go Linear to position 4 fast 45: Go Linear to position 2 fast 46: Go Linear to position 3 speed 5
47: Open Gripper 48: Go Linear to position 2 fast 49: Go Linear to position 1 fast 51: Turn on output 1
51: Turn on output 153: WaiT 10 (10 ths of seconds) 49: Jump to WAIT_1
Output #1
Keep it SafeIdeas to remember
Make sure you do not go beyond the CNC milling machine’s X-axis and Y-axis limits when setting the Load/Unload position.
The robot should be programmed to load the part into the vise using a linear Z-axis motion.
Position the Robot Arm in a location where the CNC safety shield cannot contact it during the movements of the mill table.
ATTENTIONATTENTIONATTENTIONRun the Robot program first…before you start the CNC program !!!
Never have the CNC milling machine and the robot arm performing actual movements at the same time…keep your hands on the emergency stop switches when testing your programs!!!