Difference between revisions of "Program Examples - Robot Helix motion"
Line 1: | Line 1: | ||
here is an example of doing Robot Helix movement. We use puma 6 axis robot in this example: | here is an example of doing Robot Helix movement. We use puma 6 axis robot in this example: | ||
− | [[File:Helix2.JPG]] | + | {| cellpadding="10" cellspacing="0" border="1" |
− | + | |'''[[File:Helix1.JPG]]''' ||'''[[File:Helix2.JPG]]''' || '''[[File:Helix3.JPG]]''' ||'''[[File:Helix4.JPG]]''' | |
+ | |} | ||
Helix.PRG: | Helix.PRG: | ||
Line 18: | Line 19: | ||
' module global variables | ' module global variables | ||
− | dim shared | + | dim shared ZeroPosition as joint of xyzypr = {0,0,0,0,0,0} |
− | dim shared | + | dim shared StartPosition as joint of xyzypr = {-45,45,0,0,45,0} |
− | dim shared | + | dim shared HelixCenter as location of xyzypr = #{0 , 1200 , 250 , 0 , 180 , -90} |
− | dim shared | + | dim shared HelixStart as location of xyzypr = #{0 , 1000 , -50 , 0 , 180 , -90} |
− | dim shared | + | dim shared RobotVelocity as double = 40.0 |
− | |||
program | program | ||
Line 36: | Line 36: | ||
while NOT En | while NOT En | ||
Sleep 100 | Sleep 100 | ||
+ | Vcruise = RobotVelocity 'Set robot's cruise velocity | ||
end while | end while | ||
− | Move | + | Move ZeroPosition |
call waitMotion | call waitMotion | ||
call helixMotion | call helixMotion | ||
− | Move | + | Move ZeroPosition |
call waitMotion | call waitMotion | ||
Detach | Detach | ||
Line 54: | Line 55: | ||
PUMA.BlendingMethod = 1 | PUMA.BlendingMethod = 1 | ||
PUMA.Cp = 2 | PUMA.Cp = 2 | ||
− | Move PUMA | + | Move PUMA ZeroPosition |
call waitMotion | call waitMotion | ||
− | Move PUMA | + | Move PUMA HelixStart |
call waitMotion | call waitMotion | ||
− | for i = 1 to | + | for i = 1 to 3 |
− | + | Circle PUMA Angle=3*360 CircleCenter = HelixCenter Vtran = PUMA.VmTran 'Circle center has different Z coordinate then circle starting point - causing Helix and not plane circle | |
− | + | Moves PUMA HelixStart Vtran=PUMA.VmTran 'Moves to start point in stright line (translation) | |
next i | next i | ||
− | Move PUMA | + | Move PUMA ZeroPosition |
call waitMotion | call waitMotion | ||
Revision as of 15:45, 22 January 2017
here is an example of doing Robot Helix movement. We use puma 6 axis robot in this example:
File:Helix2.JPG |
Helix.PRG:
'------------------------------------------------------------------------------
' File: Helix.prg
' Purpose: generating puma helix motion
' Version: 1.00
' Author: Eran Korkidi
' History: 10.DEC.2015 - created
'------------------------------------------------------------------------------
' module global "constants"
' module global variables
dim shared ZeroPosition as joint of xyzypr = {0,0,0,0,0,0}
dim shared StartPosition as joint of xyzypr = {-45,45,0,0,45,0}
dim shared HelixCenter as location of xyzypr = #{0 , 1200 , 250 , 0 , 180 , -90}
dim shared HelixStart as location of xyzypr = #{0 , 1000 , -50 , 0 , 180 , -90}
dim shared RobotVelocity as double = 40.0
program
Sys.Vrate = 100.0
with Puma
Attach
En = TRUE
Sleep 100
while NOT En
Sleep 100
Vcruise = RobotVelocity 'Set robot's cruise velocity
end while
Move ZeroPosition
call waitMotion
call helixMotion
Move ZeroPosition
call waitMotion
Detach
end with
end program
sub helixMotion
dim i as long
PUMA.BlendingMethod = 1
PUMA.Cp = 2
Move PUMA ZeroPosition
call waitMotion
Move PUMA HelixStart
call waitMotion
for i = 1 to 3
Circle PUMA Angle=3*360 CircleCenter = HelixCenter Vtran = PUMA.VmTran 'Circle center has different Z coordinate then circle starting point - causing Helix and not plane circle
Moves PUMA HelixStart Vtran=PUMA.VmTran 'Moves to start point in stright line (translation)
next i
Move PUMA ZeroPosition
call waitMotion
end sub
sub waitMotion
while puma.IsMoving
Sleep 1
end while
end sub