Difference between revisions of "MC-Basic:CIRCLE"

From SoftMC-Wiki
Jump to: navigation, search
m (added spiralPitch reference)
 
Line 1: Line 1:
{{Languages|MC-Basic:CIRCLE}}
+
{{Languages|MC-Basic:CIRCLE}}  
 
{{MC-Basic
 
{{MC-Basic
 
|SHORT FORM=
 
|SHORT FORM=
Line 6: Line 6:
 
|SYNTAX=
 
|SYNTAX=
 
'''Circle''' <''group''> '''Angle''' = ''<angle> '''''CircleCenter''' = {''<vector>''}
 
'''Circle''' <''group''> '''Angle''' = ''<angle> '''''CircleCenter''' = {''<vector>''}
{'''CirclePlane''' = ''<circle plane>''} ''{Optional Nodal Property}''*  
+
{'''CirclePlane''' = ''<circle plane>''} {'''spiralPitch''' = ''<pitch>''} ''{Optional Nodal Property}''*  
  
 
Or
 
Or
  
'''Circle''' <''group''> '''CirclePoint''' = ''<vector> '''''TargetPoint''' = {''<vector>''} ''{Optional Nodal Property}''*  
+
'''Circle''' <''group''> '''CirclePoint''' = ''<vector> '''''TargetPoint''' = {''<vector>''} ''{Optional Nodal Property}''*  
  
 
|AVAILABILITY=
 
|AVAILABILITY=
Line 38: Line 38:
 
*1 (XZ)
 
*1 (XZ)
 
*2 (YZ)
 
*2 (YZ)
 +
 +
<''spiralPitch''>: ± MaxDouble - Positive values describe CCW and negative CW rotations
  
 
''<vector>'': location or joint value
 
''<vector>'': location or joint value
Line 62: Line 64:
 
= ''Half Circle'' =
 
= ''Half Circle'' =
 
Here is a simple example for generating half circle motion with a delta (XYZR) robot.
 
Here is a simple example for generating half circle motion with a delta (XYZR) robot.
<syntaxhighlight lang="vb">
+
?'"`UNIQ--syntaxhighlight-00000001-QINU`"'?
Attach DELTA
 
DELTA.En=1
 
Record circPnt.rec 100000 Gap=1 RecData = DELTA.SetPoint{1},DELTA.SetPoint{2}, Sys.Clock
 
Move DELTA #{100,0,426,0}
 
Delay DELTA 3000
 
RecordOn
 
Circle DELTA CirclePoint=#{0,100,426,0} TargetPoint=#{-100,0,426,0}
 
Delay DELTA 3000
 
RecordClose
 
Detach DELTA
 
</syntaxhighlight>
 
  
 
[[File:circPnt.JPG|left|caption|450px]]
 
[[File:circPnt.JPG|left|caption|450px]]
Line 87: Line 78:
 
  System.NumberAxes = 3
 
  System.NumberAxes = 3
 
  common shared Axes[3] as generic axis
 
  common shared Axes[3] as generic axis
  common shared temp_grp as group Axnm = a1 Axnm = a2 Axnm = a3  
+
  common shared temp_grp as group Axnm = a1 Axnm = a2 Axnm = a3  
 
  common shared PLANE_XY as const long =0
 
  common shared PLANE_XY as const long =0
 
  common shared PLANE_XZ as const long =1
 
  common shared PLANE_XZ as const long =1
 
  common shared PLANE_YZ as const long =2
 
  common shared PLANE_YZ as const long =2
 
  Program
 
  Program
  Axes[1] = a1
+
Axes[1] = a1
  Axes[2] = a2
+
Axes[2] = a2
  Axes[3] = a3
+
Axes[3] = a3
  sys.DoubleFormat = 1
+
sys.DoubleFormat = 1
  sys.Name = "Helical"
+
sys.Name = "Helical"
  with temp_grp  
+
with temp_grp  
 
  End Program
 
  End Program
 
The setup stage:<br/>
 
The setup stage:<br/>
 
  dim shared pdl as long = 2
 
  dim shared pdl as long = 2
 
  Program continue
 
  Program continue
  dim i as long = 1
+
dim i as long = 1
  for i = 1 to 3
+
for i = 1 to 3
    attach Axes[i]  
+
attach Axes[i]  
      ' **** Setting Motion Parameters ****
+
' **** Setting Motion Parameters ****
      Axes[i].fmode = 0
+
Axes[i].fmode = 0
      Axes[i].pemax = 10
+
Axes[i].pemax = 10
      Axes[i].pfac = 2^16    
+
Axes[i].pfac = 2^16  
      Axes[i].vfac = Axes[i].pfac/1000/60
+
Axes[i].vfac = Axes[i].pfac/1000/60
      Axes[i].afac = Axes[i].vfac/1000
+
Axes[i].afac = Axes[i].vfac/1000
      Axes[i].jfac = Axes[i].afac/1000
+
Axes[i].jfac = Axes[i].afac/1000
      Axes[i].VCruise = 1000
+
Axes[i].VCruise = 1000
      Axes[i].vmax = 3000
+
Axes[i].vmax = 3000
      Axes[i].vospd = Axes[i].vmax * 1.2
+
Axes[i].vospd = Axes[i].vmax * 1.2
      Axes[i].velocitysafetylimit = Axes[i].vmax * 1.5
+
Axes[i].velocitysafetylimit = Axes[i].vmax * 1.5
      Axes[i].amax = 30000
+
Axes[i].amax = 30000
      Axes[i].dmax = 30000
+
Axes[i].dmax = 30000
      Axes[i].jmax = 300000
+
Axes[i].jmax = 300000
      Axes[i].acc = Axes[i].amax
+
Axes[i].acc = Axes[i].amax
      Axes[i].dec = Axes[i].dmax
+
Axes[i].dec = Axes[i].dmax
      Axes[i].jerk = Axes[i].jmax  
+
Axes[i].jerk = Axes[i].jmax  
      Axes[i].simulated = ON    
+
Axes[i].simulated = ON  
    detach Axes[i]  
+
detach Axes[i]  
  next
+
next
  call SetGroup  
+
call SetGroup  
 
  terminate Program
 
  terminate Program
 
The used subroutine and fumction at setup:<br/>
 
The used subroutine and fumction at setup:<br/>
 
  sub SetGroup
 
  sub SetGroup
 
  attach
 
  attach
    en=0
+
en=0
    vord = 100
+
vord = 100
    Print ".... "; ElementName; " - kinematics/geometric setup"
+
Print ".... "; ElementName; " - kinematics/geometric setup"
    PeMax   = 1 ' follwing error in mm (envelope)
+
PeMax = 1 ' follwing error in mm (envelope)
    smooth = -1
+
smooth = -1
    prftype = 1
+
prftype = 1
    vfac   = 1/1000
+
vfac = 1/1000
    afac   = vfac/1000
+
afac = vfac/1000
    jfac   = afac/1000   
+
jfac = afac/1000  
    vmax = max(j1.vmax,j2.vmax)
+
  vmax = max(j1.vmax,j2.vmax)
    amax = max(j1.amax,j2.amax)
+
amax = max(j1.amax,j2.amax)
    dmax = amax  
+
dmax = amax  
    decstop = 1.1*dmax
+
decstop = 1.1*dmax
    jmax   = max(j1.jmax,j2.jmax)
+
jmax = max(j1.jmax,j2.jmax)
    PositionErrorDelay   = pdl
+
PositionErrorDelay = pdl
    abs = 1   
+
abs = 1  
    vcruise = 0.5 * Vmax
+
  vcruise = 0.5 * Vmax
    acc = amax
+
acc = amax
    dec = dmax
+
dec = dmax
    jmax = 10*amax
+
jmax = 10*amax
    jerk= jmax
+
jerk= jmax
    PositionErrorSettle = 0.1 ' 100um
+
PositionErrorSettle = 0.1 ' 100um
    BlendingMethod = 0    
+
BlendingMethod = 0  
    configgroup  
+
configgroup  
    detach
+
detach
 
  end sub
 
  end sub
  
 
  function max(byval a as double, byval b as double ) as double
 
  function max(byval a as double, byval b as double ) as double
  if a > b then
+
if a > b then
    max = a
+
max = a
  else
+
else
    max = b
+
max = b
  end if
+
end if
 
  end function
 
  end function
  
Line 169: Line 160:
 
  dim shared circle_center[8] as joint of XYZ
 
  dim shared circle_center[8] as joint of XYZ
 
  program
 
  program
  dim index as long = 1
+
dim index as long = 1
  attach
+
attach
    ?VesExecute(" sys.Motion= ON")
+
?VesExecute(" sys.Motion= ON")
    call InitBuffer
+
call InitBuffer
    abs = 1
+
abs = 1
    en =1    
+
en =1  
    move {0 , 0 , 0} vcruise = 100 acc= 3000
+
move {0 , 0 , 0} vcruise = 100 acc= 3000
    move {25 , 0 , 0} vcruise =100 acc= 3000  
+
move {25 , 0 , 0} vcruise =100 acc= 3000  
    call StillMoving    
+
call StillMoving  
    record test11.rec 100000 gap =1 recdata = pcmd{1} , pcmd{2}, pcmd{3}
+
record test11.rec 100000 gap =1 recdata = pcmd{1} , pcmd{2}, pcmd{3}
    recordon  
+
recordon  
        ' Start "helical"
+
' Start "helical"
      for index = 1 to 8  
+
for index = 1 to 8  
        Circle Angle = 180 CircleCenter = (circle_center[index]+ {0,0,index*5})   Vtran = 500 CirclePlane = PLANE_XY  
+
Circle Angle = 180 CircleCenter = (circle_center[index]+ {0,0,index*5}) Vtran = 500 CirclePlane = PLANE_XY  
        call StillMoving
+
call StillMoving
        print "Position" , pcmd , index
+
print "Position" , pcmd , index
      next    
+
next  
      sleep 10
+
sleep 10
    recordclose
+
recordclose
  detach
+
detach
 
  end program  
 
  end program  
  
Line 194: Line 185:
  
 
  sub StillMoving
 
  sub StillMoving
  while ismoving <> 0
+
while ismoving <> 0
    sleep 1
+
sleep 1
  end while
+
end while
 
  end sub
 
  end sub
  
 
  sub InitBuffer
 
  sub InitBuffer
  dim index as long
+
dim index as long
  for index=1 to 8 step 2
+
for index=1 to 8 step 2
    circle_center[index] = {0,0,0}
+
circle_center[index] = {0,0,0}
  next
+
next
  for index=2 to 8 step 2
+
for index=2 to 8 step 2
    circle_center[index] = {12.5,0,0}  
+
circle_center[index] = {12.5,0,0}  
  next
+
next
 
  end sub
 
  end sub
 
<br/>
 
<br/>

Latest revision as of 13:15, 31 August 2026

Language: English  • 中文(简体)‎

The CIRCLE command issues a circular(arc) path trajectory for the specified group/robot, and uses the properties of that group.

The CIRCLE command has two formats. One specifies the group name, the angle and the circle center. This format enables multi-turn circular motion. The other is defined by a circle point and the final point of the arc.

The optional properties override the permanent values of the properties for the duration of the command. When using an optional property, the keyword must be specified.

For robot models the CIRCLE command issues a circular path in Cartesian space (XYZ). Orientation angles are interpolated proportionally to the circle angle.

For PUMA robots the orientation vector is kept orthogonal to the circular path.

Syntax

Circle <group> Angle = <angle> CircleCenter = {<vector>} {CirclePlane = <circle plane>} {spiralPitch = <pitch>} {Optional Nodal Property}*

Or

Circle <group> CirclePoint = <vector> TargetPoint = {<vector>} {Optional Nodal Property}*

Availability

All versions

Type

Double

Range

<group>: An existing group
<angle>: ± MaxDouble - Positive values describe CCW and negative CW rotations

<circle plane>:

  • 0 (XY)
  • 1 (XZ)
  • 2 (YZ)

<spiralPitch>: ± MaxDouble - Positive values describe CCW and negative CW rotations

<vector>: location or joint value

Default

Permanent property values are used unless specified otherwise. Final velocity is 0.

Scope

Task or Terminal

Limitations

  • Applicable only to groups.
  • A group cannot be moved if an axis from the group is being moved individually.
  • A group must be attached in order to be moved from within a task.

Examples

Circle XYTable Angle = 90 CircleCenter = {20,10} Vtran = 500

Circle XYtable CirclePoint = {10,20} TargetPoint = {100,200} Vtran = 500

Half Circle

Here is a simple example for generating half circle motion with a delta (XYZR) robot. ?'"`UNIQ--syntaxhighlight-00000001-QINU`"'?

caption



Helical

Here is a simple example for circle in 3D. The circle itself was defined at XY plane with additional movement in Z axis.
The code :
At the config file:

System.NumberAxes = 3
common shared Axes[3] as generic axis
common shared temp_grp as group Axnm = a1 Axnm = a2 Axnm = a3 
common shared PLANE_XY as const long =0
common shared PLANE_XZ as const long =1
common shared PLANE_YZ as const long =2
Program
Axes[1] = a1
Axes[2] = a2
Axes[3] = a3
sys.DoubleFormat = 1
sys.Name = "Helical"
with temp_grp 
End Program

The setup stage:

dim shared pdl as long = 2
Program continue
dim i as long = 1
for i = 1 to 3
attach Axes[i] 
' **** Setting Motion Parameters ****
Axes[i].fmode = 0
Axes[i].pemax = 10
Axes[i].pfac = 2^16 
Axes[i].vfac = Axes[i].pfac/1000/60
Axes[i].afac = Axes[i].vfac/1000
Axes[i].jfac = Axes[i].afac/1000
Axes[i].VCruise = 1000
Axes[i].vmax = 3000
Axes[i].vospd = Axes[i].vmax * 1.2
Axes[i].velocitysafetylimit = Axes[i].vmax * 1.5
Axes[i].amax = 30000
Axes[i].dmax = 30000
Axes[i].jmax = 300000
Axes[i].acc = Axes[i].amax
Axes[i].dec = Axes[i].dmax
Axes[i].jerk = Axes[i].jmax 
Axes[i].simulated = ON 
detach Axes[i] 
next
call SetGroup 
terminate Program

The used subroutine and fumction at setup:

sub SetGroup
attach
en=0
vord = 100
Print ".... "; ElementName; " - kinematics/geometric setup"
PeMax = 1 ' follwing error in mm (envelope)
smooth = -1
prftype = 1
vfac = 1/1000
afac = vfac/1000
jfac = afac/1000 
vmax = max(j1.vmax,j2.vmax)
amax = max(j1.amax,j2.amax)
dmax = amax 
decstop = 1.1*dmax
jmax = max(j1.jmax,j2.jmax)
PositionErrorDelay = pdl
abs = 1 
vcruise = 0.5 * Vmax
acc = amax
dec = dmax
jmax = 10*amax
jerk= jmax
PositionErrorSettle = 0.1 ' 100um
BlendingMethod = 0 
configgroup 
detach
end sub
function max(byval a as double, byval b as double ) as double
if a > b then
max = a
else
max = b
end if
end function

And the actual program:

dim shared circle_center[8] as joint of XYZ
program
dim index as long = 1
attach
?VesExecute(" sys.Motion= ON")
call InitBuffer
abs = 1
en =1 
move {0 , 0 , 0} vcruise = 100 acc= 3000
move {25 , 0 , 0} vcruise =100 acc= 3000 
call StillMoving 
record test11.rec 100000 gap =1 recdata = pcmd{1} , pcmd{2}, pcmd{3}
recordon 
' Start "helical"
for index = 1 to 8 
Circle Angle = 180 CircleCenter = (circle_center[index]+ {0,0,index*5}) Vtran = 500 CirclePlane = PLANE_XY 
call StillMoving
print "Position" , pcmd , index
next 
sleep 10
recordclose
detach
end program 

The used subroutines:

sub StillMoving
while ismoving <> 0
sleep 1
end while
end sub
sub InitBuffer
dim index as long
for index=1 to 8 step 2
circle_center[index] = {0,0,0}
next
for index=2 to 8 step 2
circle_center[index] = {12.5,0,0} 
next
end sub


The results:

caption

See Also