Вы находитесь на странице: 1из 20

Industrielle Steuerungstechnik GmbH FCT-C24

Functional description C24


Limiting decoder block ahead

1 Introduction 2

2 Block ahead limiting on basis of the number of blocks 5


2.1 Application .........................................................................................................7
2.1.1 Limiting the number of blocks via NC command ...................................................7
2.1.2 Limiting the number of blocks via channel parameters .........................................9
2.2 Specifics, restrictions ......................................................................................10

3 Time-related block ahead limiting 11


3.1 Programming example .....................................................................................14

4 Monitored block ahead operation 18

5 Parameters 19
5.1 Overview ...........................................................................................................19
5.2 Description .......................................................................................................19

Limiting decoder block ahead Release 01/2015 Page 1


Industrielle Steuerungstechnik GmbH FCT-C24

1 Introduction

Motivation, function After an NC program is started, the individual NC blocks are read in con-
tinuously by an interpreter module, are converted to an internal representa-
tion and are output to the NC channel for further processing. In the NC
channel, the data is then read in by further modules (tool radius compensa-
tion, contour preparation, etc.), edited and passed through up to the inter-
polator.
The current editing of the commands in the interpolator corresponds to the
actual status of the machine, whereas the decoded commands corre-
spond to its future status.
During program decoding, parameters (e.g. external variables) are read
and, depending on them, different program sequences are possibly run
through.
Decoder block ahead is currently not limited. Thus, the time between pro-
gram influencing during decoding and program execution can be very long.
That is to say that a parameter change that has an influence on program
decoding is only noticeable to a user in execution after a considerable de-
lay.
To keep this program influencing as close as possible in time to program
execution, the decoder block ahead must be kept as short as possible, i.e.
influences on the program are relatively directly noticeable to the user.

Limiting decoder block ahead Release 01/2015 Page 2


Industrielle Steuerungstechnik GmbH FCT-C24

%Main
N10 X.. Y.. Z.. G01 F2000
N20 X.. Y..
N30 $IF V.E.Param1 Time
N40 Z..
N... sequence
N200 $IF V.E.Ext_influence
N210 X..
N220 $ENDIF
N1000 M30

NC channel
DECODER
%Main
N10 X.. Y.. Z.. G01 F2000
N20 X.. Y..
N30 $IF V.E.Param1
N40 Z..
Decoding at N200 N...
N200 $IF V.E.Ext_influence
N210 X..
N220 $ENDIF
N1000 M30

N190..
%Main
N10 X.. Y.. Z.. G01 F2000
N20 X.. Y..
TOOL RADIUS COMPENSATION N30 $IF V.E.Param1
N40 Z..
Internal N...
dynamic buffer N200 $IF V.E.Ext_influence
N210 X..
N220 $ENDIF
N1000 M30 Decoder
N130..
block
ahead
%Main
N10 X.. Y.. Z.. G01 F2000
PATH PREPARATION N20 X.. Y..
N30 $IF V.E.Param1
Internal N40 Z..
dynamic buffer N...
N200 $IF V.E.Ext_influence
N210 X..
N220 $ENDIF
N30.. N1000 M30
N20..

INTERPOLATION
Internal
dynamic buffer
Interpolation %Main
N10 X.. Y.. Z.. G01 F2000
N10 X.. Y.. Z.. at N10 N20 X.. Y..
N30 $IF V.E.Param1
N40 Z..
N...
N200 $IF V.E.Ext_influence
N210 X..
N220 $ENDIF
N1000 M30

Figure 1-1: Decoder block ahead and NC channel storage effect

Limiting decoder block ahead Release 01/2015 Page 3


Industrielle Steuerungstechnik GmbH FCT-C24

Limiting Therefore, due to cascaded processing of NC blocks, program decoding is


ahead decoding always ahead of actual execution/interpolation.
The number of NC blocks by which the decoder leads is not constant and
is only indirectly limited by the number of available memory spaces. Thus,
the decoder block ahead is dependent on, for example,
 the type of the processed NC blocks themselves (short/long motion
blocks, parameter calculation, technological functions, switching
commands, etc.)
 the functionality active in the NC channel (TRC, HSC, spline inter-
polation, etc) and its buffer sizes.
 system settings (cycle time, task allocation, etc.)

