Program Examples - Robot Helix motion/zh-hans
语言: | English • 中文(简体) |
---|
机器人螺旋运动示例。 我们使用PUMA 6轴机器人:
点击图片查看360°视频:
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} '{J1,J2,J3,J4,J5,J6}
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} '{X,Y,Z,Y,P,R}
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 'System's velocity factor (in percents). 100 means no factor.
with Puma
Attach
En = TRUE
Sleep 100
while NOT En
Sleep 100
Vcruise = RobotVelocity 'Set robot's cruise velocity
end while
Move ZeroPosition
WaitForMotion Puma
call helixMotion
Move ZeroPosition
WaitForMotion Puma
Detach
end with
end program
sub helixMotion
dim i as long
PUMA.BlendingMethod = 1 'Type of motion blending - 1 is Continous Path blending.
PUMA.Cp = 2 'At continous path blednign, sets the blend radious value - bigger equal smoother
Move PUMA ZeroPosition
WaitForMotion Puma
Move PUMA HelixStart
WaitForMotion Puma
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
WaitForMotion Puma
end sub