Difference between revisions of "Program Examples - Robot Helix motion"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "here is an example of doing Robot Helix movement. We use puma 6 axis robot in this example: File:Helix1.JPG Helix.PRG: <syntaxhighlight lang="vb"> '---------------------...")
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
here is an example of doing Robot Helix movement. We use puma 6 axis robot in this example:
+
{{Languages|Program_Examples_-_Robot_Helix_motion}}
[[File:Helix1.JPG]]
+
Example of Robot Helix movement. We use puma 6 axis robot:
 +
 
 +
Click image for 360° video:
 +
 
 +
[[File:vid_prev.png|link=http://softmc.servotronix.com/img_auth.php/f/fe/Helix.html|400px]]
 +
 
 +
{|  cellpadding="10"  cellspacing="0"  border="1"
 +
|| '''[[File:Helix3.JPG|250px]]''' ||'''[[File:Helix4.JPG|240px]]'''
 +
|}
  
  
Line 17: Line 25:
  
 
' module global variables
 
' module global variables
dim shared jntZeroPosition as joint of xyzypr = {0,0,0,0,0,0}
+
dim shared ZeroPosition as joint of xyzypr = {0,0,0,0,0,0}                              '{J1,J2,J3,J4,J5,J6}
dim shared jntStartPosition as joint of xyzypr = {-45,45,0,0,45,0}
+
dim shared StartPosition as joint of xyzypr = {-45,45,0,0,45,0}
  
dim shared locHelixCenter as location of xyzypr = #{0 , 1200 , 250 , 0 , 180 , -90}
+
dim shared HelixCenter as location of xyzypr = #{0 , 1200 , 250 , 0 , 180 , -90}        '{X,Y,Z,Y,P,R}
dim shared locHelixStart as location of xyzypr =  #{0 , 1000 , -50 , 0 , 180 , -90}
+
dim shared HelixStart as location of xyzypr =  #{0 , 1000 , -50 , 0 , 180 , -90}
  
dim shared dVelSlow as double = 40.0
+
dim shared RobotVelocity as double = 40.0
dim shared dVelFast as double = 80.0
 
  
 
program
 
program
  
     Sys.Vrate = 100.0
+
     Sys.Vrate = 100.0                       'System's velocity factor (in percents). 100 means no factor.
 
     with Puma
 
     with Puma
 
         Attach
 
         Attach
Line 35: Line 42:
 
             while NOT En
 
             while NOT En
 
                 Sleep 100
 
                 Sleep 100
 +
            Vcruise = RobotVelocity          'Set robot's cruise velocity
 
             end while
 
             end while
             Move jntZeroPosition Vcruise=dVelSlow
+
             Move ZeroPosition
             call waitMotion
+
             WaitForMotion Puma
 
                 call helixMotion
 
                 call helixMotion
             Move jntZeroPosition Vcruise=dVelSlow
+
             Move ZeroPosition
             call waitMotion
+
             WaitForMotion Puma
 
         Detach
 
         Detach
 
     end with     
 
     end with     
Line 51: Line 59:
 
     dim i as long
 
     dim i as long
  
     PUMA.BlendingMethod = 1
+
     PUMA.BlendingMethod = 1                 'Type of motion blending - 1 is Continous Path blending.
     PUMA.Cp = 2
+
     PUMA.Cp = 2                             'At continous path blednign, sets the blend radious value - bigger equal smoother
     Move PUMA jntZeroPosition Vcruise=dVelSlow
+
     Move PUMA ZeroPosition
     call waitMotion
+
     WaitForMotion Puma
     Move PUMA locHelixStart Vcruise=dVelFast
+
     Move PUMA HelixStart
     call waitMotion
+
     WaitForMotion Puma
     for i = 1 to 2
+
     for i = 1 to 3
        Moves PUMA locHelixStart Vtran=PUMA.VmTran
+
        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
        Circle PUMA Angle=3*360 CircleCenter = locHelixCenter Vtran = PUMA.VmTran
+
        Moves PUMA HelixStart Vtran=PUMA.VmTran                                    'Moves to start point in stright line (translation)
 
     next i
 
     next i
     Move PUMA jntZeroPosition Vcruise=dVelSlow
+
     Move PUMA ZeroPosition
     call waitMotion
+
     WaitForMotion Puma
 
      
 
      
end sub
 
 
sub waitMotion
 
    while puma.IsMoving
 
        Sleep 1
 
    end while
 
 
end sub
 
end sub
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 06:43, 17 July 2017

Language: English  • 中文(简体)‎

Example of Robot Helix movement. We use puma 6 axis robot:

Click image for 360° video:

vid prev.png

Helix3.JPG Helix4.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}                              '{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