In the case of certain program runs, the user would like to specify, for ex-
ample, how far ahead of the interpolator level the decoding may be as
maximum.

To this end, the decoder block ahead can be defined by


- specifying a number of NC blocks or movement blocks or
- a time based specification (motion time).

Limiting decoder block ahead Release 01/2015 Page 4


Industrielle Steuerungstechnik GmbH FCT-C24

2 Block ahead limiting on basis of the number of blocks

Definition of Limiting is achieved by defining the number of NC blocks by which the


limiting decoder may be ahead of interpolation.
Users can define this in the NC program or before start-up of the controller
in the channel parameters. To this end, the CNC numbers each decoded
CNC line uniquely (Block Count).

Status display If decoding has reached the block ahead limit, the decoder's waiting state
is indicated by the following status bit. The status bit is cancelled when
decoding is continued.

0x00100000 BLOCK_AHEAD_LOCK_ACTIVE

The display date can be shown, for example, in the diagnostics data or via
the test user interface (ahmi.exe).

Limiting decoder block ahead Release 01/2015 Page 5


Industrielle Steuerungstechnik GmbH FCT-C24

Internal sequence For every NC block output, the decoder stores the associated line number
(block count) and an associated output counter in an internal table.
During the program run, the decoder then determines the corresponding
delta of the output counters (block ahead) in the table with the (interpolator)
line number and the line number of the NC block that it is currently pro-
cessing itself.
If this delta is then greater than the defined permissible limit, the decoder
interrupts its execution and waits with continued decoding until the interpo-
lator again falls below the defined limit, i.e. has practically "caught up"
again.

NC channel
DECODER Decoding at NC program
block count = 26
001 %Main
002 V.G.MAX_NC_BLOCKS_AHEAD = 25
003 N10 X.. Y.. Z.. G01 F2000
Yes, 004 N20 X.. Y..
Ahead wait 005 N30 X.. Y..
006 N40 Z..
limiting 007 N50 Y..
delta > 25 ... Nxx..
reached? 026 N200 X.. Y..
027 N210 X..
No,
continue

N190..

TOOL RADIUS COMPENSATION


N180.. - N140..

N130..

PATH PREPARATION
N120.. - N40..

N30..
N20..

INTERPOLATION
Interpolation at aktive interpolated
block count = 3 N10 X.. Y.. Z..
NC block

Figure 2-1: Checking decoder/interpolator block ahead limiting

Limiting decoder block ahead Release 01/2015 Page 6


Industrielle Steuerungstechnik GmbH FCT-C24

2.1 Application
Selecting block ahead Block ahead limiting can be defined in the channel parameter list or directly
limiting in the NC program.

2.1.1 Limiting the number of blocks via NC command

Activating via Global variables are available for defining and selecting limiting of decoder
NC command block ahead in the NC program.
Two (exclusive) block number limiting options are possible:
With
V.G.MAX_NC_BLOCKS_AHEAD = <value>
you define the maximum number of channel-related NC blocks (lines) by
which the decoder may be ahead of the interpolator. Channel-related NC
blocks are program lines that lead to further actions in the next NC chan-
nel, e.g. movement blocks, technological functions or switching commands.
Pure parameter calculations, blank lines and comment lines without block
number are processed at interpolator level only and are ignored on defini-
tion of the block ahead value.

With
V.G.MAX_MOTION_BLOCKS_AHEAD = <value>
you define the maximum number of pure NC motion blocks (G00, G01,
G02/03) by which the decoder may be ahead in relation to the interpolator.
All other NC program lines are ignored during definition of the block ahead
value.

As from the point where it is set, the block ahead limit is then active up to
the end of the main program M30.

Only ever one block ahead limit option may be active. The error message
P-ERR-21575 is issued if more than one option is used.

Deactivating via If the value of these V.G. variables is set to 0, limiting is deactivated again.
NC command

Limiting decoder block ahead Release 01/2015 Page 7


Industrielle Steuerungstechnik GmbH FCT-C24

Programming example

%MAIN

N180 V.G.MAX_NC_BLOCKS_AHEAD = 10 ;Selection block ahead limiting: 15 NC blocks


N190 #HSC[ MODE 1 CONTERROR 0.01]
N270 G54 G90

