SMC_SmoothAddAxes (FB)ΒΆ
FUNCTION_BLOCK SMC_SmoothAddAxes
This function smoothes motions of additional axes distributed over several objects. This leads to a constant slope of the additional axes P, Q, U, V, W and to the usage of an optimized polynomial motion profile by the axes A, B and C.

Activation of smoothing
Smoothing must be enabled and disabled in G-Code using G71 and G70. G71 starts the smoothing, G70 ends the smoothing. The additional axes that should be smoothed are defined by the parameter L<Additional axis number>.
Definition of the additional axis number:
Parameter |
Additional Axis |
---|---|
L4 |
A |
L5 |
B |
L6 |
C |
L7 |
P |
L8 |
Q |
L9 |
U |
L10 |
V |
L11 |
W |
Example G-Code
N0 G1 X100 A0 Q100 F100
N10 G71 L8 (Turn on smoothing for Q)
N20 G1 X200
N30 G71 L4 (Turn on smoothing for A)
N40 G1 X250
N50 G1 X300
N60 G1 X350
N70 G1 X400 A100
N80 G70 L4 (Turn off smoothing for A)
N90 G1 X500 Q0
N100 G70 L8 (Turn off smoothing for Q)
Note
The output data buffer available to the function block must be large enough to contain a complete smoothing range. If the output data buffer has space for n objects, no more than n-3 input objects can be smoothed. Otherwise, smoothing is exited with error.
- InOut:
Scope
Name
Type
Initial
Comment
Input
bExecute
BOOL
Execution starts on the rising edge.
bAbort
BOOL
If
TRUE
, the current processing of this function block is abortedbAppend
BOOL
As long as this input is set to
FALSE
, the DataOut-queue will be cleared at each reset. As long as it is set toTRUE
, newly incoming data will be written to the end of the DataOut-queue.poqDataIn
POINTER TO SMC_OUTQUEUE
This input path queue
dSmoothingPart
LREAL
0.5
In case of the additional axes A, B and C the user can determine, which part of the path is provided to the additional axes for acceleration/deceleration and which part is to operate with a constant velocity.
0
: No acceleration/deceleration phase is set.1
: No constant motion is to be created.0.5
: The acceleration phase plus the deceleration phase requiresthe same time than the constant motion.
dAngleTol
LREAL
0.001
For a correct parametrization of the additional axes A, B and C it is important to know, whether a object crossing leads to a stop. The input
dAngleTol
, which is also used in the function block SMC_CheckVelocities and in other preprocessing function blocks, is also required here. It should be occupied with always the same value.nSizeOutQueue
UDINT
The size of pbyBufferOutQueue in bytes.
pbyBufferOutQueue
POINTER TO ARRAY [0..0] OF SMC_GEOINFO
This input must point to the first byte of the memory area being allocated for the SMC_OUTQUEUE structure. This area must be at least as big as defined in
nSizeOutQueue
. Typically the allocation of the memory buffer is done within the declaration part of the IEC-program by defining a byte-array (ExampleBuf:ARRAY[1..50] OF SMC_GEOINFO;
). The value may be predefined, but may then be modified during a reset only.Output
bDone
BOOL
This output will be set to
TRUE
as soon as the input path has been processed completely.The function block will not perform any further actions until it gets reset.bBusy
BOOL
TRUE
, while execution of function block is not finishedbError
BOOL
Signals, that an error has occurred within the function block
wErrorID
SMC_ERROR
Error identification
poqDataOut
POINTER TO SMC_OUTQUEUE
The output path queue
Structure: