FUNCTION_BLOCK FINAL SMC_SmoothBSpline
Smoothes segments of consecutive G1 elements with a B-Spline of fifth degree. Each segment of at least 5 consecutive G1 elements of non-zero length is replaced by splines. The start and end positions of the G1 elements serve as control points of the B-spline that is created. Only the start position of the segment and the end position are interpolated exactly.
Each segment of n >= 5 G1 elements is replaced by n-5 polynomials.
Note
Does not support H-functions
Does not support changes of flags like G51, G52, G40 and so on, these changes are ignored
Requires 3D-Mode
Can be turned on and off from G-Code using G38/G39
A spline always contains the same tool correction information (i.e. lengths and diameter) as the first of the segments that it replaces.
Additional axis: First the values of the additional axis are also converted to a B-spline. For the linear axis (P,Q,U,V,W) only the positions at the end of each polynom are stored in SMC_GeoInfo. For the smoothed axis (A, B, C) the slope is also stored.
InOut:
Scope |
Name |
Type |
Comment |
Input |
bExecute |
BOOL |
Execution starts on the rising edge. |
poqDataIn |
POINTER TO SMC_OUTQUEUE |
Input path queue |
|
nSizeOutQueue |
UDINT |
Size of the data buffer pbyBufferOutQueue in bytes. |
|
pbyBufferOutQueue |
POINTER TO ARRAY [0..0] OF SMC_GEOINFO |
Points 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 an array of SMC_GeoInfo (ExampleBuf: ARRAY[1..50] OF SMC_GEOINFO for a buffer which can hold 50 path` elements). After predefining the value it may be modified during a reset only. |
|
eMode |
The element type applied for the smoothing of the axes. |
||
wFeatureFlag |
WORD |
The feature bit (0..31) used for smoothing (controlled by G38/G39) |
|
Output |
bDone |
BOOL |
Will be set to TRUE as soon as the input data from poqDataIn has been ` processed completely. Thereafter, the module will not perform any further actions |
bBusy |
BOOL |
TRUE, while execution of function block is not finished. |
|
bError |
BOOL |
Signals, that an error has occurred within the function block. |
|
wErrorID |
SMC_ERROR |
Error identification. |
|
poqDataOut |
POINTER TO SMC_OUTQUEUE |
The queue for the output path |