Documente Academic
Documente Profesional
Documente Cultură
Compensation methods
The "interpolatory compensation" function uses the following two compensation methods:
"Leadscrew error compensation" or "measuring system error compensation" (referred to
as LEC below).
Sag compensation or angularity error compensation, referred to as sag compensation
below.
Many of the characteristics of these two compensation methods are identical and are
therefore described in the next Section "General notes".
Terminology
The following terms are used in the description of "Interpolatory compensation":
Compensation value
The difference between the axis position measured by the position actual-value encoder
and the required programmed axis position (= axis position of the ideal machine). The
compensation value is often also referred to as the correction value.
Basic axis
Axis whose setpoint position or actual position forms the basis of the calculation of a
compensation value.
Compensation axis
Axis whose setpoint position or actual position is modified by a compensation value.
Interpolation point
A position of the base axis and the corresponding compensation value of the
compensation axis.
Compensation table
Table containing interpolation points
Compensation relation
Assignment of the base axis and the corresponding compensation axis and the reference
to the corresponding compensation table.
Sag errors
Weight can result in position-dependent displacement and inclination of moved parts since it
can cause machine parts and their guides to sag.
Large workpieces, too, e.g. cylinders, sag under their own weight.
Angularity errors
If moving axes are not positioned in exactly the required angle (e.g. perpendicular) with
respect to one another, increasingly serious positioning errors will occur as the deviation
from zero point becomes greater.
Compensation table
Because the above mentioned dimensional deviations directly affect the accuracy of
workpiece machining, they must be compensated for by the relevant position-dependent
compensation values. The compensation values are derived from measured error curves
and entered in the control in the form of compensation tables during commissioning. A
separate table must be created for each compensation relation.
The compensation values and additional table parameters are entered in the compensation
tables using special system variables.
Note
Compensation tables can be loaded only if the following machine data are set:
MD32700 $MA_ENC_COMP_ENABLE (interpolatory compensation)=0
or
MD32710 $MA_CEC_ENABLE (enable sag compensation)=0
Note
Once the size of the compensation tables has been defined in machine data, the NC
generates the tables after the next power ON. The default setting for these tables is "0".
The compensation tables can be output from the "Services" operating area via the serial
interface on the PCU and loaded back after editing.
These compensation values are not lost when the control is switched off because they are
stored in the non-volatile user memory. They can be updated if necessary (e.g. following
re-measuring because of machine aging).
Caution
When the setting in machine data:
MD18342 $MN_MM_CEC_MAX_POINTS[t]
(max. number of interpolation points of sag comp., SRAM)
or
MD38000 $MA_MM_ENC_COMP_MAX_POINTS
(number of interpolation points with interpolatory compensation, SRAM) changes,
the non-volatile user memory is automatically re-allocated on system power-on.
All the user data in non-volatile user memory (e.g. drive and HMI machine data, tool offsets,
part programs, compensation tables, etc.) are deleted.
References:
/FB2/ Description of Functions Basic Machine/Memory Configuration (S7)
Logging
Compensation tables are not saved with the series commissioning file.
To archive compensation tables, they must be output via the serial interface on the PCU.
The following compensation types can be selected for archiving in the operating area
"Services", "Data OUT":
LEC/measuring system error compensation (%_N_AX_EEC_INI)
Sag/angularity compensation (%_N_AX_CEC_INI)
Quadrant error compensation (%_N_AX_QEC_INI)
Compensation tables can also be saved as an archive file with HMI Advanced.
&RPSHQVDWLRQYDOXH
RIFRPSHQVDWLRQD[LV (UURUFXUYH
&RPSHQVDWLRQFXUYH
/LQHDULQWHUSRODWLRQ
Function
The leadscrew error compensation function is part of the measuring system error
compensation system.
With "measuring system error compensation" (referred to below as MSEC), the base and
compensation axes are always identical. It is therefore an axial compensation for which a
definition of the base axis and compensation axis in the compensation table is not
necessary.
The principle of the MSEC is to modify the axis-specific position actual value by the assigned
compensation value in the interpolation cycle and to apply this value to the machine axis for
immediate traversal. A positive compensation value causes the corresponding machine axis
to move in the negative direction.
The magnitude of the compensation value is not limited and is not monitored. In order to
avoid impermissibly high velocities and accelerations caused by compensation, small
compensation values must be selected. Large compensation values can cause other axis
monitoring functions to output alarms (e.g. contour monitoring, velocity setpoint limitation).
If the axis to be compensated has a 2nd position measuring system, a separate
compensation table must be created and activated for each measuring system. The correct
table is automatically used when switching between measuring systems.
Activation
The "MSEC" does not become active until the following conditions are fulfilled:
The compensation values are stored in the NC user memory and active (after power ON).
The function has been activated for the relevant machine axis (MD32700
$MA_ENC_COMP_ENABLE [e] = 1 (interpolatory compensation)).
If a 2nd position measuring system is to be compensated, this must also be enabled with
the above machine data (e = 0: 1. Measuring system; e = 1: 2. measuring system).
The axis has been referenced
DB31, ... DBX60.4 or 60.5 =1 (referenced/synchronized 1 or 2)
As soon as these conditions have been fulfilled, the axis-specific actual value is altered by
the compensation value in all modes and traversed by the machine axis immediately.
If the reference is then lost, e.g. because the encoder frequency has been exceeded
(DB31, ... DBX60.4 or 60.5 = 0), compensation processing is deactivated.
$$B(1&B&203B0$;>H$;L@$$B(1&B&203B0,1>H$;L@
00B(1&B&203B0$;B32,176>H$;L@ $$B(1&B&203B67(3>H$;L@
Compensation table
The position-related compensation values are stored in the form of system variables for the
relevant axis in the compensation table.
The following measuring-system-specific parameters must be set for the table (see diagram
below):
Compensation value for interpolation point N in compensation table
($AA_ENC_COMP [e,N,AXi])
For every individual interpolation point (axis position) the compensation value must be
entered in the table.
Interpolation point N is limited by the number of possible interpolation points in the
relevant compensation table:
(MD38000 $MA_MM_ENC_COMP_MAX_POINTS
(number of interpolation points for interpolat. compensation (SRAM))
The magnitude of the compensation value is not limited.
Permissible range of N: 0 N < MD38000 -1
Note
The first and last compensation values remain active over the entire traversing range, i.e.
these values should be set to "0" if the compensation table does not cover the entire
traversing range.
$$B(1&B&203B0$;$$B(1&B&203B0,1
N
$$B(1&B&203
Caution
When the compensation values are entered it is important that all interpolation points be
assigned a position value within the defined range (i.e. no gaps). Otherwise, the previous
valid position value is used for these interpolation points.
Note
Table parameters containing positional information are automatically converted when the
system of units is changed (when the setting in the following machine data is altered):
MD10240 $MN_SCALING_SYSTEM_IS_METRIC
(basic system metric)). The position information is always interpreted in the current
measuring system. Conversion must be implemented externally.
Automatic conversion of positional information can be configured by the setting in the
following machine data:
MD10260 $MN_CONVERT_SCALING_SYSTEM=1
External conversion is no longer necessary.
References: /FB1/ Function Manual, Basic Functions; Velocities, Setpoint-Actual Value
Systems, Closed-Loop Control (G2)
Example
The following example shows compensation value inputs for machine axis X1.
%_N_AX_EEC_INI
CHANDATA(1)
$AA_ENC_COMP[0,0,X1] = 0.0 ; 1st compensation value
( interpolation point 0)
; +0m
$AA_ENC_COMP[0,1,X1] = 0.01 ; 2nd compensation value
( interpolation point 1)
; +10m
$AA_ENC_COMP[0,2,X1] = 0.012 ; 3rd compensation value
( interpolation point 2)
; +12m
$AA_ENC_COMP[0,800,X1] = -0.0 ; last compensation value
; ( interpolation point 800)
$AA_ENC_COMP_STEP[0,X1] = 1.0 ; interpolation point distance 1.0 mm
$AA_ENC_COMP_MIN[0,X1] = -200.0 ; compensation starts at -200.0 mm
$AA_ENC_COMP_MAX[0,X1] = 600.0 ; compensation ends at +600.0 mm
$AA_ENC_COMP_IS_MODULO[0,X1] = 0 ; compensation without modulo function
M17
&RPSHQVDWLRQYDOXH (UURUFXUYH
&RPSHQVDWLRQFXUYH
OLQHDULQWHUSRODWLRQEHWZHHQLQWHUSRODWLRQSRLQWV
&RPSHQVDWLRQYDOXHVRIFRPSHQVDWLRQWDEOH
(QGSRVLWLRQ
$$B(1&B&203B0$;
&RPSHQVDWLRQ
3RLQWVSDFLQJ YDOXHLQWSRLQW
$$B(1&B&203
5HIHUHQFHSRLQW
$[LVSRVLWLRQ
,QWHUSROD
WLRQSRLQWV /LQHDULQWHUSRODWLRQ
6WDUWLQJSRVLWLRQ
$$B(1&B&203B0,1
1XPEHURILQWHUSRODWLRQSRLQWV
0'0$B00B(1&B&203B0$;B32,176
Function
In contrast to the MSEC, the base and compensation axes need not be identical for "Sag
compensation" or "Angularity error compensation", requiring an axis assignment in every
compensation table.
In order to compensate for sag of one axis (base axis) which results from its own weight, the
absolute position of another axis (compensation axis) must be influenced. "Sag
compensation" is therefore an inter-axis compensation.
As illustrated in the diagram below, the further the machining head moves in the negative Y1
axis direction, the more the cross-arm sags in the negative Z1 axis direction.
The error must be recorded in the form of a compensation table that contains a
compensation value for the Z1 axis for every actual value position in the Y1 axis. It is
sufficient to enter the compensation values for the interpolation points.
When the Y1 axis traverses, the control calculates the corresponding compensation value in
the Z1 axis in interpolation cycles performing linear interpolation for positions between the
interpolation points. This compensation is sent to the position control loop as an additional
setpoint. A positive compensation value causes the corresponding machine axis to move in
the negative direction.
=
<
6DJLQQHJ<
GLUHFWLRQEHFDXVH
RILWVRZQZHLJKW
Depending on the requirement, several compensation relations can be defined for one axis.
The total compensation value results from the sum of all the compensation values of this
axis.
Setting options
The many ways in which the compensation value for sag compensation can be
produced/influenced are listed below (see diagram below).
1. An axis can be defined as the input variable (base axis) for several compensation tables
(settable via system variables).
2. An axis can be defined as the recipient of the output variable (compensation axis) of
several compensation tables (settable via system variable). The total compensation value
is derived from the sum of the individual compensation values.
The following definitions apply for the maximum number of possible compensation tables:
Total maximum number of tables available for all axes:
2 * maximum number of axes of system
Maximum number of tables configured for one particular compensation axis:
1 * maximum number of axes of system
3. An axis can be both a base axis and a compensation axis at any one time. The
programmed (required) position setpoint is always used to calculate the compensation
values.
4. The scope of action of the compensation (starting and end position of the base axis) and
the distance between the interpolation points can be defined for every compensation
table (settable via system variables).
5. Compensation can be direction-dependent (settable via system variables).
6. Every compensation table has a modulo function for cyclic evaluation (settable via
system variables).
7. A weighting factor by which the table value is multiplied (definable as a setting data which
can therefore be altered by the part program, PLC or the user at any time) can be
introduced for every compensation table.
8. Compensation tables can be multiplied in pairs (settable via system variables). The
product is added to the total compensation value of the compensation axis.
9. The compensation can be activated in the following ways:
Machine data:
MD32710 $MA_CEC_ENABLE [AXi] (enable sag compensation)
enables the sum of all compensation relations for machine axis AXi.
Evaluation of the compensation table [t] is enabled with the following setting data:
SD41300 $SN_CEC_TABLE_ENABLE[t]
(presetting for compensation table)
It is thus possible, for example, to alter the compensation relations either from the part
program or from the PLC user program (e.g. switching over the tables), depending on
the machining requirements.
10.Setting:
MD10260 $MN_CONVERT_SCALING_SYSTEM=1
(basic system switchover active)
activates the following axial machine data:
MD32711 $MA_CEC_SCALING_SYSTEM_METRIC
(system of units of sag compensation)
The measuring system for all tables effective for this axis is set in this machine data.
Hereby all position entries are interpreted together with the calculated total compensation
value in the configured measuring system. External conversions of position information
are no longer necessary with a measuring system change.
Monitoring
To avoid excessive velocities and acceleration rates on the machine axis as a result of
applying sag compensation, the total compensation value is monitored and limited to a
maximum value.
The maximum compensation value is set for each axis with the following axial machine data:
MD32720 $MA_CEC_MAX_SUM
(maximum compensation value for sag compensation).
If the resulting total compensation value is greater than the maximum value, alarm 20124
"Sum of compensation values too high" is output. Program processing is not interrupted. The
compensation value output as an additional setpoint is limited to the maximum value.
Alteration of the total compensation value is also limited axially.
When the limit value defined by the following machine data is violated, alarm 20125 "Too
rapid change in compensation value" is generated:
MD32730 $MA_CEC_MAX_VELO (change in velocity with 1)
The program continues to run. The path not covered because of the limitation is made up as
soon as the compensation value is no longer subject to limitation.
6
$[LV
$[LVQ
6
$[LVQ
&(&B &(&B
6HWWLQJ
7$%/(B 7$%/(B
GDWD
:(,*+7 (1$%/(
0DFKLQH &(&B0$;B
GDWD 680 &(&B(1$%/(
&(&B0$;B
9(/2
2.3 Interpolatory compensation
Detailed Description
29
Detailed Description
2.3 Interpolatory compensation
Complex compensation
Since it is possible to use the position of an axis as the input quantity (base axis) for several
tables, to derive the total compensation value of an axis from several compensation
relationships (tables) and to multiply tables, it is also possible to implement sophisticated and
complex beam sag and angularity error compensation systems.
This function also makes it possible to deal with different error sources efficiently. For
example, it is possible to combine a table with a modulo function for a periodic recurring
error component with a second table without a modulo function for an aperiodic error
component for the same axis.
Leadscrew errors can also be compensated with this function by parameterizing an identical
axis for the base and compensation axes. However, in contrast to the MSEC, measuring-
system switchovers are not automatically registered in this case.
Activation
The "sag compensation" function does not become active until the following conditions are
fulfilled:
The option "Interpolatory compensation" has been enabled.
The function has been activated for the relevant machine axis (compensation axis):
MD32710 $MA_CEC_ENABLE [AXi] = 1
The compensation values have been stored in the non-volatile NC user memory and are
active (after power ON).
Evaluation of the relevant compensation table has been enabled:
SD41300 $SN_CEC_TABLE _ENABLE [t] = 1
The current measuring system of the base and compensation axes has been referenced:
DB31, ... DBX60.4 or 60.5 =1 (referenced/synchronized 1 or 2)
As soon as these conditions have been fulfilled the setpoint position of the compensation
axis is altered in all modes with reference to the setpoint position of the base axis and the
corresponding compensation value and is then immediately traversed by the machine axis.
If the reference is then lost, e.g. because the encoder frequency has been exceeded
(DB31, ... DBX60.4 or 60.5 = 0), compensation processing is deactivated.
$1B&(&B0$;>W@$1B&(&B0,1>W@
00B&(&B0$;B32,176>W@
$1B&(&B67(3>W@
Table parameters
The position-related corrections for the relevant compensation relationship are stored as
system variables in the compensation table.
The following parameters must be set for the table:
Compensation value for interpolation point N of compensation table [t]
($AN_CEC [t, N])
The compensation value of the compensation axis must be entered in the table for each
individual interpolation point (position of the base axis).
Interpolation point N is limited by the number of possible interpolation points in the
relevant compensation table:
MD18342 $MN_MM_CEC_MAX_POINTS.
Permissible range of N: 0 N < MD18342
Base axis ($AN_CEC_INPUT_AXIS[t])
Name of machine axis whose setpoint is to be used as the input for the compensation
table [t].
Compensation axis ($AN_CEC_OUTPUT_AXIS[t])
Name of machine axis to which the output of the compensation table [t] is to be applied.
Note
In multi-channel systems the "general axis identifiers" AX1... must be preset, if the
identifiers of machine axis and channel axis are identical.
$1B&(&B0$;>W@$1B&(&B0,1>W@
N
$1B&(&B67(3>W@
Note
Table parameters containing positional information are automatically converted when the
system of units is changed (when the setting in the following machine data is altered):
MD10240 $MN_SCALING_SYSTEM_IS_METRIC (basic system metric))
The position information is always interpreted in the current measuring system.
Conversion must be implemented externally.
With setting:
MD10260 $MN_CONVERT_SCALING_SYSTEM=1 (basic system switchover active)
the system of units can be configured in the following machine data:
MD32711 $MA_CEC_SCALING_SYSTEM (system of units of sag compensation)
External conversions of position information are no longer necessary with a measuring
system change.
References:
/FB1/ Description of Functions, Basic machine; Velocities, Setpoint-Actual Value
Systems, Closed-Loop Control (G2)
Table example
The following example shows the compensation table for sag compensation of axis Y1.
Depending on the position of the Y1 axis, a compensation value is applied to the Z1 axis.
The 1st compensation table (t = 0) is used for this.
%_N_NC_CEC_INI
CHANDATA(1)
$AN_CEC [0,0] =0 ; 1st compensation value
( interpolation point 0)
; for Z1: 0 m
$AN_CEC [0,1] =0.01 ; 2nd compensation value
( interpolation point 1)
; for Z1: + 10 m
$AN_CEC [0,2] =0.012 ; 3rd compensation value
( interpolation point 2)
; for Z1: + 12 m
:
$AN_CEC [0,100] =0 ; last compensation value
; (interpolation point 101)
; for Z1: 0 m
$AN_CEC_INPUT_AXIS[0] =(AX2) ; base axis Y1
$AN_CEC_OUTPUT_AXIS[0] =(AX3) ; compensation axis Z1
$AN_CEC_STEP[0] =8 ; interpolation point distance 8.0 mm
$AN_CEC_MIN[0] =-400.0 ; compensation starts at
; Y1 = -400 mm
$AN_CEC_MAX[0] =400.0 ; compensation ends at Y1 = +400 mm
$AN_CEC_DIRECTION[0] =0 ; table applies in both
; directions of travel of Y1
$AN_CEC_MULT_BY_TABLE[0] =0
$AN_CEC_IS_MODULO[0] =0 ; compensation without modulo function
M17
In this example, the setting for the number of compensation interpolation points must be as
shown below:
MD18342 $MN_MM_CEC_MAX_POINTS [0] 101
(alarm 12400 will otherwise be generated).
The compensation table for this example requires at least 808 bytes of non-volatile NC user
memory.
Table multiplication
With the table compensation function, any table can be multiplied by any other table (i.e.
even by itself). The multiplication link is established using the system variables described
above.
The following example for the compensation of machine foundation sagging illustrates an
application of table multiplication.
On large machines, sagging of the foundation can cause inclination of the whole machine.
For the boring mill in the second diagram below, for example, it is determined that
compensation of the X1 axis is dependent both on the position of the X1 axis itself (since this
determines angle of inclination b) and on the height of the boring mill (i.e. the position of the
Z1 axis).
To implement compensation, the compensation values of the X1 and Z1 axes must be
multiplied according to the following equation:
X1 = Z1 * sin(X1) Z1 * (X1)
7DEOH
;VHWS VLQ;
= ;VHWS6&RPS
=VHWS
;
7DEOH
Compensation table 1 (table index = 0) describes the reaction of axis X1 on axis X1 (sine of
the position-dependent tilting angle (X1)).
Compensation table 2 (table index = 1) describes the reaction of axis Z1 on axis X1 (linear).
In table 1, the multiplication of table 1 (index = 0) with table 2 is to be selected:
$AN_CEC_MULT_BY_TABLE[0] = 2
%RULQJPLOO
=PHDVXUHGYDOXH
=
)RXQGDWLRQXQGHUORDG
;
;
;PHDVXUHG
YDOXH
Note
The maximum dimensions of the grid (number of lines and columns) depends on the
following points:
No. of lines: Dependent on number of axes in the system (dependent on NCU type)
No. of columns: Dependent on the maximum number of values which can be entered in a
compensation table (up to a total of 2000 values)
Caution
The number of lines and columns is set via the following machine data:
MD18342 $_MN_MM_CEC_MAX_POINTS
(max. number of interpolation points of sag comp. (SRAM))
The machine data is memory-configuring.
<
Figure 2-13 Compensation values of Z axis with chessboard-like distribution of X-Y plane
Fundamental principle
The compensation values cannot be entered directly as a 2-dimensional grid. Compensation
tables in which the compensation values are entered must be created first.
A compensation table contains the compensation values of one line (four lines in the
example, i.e. four compensation tables). The compensation values 0.1 to 0.5 are entered in
the first table in the example, the compensation values 0.6 to 1.0 in the second table, and so
on. The compensation tables are referred to below as f tables and their values as f_i(x)
(i=number of table).
The compensation values of f tables are evaluated by multiplying them by other tables. The
latter are referred to below as g tables and their values as g_i(y). The number of f tables and
g tables is equal (four in the example).
In g tables, one compensation value in each table is set to 1 and all the others to 0. The
position of compensation value 1 within the table is determined by the table number. In the
first g table, compensation value 1 is positioned at the first interpolation point and, in the
second g table, at the second interpolation point, etc. By multiplying g tables by f tables, the
correct compensation value in each f table is selected by multiplying it by 1. All irrelevant
compensation values are concealed through multiplication by 0.
Using this scheme, compensation value Dz at position (x/y) is calculated according to the
following equation:
Dz(x/y)=f_1(x)*g_1(y) + f_2(x)*g_2(y) + ...
When the compensation value for the current position of the machine spindle is calculated,
the f table values are multiplied by the g table values according to this rule.
Applied to the example, this means, for instance, that compensation value Dz(500/300) is
calculated by multiplying each of the function values f_i(500) in the f tables by the function
values g_i(300) in the g tables:
Dz(500/300) = f_1(1000)*g_1(300) + f_2(1000)*g_2(300) + f_3(1000)*g_3(300) +
f_4(1000)*g_4(300)
Dz(500/300) = 0.2*0 + 0.7*1 + 1.2*0 + 1.7*0 = 0.7
(for functions values, see also f and g tables in program code)
Program code
The application example described above can be achieved with the following part program
code:
R2=R2+300
IF R2<=900 GOTOB LOOP_Y
Note
You can read the compensation value under variable "Sag + temperature compensation" on
the operator interface. To do so, select softkey "Diagnosis" followed by softkey "Service
axis". The currently effective compensation value is displayed next to the "Sag + temperature
compensation" variable.
;The power ON machine data are set to prepare the table configuration
;
;cec.md:
;Set option data for commissioning
;Define the number of interpolation points in the compensation tables
;Machine data is memory-configuring
$MN_MM_CEC_MAX_POINTS[0]=5
$MN_MM_CEC_MAX_POINTS[1]=5
$MN_MM_CEC_MAX_POINTS[2]=5
$MN_MM_CEC_MAX_POINTS[3]=5
$MN_MM_CEC_MAX_POINTS[4]=4
$MN_MM_CEC_MAX_POINTS[5]=4
$MN_MM_CEC_MAX_POINTS[6]=4
$MN_MM_CEC_MAX_POINTS[7]=4
$MA_CEC_MAX_SUM[AX3]=10.0 ; Define the maximum
; total compensation value
$MA_CEC_MAX_VELO[AX3]=100.0 ; Limit the maximum changes in the
; total compensation value
M17
Measurement
The "Measurement" function supplies the compensated actual positions (ideal machine)
required by the machine operator or programmer.
TEACH IN
The "TEACH IN" function also uses compensated position values to determine the actual
positions to be stored.
Position display
The position actual-value display in the machine coordinate system shows the ideal
(programmed) actual position value of the axis (ideal machine).
In the axis/spindle service display (operating area Diagnosis) the positional value determined
by the measuring system plus the sum of the backlash compensation and leadscrew error
compensation is displayed (= actual position value measuring system 1/2).
Access protection
Currently there is no protection against access to the compensation tables.