SINUMERIK 840D sl NC programming. Programming Manual (2020) - page 12

 

  Index      Manuals     SINUMERIK 840D sl NC programming. Programming Manual (2020)

 

Search            copyright infringement  

 

   

 

   

 

Content      ..     10      11      12      13     ..

 

 

 

SINUMERIK 840D sl NC programming. Programming Manual (2020) - page 12

 

 

Work preparation
3.13 Tool offsets
Advanced Surface / Top Surface
Note
When applying tool radius compensation CUT3DCC / CUT3DCCD in combination with the
"Advanced Surface" or "Top Surface" function (requiring a license), the setting
recommendations regarding "Advanced Surface" / "Top Surface" must be observed. Special test
programs are provided in the SIOS portal for checking the set data.
→ Test program for Advanced Surface / Top Surface (https://
support.industry.siemens.com/cs/ww/en/view/109738423)
3.13.6
Tool orientation (ORIC, ORID, OSOF, OSC, OSS, OSSE, ORIS, OSD, OST)
The term tool orientation describes the geometric alignment of the tool in space. The tool
orientation on a 5-axis machine tool can be set by means of program commands.
Z
Direction vector
X
Y
Orientation rounding movements activated with OSD and OST are formed differently depending
on the type of interpolation for tool orientation.
If vector interpolation is active, the smoothed orientation characteristic is also interpolated
using vector interpolation. On the other hand, if rotary axis interpolation is active, the
orientation is smoothed directly using rotary axis movements.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
767
Work preparation
3.13 Tool offsets
Programming
Programming a orientation change:
A change in tool orientation can be programmed by:
• Direct programming of rotary axes A, B, C (rotary axis interpolation)
• Euler or RPY angle
• Direction vector (vector interpolation by specifying A3 or B3 or C3)
• LEAD/TILT (face milling)
The reference coordinate system is either the machine coordinate system (ORIMKS) or the
current workpiece coordinate system (ORIWKS).
2ULHQWDWLRQ
FKDQJH
Programming tool orientation:
ORIC:
Orientation and path movement in parallel
ORID:
Orientation and path movement consecutively
OSOF:
No orientation smoothing
OSC:
Orientation constantly
OSS:
Orientation smoothing only at beginning of block
OSSE:
Orientation smoothing at beginning and end of block
ORIS:
Velocity of the orientation change with orientation smoothing activated in degrees per
mm (valid for OSS and OSSE)
OSD:
Smoothing of orientation by specifying smoothing distance with setting data:
SD42674 $SC_ORI_SMOOTH_DIST
OST:
Smoothing of orientation by specifying angular tolerance in degrees for vector interpo-
lation with setting data:
SD42676 $SC_ORI_SMOOTH_TOL
With rotary axis interpolation, the specified tolerance is assumed to be the maximum
variance of the orientation axes.
NC programming
768
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Note
All commands for smoothing the tool orientation (OSOF, OSC, OSS, OSSE, OSD, and OST) are
summarized in G group 34. They are modal; in other words, only one of these commands can
ever be effective at the same time.
Examples
Example 1: ORIC
If two or more blocks with orientation changes are programmed between the traversing blocks
N10 and N20 (e.g. A2=... B2=... C2=...) programmed and ORIC is active, then the
inserted circle block is distributed among these intermediate blocks according to the absolute
changes in angle.
N14
N20
N12
N10
Program code
Comment
ORIC
N8 A2=… B2=… C2=…
N10 X… Y… Z…
N12 C2=… B2=…
; The circle block inserted at the external corner is
distributed between N12 and N14, corresponding to the
N14 C2=… B2=…
change in orientation. The circular motion and the
orientation change are executed in parallel.
N20 X =…Y=… Z=… G1 F200
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
769
Work preparation
3.13 Tool offsets
Example 2: ORID
If ORID is active, then all blocks between the two traversing blocks are executed at the end of the
first traversing block. The circle block with constant orientation is executed immediately before
the second traversing block.
Perform N12 and N14
N20
N10
Program code
Comment
ORID
N8 A2=… B2=… C2=…
N10 X… Y… Z…
N12 A2=… B2=… C2=…
; The N12 and N14 blocks are executed at the end of N10.
The circle block is then executed with the actual orien-
tation.
N14 M20
; Help functions, etc.
N20 X… Y… Z…
Note
The method which is used to change orientation at an outer contour is determined using the
program command that is active in the first traversing block of an outer corner.
Without change in orientation: If the orientation is not changed at the block boundary, the
cross-section of the tool is a circle, which touches both of the contours.
NC programming
770
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Example 3: Change in orientation at an inside corner
N15
N12
N10
WRK
Program code
ORIC
N10 X …Y… Z… G1 F500
N12 X …Y… Z… A2=… B2=… C2=…
N15 X …Y… Z… A2=… B2=… C2=…
Further information
Behavior at outer corners
A circle block with the radius of the cutter is always inserted at an outside corner.
The ORIC and ORID program commands are used to determine whether changes in orientation
programmed between block N1 and N2 are executed before the inserted circle block is processed
or at the same time.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
771
Work preparation
3.13 Tool offsets
A circular block will be added
between block N1 and N2
N2
N1
R
If an orientation change is required at outside corners, this can be performed either at the same
time as interpolation or separately together with the path movement.
When ORID is programmed, the inserted blocks are executed first without path motion. The
circle block generating the corner is inserted immediately before the second of the two
traversing blocks.
If several orientation blocks are inserted at an external corner and ORIC is selected, the circular
motion is distributed among the individual inserted blocks according to the absolute values of
the orientation changes.
Smoothing orientation with OSD or OST
When blending with G642, the maximum variance for the contour axes and orientation axes
cannot vary greatly. The smaller tolerance of the two determines the type of smoothing motion
and/or angular tolerance to smooth the orientation characteristic relatively strongly without
having to accept higher contour deviations.
OSD and OST can be activated to "generously" smooth very slight deviations from the orientation
characteristics with a specified smoothing distance and angular tolerance without serious
contour deviations.
Note
Unlike the process of rounding the contour (and orientation characteristics) with G642, when
rounding the orientation with OSD and/or OST, a separate block is not formed, instead the
rounding movement is added directly to the programmed original blocks.
With OSD and/or OST, block transitions cannot be rounded if there is a change in the type of
interpolation for tool orientation (vector → rotary axis, rotary axis → vector). These block
transitions can if necessary be rounded with the standard rounding functions G641, G642
and G643.
NC programming
772
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
3.13.7
Free assignment of D numbers, cutting edge numbers
3.13.7.1
Free assignment of D numbers, cutting edge numbers (CE address)
D number
The D numbers can be used as offset numbers. The number of the cutting edge can also be
addressed via the CE address. The cutting edge number can be written by the system variable
$TC_DPCE.
Default setting: Compensation no. == cutting edge no.
Machine data are used to define the maximum number of D numbers (cutting edge numbers)
and the maximum number of cutting edges per tool (→ machine manufacturer). The following
commands are only practical if the maximum cutting edge number (MD18105) was specified to
be greater than the number of cutting edges per tool (MD18106). Observe the machine
manufacturer’s specifications.
Further information
Function Manual Tools
3.13.7.2
Free assignment of D numbers: Checking D numbers (CHKDNO)
Using the CKKDNO command, you can check whether the existing D numbers were uniquely
assigned. The D numbers of all tools defined within a TO unit may not occur more than once. No
allowance is made for replacement tools.
Syntax
state=CHKDNO(Tno1,Tno2,Dno)
Meaning
state:
=TRUE:
The D numbers are assigned uniquely to the checked
areas.
= FALSE:
There was a D number collision or the parameters are
invalid. Tno1, Tno2 and Dno return the parameters
that caused the collision. These data can now be eval-
uated in the part program.
CHKDNO(Tno1,Tno2):
All D numbers of the part specified are checked.
CHKDNO(Tno1):
All D numbers of Tno1 are checked against all other tools.
CHKDNO:
All D numbers of all tools are checked against all other tools.
3.13.7.3
Free assignment of D numbers: Rename D numbers (GETDNO, SETDNO)
You must assign unique D numbers. Two different cutting edges of a tool must not have the same
D number.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
773
Work preparation
3.13 Tool offsets
GETDNO
This command returns the D number of a particular cutting edge (ce) of a tool with tool number
t. If no D number exists for the entered parameters, d=0 will be set. If the D number is invalid,
a value greater than 32000 is returned.
SETDNO
This command assigns the value d of the D number to a cutting edge (ce) of tool t. The result of
this statement is returned via state (TRUE or FALSE). If there is no data block for the specified
parameter, the value FALSE is returned. Syntax errors generate an alarm. The D number cannot
be set explicitly to 0.
Syntax
d = GETDNO (t,ce)
state = SETDNO (t,ce,d)
Meaning
d:
D number of the tool edge
t:
T number of the tool
ce:
Cutting edge number (CE number) of the tool
state:
Indicates whether the command could be executed (TRUE or FALSE).
Example for renaming a D number
Programming
Comment
$TC_DP2[1.2]=120
$TC_DP3[1,2]
= 5.5
$TC_DPCE[1,2] = 3
; Cutting edge number CE
N10 def int DNoOld, DNoNew = 17
N20 DNoOld = GETDNO(1,3)
N30 SETDNO(1,3,DNoNew)
The new D value 17 is then assigned to cutting edge CE=3. Now the data for the cutting edge is
addressed via D number 17; both via the system variables and in the programming with the NC
address.
3.13.7.4
Free assignment of D numbers: Determine T number to the specified D number
(GETACTTD)
The pre-defined function GETACTTD determines the T number associated with an absolute D
number. There is no check for uniqueness. If several D numbers within a TO unit are the same,
the T number of the first tool found in the search is returned.
NC programming
774
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Syntax
<Status>=GETACTTD(<TNo>,<DNo>)
Meaning
GETACTTD():
Function call
<DNo>:
D number for which the T number shall be searched.
Data type:
INT
<TNo>:
T number found
Data type:
VAR INT
<status>:
Result
Data type:
INT
Value:
0
The T number was found. <Tno> contains the value of the T
number.
-1
No T number exists for the specified D number; <Tno>=0.
-2
The D number is not absolute. <TNo> receives the value of the
first tool found that contains the D number with the value
<Dno>.
-5
The function was not able to be executed for another reason.
3.13.7.5
Free assignment of D numbers: Invalidate D numbers (DZERO)
The DZERO command is used for support during retooling. Compensation data sets tagged with
this command are no longer verified by the CHKDNO command. These data sets can be accessed
again by setting the D number once more with SETDNO.
Syntax
DZERO
Meaning
DZERO:
Marks all D numbers of the TO unit as invalid.
3.13.8
Toolholder kinematics
Requirements
A toolholder can only orientate a tool in all possible directions in space if
• Two rotary axes V1 and V2 are present.
• The rotary axes are mutually orthogonal.
• The tool longitudinal axis is perpendicular to the second rotary axis V2.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
775
Work preparation
3.13 Tool offsets
In addition, the following requirement is applicable to machines for which all possible
orientations have to be settable:
• The tool longitudinal axis must be perpendicular to the first rotary axis V1.
Function
The toolholder kinematics with a maximum of two rotary axes v1 or v2 are defined using the 17
system variables $TC_CARR1[m] to $TC_CARR17[m]. The description of the toolholder consists
of:
• The vectoral distance from the first rotary axis of the toolholder I1, the vectoral distance
from the first rotary axis to the second rotary axis I2, the vectoral distance from the second
rotary axis to the reference point of the tool I3.
• The direction vectors of both rotary axes V1, V2.
• The angles of rotation α1, α2 around the two axes. The rotation angles are counted in viewing
direction of the rotary axis vectors, positive, in clockwise direction of rotation.
l1
V
1
¥Æ
1
l2
l
3
¥Æ
2
V
2
For machines with resolved kinematics (both the tool and the part can rotate), the system
variables have been extended with the entries $TC_CARR18[m] to $TC_CARR23[m].
Parameters
Function of the system variables for orientable toolholders
Designation
x component
y component
z component
l1 offset vector
$TC_CARR1[m]
$TC_CARR2[m]
$TC_CARR3[m]
l2 offset vector
$TC_CARR4[m]
$TC_CARR5[m]
$TC_CARR6[m]
v1 rotary axis
$TC_CARR7[m]
$TC_CARR8[m]
$TC_CARR9[m]
v2 rotary axis
$TC_CARR10[m]
$TC_CARR11[m]
$TC_CARR12[m]
NC programming
776
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Function of the system variables for orientable toolholders
α1 angle of rota-
$TC_CARR13[m]
tion
$TC_CARR14[m]
α2 angle of rota-
tion
l3 offset vector
$TC_CARR15[m]
$TC_CARR16[m]
$TC_CARR17[m]
Extensions of the system variables for orientable toolholders
Designation
x component
y component
z component
l4 offset vector
$TC_CARR18[m]
$TC_CARR19[m]
$TC_CARR20[m]
Axis identifier
Axis identifier of the rotary axes v1 and v2 (initialized with zero)
Rotary axis v1
$TC_CARR21[m]
Rotary axis v2
$TC_CARR22[m]
Kinematic type
$TC_CARR23[m]
Tool
Kinematics type T ->
Kinematics type P ->
Kinematics type M
Part
Only the tool can rotate
Only the part can rotate
Part and tool can rotate
Mixed mode
(default).
Offset of the
Angle in degrees of the rotary axes v1 and v2 on assuming the initial setting
Rotary axis v1
$TC_CARR24[m]
Rotary axis v2
$TC_CARR25[m]
Angle offset of
Offset of the Hirth tooth system in degrees for rotary axes v1 and v2
the rotary axis v1
$TC_CARR26[m]
Rotary axis v2
$TC_CARR27[m]
Angle increment
Offset of the Hirth tooth system in degrees for rotary axes v1 and v2
v1 rotary axis
$TC_CARR28[m]
v2 rotary axis
$TC_CARR29[m]
Min. position Ro-
Software limit for the minimum position of the rotary axes v1 and v2
tary axis v1
$TC_CARR30[m]
Rotary axis v2
$TC_CARR31[m]
Max. position Ro-
Software limits for the maximum position of the rotary axes v1 and v2
tary axis v1
$TC_CARR32[m]
Rotary axis v2
$TC_CARR33[m]
Toolholder name
A toolholder can be given a name instead of a number. $TC_CARR34[m]
User:
Intended use in user measuring cycles $TC_CARR35[m]
Axis name 1
$TC_CARR36[m]
Axis name 2
$TC_CARR37[m]
Identifier
$TC_CARR38[m]
$TC_CARR39[m]
$TC_CARR40[m]
Position
Fine
Parameters that can be added to the values
offset
in the basic parameters.
l1 offset vector
$TC_CARR41[m]
$TC_CARR42[m]
$TC_CARR43[m]
l2 offset vector
$TC_CARR44[m]
$TC_CARR45[m]
$TC_CARR46[m]
l3 offset vector
$TC_CARR55[m]
$TC_CARR56[m]
$TC_CARR57[m]
l4 offset vector
$TC_CARR58[m]
$TC_CARR59[m]
$TC_CARR60[m]
v1 rotary axis
$TC_CARR64[m]
v2 rotary axis
$TC_CARR65[m]
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
777
Work preparation
3.13 Tool offsets
Note
Explanations of parameters
"m" specifies the number of the toolholder to be programmed.
$TC_CARR47 to $TC_CARR54 and $TC_CARR61 to $TC_CARR63 are not defined and produce an
alarm if read or write access is attempted.
The start/end points of the distance vectors on the axes can be freely selected. The rotation
angles α1, α2 around the two axes are defined in the initial state of the toolholder by 0°. In this
way, the kinematics of a toolholder can be programmed for any number of possibilities.
Toolholders with only one or no rotary axis at all can be described by setting the direction vectors
of one or both rotary axes to zero.
With a toolholder without rotary axis the distance vectors act as additional tool offsets whose
components cannot be affected by a change of machining plane (G17 to G19).
Parameter extensions
Parameters of the rotary axes
The system variables have been extended by the entries $TC_CARR24[m] to $TC_CARR33[m]
and described as follows:
Offset of rotary axes
Changing the position of the rotary axis v1 or v2 for the initial setting of the
v1, v2
oriented toolholder.
The angle offset/
The offset or the angle increment of the Hirth tooth system of the rotary axes v1
angle increment of
and v2. Programmed or calculated angle is rounded up to the next value that
the rotary axes v1, v2
results from phi = s + n * d when n is an integer.
The minimum and
The minimum and maximum position of the rotary axis limit angle (software
maximum position
limit) of the rotary axes v1 and v2.
of the rotary axes v1,
v2
Parameters for the user
$TC_CARR34 to $TC_CARR40 contain parameters that are freely available to users and up to SW
6.4 were as standard, not further evaluated within the NCK or had no significance.
Fine offset parameters
$TC_CARR41 to $TC_CARR65 include fine offset parameters that can be added to the values in
the basis parameters. The fine offset value assigned to a basic parameter is obtained when the
value 40 is added to the parameter number.
NC programming
778
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Example
The toolholder used in the following example can be fully described by a rotation around the Y
axis.
z
z
Z Y
Y
Z
X
Y
X
X
X
Program code
Comment
N10 $TC_CARR8[1]=1
; Definition of the Y component of
the first rotary axis of toolholder
1.
N20 $TC_DP1[1,1] = 120
; Definition of a shaft miller.
N30 $TC_DP3[1,1]=20
; Definition of a shaft miller, 20
mm long.
N40 $TC_DP6[1,1]=5
; Definition of a shaft miller with
5 mm radius.
N50 ROT Y37
; Frame definition with 37° rota-
tion around the Y axis.
N60 X0 Y0 Z0 F10000
; Approach start position.
N70 G42 CUT2DF TCOFR TCARR=1 T1 D1 X10
Set radius compensation, tool
length compensation in rotated
frame, select toolholder 1, tool 1.
N80 X40
; Perform machining under a rota-
tion of 37°.
N90 Y40
N100 X0
N110 Y0
N120 M30
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
779
Work preparation
3.13 Tool offsets
Further information
Resolved kinematics
For machines with resolved kinematics (both the tool as well as the workpiece can be rotated),
the system variables have been expanded by the entries $TC_CARR18[m] up to
$TC_CARR23[m] and are described as follows:
The rotatable tool table consisting of:
• The vectorial clearance of the second rotary axis V2 to the reference point of a tool table that
can be rotated I4 of the third rotary axis.
The rotary axes consisting of:
• The two channel identifiers for the reference of the rotary axes V1and V2, whose position is,
when required, accessed to determine the orientation of the toolholder that can be
orientated.
The type of kinematics with one of the values T, P or M:
• Kinematics type T: Only tool can rotate.
• Kinematics type P: Only part can rotate.
• Kinematics type M: Tool and part can rotate.
Clearing the toolholder data
Data of all toolholder data sets can be deleted using $TC_CARR1[0]=0.
The kinematic type $TC_CARR23[T]=T must be assigned with one of the three permissible
uppercase or lowercase letters (T,P,M) and for this reason, should not be deleted.
Changing the toolholder data
Each of the described values can be modified by assigning a new value in the part program. Any
character other than T, P or M results in an alarm when an attempt is made to activate the
toolholder that can be orientated.
Reading the toolholder data
Each of the described values can be read by assigning it to a variable in the part program.
Fine offsets
An illegal fine offset value is only detected if a toolholder that can be orientated is activated,
which contains such a value and at the same time setting data
SD42974 $SC_TOCARR_FINE_CORRECTION = TRUE.
The maximum permissible fine offset is limited to a permissible value in the machine data.
NC programming
780
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
3.13.9
Tool length compensation for orientable toolholders (TCARR, TCOABS, TCOFR,
TCOFRX, TCOFRY, TCOFRZ)
As the spatial orientation of the tool carrier and thus of the tool changes, its tool length
components also change:
=
7
,
;
T
Tool carrier reference point
I1, I2
Tool length components
After a reset, e.g. through manual setting or change of the tool carrier with a fixed spatial
orientation, the tool length components also have to be determined again. The commands of G
group 42 "tool carrier" are used for this purpose.
Syntax
TCARR=<m>
TCOABS
TCOFR
TCOFRZ/TCOFRY/TCOFRX
Meaning
Element
Type
Meaning
TCARR=<m>
Address
Request tool carrier
<m>
Number of the tool carrier
TCOABS
G com-
Determine tool length components from the orientation of
mand
the current tool carrier
TCOFR
G com-
Determine tool length components from the orientation of
mand
the active frame
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
781
Work preparation
3.13 Tool offsets
Element
Type
Meaning
TCOFRZ/TCOFRY/
G com-
The TCOFRX/TCOFRY/TCOFRZ command assumes a tool orien-
TCOFRX
mand
ted in the corresponding direction (X/Y/Z) and calculates the
setting angles of the orientable tool carrier so that the tool in
the active frame is oriented in the same direction.
TCOFRZ
The tool oriented in the Z direction is aligned so
that it is also oriented in the Z direction in the
active frame.
TCOFRY
The tool oriented in the Y direction is aligned so
that it is also oriented in the Y direction in the
active frame.
TCOFRX
The tool oriented in the X direction is aligned so
that it is also oriented in the X direction in the
active frame.
Further information
Tool carrier selection (TCARR)
A tool carrier data block is connected to the tool carrier which describes its geometry. If a tool is
active at the time of tool carrier selection, it is assigned to the newly selected tool carrier and the
geometry data of the tool carrier take effect immediately. It is not necessary to change or re-
program the active tool. When a new tool is activated, it is treated as if it was mounted on the
active tool carrier.
With TCARR=0, the active tool carrier is deselected.
Note
The current geometry data of the tool carrier can also be defined in the NC program via the
corresponding system variables (see "Access to tool carrier data blocks").
Note
From the point of view of the control, tool carrier numbers <m> and tool numbers <n> can be
freely combined. In the real application, however, certain combinations can be ruled out for
machining or mechanical reasons. The control does not check whether the combinations make
sense.
Access to tool carrier data blocks
The current geometry data of a tool carrier can be accessed from the NC program as follows:
• Write:
$TC_CARR<n>[<m>]=<Value>
• Read:
<Value>=$TC_CARR<n>[<m>]
(<Value> must be a variable of data type REAL)
If the referenced tool carrier is not defined, an alarm is displayed.
NC programming
782
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Setting tool carrier data blocks to zero
All values of all tool carrier data blocks can be deleted from within the part program using one
command:
$TC_CARR1[0] = 0
Individual tool carrier data blocks can be selectively deleted using the predefined procedure
DELTC.
Effect of tool carrier selection
A tool carrier becomes effective when both a tool carrier and a tool have been activated. The
selection of the tool carrier alone has no effect.
The effect of a tool carrier selection depends on the command from the G group 42 (tool carrier),
which was programmed together with TCARR.
Changing the G command from this group causes the tool length components to be recalculated
when a tool carrier is active.
Calculating the tool length compensation from the tool carrier orientation (TCOABS)
TCOABS calculates the tool length compensation from the current orientation angles of the tool
carrier, stored in the system variables $TC_CARR13 and $TC_CARR14. The considered
orientation is independent of the orientation of the active frame.
For the definition of the tool carrier kinematics with system variables, see Chapter "Tool carrier
kinematics (Page 775)" in the NC Programming Manual.
Determining the tool length components from the orientation of the active frame (TCOFR)
With TCOFR, the orientation angles of the tool carrier are determined from the orientation of the
active frame. The values stored in the tool carrier data are not changed, however. These are also
used to resolve the ambiguity that can arise when calculating the rotation angles from a frame
(see following paragraph).
Ambiguities
With two axes, a particular tool orientation defined by the frame can generally be set with two
different rotation angle pairs. Of these two possible positions, the control selects the one in
which the rotation angles are as close as possible to the programmed rotation angles.
Note
In cases where ambiguity may occur, it is usually necessary to store the angles to be expected
from the frame in the tool carrier data.
Tool orientation in the active frame (TCOFRZ/TCOFRY/TCOFRX)
The TCOFRX/TCOFRY/TCOFRZ command assumes an orientation in the X/Y/Z direction for
calculating the tool carrier's setting angles, regardless of the active orientation. The selection of
the machining plane (G17/G18/G19) does not affect the orientation in the active frame.
However, it has an influence on the calculation of the tool length compensation.
Frame change
The user can change the frame after selecting the tool. This does not have any effect on the tool
length compensation components.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
783
Work preparation
3.13 Tool offsets
The rotation angles stored in the tool carrier data are not affected by the rotation angles defined
with frames. When changing from TCOFR to TCOABS, the original (programmed) angles of
rotation in the tool carrier data is reactivated.
Recalculation of the tool length compensation
To recalculate the tool length compensation after a frame change, the tool must be selected
again. When the tool length compensation is calculated, the angle of rotation of the tool carrier
is calculated in an intermediate step. Since tool carriers with two axes of rotation generally have
two rotation angle pairs with which the tool orientation can be adapted to the active frame, the
rotation angle values stored in the tool carrier data must at least approximately correspond to
the mechanically set rotation angles.
Note
In virtually any case where ambiguities may arise, it is necessary to store the approximate angle
expected from the frame in the tool carrier data.
Note
The tool orientation must be manually adapted to the active frame.
Note
The control system cannot check the angles of rotation calculated via the frame orientation for
adjustability on the machine. If the machine is designed in such a way that the axes of rotation
of the tool carrier cannot reach the tool orientation calculated by the frame orientation, an alarm
is output.
Note
The combination of tool precision compensation and the functions for tool length offset on
movable tool carriers is not permissible. If both functions are called simultaneously, an error
message is issued.
Note
With TOFRAME (Page 333) it is possible to define a frame based on the orientation direction of
the selected tool carrier.
NC programming
784
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Note
When orientation transformation is active (3, 4 or 5-axis transformation), it is possible to select
a tool carrier with an orientation deviating from the zero position without causing output of an
alarm.
Note
With an active frame without rotation, orientation with TCOFRX/TCOFRY/TCOFRZ leads to a trivial
solution, since the tool orientation already points in the X/Y/Z direction.
Orientation in the Z direction (TOFRAME)
With the TOFRAME command of the G group 53 (tool-related frame rotation), it is possible to
define a frame whose Z direction is aligned in parallel to the orientation direction of the selected
tool carrier.
If no tool carrier or a tool carrier without orientation change is active, then the Z direction in the
new frame is as follows:
• The same as the old Z direction with G17.
• The same as the old Y direction with G18.
• The same as the old X direction with G19.
Transfer parameter from standard and measuring cycles
For the transfer parameter of standard and measuring cycles, the following defined value ranges
apply.
For angle values, the following value ranges are defined:
Rotation around ...
Value range
1st geometry axis
-180° ≤ angle ≤ +180°
2nd geometry axis
-90° ≤ angle ≤ +90°
3rd geometry axis
-180° ≤ angle ≤ +180°
Note
When transferring angular values to a standard or measuring cycle, the following should be
carefully observed:
Values smaller than the computational accuracy of the NC must be rounded to zero!
The calculation resolution of the NC for angular positions is defined in the machine data:
MD10210 $MN_INT_INCR_PER_DEG
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
785
Work preparation
3.13 Tool offsets
3.13.10
Modifying the orientable tool carrier according to the machine measurement
(CORRTC)
Measured kinematic chain elements of a tool carrier can be written to special correction
elements with the CORRTC function.
Note
The correction values written with the CORRTC function are not immediately effective in the tool
carrier. The correction values only become active after deselecting the tool carrier, NEWCONF
and selecting the tool carrier.
Syntax
<_Corr_Status> = CORRTC(<_Corr_Vect>, <_Corr_Index>, <_Corr_Mode>,
[ <_No_Alarm>])
Meaning
CORRTC:
Function call
<_Corr_Status>:
Function return value
Data type:
INT
Values:
0
The function was executed without an error.
1
No tool carrier is active.
2
The active tool carrier was not defined with kinematic chains.
10
The <_Corr_Index> call parameter is negative.
11
The <_Corr_Mode> call parameter is negative.
12
Invalid reference to a section of a subchain (_CORR_INDEX).
13
No correction element has been defined in the section referred to by the
_CORR_INDEX parameter ($TC_CARR_CORR_ELEM).
20
The hundreds position of <_CORR_MODE> is invalid. Only the values 0 and 1
are permissible.
21
The thousands position of <_CORR_MODE> is invalid. Only the values 0 and
1 are permissible.
30
For the correction of an offset vector, the deviation from the current value in
at least one coordinate is greater than the maximum value specified by the
setting data SD41612 $SN_CORR_TRAFO_LIN_MAX.
31
The attempt to write a system variable was rejected because of missing write
rights.
<_Corr_Vect>:
Correction vector
The content of the correction vector is defined by the following parameters <_Corr_Index>
and <_Corr_Mode>.
If <_Corr_Status> = 30, the content of the vector is overwritten (see above).
Data type:
REAL
<_Corr_Index>:
Designates the section for which the direction vector of the correction element is to be corrected.
Data type:
INT
NC programming
786
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
<_Corr_Mode>:
Correction mode
Data type:
INT
The <Corr_Index> parameter is decimal coded (unit to thousands position):
Unit
Reserved
position:
Tens
Specifies how the correction element to which the content of <_Corr_Index>
position:
refers, is to be modified.
xx0x
The correction vector is written immediately to the correction element.
This variant can be used to immediately write the correction element
without the index <n> of the relevant system data
($NK_OFF_DIR[<n>, ...]) having to be known.
xx1x
As 0, but with the difference that the transferred correction value is in-
terpreted in world coordinates.
A difference between variants 0 and 1 can always occur when the kine-
matic chain in the initial state (positions of all rotary axes equal to 0)
contains other rotations.
xx2x
As 1, but with the difference that the correction value refers to the entire
section, i.e. a value is entered in the correction element so that the entire
section reaches the length defined by the correction value.
Hundreds
Specifies how the content of the <_Corr_Vect> parameter is to be interpreted.
position:
x0xx
The transferred correction vector <_Corr_Vect> contains the entire
new length of the correction element or the section to which
the <_Corr_Index> in conjunction with the tens position
of <_Corr_Mode> refers (absolute correction).
x1xx
The transferred correction vector <_Corr_Vect> only contains the dif-
ference compared to the current length of the correction element or the
section to which the <_Corr_Index> in conjunction with the tens po-
sition of <_Corr_Mode> refers (incremental correction).
Thousands
Determines whether or not the maximum permissible correction is to be limited by
position:
the setting data $SN_ CORR_TOCARR_LIN_MAX.
0xxx
Threshold value monitoring is active.
1xxx
The threshold value monitoring is suppressed.
<_No_Alarm>:
Response in the event of an error (return value > 0) (optional)
Data type:
BOOL
Value:
FALSE (de-
In the event of an error, the program execution is stopped and an
fault)
alarm displayed.
TRUE
In the event of an error, the program processing is not stopped and no
alarm is displayed.
Application: User-specific response corresponding to the return value
Further information about CORRTC
The kinematic structure of a tool carrier is described by one (type T and type P) or two (type M)
kinematic chains (subchains), which start from the associated reference point, machine zero or
tool carrier reference point). One of the two chains, the tool chain, ends at the reference point
of the tool, the other chain, the workpiece chain ends in the zero point of the basic coordinate
system.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
787
Work preparation
3.13 Tool offsets
The CORRTC function writes axis directions for machines with tool carriers in special correction
elements. A kinematic chain is described, for example, with elements of the type OFFSET, which
are defined via $ NK_TYPE.
CORRTC works with sections
The two subchains can each be divided into a maximum of four sections:
• Section 1 begins at the starting point of the chain and ends at the first rotary axis.
• Section 2 is the section between rotary axis 1 and rotary axis 2.
• Section 3 is the section between rotary axis 2 and the end of the chain.
The following figure shows an orientable tool carrier with 2 rotary axes.
,
6HFWLRQ
:RUNSLHFH UHIHUHQFH SRLQW
ZRUNSLHFH FKDLQ (QG SRLQW
RI NLQHPDWLF FKDLQ
,
6HFWLRQ
,
6HFWLRQ
Y
˞
Y
˞
=HUR SRLQW RI WKH ZRUOG
FRRUGLQDWH V\VWHP
Figure 3-11
CORRTC example
The sections are clearly defined: If the kinematic subchain is executed from its starting point to
its end point, then the first section has the index 1, next has index 2, and so on.
Correction elements
A reference can be made to a constant kinematic chain element (chain element of the type
$NK_TYPE[<n>] = "OFFSET") in each of these sections with the $TC_CARR_CORR_ELEM [, 0 ... 3]
system variables. The correction values determined during the machine measurement are
written to the so designated elements with the CORRTC function.
The sequence of references in $TC_CARR_CORR_ELEM[m, 0 ... 3] must correspond to the
sections described above, that is there can only be one chain element in
$TC_CARR_CORR_ELEM[m, 0] which belongs to the offset vector l1, etc.
The reference value is always the corresponding value effective in the tool carrier active when
CORRTC is called. After selection of the tool carrier, changed contents of the stored kinematic
data have no effect on the method of operation of the CORRTC function.
3.13.11
Online tool length compensation (TOFFON, TOFFOF)
Use the system variable $AA_TOFF[<n> ] to overlay the effective tool lengths in accordance with
the three tool directions three-dimensionally in real time.
NC programming
788
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
The three geometry axis identifiers are used as index <n>. Thus, the number of active direction
offsets is determined by the geometry axes that are active at the same time.
All offsets can be active at the same time.
The online tool length offset function can be used for:
• Orientation transformation TRAORI
• Orientable toolholder TCARR
Note
Online tool length offset is an option, which must be enabled in advance. This function is
only practical in conjunction with an active orientation transformation or an active
orientable toolholder.
Syntax
TRAORI
TOFFON(<compensation direction>[,<offset value>])
WHEN TRUE DO $AA_TOFF[<compensation direction>]
; In synchronized actions.
TOFFOF(<compensation direction>)
Meaning
TOFFON:
Activate online tool length offset
<compensation
Tool direction (X, Y, Z), in which the online tool length
direction>:
offset should be active.
<offset value>:
When activating, an offset value can be specified for
the relevant direction of compensation and this is im-
mediately recovered.
TOFFOF:
Reset online tool length offset
The compensation values in the specified compensation direction are reset and a pre-
processing stop is initiated.
Examples
Example 1: Selecting the tool length compensation
Program code
Comment
MD21190 $MC_TOFF_MODE = 1
; Absolute values are approached.
MD21194 $MC_TOFF_VELO[0] =1000
MD21196 $MC_TOFF_VELO[1] =1000
MD21194 $MC_TOFF_VELO[2] =1000
MD21196 $MC_TOFF_ACCEL[0] =1
MD21196 $MC_TOFF_ACCEL[1] =1
MD21196 $MC_TOFF_ACCEL[2] =1
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
789
Work preparation
3.13 Tool offsets
Program code
Comment
N5 DEF REAL XOFFSET
N10 TRAORI(1)
; Transformation on.
N20 TOFFON(Z)
; Activation of online tool length
compensation for the Z tool direc-
tion.
N30 WHEN TRUE DO $AA_TOFF[Z]=10 G4 F5
; A TLC of 10 is interpolated for the
Z tool direction.
N100 XOFFSET=$AA_TOFF_VAL[X]
; Assigns actual compensation in the
X direction.
N120 TOFFON(X,-XOFFSET) G4 F5
; For the X tool direction, the TLC
is reduced back to 0.
Example 2: Deselect the tool length offset
Program code
Comment
N10 TRAORI(1)
; Transformation on.
N20 TOFFON(X)
; Activation of online tool length
compensation for the X tool direc-
tion.
N30 WHEN TRUE DO $AA_TOFF[X]=10 G4 F5
; A TLC of 10 is interpolated for the
X tool direction.
N80 TOFFOF(X)
; Position offset of the X tool di-
rection is deleted:
...$AA_TOFF[X]=0
No axis is moved.
The position offset is added to the
actual position in the Work corre-
sponding to the
actual orientation.
Further information
Block preparation
During block preparation in preprocessing, the current tool length offset active in the main run
is also taken into consideration. To allow extensive use to be made of the maximum permissible
axis velocity, it is necessary to stop block preparation with a STOPRE preprocessing stop while a
tool offset is established.
The tool offset is always known at the time of run-in when the tool length offsets are not changed
after program start or if more blocks have been processed after changing the tool length offsets
than the IPO buffer can accommodate between run-in and main run.
NC programming
790
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Variable $AA_TOFF_PREP_DIFF
The dimension for the difference between the currently active compensation in the interpolator
and the compensation that was active at the time of block preparation can be polled in the
variable $AA_TOFF_PREP_DIFF[<n>].
Adjusting machine data and setting data
The following system data is available for online tool length offset:
• MD20610 $MC_ADD_MOVE_ACCEL_RESERVE (acceleration margin for overlaid motion)
• MD21190 $MC_TOFF_MODE
Content of system variable $AA_TOFF[<n>] is moved through as absolute value or is
integrated up.
• MD21194 $MC_TOFF_VELO (velocity of the online tool length offset)
• MD21196 $MC_TOFF_ACCEL (acceleration of the online tool length offset)
• Setting data for presetting limit values
:
SD42970 $SC_TOFF_LIMIT (upper limit of the tool length offset value)
3.13.12
Modification of the offset data for rotatable tools
3.13.12.1
Calculating orientations (ORISOLH)
The predefined ORISOLH function helps the user to set the rotary axis positions of a machine so
that a turning tool can be brought into a defined, kinematic-independent position relative to the
workpiece. Prerequisite is that a 6-axis transformation is active that has been parameterized
with kinematic chains.
Two basic functions are available:
• Tool alignment
The β and γ angles are specified. The function calculates the angles of the three orientation
axes required for this.
• Direct tool alignment
The angles of the second and third orientation axes are specified. The function calculates the
associated β and γ angles as well as that of the missing first orientation axis.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
791
Work preparation
3.13 Tool offsets
Note
Order of the orientation axes
If you run through the kinematic chain that describes the structure of the machine, from the
workpiece to the tool, then the following specifications apply for the order of the three
orientation axes of a 6-axis transformation:
• The orientation axis that is closest to the workpiece is the first orientation axis.
• The orientation axis that is closest to the tool is the third orientation axis.
Generally, the first orientation axis is a spindle and the corresponding rotation is therefore
implemented in these cases through a rotating frame.
Syntax
<RetVal> = ORISOLH(<Cntrl>,<W1>,<W2>)
NC programming
792
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Meaning
ORISOLH:
Function call
<RetVal>:
Function return value
Data type:
INT
Range of values:
0, -2, -3, ..., -17
Values:
0
Function has ended without an error.
-2
No valid transformation (6-axis orientation transformation) is
active.
-3
The first parameter (<Cntrl>) is negative.
-4
The unit position of the first parameter (<Cntrl>) is invalid.
Only the values 0 and 1 are permissible.
-5
The tens position of the first parameter (<Cntrl>) is invalid.
Only the values 0 to 3 are permissible.
-6
The hundreds position of the first parameter (<Cntrl>) is inva-
lid.
Only the values 0 and 1 are permissible.
-7
The thousands position of the first parameter (<Cntrl>) is in-
valid.
Only the values 0 to 3 are permissible.
-8
Angle γ is too large for the "Direct tool alignment" function.
-9
At least one of the specified axis positions violates an axis limit
for the "Direct tool alignment" function.
-10
No tool is active.
-11
The requested orientation cannot be set.
-12
The adaptation of the free axis angle for the Hirth joint is not
possible for the first or only solution.
-13
The adaptation of the free axis angle for the Hirth joint is not
possible for the second solution.
-14
The adaptation of the free axis angle for the Hirth joint is not
possible for either of the two solutions.
-15
The first orientation axis is parameterized as Hirth axis.
-16
The second as well as the third rotary axis has been parame-
terized as Hirth axis. Only one of the two axes can be the Hirth
axis.
-17
At least one of the specified axis positions is not compatible
with the associated Hirth joint for the "Swivel directly" func-
tion.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
793
Work preparation
3.13 Tool offsets
<Cntrl>:
Controls the behavior of the function
Data type:
INT
The <Cntrl> parameter is decimal coded (unit to thousands position):
Unit position:
The unit position controls the response to errors.
xxx0
In the event of an error (return value < 0), alarm 14106 is
output and program processing is aborted.
Note:
The alarm is also output irrespective of the value of the unit
position when the <Cntrl> parameter is negative.
xxx1
In the event of an error (return value < 0) no alarm is output.
The user can react suitably in the program.
Tens position:
Controls the behavior when an orientation axis with Hirth joint is
present.
Note:
This parameter is only evaluated for the "Tool alignment" function (i.e.
when the hundreds position has the value "0").
xx0x
The axis position is rounded off to the nearest position.
xx1x
The axis positions are rounded off so that the difference of
the β angle to its programmed value is minimal.
xx2x
The axis positions are rounded off so that the β angle is equal
to the highest possible value which is less than the program-
med value (β is rounded down).
xx3x
The axis positions are rounded off so that the β angle is equal
to the lowest possible value which is greater than the pro-
grammed value (β is rounded up).
Hundreds posi-
Specifies which function is to be executed or the significance of the
tion:
two following parameters <W1> and <W2>.
x0xx
"Tool alignment" function
Parameters <W1> and <W2> have the following meaning:
• <W1> = β
• <W2> = γ
The associated angles of the orientation axes are calculated.
x1xx
"Direct tool alignment" function
<W1> is the position specification for the second orientation
axis, <W2> is the position specification for the third orienta-
tion axis of a 6-axis transformation. The position of the first
orientation axis and the β and γ angles are defined which are
compatible with the two position specifications.
If no error occurs, two solutions are always output in the
$P_ORI_POS[<n>, <m>] system variables. The first index <n>
(0 or 1) refers to the solution and the second index <m>
(0 ... 2) to the orientation axis:
• $P_ORI_POS[0/1, 0]: Position of the first orientation axis
• $P_ORI_POS[0/1, 1]: Angle β
• $P_ORI_POS[0/1, 2]: Angle γ
A check is made as to whether the position specifications
<W1> and <W2> are compatible with any Hirth joints or active
software limits. If this is not the case, a corresponding error
number is returned (see <RetVal> parameter).
NC programming
794
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
If the angles <W1> and <W2> are selected arbitrarily, the cut-
ting edge of the tool is generally not in the machining plane.
The angle γ through which the cutting edge is rotated out of
the machining plane, must not be greater than the limit value
which is defined by the setting data SD42999 $SC_ORI-
SOLH_INCLINE_TOL.
Thousands posi-
Specifies which positions of the solutions may be modified when the
tion:
hundreds position has the value "0", i.e. for the "Tool alignment" func-
tion.
0xxx
The calculated axis positions should be as close as possible to
the current machine axis positions.
1xxx
The calculated axis positions for modulo axes should be as
close as possible to the middle of the modulo range, for other
axes as close as possible to 0. For non-modulo axes, this
means that the axis positions are reduced to the range
-180° … +180°.
2xxx
The calculated axis positions should be reduced to the range
-180° … +180° irrespective of the axis type.
<W1>:
First angle
The meaning results from the hundreds position of the <Cntrl> paramter.
Data type:
REAL
<W1>:
Second angle
The meaning results from the hundreds position of the <Cntrl> paramter.
Data type:
REAL
Note
Parameters that have not been programmed have the default value "0".
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
795
Work preparation
3.13 Tool offsets
Further information
The number of solutions found together with further status information when executing the
ORISOLH function, can be read via the following system variables:
System variable
Meaning
$P_ORI_POS
Returns the angles of the orientation axes that result from the orientation program-
[<n>, <m>]
ming.
<n>:
Index of the solution
Range of values:
0, 1
<m>:
Index of the orientation axis
Range of values:
0 ... 2
The order of the orientation axes (1 ... 3) refers to the
definition of the axes in $NT_ROT_AX_NAME.
When the ORISOLH function is called in the "Direct tool alignment" mode, the
$P_ORI_POS[0/1, 1] and P_ORI_POS[0/1, 2] variables contain the values of the two
angles β and γ belonging to the two solutions.
The first solution entered in $P_ORI_POS[<n>, <m>], i.e. with the index <n> = 0, is
always the solution that is selected by the control when the requested orientation is
approached directly. The second index <m> refers to the orientation axis, i.e. on
$NT_ROT_AX_NAME.
The axis positions entered in $P_ORI_POS[<n>, <m>] take into account the offsets
entered in $NK_OFF and $NK_OFF_FINE, i.e. these axis angles can be used in the
following blocks to set the required orientation without any further modification.
If a rotary axis is a Hirth axis, the solution positions are rounded off to the nearest
position of rest of the Hirth joint. For Hirth jointed rotary axes, you can read the
differences between the axis positions for the exact solutions and those of the solu-
tions adapted to the Hirth incrementing in the $P_ORI_DIFF system variable.
$P_ORI_DIFF
Returns the difference between the exact positions of the orientation axes and those
[<n>, <m>]
provided in $P_ORI_POS that result from the orientation programming.
<n>:
Index of the solution
Range of values:
0, 1
<m>:
Index of the orientation axis
Range of values:
0 ... 2
The order of the orientation axes (1 ... 3) refers to the
definition of the axes in $NT_ROT_AX_NAME.
The content can only be not equal to zero when the positions are incremented (Hirth
joint), i.e. when the system data $NT_HIRTH_INCR of the relevant axis is not equal to
zero and when this axis is a manual rotary axis.
NC programming
796
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
System variable
Meaning
$P_ORI_SOL
If for an orientation transformation with more than one orientation axis, the axis
angles are calculated that should result in a specified orientation, there is generally
more than one solution. The $P_ORI_SOL system variables contain the number of
valid solutions together with additional status information.
The content of $P_ORI_SOL is coded as follows:
Values < 0
General error states
-1
No solutions have been calculated yet for the active transfor-
mation (missing call of ORISOLH).
-2
A transformation is not active, or the active transformation is
not an orientation transformation (6-axis transformation) that
can provide positions for a specified orientation programming.
-4
The desired orientation cannot be set with the present kine-
matics.
-5
No solution was found when the ORISOLH function was called
in the "Direct tool alignment" mode.
-6
Angle γ is too large when the ORISOLH function was called in
the "Direct tool alignment" mode.
-7
An angle was specified when the ORISOLH function was called
in the "Direct tool alignment" mode that cannot be set because
of the Hirth joint.
-8
The first orientation axis (frame axis) must not be parameter-
ized as Hirth axis.
-9
The second as well as the third rotary axis has been parame-
terized as Hirth axis. Only one of the two axes can be the Hirth
axis.
-10
No adaptation of the solution(s) to the Hirth joint has been
found.
Values > 0
Number of mathematically possible solutions without consideration
of axis limits and any error conditions.
Unit position
0
There is no solution, i.e. the requested orientation cannot be
set.
There can be three different causes for this case:
• In principle, the requested orientation cannot be achieved
because of the machine kinematics (orientation axes not
arranged at right angles) even with an arbitrary traversing
range of the orientation axes. In this case, the tens and
hundreds positions of $P_ORI_SOL are both zero, the
$P_ORI_STAT status variables assigned to the orientation
axis have the value "-4".
• The calculated solutions cannot be achieved because they
would violate the axis limits. The positions of the orienta-
tion axes that would result without the axis limits, can be
read in $P_ORI_POS.
• Axis positions were specified when the ORISOLH function
was called in the "Direct tool alignment" mode which would
result in either the orientation vector or the orientation
normal vector of the tool being aligned parallel to the first
orientation axis, whose position is to be calculated. The
position of this axis is not defined in these cases.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
797
Work preparation
3.13 Tool offsets
System variable
Meaning
1
There is a solution.
There can be three different causes for this case:
• Based on the specified orientation and the machine kine-
matics, there is only one solution (from the mathematical
point of view, two coinciding solutions) even without con-
sideration of the axis limits. This case occurs at the edge of
the orientation range for kinematics that are not at right
angles. $P_ORI_POS contains both (identical) solutions.
• There is only one solution because a second solution is in-
valid due to the violated axis limits. The valid solution is
always the first solution in $P_ORI_POS. The second solu-
tion which would result when the axis limits are not taken
into account, can also be read in $P_ORI_POS.
• This is the normal case when the ORISOLH function is called
in the "Direct tool alignment" mode. For the specified axis
positions of two orientation axes, there is generally only
one valid position for the missing orientation axis to be
calculated.
2
There are two solutions.
8
There are an infinite number of solutions, i.e. the position of an
orientation axis (the polar axis) is arbitrary. However, from the
two possible positions of the other axes, one is excludes be-
cause of the violated axis limits.
9
There are an infinite number of solutions, i.e. the position of an
orientation axis (the polar axis) is indefinite. The indefinite axis
can be determined from the hundreds position or from the
$P_ORI_STAT system variable.
Values > 0
Bit-coded display for violated axis limits. The precise cause of the error
can be determined from the $P_ORI_STAT system variable.
Tens posi-
tion
Bit 0 (value 10):
For at least one solution, at least one axis limit of
the first orientation axis is violated.
Bit 1 (value 20):
For at least one solution, at least one axis limit of
the second orientation axis is violated.
Bit 2 (value 40):
For at least one solution, at least one axis limit of
the third orientation axis is violated.
Values > 0
Bit-coded display for non-defined axis positions (can only occur when
there is an infinite number of solutions, i.e. when the unit position is
Hundreds
equal to "9").
position
Bit 0 (value 100):
The position of the first orientation axis is not de-
fined.
Bit 1 (value 200):
The position of the second orientation axis is not
defined.
Bit 2 (value 400):
The position of the third orientation axis is not
defined.
The designations first, second and third orientation axis refer to the definition of the
axes in $NT_ROT_AX_NAME.
NC programming
798
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
System variable
Meaning
$P_ORI_STAT
Returns the status for each of the maximum three orientation axes after ORISOLH has
[<n>]
been called.
<n>:
Index of the orientation axis
(correspnds to the index of the relevant orientation axis in
$NT_ROT_AX_NAME)
Range of values:
0 ... 2
The order of the orientation axes (1 ... 3) refers to the
definition of the axes in $NT_ROT_AX_NAME.
The content of $P_ORI_STAT is coded as follows:
Values < 0
General error states
-1
The status is not defined (missing call of ORISOLH).
-2
A transformation is not active, or the active transformation is
not an orientation transformation (6-axis transformation) that
can provide positions for a specified orientation programming.
-3
The axis is not included in the active transformation.
-4
The position of the axis cannot be calculated because the re-
quested orientation cannot be achieved with the present kin-
ematics even with an arbitrary assumed traversing range of the
axis.
-5
Axis positions were specified when the ORISOLH function was
called in the "Direct tool alignment" mode which would result
in either the orientation vector or the orientation normal vector
of the tool being aligned parallel to the first orientation axis,
whose position is to be calculated. The position of this axis is
not defined in these cases.
-6
Angle γ is too large when the ORISOLH function was called in
the "Direct tool alignment" mode.
-7
An angle was specified when the ORISOLH function was called
in the "Direct tool alignment" mode that cannot be set because
of the Hirth joint.
-8
The first orientation axis (frame axis) must not be parameter-
ized as Hirth axis.
-9
The second as well as the third rotary axis has been parame-
terized as Hirth axis. Only one of the two axes can be the Hirth
axis.
-10
No adaptation of the solution(s) to the Hirth joint has been
found.
Values > 0
Bit-coded display for violated axis limits of the first solution.
Unit position
Bit 0 (value 1):
The first solution violates the lower axis limit.
Bit 1 (value 2):
The first solution violates the upper axis limit.
Values > 0
Bit-coded display for violated axis limits of the second solution.
Tens posi-
Bit 0 (value 10):
The second solution violates the lower axis limit.
tion
Bit 1 (value 20):
The second solution violates the upper axis limit.
Values > 0
Display of a non-defined axis position.
Hundreds
Bit 0 (value 100):
The position of the orientation axis is not defined,
position
i.e. the requested orientation is achieved with
each arbitrary setting of the rotary axis (polar po-
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
799
Work preparation
3.13 Tool offsets
System variable
Meaning
sition). This information is also contained in the
$P_ORI_SOL system variable.
Of the error numbers that indicate a violation of the axis limits, several can occur
simultaneously. When an axis limit is violated, an attempt is made to reach a position
within the permissible axis limits by adding or subtracting multiples of 360°. If this is
not possible, it is not clearly defined whether the lower or the upper axis limit has
been violated.
If there is no solution for the requested orientation ($P_ORI_SOL = 0), the status of
the orientation axes in the transformation is "0".
Note
$NT_ROT_AX_NAME
This system variable refers to a maximum of three axes used for setting the orientation. It
contains the names of the chain elements ($NK_NAME) that define the machine axes (rotary
axes) that must perform the orientation movements resulting from a kinematic transformation.
The order in which the maximum three rotary axes are contained in this system variable is
irrelevant for the machine kinematics because this is derived from the structure of the kinematic
chains. However, as it defines the order in which other variables access the rotary axes, the order
of the orientation axes in $NT_ROT_AX_NAME must match the kinematic description.
Note
Status information
The status information that shows, for example, that an orientation cannot be achieved or can
only be achieved when relevant axis limits are violated, does not trigger an NC alarm. It is the
responsibility of the user to react suitably to the specified conditions.
3.13.12.2
Activating the modification of the offset data for rotatable tools (CUTMOD,
CUTMODK)
The modification of the offset data for rotatable tools is activated in the NC program via the
CUTMOD (in combination with orientable tool carriers) or CUTMODK language command (for
orientation transformations that were defined by means of kinematic chains).
Note
As the orientable tool carriers and orientation transformations that were defined by means of
kinematic chains cannot be active at the same time, there are no conflicts between the two
variants.
Syntax
CUTMOD = <Value>
or
NC programming
800
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
CUTMODK = <Command>
Meaning
CUTMOD:
Function call in combination with orientable tool carriers
<Value>:
Assigned value
Data type:
INT
Value:
0
The function is deactivated.
The values supplied from system variables $P_AD... are the same as
the corresponding tool parameters.
> 0
The function is activated if an orientable tool carrier with the speci-
fied number is active, i.e. the activation is linked to a specific ori-
entable tool carrier.
The values supplied from system variables $P_AD... may be modi-
fied with respect to the corresponding tool parameters depending
on the active rotation.
The deactivation of the designated orientable tool carrier tempo-
rarily deactivates the function; the activation of another orientable
tool carrier permanently deactivates it. This is the reason why in the
first case, the function is re-activated when again selecting the
same orientable tool carrier; in the second case, a new selection is
required - even if at a subsequent time, the orientable tool carrier is
re-activated with the specified number.
The function is not influenced by a reset.
-1
The function is always activated if an orientable tool carrier is active.
When changing the tool carrier or when de-selecting it and a sub-
sequent new selection, CUTMOD does not have to be set again.
-2
The function is always activated if an orientable tool carrier is active
whose number is the same as the currently active orientable tool
carrier.
If an orientable tool carrier is not active, then this has the same
significance as CUTMOD=0.
If an orientable tool carrier is active, then this has the same signif-
icance as when directly specifying the actual tool carrier number.
< -2
Values less than 2 are ignored, i.e. this case is treated as if CUTMOD
was not programmed.
Note:
This value range should not be used as it is reserved for possible
subsequent expansions.
CUTMODK:
Function call in combination with orientation transformations that have been defined by
means of kinematic chains
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
801
Work preparation
3.13 Tool offsets
<Command>:
Assigned Command
Data type:
STRING
Value:
"NEW"
The states of an active transformation defined with kinematic
chains relevant for the "Modification of the offset data", the
name of the transformation and the current contour frame
are saved.
Note:
This command is only permissible when a suitable transfor-
mation (TRAORI_DYN, TRAORI_STAT or TRAANG_K) is active.
"OFF"
Switches the active "Modification of the offset data" off. The
data previously stored with "NEW" is retained.
Note:
This command is also permissible when CUTMODK is not ac-
tive. It then remains without effect. Any data set present for
the "Modification of the offset data" is retained.
"ON"
With this command, the "Modification of the offset data" is re-
activated with a data set previously stored with the "NEW"
command.
If a transformation with the name of the stored data set is
active when this command is executed, the "Modification of
the offset data" takes effect immediately. Otherwise, the ac-
tivation is delayed until an active transformation is activated.
"CLEAR"
As with the "OFF" command, switches the "Modification of
the offset data" off and also deletes the stored data set.
Note:
This command is also permissible when CUTMODK is not ac-
tive.
Note
SD42984 $SC_CUTDIRMOD
The CUTMOD or CUTMODK command replaces the function that can be activated using the
setting data SD42984 $SC_CUTDIRMOD. However, this function remains available unchanged.
However, as it doesn't make sense to use both functions in parallel, it can only be activated if
CUTMOD is equal to zero and CUTMODK is the zero string.
Further information
Reading modified offset data
The modified offset data is provided in the following system variables and OPI variables:
Meaning
System variable
OPI variable
Cutting edge position
$P_AD[2]
cuttEdgeParam2
Holder angle
$P_AD[10]
cuttEdgeParam10
Cut direction
$P_AD[11]
cuttEdgeParam11
Clearance angle
$P_AD[24]
cuttEdgeParam24
The data is always modified with respect to the corresponding tool parameters ($TC_DP2[..., ...]
etc.) when the "Modification of the offset data for rotatable tools" function was activated with
NC programming
802
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
the CUTMOD or CUTMODK command and the tool was rotated by an orientable tool carrier or a
suitable orientation transformation.
Further function-relevant system variables
System variable
Meaning
$P_CUTMOD_ANG /
Returns the angle through which a tool was rotated in the active machining
plane and the modified cutting edge data available for the CUTMOD and CUT-
$AC_CUTMOD_ANG
MODK functions.
$P_CUTMOD /
Reads the currently valid value that was last programmed with the CUTMOD
command (number of the tool carrier for which the modification of the offset
$AC_CUTMOD
data should be activated).
If the last programmed value was CUTMOD = -2 (activation with the currently
active orientable tool carrier), then the value "-2" is not returned in the system
variable, but rather the number of the orientable tool carrier active at the time
of programming.
$P_CUTMODK /
Reads the name of the transformation under which the currently valid data set
for the "Modification of the offset data" was created.
$AC_CUTMODK
$P_CUT_INV /
Supplies the value TRUE if the tool is rotated so that the spindle direction of
rotation must be inverted. To do this, the following four conditions must be
$AC_CUT_INV
fulfilled in the block to which the read operations refer:
1. If a turning or grinding tool is active
(tool types 400 to 599 and / or SD42950 $SC_TOOL_LENGTH_TYPE = 2).
2. The modification of the offset data was activated with the CUTMOD
or CUTMODK command.
3. An orientable tool carrier or an orientation transformation defined with
kinematic chains is active, which was selected with the CUTMOD or CUT-
MODK command.
4. The tool is rotated by the orientable tool carrier or the kinematic orientation
transformation so that the resulting normal of the tool cutting edge is ro-
tated with respect to the initial position by more than 90° (typically 180°).
If at least one of the specified four conditions is not fulfilled, the variable returns
the value FALSE. For tools whose cutting edge position is not defined, the value
of the variable is always FALSE.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
803
Work preparation
3.13 Tool offsets
System variable
Meaning
$P_CUTMOD_ERR
Error state after the last call of the CUTMOD function
The CUTMOD function can also be called implicitly for a tool change. At a reset,
the variable is reset to zero. It is reset at every tool change and, if required,
rewritten.
The variable is bit-coded. The bits have the following meanings:
Bit 0:
No valid cut direction is defined for the active tool.
Bit 1:
The cutting edge angle (clearance angle and holder angle) of the ac-
tive tool are both zero.
Bit 2:
The clearance angle of the active tool has an impermissible value (< 0°
or > 180°).
Bit 3:
The holder angle of the active tool has an impermissible value (< 0° or
> 90°).
Bit 4:
The plate angle of the active tool has an impermissible value (< 0° or >
90°).
Bit 5:
The cutting edge position - holder angle combination of the active tool
is not permitted (the holder angle must be ≤ 90° for cutting edge
position 1 to 4; for cutting edge positions 5 to 8 it must be ≥ 90°).
Bit 6:
Illegal rotation of the active tool.
The tool was rotated out of the active machining plane by ± 90° (with
a tolerance of about 1°). The cutting edge position is therefore no
longer defined in the machining plane.
Bit 7:
The cutting plate is not in the machining plane and the angle between
the cutting plate and the machining plane exceeds the upper limit
specified with the setting data SD42998 $SC_CUTMOD_PLANE_TOL.
Bit 8:
The cutting plate is not in the machining plane. Angle α is greater than
1°. Angle α is the angle of rotation around the coordinate axis which is
perpendicular to the axis of rotation of angle β as well as to the axis of
rotation of angle γ (the X axis for G18).
$P_...: Preprocessing variables
$AC_...: Main run variables
All main run variables can be read in synchronized actions. A read access operation from the
preprocessing generates a preprocessing stop.
Plane change
To determine the modified cutting edge position, cutting direction and holder or clearance
angle, the evaluation of the cutting edge in the active plane (G17 - G19) is decisive.
However, if setting data SD42940 $SC_TOOL_LENGTH_CONST (change of the tool length
component when selecting the plane) has a valid non-zero value (plus or minus 17, 18 or 19),
its contents define the plane in which the relevant quantities are evaluated.
This priority rule of the setting data over the G code can be deactivated by setting bit 18 of the
machine data $MC_TOOL_PARAMETER_DEF_MASK. This means that when this bit is set, the
plane defined with the G command of group 6 is still valid.
Effectiveness of the modified cutting data
The modified cutting edge position and the modified cutting edge reference point are
immediately effective when programming, even for a tool that is already active. A tool does not
have to be re-selected for this purpose.
NC programming
804
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Example
For a tool with cutting edge position 3 and an orientable tool carrier that can rotate the tool
around the B axis, the cutting edge position shall be modified after a tool rotation with the aid
of the CUTMOD command.
;
%
r
=
r
6
r
3
6/
S:
Cutting edge center point
P:
Cutting edge reference point
SL:
Cutting edge position
Program code
Comment
N10 $TC_DP1[1,1]=500
N20 $TC_DP2[1,1]=3
;Cutting edge position
N30 $TC_DP3[1,1]=12
N40 $TC_DP4[1,1]=1
N50 $TC_DP6[1,1]=6
N60 $TC_DP10[1,1]=110
; Holder angle
N70 $TC_DP11[1,1]=3
; Cut direction
N80 $TC_DP24[1,1]=25
; Clearance angle
N90 $TC_CARR7[2]=0 $TC_CARR8[2]=1 $TC_CARR9[2]=0
; B axis
N100 $TC_CARR10[2]=0 $TC_CARR11[2]=0
; C axis
$TC_CARR12[2]=1
N110 $TC_CARR13[2]=0
N120 $TC_CARR14[2]=0
N130 $TC_CARR21[2]=X
N140 $TC_CARR22[2]=X
N150 $TC_CARR23[2]="M"
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
805
Work preparation
3.13 Tool offsets
Program code
Comment
N160 TCOABS CUTMOD=0
N170 G18 T1 D1 TCARR=2
; X
Y
Z
N180 X0 Y0 Z0 F10000
; 12.000
0.000
1.000
N190 $TC_CARR13[2]=30
N200 TCARR=2
N210 X0 Y0 Z0
; 10.892
0.000
-5.134
N220 G42 Z-10
;
8.696
0.000
-17.330
N230 Z-20
;
8.696
0.000
-21.330
N240 X10
; 12.696
0.000
-21.330
N250 G40 X20 Z0
; 30.892
0.000
-5.134
N260 CUTMOD=2 X0 Y0 Z0
;
8.696
0.000
-7.330
N270 G42 Z-10
;
8.696
0.000
-17.330
N280 Z-20
;
8.696
0.000
-21.330
N290 X10
; 12.696
0.000
-21.330
N300 G40 X20 Z0
; 28.696
0.000
-7.330
N310 M30
The numerical values in the comments specify the end of block positions in the machine coordinates (MCS)
in the sequence X → Y → Z.
Explanations
In block N180, initially the tool is selected for CUTMOD=0 and non-rotated tool holders that can
be orientated. As all offset vectors of the tool holder that can be orientated are 0, the position
that corresponds to the tool lengths specified in $TC_DP3[1,1] and $TC_DP4[1,1] is
approached.
The tool holder that can be orientated with a rotation of 30° around the B axis is activated in block
N200. As the cutting edge position is not modified due to CUTMOD=0, the old cutting edge
reference point is decisive just as before. This is the reason why in block N210 the position is
approached, which keeps the old tool nose reference point at the zero (i.e. the vector (1, 12) is
rotated through 30° in the Z/X plane).
In block N260, contrary to block N200, CUTMOD=2 is effective. As a result of the tool holder
rotation that can be orientated, the modified cutting edge position becomes 8. Deviating axis
positions also result from this.
The tool radius compensation (TRC) is activated in blocks N220 and/or N270. The different
cutting edge position in both program sections has no effect on the end positions of the blocks
in which the TRC is active; the corresponding positions are therefore identical. The different
cutting edge positions only become effective again in the deselect blocks N260 and/or N300.
NC programming
806
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
3.13.13
Working with tool environments
Overview of functions
• Save tool environment (TOOLENV) (Page 807)
• Delete tool environment (DELTOOLENV) (Page 810)
• Read T, D and DL number (GETTENV) (Page 811)
• Read tool lengths and/or tool length components (GETTCOR) (Page 812)
• Change tool components (SETTCOR) (Page 818)
System variables overview
• Read information about the saved tool environments ($P_TOOLENVN, ($P_TOOLENV)
(Page 812)
3.13.13.1
Save tool environment (TOOLENV)
The TOOLENV function is used to save any current states needed for the evaluation of tool data
stored in the memory.
The individual data are as follows:
• The active G command of group:
-
6 (G17, G18, G19)
–
56 (TOWSTD, TOWMCS, TOWWCS, TOWBCS, TOWTCS, TOWKCS)
• The active transverse axis
• Machine data:
- MD18112 $MN_MM_KIND_OF_SUMCORR (properties of the summed offsets in the TO
area)
- MD20360 $MC_TOOL_PARAMETER_DEF_MASK (definition of tool parameters).
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
807
Work preparation
3.13 Tool offsets
• Setting data:
- SD42900 $SC_MIRROR_TOOL_LENGTH (sign change tool length when mirroring)
- SD42910 $SC_MIRROR_TOOL_WEAR (sign change tool wear when mirroring)
- SD42920 $SC_WEAR_SIGN_CUTPOS (sign of the tool wear with cutting edge systems)
- SD42930 $SC_WEAR_SIGN (sign of wear)
- SD42935 $SC_WEAR_TRANSFORM (transformations for tool components)
- SD42940 $SC_LENGTH_CONST (change of the tool length components for a plane
change)
- SD42942 $SC_TOOL_LENGTH_CONST_T (change of tool length components for turning
tools at change of plane)
- SD42950 $SC_TOOL_LENGTH_TYPE (allocation of the tool length components
independent of tool type)
- SD42954 $SC_TOOL_ORI_CONST_M (change of tool orientation components for milling
tools at change of plane)
- SD42956 $SC_TOOL_ORI_CONST_T (change of tool orientation components for turning
tools at change of plane)
• The orientation component of the current complete frame (rotation and mirroring, no work
offsets or scaling)
• The orientation component and the resulting length of the active toolholder with orientation
capability
• The orientation component and the resulting length of an active transformation
In addition to the data describing the environment of the tool, the T number, D number and DL
number of the active tool are also stored, so that the tool can be accessed later in the same
environment as the TOOLENV call, without having to name the tool again.
Syntax
<Status> = TOOLENV(<name>)
Meaning
TOOLENV(...):
Predefined function to save a tool environment
Alone in the
Yes
block:
NC programming
808
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
<Status>:
Function return value. Negative values indicate error states.
Data type:
INT
Value:
0
Function OK
-1
No memory reserved for tool environments:
MD18116 $MN_MM_NUM_TOOL_ENV = 0
This means that the "tool environments" functionality is not
available.
-2
No more free memory locations for tool environments available.
-3
Null string illegal as name of a tool environment.
-4
No parameter (<name>) specified.
Parameters
1
<name>:
Name, under which the current data set should be saved.
If a data set of the same name already exists, then it is overwritten. In this case, the
status is "0".
Data type:
STRING
Further information
Base dimension/adapter dimension - tool length compensation
When the tool magazine management is active (only available with the "Tool management"
option!), the value of the following machine data defines whether the adapter length or the tool
base dimension (cutting edge-specific parameters $TC_DP21, $TC_DP22 and $TC_DP23) is
incorporated in the calculation of the tool length:
MD18104 $MN_MM_NUM_TOOL_ADAPTER (tool adapter in TO area).
Since a change to this machine data only takes effect after the control system has powered up,
it is not saved in the tool environment.
Resulting length of toolholders with orientation capability and transformations:
Note
Both toolholders with orientation capability and transformations can use system variables or
machine data, which act as additional tool length components, and which can be subjected
partially or completely to the rotations performed. The resulting additional tool length
components must also be saved when TOOLENV is called, because they represent part of the
environment, in which the tool is used.
Adapter transformation
The adapter transformation is a property of the tool adapter and thus of the complete tool. It is,
therefore, not part of a tool environment, which can be applied to another tool.
By saving the complete data necessary to determine the overall tool length, it is possible to
calculate the effective length of the tool at a later point in time, even if the tool is no longer active
or if the conditions of the environment (e.g. G codes or setting data) have changed. Similarly, the
effective length of a different tool can be calculated assuming that it would be used under the
same conditions as the tool, for which the status was saved.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
809
Work preparation
3.13 Tool offsets
Maximum number of data sets for tool environments
Machine data MD18116 $MN_MM_NUM_TOOL_ENV is used to define the maximum number of
data sets that can be saved to describe the tool environments. The data are in the TOA area. They
are kept even when the control system is switched off.
Data cannot be backed up. This means that this data cannot be transferred between the
different control systems.
3.13.13.2
Delete tool environment (DELTOOLENV)
The DELTOOLENV function is used to delete the data sets that are used to describe tool
environments. Deletion means that the set of data stored under a particular name can no longer
be accessed (an access attempt triggers an alarm).
Note
Data sets can only be deleted using the DELTOOLENV function, by an INITIAL.INI download or by
a cold start (NC power up with default machine data). There are no additional automatic
deletion operations.
Syntax
<Status> = DELTOOLENV(<name>)
<Status> = DELTOOLENV()
Meaning
DELTOOLENV(...):
Predefined function to delete a tool environment
Alone in the
Yes
block:
<Status>:
Function return value. Negative values indicate error states.
Data type:
INT
Value:
0
Function OK
-1
No memory reserved for tool environments:
MD18116 $MN_MM_NUM_TOOL_ENV = 0
This means that the "tool environments" functionality is not
available.
-2
A tool environment with the specified name does not exist.
Parameters
1
<name>:
Name of data set to be deleted
Data type:
STRING
DELTOOLENV():
DELTOOLENV() deletes data sets describing tool environments without speci-
fying a name
NC programming
810
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
3.13.13.3
Read T, D and DL number (GETTENV)
The GETTENV function is used to read the T, D and DL numbers stored in a tool environment.
Syntax
<Status> = GETTENV(<name>, <TDDL>)
Meaning
GETTENV(...):
Predefined function to read T, D and DL numbers in a data set to describe a tool
environment
Alone in the
Yes
block:
<Status>:
Function return value. Negative values indicate error states.
Data type:
INT
Value:
0
Function OK
-1
No memory reserved for tool environments:
MD18116 $MN_MM_NUM_TOOL_ENV = 0
This means that the "tool environments" functionality is not
available.
-2
A tool environment with the specified name does not exist.
Parameters
1
<name>:
Name of the data set from which the T, D and DL numbers are to be read
Data type:
STRING
2
<TDDL>:
The field of this result parameter contains the T, D and DL numbers of the tool,
whose tool environment is saved in the specified data set:
• <TDDL> [0]: T number
• <TDDL> [1]: D number
• <TDDL> [2]: DL number
Data type:
INT[3]
GETTENV(,<TDDL>),
When calling function GETTENV, it is permissible to omit the first param-
GETTENV("",<TDDL>):
eter - or to transfer the null string as first parameter. In these two special
cases, in <TDDL>, the T, D and DL numbers of theactive tool are returned.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
811
Work preparation
3.13 Tool offsets
3.13.13.4
Read information about the saved tool environments ($P_TOOLENVN, ($P_TOOLENV)
Information regarding the saved tool environments can be read using the following system
variables:
$P_TOOLENVN:
Supplies the number of data sets (which have still not been deleted) - defined using
TOOLENV - to describe tool environments
Syntax:
<n> = $P_TOOLENVN
Meaning:
<n>:
Number of defined data sets
Data type:
INT
Value range:
0 ... MD18116
$MN_MM_NUM_TOOL_ENV
This system variable can be accessed even if no tool environments are possible
(MD18116 = 0). In this case, the return value is "0".
$P_TOOLENV:
Supplies the name of the <i>th data set to describe a tool environment
Syntax:
<Name> = $P_TOOLENV[<i>]
Meaning:
<name>:
Name of the data set with number <i>
Data type:
STRING
<i>:
Number of the data set
Data type:
INT
Value range:
1 ... $P_TOOLENVN
The assignment of numbers to data sets is not fixed, but can be changed as a result
of deleting or creating data sets. The data sets are numbered internally.
If <i> refers to a data set that has not been defined, then the null string is returned.
If index <i> is not valid, i.e. <i> is less than 1 or higher than that the maximum
number of data sets for tool environments (MD18116 $MN_MM_NUM_TOOLENV),
then the following alarm is output:
Alarm 17020 "inadmissible array index 1"
3.13.13.5
Read tool lengths and/or tool length components (GETTCOR)
The GETTCOR function is used to read out tool lengths or tool length components.
The parameters can be used to specify which components are considered and the conditions
under which the tool is used.
Syntax
<Status> = GETTCOR(<Len>[, <Comp>, <Stat>, <T>, <D>, <DL>])
Meaning
GETTCOR(...):
Predefined function to read tool lengths or to read tool length components
Alone in the
Yes
block:
NC programming
812
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
<Status>:
Function return value. Negative values indicate error states.
Data type:
INT
Value:
0
Function OK
-1
No memory reserved for tool environments:
MD18116 $MN_MM_NUM_TOOL_ENV = 0
This means that the "tool environments" functionality is not
available.
-2
A tool environment with the name specified under <Stat> does
not exist.
-3
Invalid string in parameter <Comp>.
Causes of this error can be invalid characters or characters pro-
grammed twice.
-4
Invalid T number
-5
Invalid D number
-6
Invalid DL number
-7
Attempt to access a non-existent memory module.
-8
Attempt to access a non-existent option (programmable tool ori-
entation, tool management).
-9
The <Comp> string contains a colon (identifier for the specifica-
tion of a coordinate system), but it is not followed by a valid
character denoting the coordinate system.
Parameters
1
<Len>:
Result vector
Data type:
REAL[11]
The vector components are arranged in the following order:
• <Len> [0]: Tool type
• <Len> [1]: Cutting edge position
• <Len> [2]: Abscissa
• <Len> [3]: Ordinate
• <Len> [4]: Applicate
• <Len> [5]: Tool radius
The coordinate system defined in <Comp> and <Stat> is used as the reference
coordinate system for the length components. If a coordinate system is not defined
in <Comp>, then tool lengths are displayed in the machine coordinate system.
The assignment of the abscissa, ordinate and applicate to the geometry axes de-
pends on the active plane used in the tool environment. This means, for G17, the
abscissa is parallel to X, with G18 it is parallel to Z, etc.
Components <Len>[6] to <Len>[10] contain the additional parameters, which can
be used to specify the geometry description of a tool (e.g. $TC_DP7 to $TC_DP11 for
the geometry and the corresponding components for wear or sum and setup off-
sets).
These 5 additional elements and the tool radius are only defined for components E,
G, S, and W. Their evaluation does not depend on <Stat>. The corresponding values
in <Len>[6] to <Len>[10] can thus only be not equal to zero if at least one of the four
specified components is involved in the tool length calculation. The remaining
components do not influence the result. The dimensions refer to the control's basic
system (inch or metric).
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
813
Work preparation
3.13 Tool offsets
2
<Comp>:
Tool length components (optional)
Data type:
STRING
The character string consists of two substrings, which are separated from one an-
other by a colon.
General form: "<SubStr_1> [: <SubStr_2]"
<SubStr_1>:
The first substring designates the tool length components to be
taken into account when calculating the tool length.
The order of the characters in the substrings, and their notation
(upper or lower case), is arbitrary. Any number of blanks or white
spaces can be inserted between the characters.
Note:
It is not permissible that the characters in the substring are
programmed twice.
Charac-
-
Minus symbol (only allowed as first character)
ters:
The complete tool length is calculated, minus
the components specified in the next string.
C
Adapter or tool base dimension (whichever of
the two alternative components is active for the
tool in use)
E
Setup offsets
G
Geometry
K
Kinematic transformation (is only evaluated for
generic 3, 4 and 5-axis transformation)
S
Summed offsets
T
Toolholder with orientation capability
W
Wear
If the first substring is empty (except for white spaces), the com-
plete tool length is calculated allowing for all components. This
applies even if the <Comp> parameter is not specified.
<Substr_2>:
The optional second substring identifies the coordinate system,
in which the tool length is to be output.
The second substring only comprises one single relevant char-
acter.
Charac-
A
Adjustable coordinate system (ACS)
ters:
B
Basic coordinate system (BCS)
K
Tool coordinate system of kinematic transfor-
mation (KCS)
M
Machine coordinate system (MCS)
T
Tool coordinate system (TCS)
W
Workpiece coordinate system (WCS)
If no coordinate system is specified, the evaluation is performed
in the MCS (machine coordinate system). If any rotations are to
be taken into account, they are specified in the tool environment
defined in <Stat>.
3
<_Stat>:
Name of the data set for describing a tool environment (optional)
Data type:
STRING
If the value of this parameter is the null string (""), or is not specified, then the
current status is used. The current tool is used if a tool is not specified.
NC programming
814
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
4
<T>:
Internal T number of the tool (optional).
Data type:
INT
If this parameter is not specified or if its value is "0", then the tool stored in <Stat>
is used.
If the value of this parameter is "-1", then the T number of the active tool is used. It
is also possible to explicitly specify the number of the active tool.
Note:
If <Stat> is not specified, the actual status is used as the tool environment. Since <T>
= 0 refers to the T number saved in the tool environment, the active tool is used in
this environment, i.e. parameters <T> = 0 and <T> = -1 have the same meaning in
this special case.
5
<D>:
Cutting edge of the tool (optional).
Data type:
INT
If this parameter is not specified, or if its value is "0", then the D number used is
based on the source of the T number. If the T number from the tool environment is
used, then the D number of the tool environment is also read, otherwise the D
number of the currently active tool is read.
6
<DL>:
Number of the offset dependent on the location (optional).
Data type:
INT
If this parameter is not specified, then the DL number used is based on the source
of the T number. If the T number from the tool environment is used, then the D
number of the tool environment is also read, otherwise the D number of the cur-
rently active tool is read.
Examples
GETTCOR(_LEN)
Calculates the tool length of the currently active
tool in the machine coordinate system allowing for
all components.
GETTCOR(_LEN,"CGW:W")
Calculates the tool length for the active tool, con-
sisting of the adapter or tool base dimension, ge-
ometry and wear. Further components, such as
toolholder with orientation capability or kinematic
transformation, are not considered. Output in the
workpiece coordinate system.
GETTCOR (_LEN,"-K:B")
Calculates the complete tool length of the active
tool without allowing for the length components of
a possibly active kinematic transformation. Output
in the basic coordinate system.
GETTCOR (_LEN,":M","Testenv1",,3)
Calculates the complete tool length in the machine
coordinate system for the tool stored in the tool
environment named "Testenv1". However, the cal-
culation is performed for cutting edge number D3,
regardless of the cutting edge number stored.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
815
Work preparation
3.13 Tool offsets
Additional information
Adapter transformation/toolholder with orientation capability/kinematic transformation
Any rotations and component exchanges initiated by the adapter transformation, toolholder
with orientation capability and kinematic transformation, are part of the tool environment. They
are thus always performed, even if the corresponding length component is not supposed to be
included. If this is undesirable, tool environments must be defined, in which the corresponding
transformations are not active. In many cases (i.e. any time a transformation or toolholder with
orientation capability is not used on a machine), the data sets stored for the tool environments
automatically fulfill these conditions, with the result that the user does not need to make special
provision.
Turning and grinding tools: Calculating the tool length depending on MD20360
$MC_TOOL_PARAMETER_DEF_MASK
The following machine data defines how the wear and tool length are to be evaluated if a
diameter axis is used for turning and grinding tools.
MD20360 $MC_TOOL_PARAMETER_DEF_MASK (definition of tool parameters).
Bit
Value
0
For turning and grinding tools, the wear parameter of the transverse axis is taken into account
as the diameter value:
= 0 (default)
No
= 1
Yes
1
For turning and grinding tools, the tool length component of the transverse axis is taken into
account as the diameter value:
= 0 (default)
No
= 1
Yes
If the bits involved are set, the associated entry is weighted with a factor of 0.5. This weighting is
reflected in the tool length returned by GETTCOR.
Example:
MD20360 $MC_TOOL_PARAMETER_DEF_MASK = 3
MD20100 $MC_DIAMETER_AX_DEF (geometry axis with transverse axis function) = "X"
X is diameter axis (standard turning machine configuration)
Program code
Comment
N30 $TC_DP1[1,1]=500
N40 $TC_DP2[1,1]=2
N50 $TC_DP3[1,1]=3.0
; geometry L1
N60 $TC_DP4[1,1]=4.0
N70 $TC_DP5[1,1]=5.0
N80 $TC_DP12[1,1]=12.0
; wear L1
N90 $TC_DP13[1,1]=13.0
N100 $TC_DP14[1,1]=14.0
N110 T1 D1 G18
N120 R1=GETTCOR(_LEN,"GW")
N130 R3=_LEN[2]
; 17.0 (= 4.0 + 13.0)
NC programming
816
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Program code
Comment
N140 R4=_LEN[3]
; 7.5 (= 0.5 * 3.0 + 0.5 * 12.0)
N150 R5=_LEN[4]
; 19.0 (= 5.0 + 14.0)
N160 M30
Length components of the kinematic transformation and toolholder with orientation
capability
If a toolholder with orientation capability is taken account of during the tool length
calculation, the following vectors are included in that calculation:
Type
Vectors
M
l1 and l2
T
l1, l2 and l3
P
The tool length is not influenced by the toolholder with orientation capability.
In generic 5-axis transformation, the following machine data are included in the tool length
calculation for transformer types 24 and 56:
Transforma-
Machine data
tion type
24
MD24550/24650 $MC_TRAFO5_BASE_TOOL_1/2
MD24560/24660 $MC_TRAFO5_JOINT_OFFSET_1/2
MD24558/24658 $MC_TRAFO5_PART_OFFSET_1/2
56
MD24550/24650 $MC_TRAFO5_BASE_TOOL_1/2
MD24560/24660 $MC_TRAFO5_JOINT_OFFSET_1/2
Transformation type 56 (moving tool and moving workpiece) corresponds to type M for
toolholders with orientation capability.
For this 5-axis transformation, in the previous software releases, vector MD24560/24660
$MC_TRAFO5_JOINT_OFFSET_1/2 (vector of kinematic offset of the 1st/2nd 5-axis
transformation in the channel) corresponds to the sum of the two vectors l1 and l3 for a type M
tool carrier with orientation capability.
Only the sum is relevant for the transformation in both cases. The way, in which the two
individual components are composed, is insignificant. However, when calculating the tool
length, it is relevant which component is assigned to the tool and which is assigned to the tool
table. This is the reason that machine data MD24558/24658
$MC_TRAFO5_JOINT_OFFSET_PART_1/2 (vector kinematic offset in table) was introduced. It
corresponds to vector l3. Machine data:MD24560/24660 $MC_TRAFO5_JOINT_OFFSET_1/2 no
longer corresponds to the sum of l1 and l3, but only to vector l1. If machine data
MD24558/24658 $MC_TRAFO5_JOINT_OFFSET_PART_1/2 is equal to zero, the behavior is the
same as before.
Compatibility
The GETTCOR function is used in conjunction with the TOOLENV and SETTCOR functions to
replace parts of the functionality, which were previously implemented externally in the
measuring cycles.
Only some of the parameters, which actually determine the effective tool length, were
implemented in the measuring cycles. The functions mentioned above can be configured to
reproduce the behavior of the measuring cycles in relation to the tool length calculation.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
817
Work preparation
3.13 Tool offsets
3.13.13.6
Change tool components (SETTCOR)
The SETTCOR function is used to change tool components taking into account all general
conditions that can be involved when evaluating the individual components.
Note
Regarding the terminology: If in the following, in conjunction with the tool length, tool
components are involved, then the components considered from a vectorial perspective are
meant, which make up the complete tool length (e.g. geometry or wear). Such a component
comprises three individual values (L1, L2, L3), which are called coordinate values in the
following.
The tool component "geometry" therefore comprises three coordinate values $TC_DP3 to
$TC_DP5.
Syntax
<Status> = SETTCOR(<CorVal>, <Comp>, [<CorComp>, <CorMode>, <GeoAx>,
<Stat>, <T>, <D>, <DL>])
Meaning
SETTCOR(...):
Predefined function to change tool components
Alone in the
Yes
block:
NC programming
818
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
<Status>:
Function return value. Negative values indicate error states.
Data type:
INT
Value:
0
Function OK
-1
No memory reserved for tool environments:
MD18116 $MN_MM_NUM_TOOL_ENV = 0
This means that the "tool environments" functionality is not
available.
-2
A tool environment with the name specified under <Stat> does
not exist.
-3
Invalid string in parameter <Comp>.
Causes of this error can be invalid characters or characters pro-
grammed twice.
-4
Invalid T number.
-5
Invalid D number.
-6
Invalid DL number.
-7
Attempt to access a non-existent memory module.
-8
Attempt to access a non-existent option (programmable tool ori-
entation, tool management).
-9
Illegal numerical value for parameter <CorComp>.
-10
Illegal numerical value for parameter <CorMode>.
-11
The contents of parameters <Comp> and <CorComp> are con-
tradictory.
-12
The contents of parameters <Comp> and <CorMode> are con-
tradictory.
-13
The content of the <GeoAx parameter does not designate a ge-
ometry axis.
-14
Write attempt to a non-existent setup offset.
Parameters
1
<CorVal>:
Correction vector
In the workpiece coordinate system (WCS) defined by <Stat>, the following assign-
ment applies:
• <CorVal> [0]: Abscissa
• <CorVal> [1]: Ordinate
• <CorVal> [2]: Applicate
If only one tool component is to be corrected (i.e. no vectorial correction, see pa-
rameter <CorMode>), the correction value is always in <CorVal>[0], independent of
the axis on which it acts. The contents of the other two components are then not
evaluated.
If <CorVal> or a component of <CorVal> refers to the transverse axis, then the data
is evaluated as radius dimension. This means that a tool is, for example, "longer"
by the specified dimension; this correspondingly results in a change to the work-
piece diameter that is twice as large.
The dimensions refer to the basic system (inch or metric) of the control system.
Data type:
REAL[3]
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
819
Work preparation
3.13 Tool offsets
2
<Comp>:
Tool component(s)
Data type:
STRING
The character string consists of two substrings, which are separated from one an-
other by a colon.
General form: "<SubStr_1> [: <SubStr_2]"
<SubStr_1>:
The first substring must always be available, and can either
comprise one or two characters. The first or only character for the
1st component (Val1) and the second character for the 2nd com-
ponent (Val2), which are processed according to the subsequent
parameters <CorComp> and <CorMode>.
Charac-
C
Adapter or tool base dimension (whichever
ters:
of the two alternative components is active
for the tool in use)
E
Setup offsets
G
Geometry
S
Sum offsets
W
Wear
<Substr_2>:
The second substring is optional. Alternatively, it can comprise
(individual) letters "W" or "T".
Charac-
W
If the second substring is empty or contains
ters:
the letter "W", then the offset values are tak-
en into account as if they had been meas-
ured in the workpiececoordinate system
(WCS).
T
If the second substring contains the letter
"T", then the offset values are taken into ac-
count as if they had been measured in
the toolcoordinate system (Tool Coordinate
System, TCS).
The notation of the characters in the string (upper or lower case) is arbitrary. Any
number of spaces or tabs (white spaces) can be inserted.
NC programming
820
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
3
<CorComp>:
Specifies the component(s) of the tool data sets that are to be described (optional).
Data type:
INT
Value:
0
Offset value <CorVal>[0] refers to the geometry axis transferred
in parameter <GeoAx> in the workpiece coordinate system - or
in the tool coordinate system (also see a description of parame-
ter <Comp>). This means that the offset value must be calculated
in the designated tool components so that, taking account all the
parameters that can influence the tool length calculation, a
change of the total tool length by the specified value in the
specified axis direction is obtained.
This change should be achieved by correcting the component
specified in <Comp> and the symbolic algorithm specified in
<CorMode> (see the following parameters). The resulting cor-
rection can therefore have an effect on all three axis components.
1
Like "0", however, vectorial. The content of vector <CorVal> re-
fers to abscissa, ordinate and applicate in the workpiece coordi-
nate system or tool coordinate system (see the description of
parameter <Comp>).
Subsequent parameter <GeoAx> is not evaluated.
2
Vectorial offset, i.e. L1, L2 and L3 can change simultaneously.
In contrast to the versions from "0 and "1", the offset values con-
tained in <CorVal> refer to the coordinates of Val1 components
(see following parameter <CorMode>) of the tool.
Any possible inclination of an existing tool compared with the
workpiece coordinate system has no influence on the offset.
3 - 5
Correction of tool lengths L1 to L3 ($TC_DP3 to $TC_DP5) or the
corresponding values for wear, setting up or additive offsets.
The offset value is contained in <CorVal>[0]. It is measured in the
coordinates of the Val1 component (see following parameter
<CorMode>) of the tool. Any possible inclination of an existing
tool compared with the workpiece coordinate system has no
influence on the offset.
6
Correction of the tool radius ($TC_DP6) or the corresponding
values for wear, setting up or additive offsets. Bits 10 and 11
(evaluation of the diameter and/or diameter wear data, either
specified as a radius or diameter) in machine data
MD20360 $MC_TOOL_PARAMETER_DEF_MASK are taken into
account.
7
Correction of $TC_DP7 to $TC_DP11 or the corresponding values
– 11
for wear, setting up or additive offsets. These parameters are
treated just like the tool radius.
If this parameter is not specified then its value is "0".
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
821
Work preparation
3.13 Tool offsets
4
<CorMode>:
Specifies the type of write operation to be executed (optional).
Data type:
INT
Value:
0
Val1new = <CorVal>
1
Val1new = Val1old + <CorVal>
2
Val1new = <CorVal>
Val2new = 0
3
Val1new = Val1old + Val2old + <CorVal>
Val2new = 0
The notation Val1old + Val2old is symbolic. If the two components (due to the status of
<_Stat>) are evaluated in different ways, i.e. if a rotation is effective between the
two components, then Val2old is transformed prior to addition so that the resulting
tool length after deleting Val2new and prior to the addition of <CorVal> remains
unchanged.
<CorVal> always refers to Val1. <CorVal> is a value, which dependent on the second
part of parameter <Comp>, is measured in the workpiece coordinate system (WCS)
or in the tool coordinate system (TCS). It is therefore already transformed with
respect to the tool components, in which it should be calculated. Therefore, it
cannot be directly calculated together with the saved value, but must be trans-
formed back prior to adding to Val1 or Val2. This can mean that the offset acts on an
axis different than the one defined by <CorComp> - or that it acts on several axes.
For the case <CorComp> = 0, i.e. when <CorVal> does not contain a vector, but only
an individual value, then the described operations are executed in the coordinates
in which <CorVal> was measured (WCS/TCS). In particular, this also applies to set-
ting Val2new to zero in variants 2 and 3. This result is then transformed back into the
coordinates of the tool. This can mean that none of the coordinate values to be set
to zero (L1, L2, L3) become zero, or coordinate values, that were previously zero, are
now not equal to zero. However, if the corresponding operations are successively
executed for all three geometry axes, then it is guaranteed that all three coordinate
values of the components to be deleted are zero. If the tool is not rotated with
respect to the workpiece coordinate system or is rotated so that all tool components
remain parallel to the coordinate axes (axis exchange operations), then this also
ensures that only one tool coordinate changes.
The successive execution of the same operation (<CorMode>) with <CorComp> = 0
for all three coordinate axes in any sequence is identical with the single execution
of the same operation with <CorComp>=1.
For parameter values "0" and "1", parameter <Comp> must contain one character,
and for parameter values "2" and "3", two characters.
Example:
<Comp> contains string "ES", <CorMode> the value "2"
⇒ Setup offsetnew = <CorVal>, summed offsetnew = 0
If parameter <CorMode> is not specified, then its value is "0".
5
<GeoAx>:
Specifies the index of the geometry axis in which the offset value <CorVal>[0] was
read (optional)
Data type:
INT
Value range:
0 ... 2
Indices 0 to 2 refer to abscissa, ordinate and applicate in the active plane (G17/G18/
G19) of the current tool environment.
The content of this parameter is only evaluated if parameter <CorComp> has a value
of "0".
NC programming
822
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
6
<Stat>:
Name of the data set for describing a tool environment (optional)
Data type:
STRING
If the value of this parameter is the null string (""), or is not specified, then the
current status is used. The current tool is used if a tool is not specified.
7
<T>:
Internal T number of the tool (optional).
Data type:
INT
If this parameter is not specified or if its value is "0", then the tool stored in <Stat>
is used.
If the value of this parameter is "-1", then the T number of the active tool is used. It
is also possible to explicitly specify the number of the active tool.
Note:
If <Stat> is not specified, the actual status is used as the tool environment. Since <T>
= 0 refers to the T number saved in the tool environment, the active tool is used in
this environment, i.e. parameters <T> = 0 and <T> = -1 have the same meaning in
this special case.
8
<D>:
Cutting edge of the tool (optional).
Data type:
INT
If this parameter is not specified, or if its value is "0", then the D number used is
based on the source of the T number. If the T number from the tool environment is
used, the D number of the tool environment is also read, otherwise the D number
of the currently active tool is read.
9
<TL>:
Number of the offset dependent on the location (optional).
Data type:
INT
If this parameter is not specified, then the DL number used is based on the source
of the T number. If the T number from the tool environment is used, the D number
of the tool environment is also read, otherwise the D number of the currently active
tool is read. If T, D and DL specify a tool without location-dependent offsets, no
summed or setup offsets may be specified in parameter <Comp> (error code in
<Status>).
Note
Not all possible combinations of the three parameters <Comp>, <CorComp> and <CorMode>
make sense. For example, algorithm 3 in <CorComp> requires that two characters are specified
in <Comp>. If an invalid parameter combination is specified, then a corresponding error code is
returned in the <Status>.
Examples
Example 1
Program code
Comment
N10 DEF REAL _CORVAL[3]
N20 $TC_DP1[1,1]=120
; Milling tool
N30 $TC_DP3[1,1]=10.0
; Geometry L1
N40 $TC_DP12[1,1]=1.0
; wear L1
N50 _CORVAL[0]=0.333
N60 T1 D1 G17 G0
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
823
Work preparation
3.13 Tool offsets
Program code
Comment
N70 R1=SETTCOR(_CORVAL,"G",0,0,2)
N80 T1 D1 X0 Y0 Z0
; ==> MCS position X0.000 Y0.000 Z1.333
N90 M30
<CorComp> is "0", therefore, the coordinate value of the geometry component acting in the Z
direction must be replaced by the offset value 0.333.
The resulting total tool length is thus: L1 = 0.333 + 1.000 = 1.333
Example 2
Program code
Comment
N10 DEF REAL _CORVAL[3]
N20 $TC_DP1[1,1]=120
; milling tool
N30 $TC_DP3[1,1]=10.0
; geometry L1
N40 $TC_DP12[1,1]=1.0
; wear L1
N50 _CORVAL[0]=0.333
N60 T1 D1 G17 G0
N70 R1=SETTCOR(_CORVAL,"W",0,1,2)
N80 T1 D1 X0 Y0 Z0
; ==> MCS position X0.000 Y0.000 Z11.333
N90 M30
<CorComp> is "1", this means that the offset value of 0.333 - acting in the Z axis - is added to
the wear value of 1.0.
The resulting total tool length is thus: L1 = 10.0 + 1.333 = 11.333
Example 3
Program code
Comment
N10 DEF REAL _CORVAL[3]
N20 $TC_DP1[1,1]=120
; Milling tool
N30 $TC_DP3[1,1]=10.0
; Geometry L1
N40 $TC_DP12[1,1]=1.0
; Wear L1
N50 _CORVAL[0]=0.333
N60 T1 D1 G17 G0
N70 R1=SETTCOR(_CORVAL,"GW",0,2,2)
N80 T1 D1 X0 Y0 Z0
; ==> MCS position X0.000 Y0.000 Z0.333
N90 M30
<CorComp> is "2", therefore, the offset effective in the Z axis is entered in the geometry
component (the old value is overwritten) and the wear value is deleted.
The resulting total tool length is thus: L1 = 0.333 + 0.0 = 0.333
Example 4
Program code
Comment
N10 DEF REAL _CORVAL[3]
N20 $TC_DP1[1,1]=120
; Milling tool
N30 $TC_DP3[1,1]=10.0
; Geometry L1
NC programming
824
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
Program code
Comment
N40 $TC_DP12[1,1]=1.0
; wear L1
N50 _CORVAL[0]=0.333
N60 T1 D1 G17 G0
N70 R1=SETTCOR(_CORVAL,"GW",0,3,2)
N80 T1 D1 X0 Y0 Z0
; ==> MCS position X0.000 Y0.000 Z11.333
N90 M30
<CorComp> is "3", therefore, the wear value and compensation value are added to the geometry
component and the wear component is deleted.
The resulting total tool length is thus: L1 = 11.333 + 0.0 = 11.333
Example 5
Program code
Comment
N10 DEF REAL _CORVAL[3]
N20 $TC_DP1[1,1]=120
; Milling tool
N30 $TC_DP3[1,1]=10.0
; Geometry L1
N40 $TC_DP12[1,1]=1.0
; Wear L1
N50 _CORVAL[0]=0.333
N60 T1 D1 G17 G0
N70 R1=SETTCOR(_CORVAL,"GW",0,3,0)
N80 T1 D1 X0 Y0 Z0
; ==> MCS position X0.333 Y0.000 Z11.000
N90 M30
<CorComp> is "3", as in the previous example, but the compensation is now effective on the
geometry axis with index "0" (X axis), which for a milling tool, is assigned to tool component L3
due to G17. As a consequence, when calling SETTCOR, tool parameters $TC_DP3 and $TC_DP12
are not influenced. Instead, the compensation value is entered in $TC_DP5.
Example 6
Program code
Comment
N10 DEF REAL _CORVAL[3]
N20 $TC_DP1[1,1]=500
; turning tool
N30 $TC_DP3[1,1]=10.0
; geometry L1
N40 $TC_DP4[1,1]=15.0
; geometry L2
N50 $TC_DP12[1,1]=10.0
; wear L1
N60 $TC_DP13[1,1]=0.0
; wear L2
N70 _CORVAL[0]=5.0
N80 ROT Y-30
N90 T1 D1 G18 G0
N100 R1=SETTCOR(_CORVAL,"GW",0,3,1)
N110 T1 D1 X0 Y0 Z0
; ==> MCS position X24.330 Y0.000 Z17.500
N120 M30
The tool is a turning tool. A frame rotation is activated in N80, causing the basic coordinate
system (BCS) to be rotated in relation to the workpiece coordinate system (WCS). In the WCS, the
compensation value (N70) acts on the geometry axis with index 1, i.e. on the X axis because G18
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
825
Work preparation
3.13 Tool offsets
is active. Since <CorMode> = 3, the tool wear in the direction of the X axis of the WCS must
become zero once N100 has been executed.
The contents of the relevant tool parameters at the end of the program are thus:
$TC_DP3[1,1]: 21.830 ; geometry L1
$TC_DP4[1,1] : 21.830 ; geometry L2
$TC_DP12[1,1] : 2.500 ; wear L1
$TC_DP13[1,1] : -4.330 ; wear L2
The geometrical relationships are shown in the figure below: The total wear including _CORVAL
is mapped onto the X' direction in the WCS. This produces point P2. The coordinates of this point
(measured in X/Y coordinates) are entered in the geometry component of the tool. The
difference vector P2 - P1 remains in the wear. The wear thus no longer has a component in the
direction of _CORVAL.
2ULJLQDO WRRO OHQJWK
[
[
3
B&259$/ DFWLYH LQ WKH ; GLUHFWLRQ
:HDU /
/
*HRPHWU\ /
/
]
If the program example is continued after N110 with the following instructions, then the
remaining wear is included completely in the geometry because the compensation is now
effective in the Z' axis (parameter <GeoAx> = 0):
N120 _CORVAL[0]=0.0
N130 R1=SETTCOR(_CORVAL,"GW",0,3,0)
N140 T1 D1 X0 Y0 Z0 ; ==> MCS position X24.330 Y0.000 Z17.500
Since the new compensation value is "0", the total tool length and thus the position approached
in N140 may not change. If _CORVAL were not equal to "0" in N120, a new total tool length and
thus a new position in N140 would result, however, the wear component of the tool length
would always be zero, i.e. the total tool length is subsequently always contained in the geometry
component of the tool.
NC programming
826
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
The same result as that achieved by calling the SETTCOR function with the <CorComp> = 0
parameter twice can also be reached by calling <CorComp> = 1 (vectorial compensation) just
once:
Program code
Comment
N10 DEF REAL _CORVAL[3]
N20 $TC_DP1[1,1]=500
; turning tool
N30 $TC_DP3[1,1]=10.0
; geometry L1
N40 $TC_DP4[1,1]=15.0
; geometry L2
N50 $TC_DP12[1,1]=10.0
; wear L1
N60 $TC_DP13[1,1]=0.0
; wear L2
N70 _CORVAL[0]=0.0
N71 _CORVAL[1]=5.0
N72 _CORVAL[2]=0.0
N80 ROT Y-30
N90 T1 D1 G18 G0
N100 R1=SETTCOR(_CORVAL,"GW",1,3,1)
N110 T1 D1 X0 Y0 Z0
; ==> MCS position X24.330 Y0.000 Z17.500
N120 M30
In this case, all wear components of the tool are set to zero immediately after the first call of
SETTCOR in N100.
Example 7
Program code
Comment
N10 DEF REAL _CORVAL[3]
N20 $TC_DP1[1,1]=500
; turning tool
N30 $TC_DP3[1,1]=10.0
; geometry L1
N40 $TC_DP4[1,1]=15.0
; geometry L2
N50 $TC_DP12[1,1]=10.0
; wear L1
N60 $TC_DP13[1,1]=0.0
; wear L2
N70 _CORVAL[0]=5.0
N80 ROT Y-30
N90 T1 D1 G18 G0
N100 R1=SETTCOR(_CORVAL,"GW",3,3)
N110 T1 D1 X0 Y0 Z0
; ==> MCS position X25.000 Y0.000 Z15.000
N120 M30
When compared to example 6, parameter <CorComp> = 3, and so the <GeoAx> parameter can
be omitted. The value contained in _CORVAL[0] now acts immediately on the tool length
component L1, the rotation in N80 has no effect on the result, the wear components in
$TC_DP12 are included in the geometry component together with _CORVAL[0], with the result
that the total tool length is stored in the geometry component of the tool, due to $TC_DP13,
after the first SETTCOR call in N100.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
827
Work preparation
3.13 Tool offsets
Example 8
Program code
Comment
N10 DEF REAL _CORVAL[3]
N20 $TC_DP1[1,1]=500
; turning tool
N30 $TC_DP3[1,1]=10.0
; geometry L1
N40 $TC_DP4[1,1]=15.0
; geometry L2
N50 $TC_DP5[1,1]=20.0
; geometry L3
N60 $TC_DP12[1,1]=10.0
; wear L1
N70 $TC_DP13[1,1]=0.0
; wear L2
N80 $TC_DP14[1,1]=0.0
; wear L3
N90 $SC_WEAR_SIGN=TRUE
N100 _CORVAL[0]=10.0
N110 _CORVAL[1]=15.0
N120 _CORVAL[2]=5.0
N130 ROT Y-30
N140 T1 D1 G18 G0
N150 R1=SETTCOR(_CORVAL,"W",1,1)
N160 T1 D1 X0 Y0 Z0
; ==> MCS position X7.990 Y25.000 Z31.160
N170 M30
Setting data:SD42930 $SC_WEAR_SIGN is enabled in N90, i.e. the wear must be evaluated with
a negative sign. The compensation is vectorial (<CorComp> = 1), and the compensation vector
must be added to the wear (<CorMode> = 1). The geometrical relationships in the Z/X plane are
shown in the diagram below:
;
;
5HVXOWLQJ ZHDU FRPSRQHQW
*HRPHWU\
/
/
3
3
B&259$/ <
;
=
3
=
:HDU /
/
2ULJLQDO WRRO OHQJWK
QHJDWLYH HYDOXDWLRQ
=
The geometry component of the tool remains unchanged due to <CorMode> = 1. The
compensation vector defined in the WCS (rotation around the y axis) must be included in the
wear component such that the total tool length in Fig. 3 refers to point P2. Therefore, the
resulting wear component of the tool is given by the distance of the two points P1 and P2.
NC programming
828
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
However, since the wear is evaluated negatively, due to setting data SD42930 $SC_WEAR_SIGN,
the compensation determined in this way has to be entered in the compensation memory with
a negative sign. The contents of the relevant tool parameters at the end of the program are thus:
$TC_DP3[1,1]: 10.000 ; geometry L1 (unchanged)
$TC_DP4[1,1] : 15.000 ; geometry L2 (unchanged)
$TC_DP5[1,1]: 10.000 ; geometry L3 (unchanged)
$TC_DP12[1,1] : 2.010 ; wear L1 (= 10 - 15 * cos(30) + 10 * sin(30))
$TC_DP13[1,1] : -16.160 ; wear L2 (= -15 * sin(30) - 10 * cos(30))
$TC_DP14[1,1] : -5.000 ; wear L3
The effect of setting data SD42930 $SC_WEAR_SIGN on the L3 component in the Y direction can
be recognized without the additional complication caused by the frame rotation.
Additional information
Turning/grinding tools: Calculating the tool length depending on MD20360
$MC_TOOL_PARAMETER_DEF_MASK
The following machine data defines how the wear and tool length are to be evaluated if a
diameter axis is used for turning/grinding tools:
MD20360 $MC_TOOL_PARAMETER_DEF_MASK.<Bit> = <Value>
<Bit>
<Val-
Meaning
ue>
0
0
For turning/grinding tools, the wear parameter of the transverse axis is taken into
account in the radius value:
1
For turning/grinding tools, the wear parameter of the transverse axis is taken into
account as the diameter value:
1
0
For turning/grinding tools, the tool length component of the transverse axis is
taken into account as the radius value:
1
For turning/grinding tools, the tool length component of the transverse axis is
taken into account as the diameter value:
If the bits involved are set, the associated entry is weighted with a factor of 0.5. The correction
using SETTCOR is executed so that the total effective tool length change is equal to the value
transferred in <CorVal>. If, when calculating the length, a length is evaluated with a factor of 0.5
as a result of machine data MD20360 $MC_TOOL_PARAMETER_DEF_MASK, then the
compensation of this component must be realized with twice the value transferred.
Example
MD20360 $MC_TOOL_PARAMETER_DEF_MASK = 2 (tool length must be evaluated in the
diameter axis using a factor of 0.5)
Axis X is the diameter axis.
Program code
Comment
N10 DEF REAL _LEN[11]
N20 DEF REAL _CORVAL[3]
N30 $TC_DP1[1,1]=500
; Tool type
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
829
Work preparation
3.13 Tool offsets
Program code
Comment
N40 $TC_DP2[1,1]=2
; Cutting edge position
N50 $TC_DP3[1,1]=3.
; Geometry - length 1
N60 $TC_DP4[1,1]=4.
; Geometry - length 2
N70 $TC_DP5[1,1]=5.
; Geometry - length 3
N80 _CORVAL[0]=1.
N90 _CORVAL[1]=1.
N100 _CORVAL[2]=1.
N110 T1 D1 G18 G0 X0 Y0 Z0
; ==> MCS position X1.5 Y5 Z4
N120 R1=SETTCOR(_CORVAL,"G",1,1)
N130 T1 D1 X0 Y0 Z0
; ==> MCS position X2.5 Y6 Z5
N140 R3=$TC_DP3[1,1]
; = 5. = (3.000 + 2.*1.000)
N150 R4=$TC_DP4[1,1]
; = 5. = (4.000 + 1.000)
N160 R5=$TC_DP5[1,1]
; = 6. = (5.000 + 1.000)
N170 M30
In each axis, the tool length compensation should be 1 mm (N80 to N100). 1 mm is thus added
to the original length in lengths L2 and L3. Twice the compensation value (2 mm) is added to the
original tool length in L1, in order to change the total length by 1 mm as required. If the positions
approached in blocks N110 and N130 are compared, it can be seen that each axis position has
changed by 1 mm.
3.13.14
Read the assignment of the tool lengths L1, L2, L3 to the coordinate axes
(LENTOAX)
The LENTOAX function provides information about the assignment of tool lengths L1, L2 and L3
of the active tool to the abscissa, ordinate and applicate. The assignment of abscissa, ordinate
and applicate to the geometry axes is affected by frames and the active plane (G17 - G19).
Only the geometry component of a tool ($TC_DP3[<t>,<d>] to $TC_DP5[<t>,<d>]) is
considered, i.e. a different axis assignment for other components (e.g. wear) has no effect on the
result.
Syntax
<Status> = LENTOAX(<AxInd>, <Matrix>[, <Coord>])
Principle
LENTOAX(...):
Predefined function to read the assignment of tool lengths L1, L2 and L3 of the
active tool to the coordinate axes
Alone in the block:
Yes
NC programming
830
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
<Status>:
Function return value. Negative values indicate error states.
Data type:
INT
Value:
0
Function OK
Information provided in <AxInd> is sufficient for the descrip-
tion (all tool length components are in parallel to the geom-
etry axes).
1
Function is OK, however, the content of <Matrix> must be
evaluated for a correct description (the tool length compo-
nents are not parallel to the geometry axes).
-1
Invalid string in parameter <Coord>.
-2
No tool active.
Parameters
1
<AxInd>:
If the tool length components are parallel to the geometry axes, the axis indices
assigned to length components L1 to L3 are returned in the <AxInd> array.
• <AxInd> [0]: Abscissa
• <AxInd> [1]: Ordinate
• <AxInd> [2]: Applicate
Data type:
INT[3]
Value:
0
No assignment exists (axis does not exist)
1 ... 3
Number of the length effective in the corresponding coordi-
nate axis.
or
The sign is negative if the tool length component is pointing
-1 ... -3
in the negative coordinate direction.
If not all length components are parallel or antiparallel to the geometry axes, the
index of the axis, which contains the largest part of a tool length component, is
returned in <AxInd>. In this case (if the function does not return an error for a
different reason), then the return value is <Status> = 1. The mapping of tool length
components L1 to L3 to geometry axes 1 to 3 is then described completely by the
content of the 2nd parameter <Matrix>.
2
<Matrix>:
Matrix which represents the vector of the tool lengths (L1=1, L2=1, L3=1) to the
vector of the coordinate axes (abscissa, ordinate, applicate), i.e. the tool length
components are assigned to the columns in the order L1, L2, L3 and the axes are
assigned to the lines in the order abscissa, ordinate, applicate.
Data type:
REAL
All elements are always valid in the matrix, even if the geometry axis belonging to
the coordinate axis is not available, i.e. if the corresponding entry in <AxInd> is 0.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
831
Work preparation
3.13 Tool offsets
3
<Coord>:
coordinate system applicable for the assignment (optional)
Data type:
STRING
Charac-
MCS
The tool length is represented in the machine coordinate sys-
ters:
tem.
M
BCS
The tool length is represented in the basic coordinate system.
B
WCS
The tool length is represented in the workpiece coordinate
system (default setting).
W
KCS
The tool length is represented in the tool coordinate system
of the kinematic transformation.
K
TCS
The tool length is represented in the tool coordinate system.
T
The notation of the characters in the string (upper or lower case) is arbitrary.
If the parameter <Coord> is not specified, then WCS is used (default setting).
Note
In the TCS, all tool length components are always parallel or antiparallel to the axes.
The components can only be antiparallel when mirroring is active and the following setting data
is activated:
SD42900 $SC_MIRROR_TOOL_LENGTH (sign change tool length when mirroring)
Example
Standard application, milling tool for G17.
L1 applies in Z (applicate), L2 applies in Y (ordinate), L3 applies in X (abscissa).
Function call in the form:
<Status>=LENTOAX(<AxInd>,<Matrix>,"WCS")
The result parameter <AxInd> then contains the values:
<AxInd>[0] = 3
<AxInd>[1] = 2
<AxInd>[2] = 1
Or, in short: (3, 2, 1)
In this case, the associated matrix (<Matrix>) is:
0DWUL[!
A change from G17 to G18 or G19 does not alter the result, because the assignment of the length
components to the geometry axes changes in the same way as the assignment of the abscissa,
ordinate and applicate.
A frame rotation of Z through 60 degrees is now programmed with G17 active, e.g.
NC programming
832
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.13 Tool offsets
ROT Z60
The direction of the applicate (Z direction) remains unchanged; the main component of L2 now
lies in the direction of the new X axis; the main component of L1 now lies in the direction of the
negative Y axis. As a consequence, the return value (<Status>) is "1", <AxInd> contains the
values (2, -3, 1).
In this case, the associated matrix (<Matrix>) is:
VLQ r FRV r
0DWUL[!
FRV r
VLQ r
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
833
Work preparation
3.14 Path traversing behavior
3.14
Path traversing behavior
3.14.1
Feedrate characteristic (FNORM, FLIN, FCUB, FPO)
To permit flexible definition of the feedrate characteristic, the feedrate programming according
to DIN 66025 has been extended by linear and cubic characteristics.
The cubic characteristics can be programmed either directly or as interpolating splines. These
additional characteristics make it possible to program continuously smooth velocity
characteristics depending on the curvature of the workpiece to be machined.
These additional characteristics make it possible to program continuously smooth velocity
characteristics depending on the curvature of the workpiece to be machined.
Syntax
F… FNORM
F… FLIN
F… FCUB
F=FPO(…,…,…)
Meaning
FNORM:
Basic setting. The feed value is specified as a function of the traverse path of the block and
is then valid as a modal value.
FLIN:
Path velocity profile linear:
The feed value is approached linearly via the traverse path from the current value at the
block beginning to the block end and is then valid as a modal value. The response can be
combined with G93 and G94.
FCUB:
Path velocity profile cubic:
The blockwise programmed F values (relative to the end of the block) are connected by
a spline. The spline begins and ends tangentially with the previous and following de-
fined feedrate and takes effect with G93 and G94.
If the F address is missing from a block, the last F value to be programmed is used.
F=FPO… :
Polynomial path velocity profile:
The F address defines the feed characteristic via a polynomial from the current value to
the block end. The end value is valid thereafter as a modal value.
Feed optimization on curved path sections
Feed polynomial F=FPO and feed spline FCUB should always be traversed at constant cutting
rate CFC, thereby allowing a jerk-free setpoint feed profile to be generated. This enables
creation of a continuous acceleration setpoint feed profile.
NC programming
834
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
Work preparation
3.14 Path traversing behavior
Example: Various feed profiles
This example shows you the programming and graphic representation of various feed profiles.
Feed
5000
4000
3000
2000
1000
Path
N N
N
N N N N N N N N N N N N
1
2
3
4
5
6
7
8
9
10
11
12 13 14 15
Program code
Comment
N1 F1000 FNORM G1 X8 G91 G64
; Constant feedrate profile, incremental di-
mension data
N2 F2000 X7
; Setpoint velocity step change
N3 F=FPO(4000, 6000, -4000)
; Feed profile via polynomial with feed 4000
at the end of the block
N4 X6
; Polynomial feedrate 4000 is valid as modal
value
N5 F3000 FLIN X5
; Linear feedrate profile
N6 F2000 X8
; Linear feedrate profile
N7 X5
; Linear feedrate is valid as modal value
N8 F1000 FNORM X5
; Constant feedrate profile with acceleration
step change
N9 F1400 FCUB X8
; All of the following F values programmed in
blocks are connected with splines
N10 F2200 X6
N11 F3900 X7
N12 F4600 X7
N13 F4900 X5
; Switch-out spline profile
N14 FNORM X5
N15 X20
Further information
FNORM
The feed address F defines the path feedrate as a constant value according to DIN 66025.
NC programming
Programming Manual, 10/2020, 6FC5398-2EP40-0BA1
835

 

 

 

 

 

 

 

Content      ..     10      11      12      13     ..