N320 #HSC ON
N47200: G1 F4000 Y597.771 Z-5.596
N47210 Y597.343 Z-5.205
N47220 Y596.911 Z-4.861
N47230 Y596.475 Z-4.561
N47240 Y596.067 Z-4.321
N47250 Y595.643 Z-4.112
N47260 Y595.278 Z-3.965
N47270 Y594.905 Z-3.841
N47280 Y594.524 Z-3.747
N47290 Y594.136 Z-3.683

N47350 V.G.MAX_NC_BLOCKS_AHEAD = 0 ; Deselection block ahead limiting

N47450 V.G.MAX_MOTION_BLOCKS_AHEAD = 20 ; Selection block ahead limiting:
20 motion blocks
N47440 Y589.152 Z-5.735
N47450 Y588.76 Z-6.156
N47460 Y588.235 Z-6.767
N47470 Y587.299 Z-7.889
N47480 Y587.034 Z-8.198
N47490 Y586.768 Z-8.463
N47500 Y586.492 Z-8.686
N47510 Y586.235 Z-8.853
N47520 Y585.994 Z-8.971
N47530 Y585.791 Z-9.039
N475403 V.G.MAX_MOTION_BLOCKS_AHEAD = 0 ; Deselection block ahead limiting

N999999 M30

Limiting decoder block ahead Release 01/2015 Page 8


Industrielle Steuerungstechnik GmbH FCT-C24

2.1.2 Limiting the number of blocks via channel parameters

Activating via As an alternative, corresponding parameters are available in the channel


channel parameters parameter list for block ahead configuration:
With
max_nc_blocks_ahead <value> ( P-CHAN-00216 )

you define the maximum number of channel-related NC blocks (lines) by


which the decoder may be ahead of the interpolator.

With
max_motion_blocks_ahead <value> ( P-CHAN-00246)

you define the maximum number of NC motion blocks (G00, G01, G02/03)
by which the decoder may be ahead of the interpolator.

After the program is started, the block ahead limit is immediately active and
remains selected up to the main program end M30.
After the program is started, the block ahead limit can be modified at any
time in the NC program or can be deactivated by writing the corresponding
variable
V.G.MAX_NC_BLOCKS_AHEAD

or
V.G.MAX_MOTION_BLOCKS_AHEAD.

The value set in the channel parameter list then applies again the next time
the program is started.

Only ever one block ahead limit may be activated via the configuration. The
error message P-ERR-21575 is issued if more than one option is used.

Deactivating via No limit is active after starting of the program if these parameters are set
channel parameters equal to 0 or if they are not specified in the list.

Limiting decoder block ahead Release 01/2015 Page 9


Industrielle Steuerungstechnik GmbH FCT-C24

2.2 Specifics, restrictions

Restrictions/ If a large number of "empty" lines is programmed in the NC program that


specifics are only evaluated internally in the decoder, no commands are output to
the NC channel.
In particular in the case of block ahead limiting via the definition
"MAX_NC_BLOCKS_AHEAD", this can lead to a situation in which decod-
ing is interrupted because the channel no longer supplies any new blocks
(deadlock).
To avoid this, if possible no large blocks of comment lines, empty lines,
parameter calculations, etc. should occur after selection of block ahead
limiting.
It may also be necessary to increase the block ahead limit value.

To ensure that no deadlock of the NC channel occurs when decoder


block ahead is limited, you are advised to define at least 10 lines as the
limit.
As contour planning stores different number of blocks depending on the
active functionality in the NC channel, a clearly higher block ahead limit
may be necessary.
The overall storage effect of the channel depends on the following active
functions, for example:
• Tool radius compensation
• Contouring G61/G262
• #HSC (spline)
• Micro joints
• Dynamic planning
Depending on the path dynamics, feed rate fluctuations can occur when
block ahead limiting is active if motion blocks are relatively short.

For stable execution, a monitored block ahead operation can be optional-


ly selected by the channel parameter P-CHAN-00270 (see Section 4):

dec_max_ahead_protected ACTIVE

Limiting decoder block ahead Release 01/2015 Page 10


Industrielle Steuerungstechnik GmbH FCT-C24

3 Time-related block ahead limiting

