Difference between revisions of "Cartesian Gearing"
(created) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{Languages}} | + | <div id="BackToTop" class="noprint" style="background-color:; position:fixed; bottom:32px; left:95%; z-index:9999; padding:0; margin:0;"> |
+ | <span style="color:blue; font-size:8pt; font-face:verdana,sans-serif; border:0.2em outset:#ceebf7; padding:0.1em; font-weight:bolder; -moz-border-radius:8px; "> | ||
+ | [[Image:TOP2.png|50px|link=#top]] </span></div> | ||
+ | {{Languages|Cartesian_Gearing}} | ||
==Introduction == | ==Introduction == | ||
− | The Cartesian Gearing (CG) feature enables users to move additional axis proportionally to | + | The '''Cartesian Gearing''' (CG) feature enables users to move additional axis proportionally to traveled path of the robot’s tool-tip. <br> |
− | traveled path of the robot’s tool-tip. Slaving an axis to it's Pext that is geared to the robot's incremental cartesian change- | + | Slaving an axis to it's '''''Pext''''' that is geared to the robot's incremental cartesian change - the path variable ('''L''') in cartesian space is computed each motion sampling period. <br> |
− | the path variable (L) in cartesian space is computed each motion sampling period. | + | The variable keeps track of the traveled path in cartesian space (X,Y,Z). The value is accumulative, which means that if a same line segment is traveled back and forth the '''L''' will be increased by the double of the segment length. <br> |
− | The variable keeps track of the traveled path in cartesian space (X,Y,Z). The value is | ||
− | accumulative, which means that if a same line segment is traveled back and forth the | ||
− | L will be increased by the double of the segment length. | ||
− | Additionally the ratio between the traveled path and the length-of-the path variable L | + | Additionally, the ratio between the traveled path and the length-of-the path variable '''L''' can be changed for each movement separately. This means that user can assign a nodal ratio parameter for each movement differently. <br> |
− | can be changed for each movement separately. This means that user can assign a | ||
− | nodal ratio parameter for each movement differently. | ||
− | The L variable is available as external position (Ax.Pext) of an axis. The axis is an arbitrary axis | + | The '''L''' variable is available as external position (''Ax.Pext'') of an axis. The axis is an arbitrary axis that can be of the same robot or any external axis in the system.<br> |
− | that can be of the same robot or any external axis in the system. | ||
<br/> | <br/> | ||
− | [[File:cartesian gearing.png| Caption |Cartesian Gearing | | + | [[File:cartesian gearing.png| Caption |Cartesian Gearing |300px]] |
<br/> | <br/> | ||
Line 24: | Line 21: | ||
The following function are available for Cartesian Gearing Setup: | The following function are available for Cartesian Gearing Setup: | ||
− | '''CG_VER(0,0,0)''' Returns the current version number | + | {| border = "1" align="left" |
− | + | | align="center" |''' Function ''' | |
− | '''CG_STATUS(0,0,0)''' Prints on telnet connection internal CG status variables | + | | align="center" |'''Description ''' |
− | + | | align="center" |'''Notes ''' | |
− | '''CG_SET(int rid, int aid, int pf)''' Setting up CG relationship, if everything is OK a zero value is returned. | + | |- |
− | + | |'''CG_VER(0,0,0)''' | |
− | rid – robot ID | + | |Returns the current version number |
− | + | | | |
− | aid – axis ID | + | |- |
− | + | |'''CG_STATUS(0,0,0)''' | |
− | pf - integer value | + | |Prints on telnet connection internal CG status variables |
− | + | | | |
− | In order to get | + | |- |
− | + | |'''CG_SET(int rid, int aid, int pf)''' | |
− | '''CG_UNSET(int rbt_id, int axis_handle,0)''' Removing CG relationship, undoes the CG_SET | + | |Setting up CG relationship, if everything is OK a zero value is returned. |
− | + | | | |
− | '''CG_SET(int rbt_id, int value,0)''' Set the L to a new value (offset). The value given here is in | + | |- |
− | + | |'''rid''' – robot ID | |
− | '''CG_STOP (0,0,0)''' Stopping the CG process at the current value of L. '''Stopping is performed immediately, without deceleration profile''' | + | | |
− | + | |Available as ElementID group property | |
− | '''CG_START(0,0,0)''' Re-starting the CG process that was stopped by CG_STOP command | + | |- |
− | + | |'''aid''' – axis ID | |
− | '''CG_MOD(mod,0,0)''' Setting the CG mode (0 – command, default, 1- feedback) if the L variable is computed from the command (setpoint) or the feedback Cartesian coordinates (here). | + | | |
− | + | |Available as ElementID axis property | |
− | '''CG_MASK(mask,0,0)''' Defining the operational space in which L is computed. For example if mask = 1 then only changes in X coordinate will be included in computation of L. | + | |- |
− | Possible values | + | |'''pf''' - integer value |
− | + | |Returns the number of counts per one millimeter traveled path | |
− | + | |In order to get ''Pext'' in millimeters the same value should be assigned to '''pExtFac''' | |
+ | |- | ||
+ | |'''CG_UNSET(int rbt_id, int axis_handle,0)''' | ||
+ | |Removing CG relationship, undoes the '''''CG_SET'''''' | ||
+ | | | ||
+ | |- | ||
+ | |'''CG_SET(int rbt_id, int value,0)''' | ||
+ | |Set the '''L''' to a new value (offset). The value given here is in ''Pext'' counts | ||
+ | | | ||
+ | |- | ||
+ | |'''CG_STOP (0,0,0)''' | ||
+ | |Stopping the CG process at the current value of '''L'''. | ||
+ | |'''Stopping is performed immediately, without deceleration profile''' | ||
+ | |- | ||
+ | |'''CG_START(0,0,0)''' | ||
+ | |Re-starting the CG process that was stopped by '''''CG_STOP''''' command | ||
+ | | | ||
+ | |- | ||
+ | |'''CG_MOD(mod,0,0)''' | ||
+ | |Setting the CG mode (0 – command, default, 1- feedback) if the L variable is computed from the command (setpoint) or the feedback Cartesian coordinates (here). | ||
+ | | | ||
+ | |- | ||
+ | |'''CG_MASK(mask,0,0)''' | ||
+ | |Defining the operational space in which L is computed. | ||
+ | |align="left" |<u>For example</u>: if mask = 1 then only changes in X coordinate will be included in computation of '''L'''. <br> Possible values will be: | ||
{| {{table}} border = "1" | {| {{table}} border = "1" | ||
Line 76: | Line 97: | ||
|} | |} | ||
− | + | |} | |
== Multi Tool Cartesian Gearing == | == Multi Tool Cartesian Gearing == | ||
In case the robot has more than a single tool, then user can assign axis per tool. | In case the robot has more than a single tool, then user can assign axis per tool. | ||
+ | {| border = "1" align="left" | ||
+ | | align="center" |''' Function ''' | ||
+ | | align="center" |'''Description ''' | ||
+ | | align="center" |'''Notes ''' | ||
+ | |- | ||
+ | |'''CG_ASSIGN_TOOL(int axisHandle, SYS_POINT * pntTool)''' | ||
+ | |Tool number and offset. | ||
+ | |These offset are later used for calculating cartGear | ||
+ | |- | ||
+ | |'''CG_CLEAR_ALL_TOOLS(void)''' | ||
+ | |Set null value (zeros) in all tools | ||
+ | | | ||
+ | |} | ||
+ | |||
+ | |||
+ | ==Program Example== | ||
+ | {{Languages|Cartesian_Gearing}} | ||
+ | Here is an example of using cartesian gearing for Puma robot | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <syntaxhighlight lang="vb"> | ||
+ | '------------------------------------------------------------------------------ | ||
+ | ' File: Puma_CG.prg | ||
+ | ' Purpose: cartesian gearing example | ||
+ | ' Version: 1.00 | ||
+ | ' Author: Eran Korkidi | ||
+ | ' History: 25.JUL.2016 | ||
+ | '------------------------------------------------------------------------------ | ||
+ | |||
+ | import_c CG_VER (byval as long, byval as long, byval as long) as long | ||
+ | import_c CG_STATUS (byval as long, byval as long, byval as long) as long | ||
+ | import_c CG_SET (byval as long, byval as long, byval as long) as long | ||
+ | import_c CG_UNSET (byval as long, byval as long, byval as long) as long | ||
+ | import_c CG_MOD (byval as long, byval as long, byval as long) as long | ||
+ | import_c CG_STOP (byval as long, byval as long, byval as long) as long | ||
+ | import_c CG_START (byval as long, byval as long, byval as long) as long | ||
+ | import_c CG_MASK (byval as long, byval as long, byval as long) as long | ||
+ | |||
+ | |||
+ | dim shared lRobotID as long | ||
+ | dim shared laxisID as long | ||
+ | dim shared lResolution as long | ||
+ | dim shared lGearMode as long = 1 ' 1 = commmand, 0 = fbk | ||
+ | dim shared lDummy as long = 0 | ||
+ | |||
+ | dim shared jntStartPosition as joint of xyzypr = {0,45,0,0,45,0} | ||
+ | |||
+ | program | ||
+ | |||
+ | call cartesianGearSetup | ||
+ | call motionSetup | ||
+ | call executMotion | ||
+ | |||
+ | end program ' <MyTask>.prg | ||
+ | |||
+ | |||
+ | sub executMotion | ||
+ | |||
+ | dim dPrevA13position as double | ||
+ | dim dPath as double | ||
+ | |||
+ | Attach Puma | ||
+ | Attach A13 | ||
+ | Puma.En = ON | ||
+ | A13.En = ON | ||
+ | Move PUMA jntStartPosition Vcruise=PUMA.Vmax | ||
+ | call waitMotionGr | ||
+ | 'Move A13 0 Vcruise=A13.Vmax Abs=1 | ||
+ | call waitMotionAx | ||
+ | Sleep 1000 | ||
+ | A13.Slave = ON | ||
+ | Sleep 1000 | ||
+ | dPrevA13position = A13.Pcmd | ||
+ | Moves PUMA #{100,0,0,0,0,0} Vtran=100 Abs=OFF Upar=1 | ||
+ | call waitMotionGr | ||
+ | Moves PUMA #{-100,0,0,0,0,0} Vtran=100 Abs=OFF Upar=1 | ||
+ | call waitMotionGr | ||
+ | Moves PUMA #{100,0,0,0,0,0} Vtran=100 Abs=OFF Upar=1 | ||
+ | call waitMotionGr | ||
+ | Circle PUMA Angle=360 CircleCenter=jntStartPosition Vtran=100 Upar=1 | ||
+ | call waitMotionGr | ||
+ | Sleep 1000 | ||
+ | A13.Slave = OFF | ||
+ | dPath = A13.Pcmd - dPrevA13position | ||
+ | ? "Path = " dPath ", should be " A13.GearRatio*(100*3 + 2*100*PI) | ||
+ | Detach A13 | ||
+ | Detach Puma | ||
+ | |||
+ | end sub | ||
+ | |||
+ | |||
+ | sub cartesianGearSetup | ||
+ | |||
+ | lRobotID = PUMA.ElementId | ||
+ | laxisID = A13.ElementId | ||
+ | lResolution = 1E5 | ||
+ | |||
+ | |||
+ | ' ? CG_STOP(lDummy, lDummy, lDummy) | ||
+ | ? CG_VER(lDummy, lDummy, lDummy) | ||
+ | ? CG_STATUS(lDummy, lDummy, lDummy) | ||
+ | ? CG_MASK(0b111, 0, 0) ' xyz | ||
+ | ? CG_UNSET(lRobotID, laxisID, 0) | ||
+ | ? CG_SET(lRobotID, laxisID, lResolution) | ||
+ | ' ? CG_RESET(lRobotID, 0, 0) | ||
+ | ? CG_MOD(lGearMode, 0, 0) | ||
+ | |||
+ | end sub | ||
+ | |||
+ | |||
+ | sub motionSetup | ||
+ | |||
+ | dim i as long | ||
+ | dim genAxis as generic axis | ||
+ | |||
+ | for i = 1 to Sys.Naxes | ||
+ | genAxis = systemAxis(i) | ||
+ | genAxis.En = OFF | ||
+ | Attach genAxis | ||
+ | genAxis.Pedel = 2.0 | ||
+ | genAxis.PeMax = 10.0 | ||
+ | Detach genAxis | ||
+ | next | ||
+ | Attach A13 | ||
+ | A13.PextFac = lResolution | ||
+ | A13.MasterSource = A13.Pext | ||
+ | A13.GearRatio = 2 | ||
+ | A13.Slave = 0 | ||
+ | A13.Vmax = PUMA.Vmax | ||
+ | A13.Amax = A13.Vmax * 10.0 | ||
+ | A13.Dmax = A13.Vmax * 10.0 | ||
+ | A13.Jmax = A13.Amax * 10.0 | ||
+ | A13.Vcruise = A13.Vmax | ||
+ | A13.Acc = A13.Amax | ||
+ | A13.Dec = A13.Dmax | ||
+ | A13.Jerk = A13.Jmax | ||
+ | A13.Vospd = A13.Vmax * 1.2 | ||
+ | A13.Pfac = 1E6 / 360 | ||
+ | A13.Vfac = A13.Pfac / 1E3 | ||
+ | A13.Afac = A13.Pfac / 1E6 | ||
+ | A13.Jfac = A13.Pfac / 1E9 | ||
+ | Detach A13 | ||
+ | |||
+ | end sub | ||
+ | |||
+ | sub waitMotionGr | ||
+ | while PUMA.IsMoving | ||
+ | Sleep 1 | ||
+ | end while | ||
+ | end sub | ||
− | |||
− | + | sub waitMotionAx | |
+ | while A13.IsMoving | ||
+ | Sleep 1 | ||
+ | end while | ||
+ | end sub | ||
+ | </syntaxhighlight> | ||
[[Category:Motion Control|Motion Blending]] | [[Category:Motion Control|Motion Blending]] | ||
[[Category:Motion Blending|Blending]] | [[Category:Motion Blending|Blending]] |
Latest revision as of 10:13, 20 February 2018
Language: | English |
---|
Introduction
The Cartesian Gearing (CG) feature enables users to move additional axis proportionally to traveled path of the robot’s tool-tip.
Slaving an axis to it's Pext that is geared to the robot's incremental cartesian change - the path variable (L) in cartesian space is computed each motion sampling period.
The variable keeps track of the traveled path in cartesian space (X,Y,Z). The value is accumulative, which means that if a same line segment is traveled back and forth the L will be increased by the double of the segment length.
Additionally, the ratio between the traveled path and the length-of-the path variable L can be changed for each movement separately. This means that user can assign a nodal ratio parameter for each movement differently.
The L variable is available as external position (Ax.Pext) of an axis. The axis is an arbitrary axis that can be of the same robot or any external axis in the system.
User Functions
The following function are available for Cartesian Gearing Setup:
Function | Description | Notes | |||||||||||||||||||||||||||
CG_VER(0,0,0) | Returns the current version number | ||||||||||||||||||||||||||||
CG_STATUS(0,0,0) | Prints on telnet connection internal CG status variables | ||||||||||||||||||||||||||||
CG_SET(int rid, int aid, int pf) | Setting up CG relationship, if everything is OK a zero value is returned. | ||||||||||||||||||||||||||||
rid – robot ID | Available as ElementID group property | ||||||||||||||||||||||||||||
aid – axis ID | Available as ElementID axis property | ||||||||||||||||||||||||||||
pf - integer value | Returns the number of counts per one millimeter traveled path | In order to get Pext in millimeters the same value should be assigned to pExtFac | |||||||||||||||||||||||||||
CG_UNSET(int rbt_id, int axis_handle,0) | Removing CG relationship, undoes the CG_SET' | ||||||||||||||||||||||||||||
CG_SET(int rbt_id, int value,0) | Set the L to a new value (offset). The value given here is in Pext counts | ||||||||||||||||||||||||||||
CG_STOP (0,0,0) | Stopping the CG process at the current value of L. | Stopping is performed immediately, without deceleration profile | |||||||||||||||||||||||||||
CG_START(0,0,0) | Re-starting the CG process that was stopped by CG_STOP command | ||||||||||||||||||||||||||||
CG_MOD(mod,0,0) | Setting the CG mode (0 – command, default, 1- feedback) if the L variable is computed from the command (setpoint) or the feedback Cartesian coordinates (here). | ||||||||||||||||||||||||||||
CG_MASK(mask,0,0) | Defining the operational space in which L is computed. | For example: if mask = 1 then only changes in X coordinate will be included in computation of L. Possible values will be:
|
Multi Tool Cartesian Gearing
In case the robot has more than a single tool, then user can assign axis per tool.
Function | Description | Notes |
CG_ASSIGN_TOOL(int axisHandle, SYS_POINT * pntTool) | Tool number and offset. | These offset are later used for calculating cartGear |
CG_CLEAR_ALL_TOOLS(void) | Set null value (zeros) in all tools |
Program Example
Language: | English |
---|
Here is an example of using cartesian gearing for Puma robot
'------------------------------------------------------------------------------
' File: Puma_CG.prg
' Purpose: cartesian gearing example
' Version: 1.00
' Author: Eran Korkidi
' History: 25.JUL.2016
'------------------------------------------------------------------------------
import_c CG_VER (byval as long, byval as long, byval as long) as long
import_c CG_STATUS (byval as long, byval as long, byval as long) as long
import_c CG_SET (byval as long, byval as long, byval as long) as long
import_c CG_UNSET (byval as long, byval as long, byval as long) as long
import_c CG_MOD (byval as long, byval as long, byval as long) as long
import_c CG_STOP (byval as long, byval as long, byval as long) as long
import_c CG_START (byval as long, byval as long, byval as long) as long
import_c CG_MASK (byval as long, byval as long, byval as long) as long
dim shared lRobotID as long
dim shared laxisID as long
dim shared lResolution as long
dim shared lGearMode as long = 1 ' 1 = commmand, 0 = fbk
dim shared lDummy as long = 0
dim shared jntStartPosition as joint of xyzypr = {0,45,0,0,45,0}
program
call cartesianGearSetup
call motionSetup
call executMotion
end program ' <MyTask>.prg
sub executMotion
dim dPrevA13position as double
dim dPath as double
Attach Puma
Attach A13
Puma.En = ON
A13.En = ON
Move PUMA jntStartPosition Vcruise=PUMA.Vmax
call waitMotionGr
'Move A13 0 Vcruise=A13.Vmax Abs=1
call waitMotionAx
Sleep 1000
A13.Slave = ON
Sleep 1000
dPrevA13position = A13.Pcmd
Moves PUMA #{100,0,0,0,0,0} Vtran=100 Abs=OFF Upar=1
call waitMotionGr
Moves PUMA #{-100,0,0,0,0,0} Vtran=100 Abs=OFF Upar=1
call waitMotionGr
Moves PUMA #{100,0,0,0,0,0} Vtran=100 Abs=OFF Upar=1
call waitMotionGr
Circle PUMA Angle=360 CircleCenter=jntStartPosition Vtran=100 Upar=1
call waitMotionGr
Sleep 1000
A13.Slave = OFF
dPath = A13.Pcmd - dPrevA13position
? "Path = " dPath ", should be " A13.GearRatio*(100*3 + 2*100*PI)
Detach A13
Detach Puma
end sub
sub cartesianGearSetup
lRobotID = PUMA.ElementId
laxisID = A13.ElementId
lResolution = 1E5
' ? CG_STOP(lDummy, lDummy, lDummy)
? CG_VER(lDummy, lDummy, lDummy)
? CG_STATUS(lDummy, lDummy, lDummy)
? CG_MASK(0b111, 0, 0) ' xyz
? CG_UNSET(lRobotID, laxisID, 0)
? CG_SET(lRobotID, laxisID, lResolution)
' ? CG_RESET(lRobotID, 0, 0)
? CG_MOD(lGearMode, 0, 0)
end sub
sub motionSetup
dim i as long
dim genAxis as generic axis
for i = 1 to Sys.Naxes
genAxis = systemAxis(i)
genAxis.En = OFF
Attach genAxis
genAxis.Pedel = 2.0
genAxis.PeMax = 10.0
Detach genAxis
next
Attach A13
A13.PextFac = lResolution
A13.MasterSource = A13.Pext
A13.GearRatio = 2
A13.Slave = 0
A13.Vmax = PUMA.Vmax
A13.Amax = A13.Vmax * 10.0
A13.Dmax = A13.Vmax * 10.0
A13.Jmax = A13.Amax * 10.0
A13.Vcruise = A13.Vmax
A13.Acc = A13.Amax
A13.Dec = A13.Dmax
A13.Jerk = A13.Jmax
A13.Vospd = A13.Vmax * 1.2
A13.Pfac = 1E6 / 360
A13.Vfac = A13.Pfac / 1E3
A13.Afac = A13.Pfac / 1E6
A13.Jfac = A13.Pfac / 1E9
Detach A13
end sub
sub waitMotionGr
while PUMA.IsMoving
Sleep 1
end while
end sub
sub waitMotionAx
while A13.IsMoving
Sleep 1
end while
end sub