5 smc_smoothpath, Smc_smoothpath, L-force | plc designer - softmotion – Lenze PLC Designer PLC-Designer (R2-x) SoftMotion User Manual
Page 178

DMS 5.2 EN 03/2011 TD17
L
178
L-force | PLC Designer - SoftMotion
The SM_CNC.lib library
SMC_SmoothPath
7.5
SMC_SmoothPath
The SMC_SmoothPath program organisation unit (SM_CNC.lib) may be used for path
preprocessing: it rounds path angles, thus creating a smooth path. This is needed for
applications where the accuracy of the path is not as important as the velocity and where,
therefore, angles which force the velocity to be reduced to 0 must be avoided.
The SMC_SmoothPath program organisation unit functions as follows:
All SMC_GEOINFO objects found in the input OUTQUEUE structure are checked one after
the other. If bit 4 of the Intern_Mark variable is set in one of these objects, angle smoothing
starts from that point until bit 3 of Intern_Mark is set in one of the subsequent objects.
SMC_NCDecoder sets these bits as a response to commands G51/G50. In other words, path
smoothing will be performed for all objects located within commands G51 and G50.
Inputs (VAR_IN)
bExecute: BOOL
The program organisation unit executes a reset and starts the tool radius correction if a
rising edge is detected at this input.
bAppend: BOOL
If this input is set to FALSE, the DataOut queue will be cleared on each reset. If it is TRUE,
new data will be written at the end of the DataOut queue.
poqDataIn: POINTER TO SMC_OUTQUEUE
This input points to the SMC_OUTQUEUE structure object that contains the
SMC_GEOINFO objects of the unrounded path; typically it points to the DataOut output of
the preceding program organisation unit (e.g. SMC_NCDecoder).
dEdgeDistance: LREAL
This input variable contains the value which, when added to the relevant ToolRadius value
of the SMC_GEOINFO object, gives the distance to an angle at which the corresponding
objects will be cut and replaced by a spline. It may be changed online, which means that
you can define the value offline (by means of the SMC_GEOINFO structure) and modulate
it online. Default value: 0.
dAngleTol: REAL
This input describes the angle tolerance value up to which a path bend should not be
smoothed.
For this purpose, the path will be cut at a defined distance to the angle and
a spline will be inserted. The distance is specified by the SMC_GEOINFO
structure object of the first object to be smoothed as well as by one of its
inputs. The sum of both values is taken as the radius of a circle which has its
centre point in the path angle and which will intersect with the surrounding
objects.