Definition of In the case of time-limited block ahead limiting, the maximum permissible
limiting decoding lead is defined by specifying a time in seconds, i.e. by how many
seconds decoding may be ahead of program execution (interpolation).
In this case, only the travel time of motion blocks such as G00, G01, G02,
G03 is considered as well as the dwell time (G04,#TIME). Other time-
consuming NC functions such as M functions, etc. are not considered. In
particular no real-time influences such as override, feedhold, etc. are eval-
uated.
The travel time calculated here is based on the programmed contouring
motion. However, this can only be a rough estimate because contour and
dynamics-influencing functions such as tool radius compensation, polyno-
mial contouring, spline interpolation, override, feedhold etc. cannot be con-
sidered in the decoder. That is to say, the real contouring speed can devi-
ate considerably from the programmed contouring speed.

The following conditions apply to estimation (calculation) of the travel time:


 Linear and circular blocks are considered.
 The speeds are defined via the F word valid in the block or the cal-
culated feed rate value in the case of rapid traversing. No accel-
eration/deceleration phases are considered.
 During determination of the travel time on the contour, only feed
axes are considered (#FGROUP)
 If only slave axes are programmed in the block, the slowest axis is
used on calculation of the travel time.

Restrictions:
 Independent axis motions (INDP_SYN. INDP_ASYN) and the "Z"
amount of helical motions are not considered.
 No consideration of override, M functions, etc.

Time-related block ahead limiting is selected/canceled analogously to


block-related block ahead limiting either in the NC program by means of a
special V.G variable ...
V.G.MAX_TIME_AHEAD = <value in [sec.]>

... or generally by the channel parameter P-CHAN-00269:


max_time_ahead <value in [sec.]>

Limiting decoder block ahead Release 01/2015 Page 11


Industrielle Steuerungstechnik GmbH FCT-C24

Status display If decoding has reached the block ahead limit, the decoder's waiting state
is indicated by the following status bit. The status bit is cancelled when
decoding is continued.

0x00200000 TIME_AHEAD_LOCK_ACTIVE

The display date can be shown, for example, in the diagnostics data or via
the test user interface (ahmi.exe).

Internal sequence Calculation of the relevant travel times takes place completely in the de-
coder.
To this end, the decoder estimates a minimum execution time = path
length/speed for each (travel) block.
The decoder keeps the block count and the time required in a table for
each output travel block. With the block count indicated by the interpolator,
the time lead with respect to the travel block processed last is then deter-
mined via the table. If this delta is then greater than the defined permissible
limit, the decoder interrupts its execution and waits with continued decod-
ing until the interpolator again falls below the defined limit, i.e. has practi-
cally "caught up" again.
Block ahead limiting is active only if the interpolator's block supply (moni-
Effectiveness tored operating mode, Section 4) is ensured.

Limiting decoder block ahead Release 01/2015 Page 12


Industrielle Steuerungstechnik GmbH FCT-C24

Programming example

%MAIN

N190 #HSC[ MODE 1 CONTERROR 0.01]


N270 G54 G90
N280 V.G.MAX_TIME_AHEAD = 2 ;Selection of ahead limiting 2 seconds

N320 #HSC ON
N47200: G1 F4000 Y597.771 Z-5.596
N47210 Y597.343 Z-5.205
N47220 Y596.911 Z-4.861
N47230 Y596.475 Z-4.561
N47240 Y596.067 Z-4.321
N47250 Y595.643 Z-4.112
N47260 Y595.278 Z-3.965
N47270 Y594.905 Z-3.841
N47280 Y594.524 Z-3.747
N47290 Y594.136 Z-3.683

N47440 Y589.152 Z-5.735
N47450 Y588.76 Z-6.156
N47460 Y588.235 Z-6.767
N47470 Y587.299 Z-7.889
N47480 Y587.034 Z-8.198
N47490 Y586.768 Z-8.463
N47500 Y586.492 Z-8.686
N47510 Y586.235 Z-8.853
N47520 Y585.994 Z-8.971
N47530 Y585.791 Z-9.039
N475403 V.G.MAX_TIME_AHEAD = 0 ; Deselection of ahead limiting

N999999 M30

Limiting decoder block ahead Release 01/2015 Page 13


Industrielle Steuerungstechnik GmbH FCT-C24

3.1 Programming example


In the following test program, a square with an edge length of 100 mm is
run through. Each side is segmented into 100 single blocks. Based on a
lead time of 2 seconds, as values become increasingly smaller it becomes
apparent that the contouring speed can no longer be kept constant due to
the pulsating supply of blocks.

% Quadrat.nc

#SLOPE [TYPE=HSC]
G133 100
V.G.MAX_TIME_AHEAD = 2 ;Seconds

G00 G90 X0 Y0
P40 = 5000
P30=100.0 (* Side length of square *)
P20 = 100 (* Number of block segments of a side length*)
P10 = P30/P20

$FOR P1=1,P20, 1
N[P1]G01 G91 XP10 FP40
$ENDFOR
G90
$FOR P1=1,P20, 1
N[P1+1000]G01 G91 YP10
$ENDFOR
G90
$FOR P1=1,P20, 1
N[P1+2000]G01 G91 X-P10
$ENDFOR
G90
$FOR P1=1,P20, 1
N[P1+3000]G01 G91 Y-P10
$ENDFOR
G90
V.G.MAX_TIME_AHEAD = 0 ;Seconds
M30
6
x 10

0.8
Sollwert 2

0.6

0.4

0.2

0
0 0.2 0.4 0.6 0.8 1
6
Sollwert 1 x 10

Test contour

Limiting decoder block ahead Release 01/2015 Page 14


Industrielle Steuerungstechnik GmbH FCT-C24

Gradient of path velocity for different times ahead:


Time ahead: 2 seconds, block supply is sufficient

4
x 10

5
Bahngeschw.

0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
3
Takte x 10

Time ahead: 0.5 seconds, block supply is sufficient

4
x 10

5
Bahngeschw.

0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
3
Takte x 10

Limiting decoder block ahead Release 01/2015 Page 15


Industrielle Steuerungstechnik GmbH FCT-C24

Time ahead: 0.25 seconds, block supply is sufficient

4
x 10

5
Bahngeschw.

0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
3
Takte x 10

Time ahead: 0.225 seconds, block supply starts pulsating, path velocity varies

4
x 10

5
Bahngeschw.

0
0 0.2 0.4 0.6 0.8 1 1.2
3
Takte x 10

Limiting decoder block ahead Release 01/2015 Page 16


Industrielle Steuerungstechnik GmbH FCT-C24

Time ahead: 0.2 seconds, block supply pulsation increases, path velocity varies

4
x 10

5
Bahngeschw.

0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
3
Takte x 10

Time ahead: 0.1 seconds, block supply pulsation is very strong, path velocity varies

4
x 10

5
Bahngeschw.

0
0 0.5 1 1.5 2
3
Takte x 10

Limiting decoder block ahead Release 01/2015 Page 17


Industrielle Steuerungstechnik GmbH FCT-C24

4 Monitored block ahead operation

Effectiveness of block As far as possible, use of block ahead limiting must not influence the
ahead limiting programmed contouring motion in its course and its dynamics.
Priority 1: Maintaining the interpolator's block supply has top priority because this is
block supply the basic prerequisite for a stable sequence of the contouring motion.
Priority 2: Maintaining the programmed contouring speed or keeping to the path's
contouring dynamics dynamics is a further criterion. As a result of block ahead limiting, this
should not deviate too considerably from the optimum feed rate value
that is possible within the scope of the path's dynamics.
Priority 3:
Block ahead limiting attempts to keep to the programmed feed rate value
block ahead limiting
only when these two criteria are met.

Monitored
To ensure this staggered consideration, block ahead operation can take
block ahead operation
place in a monitored mode.
If the interpolator discovers that the block supply no longer suffices due
to an active block ahead limit and a stop of motion is impending, or the
programmed contouring speed can no longer be kept to within the scope
of the dynamic limits, it indicates this to the decoder in addition to the
current block count.
Then, the decoder immediately cancels any active block ahead limit to be
able to supply the channel with blocks again, even if the block ahead limit
is still exceeded.
Thus, the block ahead limit is considered or kept to only if the interpola-
tor's block supply is sufficient and the programmed path dynamics can be
kept to.
Thanks to these priorities, the supply of blocks can never be interrupted
and, consequently, the NC channel's contouring motion can never be
stopped.

Mode selection This mode is always active by default in the case of the time-related
block ahead limit.
In the case of the block-related block ahead limit, to ensure downward
compatibility the monitoring mode can be additionally activated by the
channel parameter P-CHAN-00270:
dec_max_ahead_protected NONE | ACTIVE

Limits of Although this mode ensures stable execution, user should nevertheless
monitoring make sure they do not set the block ahead limit values too low.
It values are too low, there is otherwise a risk that the block supply by the
decoder is interrupted too often and is thus requested again by the inter-
polator. Due to the buffering effect of the NC channel, this can lead to
"pulsing" of the block supply and to a highly fluctuating contouring speed
(see program example in Section 3.1).

Limiting decoder block ahead Release 01/2015 Page 18


Industrielle Steuerungstechnik GmbH FCT-C24

5 Parameters
5.1 Overview

Constant Description
0x00100000 BLOCK_AHEAD_LOCK_ACTIVE status display:
Decoding in block ahead limiting. Waiting for interpolator.

ID Parameters Description
P-CHAN-00216 max_nc_blocks_ahead Block ahead limit via (relevant) number of blocks
P-CHAN-00246 max_motion_blocks_ahead Block ahead limit via number of motion blocks
P-CHAN-00269 max_time_ahead Ahead limiting via motion time
P-CHAN-00270 dec_max_ahead_protected Ahead limiting in "protected mode"

5.2 Description

P-CHAN-00216 Block ahead limit via (relevant) number of blocks


Parameter max_nc_blocks_ahead
Description Limiting decoder block ahead to a default value unequal to zero. The value defines the max-
imum number of NC blocks (lines) by which the decoder may be ahead of the interpolator.
Data type UNS32
Data range 0 ≤ P-CHAN-00216 ≤ MAX (UNS32)
Dimension Translatory: -- Rotatory: --
Default Default is 0, no block ahead limit
Remarks After the program is started, the block ahead limit via the (relevant) number of blocks is
immediately active and remains selected up to the main program end M30.
Either only P-CHAN-00216 or P-CHAN-00246 may be assigned != 0.

Limiting decoder block ahead Release 01/2015 Page 19


Industrielle Steuerungstechnik GmbH FCT-C24

P-CHAN-00246 Block ahead limit via number of motion blocks


Parameter max_motion_blocks_ahead
Description Limiting decoder block ahead to a default value unequal to zero. The value defines the max-
imum number of pure NC motion blocks by which the decoder may be ahead of the interpo-
lator.
Data type UNS32
Data range 0 ≤ P-CHAN-00246 ≤ MAX (UNS32)
Dimension Translatory: -- Rotatory: --
Default Default is 0, no block ahead limit
Remarks After the program is started, the block ahead limit via the number of motion blocks is imme-
diately active and remains selected up to the main program end M30.
Either only P-CHAN-00246 or P-CHAN-00216 may be assigned != 0.

P-CHAN-00269 Block ahead limit via travel time


Parameter max_time_ahead
Description Limiting decoder block ahead to a default value unequal to zero. Referred to the contouring
motion, the value defines the travel time in µs by which the decoder may maximally be
ahead of the interpolator.
Data type UNS32
Data range 0 ≤ P-CHAN-00269 ≤ MAX (REAL64)
Dimension µs
Default Default is 0, no block ahead limit
Remarks After the program is started, the time-related block ahead limit is immediately active and
remains selected up to the main program end M30.
Either only P-CHAN-00269 or P-CHAN-00216 or P-CHAN-00246 may be assigned != 0.
By default, time-related block ahead limiting is operated in the monitored mode.

P-CHAN-00270 Block ahead monitoring in the "monitored mode"


Parameter dec_max_ahead_protected
Description To ensure special execution, block ahead limiting can be operated in a special mode in
which the block ahead limit is only effective if the block supply of the interpolator and the
path dynamics are not jeopardized.
Data type String
Data range NONE | ACTIVE
Dimension Translatory: -- Rotatory: --
Default The default is 0 or NONE (no monitored operating mode)
Remarks Optional for block-related block ahead limiting (the default is NONE).
Time-related block ahead limiting is implicitly always operated in the monitored mode.

Limiting decoder block ahead Release 01/2015 Page 20

Вам также может понравиться