SMC_SmoothAddAxes (FB)ΒΆ
FUNCTION_BLOCK SMC_SmoothAddAxes
This function is able to smooth motions of additional axes, which are distributed among several objects. This leads to the same slope by 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 the smooth
The marking which part is to smooth must be done with G-code and the word G71 and G70. G71 starts the smoothing, G70 ends the smoothing. But for that, the additional axes which are going to be smoothed must be 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 data buffer, which is available by the function block, must be large enough containing a complete smoothing range. So, if the function block contains n objects, not more than n-3 objects can be smoothed. Otherwise, smoothing is exited with error.
- InOut:
Scope
Name
Type
Initial
Comment
Input
bExecuteBOOLExecution starts on the rising edge.
bAbortBOOLIf
TRUE, the current processing of this function block is abortedbAppendBOOLAs 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.poqDataInPOINTER TO SMC_OUTQUEUE
This input path queue
dSmoothingPartLREAL0.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.
dAngleTolLREAL0.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.nSizeOutQueueUDINTThe size of pbyBufferOutQueue in bytes.
pbyBufferOutQueuePOINTER 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
bDoneBOOLThis output will be set to
TRUEas soon as the input path has been processed completely.The function block will not perform any further actions until it gets reset.bBusyBOOLTRUE, while execution of function block is not finishedbErrorBOOLSignals, that an error has occurred within the function block
wErrorIDSMC_ERRORError identification
poqDataOutPOINTER TO SMC_OUTQUEUE
The output path queue
Structure: